Skip to content

__quantum__qis__measure__body implementation is incorrect when multiple bases passed #260

@nleehone

Description

@nleehone

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions