Thursday, September 26, 2024

Measurement

 

Was curious why running my circuit form Quantum composer was getting different results
then running the circuit from python code. Below:
You
Qiskit 1.2; if I put together a 3 qubit circuit, and run the mesaure_all() command, how is that different 

from measuring each qubit individually?


Copilot

When you use the measure_all() command in a 3-qubit circuit, it measures all qubits simultaneously and collapses the entire quantum state into a classical state. This means you get a single outcome that represents the state of all three qubits at the moment of measurement.

On the other hand, measuring each qubit individually involves measuring one qubit at a time. This can affect the overall quantum state differently because each measurement collapses the state of the measured qubit, potentially altering the state of the remaining qubits due to quantum entanglement or superposition12.

In summary:

  • measure_all(): Measures all qubits at once, collapsing the entire state.
  • Individual measurements: Measures qubits one by one, potentially altering the state of the remaining qubits with each measurement.

Does that help clarify things? Feel free to ask if you have more questions about quantum circuits!

                                                        *     *     *

So there we have it; the code being generated from my circuit on Composer was asking

for individual measurements, whereas the one from standard code was using measure_all().

On individual measurements, everything collapsed to zero...


This might be a why the QFTinverse is so useful in the Phase Eastimation Protocol!!

                                                         *     *     *

Meta produced a very useful piece of code for me, yesterday. It is something of a game,

where one can change the basis on which one wants one's circuits to be measured.(This is

for use starting from a fourier state, but one can disactivate that particular aspect!!)


                                                                     



                                                                          




*     *     *
Below, measurement in the Z_basis with Perplexity:

                                                                 





                                                                         *     *     *

Measurement in the X-basis with Perplexity:

                                                                       




https://www.perplexity.ai/search/qiskit-1-2-what-code-would-you-4a71LaRsTY6_dBDZOmoqig#5
















                                                                                   






 

No comments: