Khazam Alhamdan
Khazam Alhamdan

Reputation: 88

How does measurement gate work?

I have a state |Q> of n bits and want to measure the bit number i. Is there a matrix to apply on the state, so the state Q ends up to Q', like the Hadamard or X gates?

Or I should apply the measurement matrix |x><x| based on the outcome of the measurement, if 0 then x=0, and if 1 then x=1?

Upvotes: 2

Views: 4466

Answers (2)

Craig Gidney
Craig Gidney

Reputation: 18316

Although we often represent measurement as an operation that applies to a single qubit, it doesn't act like other single-qubit operations. There are some details omitted.

Equivalence w/ CNOT

Measuring a qubit is equivalent to using it as the control for a CNOT that toggles an otherwise unused ancilla qubit. Knowing this equivalence is useful, because it lets you translate what you know about two-qubit unitary operations into facts about measurement.

Here's a circuit showing that a qubit rotated around the Y axis ends up in the same mixed state when you measure as it does when you CNOT-onto-ancilla. The green circle things are Bloch sphere representations of each qubit's marginal state:

Measure-vs-CNOT cycle

(If you want to use this CNOT trick to compute the mixed state result, instead of a pure state, just represent the state as a density matrix then trace over the ancilla qubit after performing the CNOT.)

Basically, measurement is observationally indistinguishable from making entangled copies. The difference, in practical terms, is that measurement is thermodynamically irreversible whereas a CNOT is easy to reverse.

Expected Outcomes

If you ignore the measurement result, then measurement acts like a projection of the density matrix. For example, in the animation above, notice that measurement causes the state to snap to (be projected onto) the Z axis of the Bloch sphere.

If you have access to the measurement result, then the measurement not only projects but also informs you of the new state of the system. In the single-qubit-in-the-computational-basis case, this forces the qubit to be all-ON or all-OFF due to the quantization of spin.

Representation

Measurements can be represented in various ways.

A very common representation is "projective measurements". Projective measurements are represented by a Hermitian matrix (called the "observable"). The eigenvalues of the matrix are the possible results. You get the probability of each result by projecting your state's density matrix into each eigenspace and tracing.

A more flexible and arguably better representation is positive-operator valued measures (POVM measurements). POVMs are represented by a set of squared Hermitian matrices, with the condition that the sum of the set's matrices must be the identity matrix. The probability of the result corresponding to the squared matrix F from the set is the trace of the state's density matrix times F.

Translating a projective measurement into a circuit that performs that measurement (using only computational basis measurements) is straightforward, because the necessary basis change operation is just a unitary matrix whose rows are the eigenvectors of the observable. Translating POVM measurements is trickier, and requires introducing ancilla bits.

For more information, see this answer on the physics stackexchange.

Upvotes: 6

Khazam Alhamdan
Khazam Alhamdan

Reputation: 88

The measurement works as follows:

if you want to measure qubit number i (indexing from 1 to n), then based on the probability associated with all states, the outcome of measuring qubit i is 0 or 1 randomly with higher chance for the higher probability.

P_i(0) = <Q| M'0 M0 |Q>
P_i(1) = <Q| M'1 M1 |Q>

where P_i(0) is the probability of measuring qubit i to be 0, and P_i(1) is the probability of being 1. M0 is the measurment matrix of 0, and M1 is for 1. M'0 is M0 hermitian, and M'1 is M1 hermitian.

if you want to measure only the i-th qubit of the quantum system which is in state |Q> of n qubits. then the operation you would apply is:

I x I x I x I x ... x I x Mb x I x ... x I } n kronecker multiplication

1   2   3   4   ...  i-1  i  i+1  ...   n } indices

where I is the identity matrix, Mb is the measurement matrix based on the measured value of the i-th either b=0, or b=1. x is the kronecker multiplication.

Summary:

pre measurement state |Q>
measurement of qubit i = b (b = 1 or 0 randomly selected based on the probability of each)
if b is 0: Mb = M0 = |0><0|
if b is 1: Mb = M1 = |1><1|
M = I x I x I x ... x I x Mb x I x ... x I
post state |Q'> = M|Q>

Upvotes: 0

Related Questions