Use this file to discover all available pages before exploring further.
View on GitHub
Open this notebook in GitHub to run it yourself
Entanglement is an important aspect to study quantum algorithms. In this tutorial, we show how to create a bell pair state ∣Φ+⟩ of 2 qubits, using the Hadamard and the Controlled-NOT transformation.
Alice has a qubit which is initially set to ∣0⟩
Bob has a qubit which is initally set to ∣0⟩Alice applies 2x2 Hadamard Matrix (H) to create a superposition of her qubit’s state. It is defined as: H⋅(10)=(212121−21)⋅(10)=(2121)=21∣0⟩+21∣1⟩Alice and Bob combine their qubits and generate the composite quantum state as:(2121)⊗(10)=210210Alice now applies the Controlled NOT gate operation, with her qubit being the control qubit and Bob’s qubit as the target qubit.The Controlled NOT qubit when applied only affects the target qubit by inverting its state if the control qubit is ∣1⟩.The 4x4 matrix for Controlled NOT(CNOT) transformation matrix is defined as: CNOT=1000010000010010The new quantum state is:1000010000010010210210=210021=21∣00⟩+21∣11⟩In this situation the qubit’s of Alice and Bob are correlated to each other.
If we measure both the qubits we will either get the state ∣00⟩ or the state ∣11⟩ with equal probability.It is described as:
When Alice observes her state as ∣0⟩ then the state of Bob’s qubit collapses to the state ∣0⟩
When Alice observes her state as ∣1⟩ then the state of Bob’s qubit collapses to the state ∣1⟩
The resultant entangled state is designated as a bell pair state ∣Φ+⟩∣Φ+⟩=21(∣00⟩+∣11⟩)
The GHZ state, a highly entangeld state entengaling all qubits in a circuit.∣GHZ⟩=2∣0⟩⊗n+∣1⟩⊗nCreate a function that will generate a GHZ state for n qubits.Use the Classiq build in repeat no classical loops. An example circuit is shown below. As you can see to create this circuit, there are two steps:
Apply the H gate to the first qubit.
Perform a CNOT gate between the first qubit and all other qubits, or perform CNOT gates like seen in the image below.