PyClifford
PyClifford copied to clipboard
[UnitaryHack] Mixed state unitary evolution and expectations
Implement mixed state quantum evolution, measurement, and expectation values. In the current implementation, the stabilizer state class has an attribute stabilizer_state.r
which labels how many stabilizer generators are used to describe the state. For example, for a N
qubit stabilizer state, in the gs
matrix, the first N
rows denote the stabilizer generators in binary vectors, and the second N
rows denote the destabilizer generators in binary vectors. And the stabilizer generators used are from stabilizer_state.r
to N
, while destabilizer generators used are from stabilizer_state.r+N
to 2N
.
Therefore, if stabilizer_state.r=0
, the state is fully stabilized by the first N
generators, and the state is pure. And one need to change the evolution, measurement, calculation of expectation functions accordingly to general 0<stabilizer_state.r<=N
for the mixed states.