Introduction to Quantum Computing |
Quantum gates
In this lesson, you will use a single qubit with Pauli X, Y and Z gates.
1) Quantum Gates – the Pauli X gate
You have used some of the programming instructions, or gates, in the quantum computer composer. Last time you only used the measurement tool, and found a single qubit started in the |0> state had a 100% chance of registering zero when no other operations were performed.
This time we are going to try the effect of a few other gates. Let’s start off with the Pauli X gate.
Gate icon |
Gate name |
What it does |
Bloch sphere representation |
Pauli X
gate |
180° turn around the X-axis |
Create a new program in the Quantum Experience using ibmqx4. Drag the X-gate to qubit q(0) on the score, and then apply the measurement tool. If you make a mistake, double-click on the gate to delete it, or drag it to the top left (a delete bin will appear). This is how your program should look: |
Run the program by clicking on the ‘Simulate’ button, and it will be run 100 times. Look at the output.
This time, there is 100% chance that qubit q(0) has the value |1>. (Last time, without the X-gate, it had the value |0>).
So, the X-gate can flip the value of our qubit, from |0> to |1>.
2) Other Pauli gates
Now it is your turn. Find the effect of using the Pauli Y and Z gates.
This is what you should see.
= = 1
==0
Now you can experiment. Please use any combination of X, Y and Z gates to see if you can make the qubit have any value other than |0> or |1>.
When you have tried several combinations, add just one more gate to some of your trials. Does this help?
Homework
Glance at the IBM quantum experience user guide at:
https://www.qiskit.org/ibmqx-user-guides/full-user-guide/introduction.html
Appendix
Here is a short description of the most popular quantum gates with a Bloch sphere illustrating their action. Most illustrations are done on a qubit in the |0> state, but the twists and turns would apply on a qubit in any other state.
Gate icon |
Gate name |
What it does |
Bloch sphere representation |
Identity gate |
Performs an idle operation on the qubit for one unit of time |
No change |
|
Pauli X
gate |
180° turn around the X-axis |
||
Pauli Y gate |
180° turn around the Y-axis |
||
Pauli Z
gate |
180° turn around the Z-axis |
||
Hadamard gate |
Makes superpositions |
|
|
Phase gate |
Makes complex superpositions: maps X→Y |
||
Opposite Phase gate |
maps X→−Y |
||
Controlled-NOT gate |
Generates entanglement between two qubits |
←→ |
|
Phase gate |
45° rotation around the Z-axis |
||
Measurement gate |
Gives the value of the qubit in the Z-axis (i.e. |0> or |1>) |