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

__quantum__qis__measure__body implementation is incorrect when multiple bases passed #260

Open
nleehone opened this issue Sep 7, 2023 · 0 comments

Comments

@nleehone
Copy link

nleehone commented Sep 7, 2023

The current implementation of the __quantum__qis__measure__body (https://github.com/qir-alliance/qcor/blob/master/mlir/qir_qrt/qir-qis-ms-compat.cpp#L341) will perform independent measurements of each qubit when multiple bases are passed. For example, if the measurement bases [Z, Z] are specified, the first qubit is measured and projects the state, then the second qubit is measured and again projects the state.

For a bell pair |00> + |11> (ignoring normalization factors) the current implementation will result in storing the bit 0 50% of the time, and the state will be projected into |00>, and will result in storing the bit 1 50% of the time with the state projected into |11>. This is incorrect as it does not follow the description outlined in https://learn.microsoft.com/en-us/qsharp/api/qsharp/microsoft.quantum.intrinsic.measure

The correct implementation is a parity measurement for [Z, Z], which deterministically returns 0 for the bell pair |00> + |11> and leaves the state as is without disturbing it.

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

No branches or pull requests

1 participant