Path: blob/main/notebooks/ch-labs/Lab04_Bell_GHZ_Circuit.ipynb
3855 views
Kernel: Python 3
Lab 4 Bell Circuit & GHZ Circuit
Prerequisite Ch.2.2 Multiple Qubits and Entangled States
Other relevant materials Circuit Tutorial: Getting Started with Qiskit
Applications Ch.3.11 Quantum Teleportation Ch.3.12 Superdense Coding Ch.3.13 Quantum Key Distribution
In [1]:
Part 1: Bell State using Controlled-X gate
Goal
Create Bell state using CNOT or controlled-X gate.
In [2]:
In [3]:
Out[3]:
Note: Since these qubits are in entangled state, their state cannot be written as two separate qubit states. This also means that we lose information when we try to plot our state on separate Bloch spheres as seen below.
| Input State | Circuit | QSphere Plot | Histogram | City Plot | Paulivec | Hinton Plot |
|---|---|---|---|---|---|---|
| q0 = 0 q1 = 0 | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| q0 = 1 q1 = 0 | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| q0 = 0 q1 = 1 | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| q0 = 1 q1 = 1 | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
Part 2: Bell States on Real Quantum Device
Goal
Run Bell State circuit on real quantum device.
In [4]:
In [5]:
In [6]:
Out[6]:
For inputs 0 0 Representation of Entangled States are,
Job Status: job has successfully run
In [7]:
Out[7]:
Job Status: job has successfully run
Part 3: 3-Qubit GHZ Circuit
Goal
Create a 3-qubit GHZ circuit and visualize the states.
In [8]:
In [9]:
Out[9]:
Note: Since these qubits are in entangled state, their state cannot be written as two separate qubit states. This also means that we lose information when we try to plot our state on separate Bloch spheres as seen below.
| Input State | Circuit | QSphere Plot | Histogram | City Plot | Paulivec | Hinton Plot |
|---|---|---|---|---|---|---|
| q0 = 0; q1 = 0; q2 = 0 | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| q0 = 1; q1 = 0; q2 = 0 | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| q0 = 0; q1 = 1; q2 = 0 | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| q0 = 1; q1 = 1; q2 = 0 | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| q0 = 0; q1 = 0; q2 = 1 | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| q0 = 1; q1 = 0; q2 = 1 | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| q0 = 0; q1 = 1; q2 = 1 | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| q0 = 1; q1 = 1; q2 = 1 | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
Part 4: 5-Qubit GHZ Circuit
Goal
Create a 5-qubit GHZ circuit and visualize the states.
In [10]:
In [11]:
Out[11]:
For inputs 0 0 0 1 0 Representation of GHZ States are:
In [12]:
Out[12]:
For inputs 1 1 0 0 1 Representation of GHZ States are:
For inputs 0 1 0 1 0 Representation of GHZ States are:
Part 5: Real Quantum Device
Goal
Run 5-qubit GHZ circuit on real quantum device.
In [13]:
In [14]:
In [15]:
Out[15]:
Job Status: job has successfully run
In [16]:
Out[16]:
Job Status: job has successfully run
For inputs 0 0 0 0 0 Representation of GHZ circuit states are,
In [17]:
Out[17]:
{'qiskit-terra': '0.19.1', 'qiskit-aer': '0.9.1', 'qiskit-ignis': '0.7.0', 'qiskit-ibmq-provider': '0.18.2', 'qiskit-aqua': None, 'qiskit': '0.33.1', 'qiskit-nature': '0.3.0', 'qiskit-finance': '0.3.0', 'qiskit-optimization': '0.2.3', 'qiskit-machine-learning': '0.3.0'}
In [ ]:







































































