avatarOlga

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

2679

Abstract

ays in |0>, but if the collapsed state is 1, the second qubit must be in |1> state. Either option is possible with the probability of ½. Let’s keep this result in mind.</p><p id="2e7c"><b>Circuit 2. </b>In the second quantum circuit, the quantum CX gate is applied first and then a measurement is made.</p><figure id="ddf3"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*ws5MYvN6QqUAfPNMrVr1mw.png"><figcaption></figcaption></figure><p id="a764">My first step in the calculations is similar as for the first quantum circuit. After applying the Hadamard gate, the state of two qubits is</p><figure id="ecee"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*zCSo9EjfXgcSdFlKBIxr2Q.png"><figcaption></figcaption></figure><p id="57e7">Now, I have to apply the CX gate depending on the first qubit. Because the first qubit is in the equal superposition, the X gate will be applied to the second qubit with a probability of ½. So, again, the second qubit will be in the state |0> with the probability ½ or in |1> with the probability ½.</p><p id="4c3b">Measuring the first qubit gives either 0 or 1 with an equal probability of 1/2.</p><p id="0588">As a result, we have the same outcomes regardless of when we measure the quantum circuit. This phenomena is called the<b> Principle of Deferred Measurement</b>. Here, I cite the exact definition from Quantum Computation and Quantum Information book by Nielsen and Chuang:</p><blockquote id="fade"><p>“Measurement can always be moved from an intermediate stage of a quantum circuit to the end of the circuit; if the measurement results are used at any stage of the circuit then the classically controlled operations can be replaced by conditional quantum operations.”</p></blockquote><p id="90b0">Simply put, a quantum circuit can be replaced with an identical circuit where all computations are made before all measurements.</p><h1 id="48bb">However, . . .</h1><p id="0d16">Although the two examples above are very convincing and may perfectly reflect the idea of the deferred measurement, let’s consider slightly different examples.</p><p id="fb62"><b>Circuit 1. </b>For the first circuit, I will interleave the H gates and the measurement gates.</p><figure id="82a8"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*MHDQNK3JCjVuDxZya6ni_Q.png"><figcaption></figcaption></figure><p id="929a">The outcome is either 0 or 1 with an equal probability of 1/2.</p><p id="874f"><b>Circuit 2. </b>For the second circuit, I apply two Hadamard gates in sequence. Because these gates “cancel” out each other, there is no effect on the qubit. So, I’ll get 0 with a probability of 1 a

Options

fter the measurement.</p><figure id="2c01"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*tpfCNuMfrmrCZNHBSWw3xA.png"><figcaption></figcaption></figure><p id="b1e0">🤔🤔🤔</p><p id="dc49">Can the measurement <b>always</b> be moved to the end of the circuit?</p><h1 id="97cc">The Different Version of the Deferred Measurement</h1><p id="a767">Clearly, something went wrong in the last two examples as they completely contradict the principle of deferred measurement formulated above.</p><p id="a6d5">I personally like the following formulation of the principle of deferred measurement as it does not provide such contradictions among examples. The formulation is from the lecture notes on <a href="https://arxiv.org/abs/2201.08309">Quantum Algorithms for Scientific Computation by Prof. Lin Lin</a> at UC Berkeley.</p><blockquote id="741f"><p>“ When deferring quantum measurements, it is necessary to store the intermediate information in extra (ancilla) qubits, even if such information is not used afterwards. ”</p></blockquote><p id="8d0a">Below is depicted a quantum circuit with the added ancilla qubit for the alternative formulation of the Principle of Deferred Measurement.</p><figure id="f39d"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*bx8Cd1iqi6S7kV1-rcabaw.png"><figcaption></figcaption></figure><p id="bcaa">So, to defer the measurement until the end of the circuit, we have <b>to use an additional qubit along with a CX quantum gate</b>. Now you can do math and check yourself that everything works as expected.</p><p id="b9ed">While introducing ancilla qubits is viable option, it can be challenging in practice. Imagine a quantum algorithm with 10,000 qubits (as of January 2024, the largest quantum computers have slightly more than 1000 qubits). If we want to defer the measurement for each qubit, we would need a total of 20,000 qubits!</p><p id="b302"><i>What do you think about the principle of deferred measurement and its formulations? Please share your thoughts in the comments!</i></p><h1 id="a5e1">References</h1><ol><li>M.A. Nielsen, I.L. Chuang. Quantum Computing and Quantum Information. Cambridge University Press, 2016.</li><li><a href="https://arxiv.org/abs/2201.08309">Lin Lin, Lecture Notes on Quantum Algorithms for Scientific Computation, 2022</a>.</li></ol><p id="4984"><b><i>All opinions and views are my own and do not reflect opinions of my current, past, or future employers.</i></b></p><h2 id="f664">If you like my stories and want to learn more about the Quantum Computing field, please clap 👏(lots!!), leave a comment ✋, share, follow me 🔔, or buy me a cup of boba tea🧋.</h2></article></body>

Quantum Measurement: To measure or not to measure?

