hongyehu / PyClifford

An intuitive programming package for simulating and analyzing Clifford circuits, quantum measurement, and stabilizer states with applications to many-body localization, classical shadows, quantum chemistry and error correction code.
https://hongyehu.github.io/PyCliffordPages/intro.html
BSD 3-Clause "New" or "Revised" License
74 stars 15 forks source link

[Unitary Hack]Partial Trace of the stabilizer state #24

Open hongyehu opened 5 months ago

hongyehu commented 5 months ago

The task of this bounty is to implement a function p_trace(state, positions) to return a partial trace (potentially a mixed state) of the stabilizer state, and the positions are the qubits that are not being traced out. References and preliminary code can be provided upon request. A successful solution should include testing results

Youngcius commented 5 months ago

I would like to try to solve this issue. Shall I implement this functionality in both PyClifford/utils.py and torchclifford.utils.py, right?

Youngcius commented 5 months ago

Hi @hongyehu Should the input state be in type of StabilizerState or an ndarray?

hongyehu commented 5 months ago

Hi @Youngcius, if you can implement theptrace in pyclifford, and test it, I will consider you have the bounty :-) Also, there are already some implementations or hints in the repo. Please let me know if you need help. The input state is in type of StabilizerState

atomgardner commented 5 months ago

@hongyehu, is the idea here to adapt PTRACE from https://arxiv.org/pdf/quant-ph/0505036 to the stabilizer+destabilizer architecture?

hongyehu commented 4 months ago

Hi @atomgardner, yes, exactly! Btw, there is a branch called partial trace, where the canonicalization is implemented. And feel free to test and use it!