oreilly-qc / oreilly-qc.github.io

Code samples for Programming Quantum Computers, from O'Reilly Media
130 stars 59 forks source link

Chapter 3 multi-qubit to single-qubit representation #39

Closed LogicNg closed 3 years ago

LogicNg commented 3 years ago

image

To convince yourself that these single-qubit and multi-qubit representations are equivalent, write down each decimal value in the multi-qubit state in terms of the three-bit binary values. In fact, this multi-qubit state can be generated simply using two single-qubit HAD operations, as shown by Example 3-1.

I don't quite get it, can someone explain what it means?

mattpenner commented 3 years ago

LogicNg, what it means is to write out the potential possibilities in binary. Each qubit once read can normally be a 0 or a 1. In the example above we have set the first qubit to be 0 and the other two qubits in superposition. This means once read qubit 1 will always be 0, and qubits 2 and 3 can potentially be 0 or 1.

Writing this out in a table you can see the following: image

Note that if we force qubit 1 to be 0, but allow qubit 2 & 3 to be 0 or 1, the only potential outcomes are 0, 2, 4, & 6.

There are a few times in the book where writing out the qubits in a binary table like this helps understand the examples and I have done this several times. In fact, I have an expanded binary spreadsheet I generated keep on hand as I read through the book.