import numpy as np
from qiskit import *

qc = QuantumCircuit(3)
# Apply H-gate to each qubit:
for qubit in range(3):
    qc.h(qubit)
# See the circuit:
qc.draw('mpl')

# Let's see the result
backend = Aer.get_backend('statevector_simulator')
out = execute(qc,backend).result().get_statevector()
print(out)

qc = QuantumCircuit(2)
qc.h(0)
qc.x(1)
qc.draw('mpl')

#create circuit with two qubit
qc = QuantumCircuit(2)
# Apply CNOT
qc.cx(0,1)
# See the circuit:
qc.draw('mpl')

#create two qubit circuit
qc = QuantumCircuit(2)
# Apply H-gate to the first:
qc.h(0)
qc.draw('mpl')

# Let's see the result:
backend = Aer.get_backend('statevector_simulator')
final_state = execute(qc,backend).result().get_statevector()
print(final_state)

# Apply a CNOT:
qc.cx(0,1)
qc.draw('mpl')

# Let's see the result:
final_state = execute(qc,backend).result().get_statevector()
print(final_state)