The first time I learned about the concept of deferred measurement was in an academic environment when studying the teleportation protocols. To my surprise, this concept is not widely introduced in educational tutorials composed by companies and start-ups. However, I believe that understanding the principle of deferred measurement greatly helps in quantum algorithm design and development, in general. Understanding the principle of deferred measurement is essential for manipulating entangled qubits and utilizing the power of quantum parallelism.

Prerequisite. Basic understanding of quantum gates, quantum circuits, and quantum measurements.

When to Make a Measurement?

The discovery that amazed me was that quantum circuits can be measured in the middle of the circuit or delayed until the end, yet still provide the same measurement outcome. Intrigued, I have decided to further explore this topic and share my discoveries in this short article.

Let’s see how it works. As an example, let’s consider the following two quantum circuits.

Circuit 1. Given two qubits both initialized in |0> states. On the first qubit, the H gate is applied and the qubit is measured. Based on the measurement outcome, either X gate is applied or not on the second qubit. Note that after we measure, the quantum bit becomes a classical bit, hence we apply a “classical version” of the CX gate. I prefer to think about it as an “if else” statement from programming languages. In quantum computing field the corresponding terminology is called a conditional operator. To represent the “if else” statement on the circuit, the conditional X gate is marked with double lines.

Let’s use a little bit of mathematical formalism to find out the final state.

The initial state of the entire quantum circuit is the tensor product between the states of the qubits: |0>⊗|0> = |0>|0>.

We then act with H gate on the first qubit only:

Measuring out the first qubit, we collapse the superposition into either 0 or 1 state with an equal probability of ½.

Now, if the collapsed state is 0, the second qubit stays in |0>, but if the collapsed state is 1, the second qubit must be in |1> state. Either option is possible with the probability of ½. Let’s keep this result in mind.

Circuit 2. In the second quantum circuit, the quantum CX gate is applied first and then a measurement is made.

My first step in the calculations is similar as for the first quantum circuit. After applying the Hadamard gate, the state of two qubits is

Now, I have to apply the CX gate depending on the first qubit. Because the first qubit is in the equal superposition, the X gate will be applied to the second qubit with a probability of ½. So, again, the second qubit will be in the state |0> with the probability ½ or in |1> with the probability ½.

Measuring the first qubit gives either 0 or 1 with an equal probability of 1/2.

As a result, we have the same outcomes regardless of when we measure the quantum circuit. This phenomena is called the Principle of Deferred Measurement. Here, I cite the exact definition from Quantum Computation and Quantum Information book by Nielsen and Chuang:

“Measurement can always be moved from an intermediate stage of a quantum circuit to the end of the circuit; if the measurement results are used at any stage of the circuit then the classically controlled operations can be replaced by conditional quantum operations.”

Simply put, a quantum circuit can be replaced with an identical circuit where all computations are made before all measurements.

However, . . .

Although the two examples above are very convincing and may perfectly reflect the idea of the deferred measurement, let’s consider slightly different examples.

Circuit 1. For the first circuit, I will interleave the H gates and the measurement gates.

The outcome is either 0 or 1 with an equal probability of 1/2.

Circuit 2. For the second circuit, I apply two Hadamard gates in sequence. Because these gates “cancel” out each other, there is no effect on the qubit. So, I’ll get 0 with a probability of 1 after the measurement.

🤔🤔🤔

Can the measurement always be moved to the end of the circuit?

The Different Version of the Deferred Measurement

Clearly, something went wrong in the last two examples as they completely contradict the principle of deferred measurement formulated above.

I personally like the following formulation of the principle of deferred measurement as it does not provide such contradictions among examples. The formulation is from the lecture notes on Quantum Algorithms for Scientific Computation by Prof. Lin Lin at UC Berkeley.

“ When deferring quantum measurements, it is necessary to store the intermediate information in extra (ancilla) qubits, even if such information is not used afterwards. ”

Below is depicted a quantum circuit with the added ancilla qubit for the alternative formulation of the Principle of Deferred Measurement.

So, to defer the measurement until the end of the circuit, we have to use an additional qubit along with a CX quantum gate. Now you can do math and check yourself that everything works as expected.

While introducing ancilla qubits is viable option, it can be challenging in practice. Imagine a quantum algorithm with 10,000 qubits (as of January 2024, the largest quantum computers have slightly more than 1000 qubits). If we want to defer the measurement for each qubit, we would need a total of 20,000 qubits!

What do you think about the principle of deferred measurement and its formulations? Please share your thoughts in the comments!

References

  1. M.A. Nielsen, I.L. Chuang. Quantum Computing and Quantum Information. Cambridge University Press, 2016.
  2. Lin Lin, Lecture Notes on Quantum Algorithms for Scientific Computation, 2022.

All opinions and views are my own and do not reflect opinions of my current, past, or future employers.

If you like my stories and want to learn more about the Quantum Computing field, please clap 👏(lots!!), leave a comment ✋, share, follow me 🔔, or buy me a cup of boba tea🧋.

Quantum Computing
Quantum
Quantum Computer
Quantum Measurement
Recommended from ReadMedium