Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise a warning if pftrajectory (and others) if the circuit contains measurements that discard the result, i.e. sMZ(1,nothing) #192

Open
amicciche opened this issue Sep 27, 2023 · 4 comments

Comments

@amicciche
Copy link
Member

amicciche commented Sep 27, 2023

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
Copy link
Member Author

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

@Krastanov
Copy link
Member

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
Copy link
Member

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 Krastanov changed the title PauliFrame initZ! not working properly Raise a warning if pftrajectory (and others) if the circuit contains measurements that discard the result, i.e. sMZ(1,nothing) Sep 28, 2023
@amicciche
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants