QuantumClifford.jl
QuantumClifford.jl copied to clipboard
Raise a warning if pftrajectory (and others) if the circuit contains measurements that discard the result, i.e. `sMZ(1,nothing)`
I don't know why we haven't noticed this until now, but shouldn't the measurements be half zeros and half ones? I thought for certain this used to work at one point.
The reason this came up was that I was quite skeptical that pauli frames would work to perform the "double syndrome measurement" encoding circuit, thinking mostly about how it would handle entangled states post-measurement . I wanted see if it had correct output for measuring the bell state, but it was all 0s, which lead to this discovery...
I think it is just a minor bug in how you define the sMZ measurement. It needs two arguments, not just one. Implicitly, if you have only one argument it means "measure this qubit and discard the result".
This works: pftrajectories(PauliFrame(20,1,1), [sHadamard(1), sMZ(1,1)]) |> pfmeasurements
We should have a warning when the circuit contain measurement that discard the result (i.e. when we have sMZ(qubit) instead of sMZ(qubit,bit)).
Oh, I feel a bit silly now, but at least it lead to something!