This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from qiskit import * | |
from qiskit.tools.visualization import plot_bloch_multivector | |
from qiskit.tools.visualization import plot_histogram | |
# Creating a circuit with 2 quantum bits and one classical bit | |
qc = QuantumCircuit(2,1) | |
# Preparing inputs | |
qc.x(0) # Comment this line to make Qbit0 = |0> | |
qc.x(1) # Comment this line to make Qbit1 = |0> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from qiskit import * | |
from qiskit.tools.visualization import plot_bloch_multivector | |
from qiskit.tools.visualization import plot_histogram | |
# Creating a circuit with 3 quantum bits and one classical bit | |
qc = QuantumCircuit(3,1) | |
# Preparing inputs | |
qc.x(0) # Comment this line to make Qbit0 = |0> | |
qc.x(1) # Comment this line to make Qbit1 = |0> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from qiskit import * | |
from qiskit.tools.visualization import plot_bloch_multivector | |
from qiskit.tools.visualization import plot_histogram | |
# Creating a circuit with 3 quantum bits and 2 classical bits | |
qc = QuantumCircuit(3,2) | |
# Preparing inputs | |
qc.x(0) # Comment this line to make Qbit0 = |0> | |
qc.x(1) # Comment this line to make Qbit1 = |0> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from qiskit import * | |
from qiskit.tools.visualization import plot_bloch_multivector | |
from qiskit.tools.visualization import plot_histogram | |
# Creating a circuit with 3 quantum bits and one classical bit | |
qc = QuantumCircuit(3,1) | |
# Preparing inputs | |
qc.x(0) # Comment this line to make Qbit0 = |0> | |
qc.x(1) # Comment this line to make Qbit1 = |0> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from qiskit import * | |
from qiskit.tools.visualization import plot_bloch_multivector | |
from qiskit.tools.visualization import plot_histogram | |
# Creating a circuit with 8 quantum bits and 2 classical bits | |
qc = QuantumCircuit(8,2) | |
# Preparing inputs | |
qc.x(0) # Comment this line to make Qbit0 = |0> | |
qc.x(1) # Comment this line to make Qbit1 = |0> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from matplotlib import pyplot as plt | |
import numpy as np | |
from qiskit import * | |
# Creating a circuit with 3 quantum bits and 2 classical bit | |
qc = QuantumCircuit(3,2) | |
# Preparing inputs | |
qc.h(0) | |
qc.h(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from matplotlib import pyplot as plt | |
import numpy as np | |
from qiskit import * | |
from qiskit.tools.visualization import plot_histogram | |
# Creating a circuit with 3 quantum bits and 2 classical bit | |
qc = QuantumCircuit(2,1) | |
# Preparing inputs | |
qc.h(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from matplotlib import pyplot as plt | |
import numpy as np | |
from qiskit import * | |
from qiskit.tools.visualization import plot_histogram | |
from qiskit.tools.visualization import plot_state_city | |
from qiskit.providers.aer import StatevectorSimulator | |
# Creating quantum circuit with 3 qubits | |
qc = QuantumCircuit(3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from matplotlib import pyplot as plt | |
import numpy as np | |
from qiskit import * | |
from qiskit.tools.visualization import plot_histogram | |
# Creating quantum circuit with 3 qubits and 3 classical bits | |
qc = QuantumCircuit(3,3) | |
# Preparing inputs | |
qc.h(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import all necessary objects and methods for quantum circuits | |
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, execute, Aer | |
all_pairs = ['00','01','10','11'] | |
for pair in all_pairs: | |
# Creating the circuit with two classical bits and 2 qbits | |
qc = QuantumCircuit(2,2) | |
# Creating the entangled state | |
qc.h(1) |