QuantumClifford.jl icon indicating copy to clipboard operation
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)`

Open amicciche opened this issue 2 years ago • 4 comments

image

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.

amicciche avatar Sep 27 '23 21:09 amicciche

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...

amicciche avatar Sep 27 '23 21:09 amicciche

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

Krastanov avatar Sep 28 '23 00:09 Krastanov

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)).

Krastanov avatar Sep 28 '23 00:09 Krastanov

Oh, I feel a bit silly now, but at least it lead to something!

amicciche avatar Sep 28 '23 00:09 amicciche