import qiskit
qiskit.__version__

qiskit.__qiskit_version__

#Import the required packages
from qiskit import QuantumCircuit, QuantumRegister,ClassicalRegister,Aer,execute
from qiskit.visualization import *
from math import sqrt

v=[1/sqrt(2),0,0,1/sqrt(2)]

v

qc_bell=QuantumCircuit(2)
v=[1/sqrt(2),0,0,1/sqrt(2)]
qc_bell.initialize(v,[0,1])
qc_bell.draw('mpl')

backend=Aer.get_backend('statevector_simulator')
job=execute(qc_bell,backend)
result=job.result()
sv=result.get_statevector()
print("Statvector :",sv)

sv.draw(output="latex")

#Create a Quantum Circuit with 2 qubits 
qc_bell=QuantumCircuit(2)
qc_bell.h(0)
qc_bell.cx(0,1)

qc_bell.draw('mpl')

backend=Aer.get_backend('statevector_simulator')
job=execute(qc_bell,backend)
result=job.result()
sv=result.get_statevector()
print("Statvector :",sv)

sv.draw(output="latex")

qc_2=QuantumCircuit(2)
v1, v2=[0,1],[1,0]
qc_2.initialize(v1,0)
qc_2.initialize(v2,1)
qc_2.draw('mpl')

backend=Aer.get_backend('statevector_simulator')
job=execute(qc_2,backend)
result=job.result()
sv=result.get_statevector()
print("Statvector :",sv)

sv.draw(output="latex")

#Create a Quantum Circuit with 2 qubits 
qc_3=QuantumCircuit(2)
qc_3.x(0)
qc_3.draw('mpl',initial_state=True)

backend=Aer.get_backend('statevector_simulator')
job=execute(qc_3,backend)
result=job.result()
sv=result.get_statevector()
print("Statvector :",sv)

sv.draw(output="latex")

#Create a Quantum Circuit with 2 qubits 
qc_4=QuantumCircuit(2)
qc_4.cx(0,1)
qc_4.draw('mpl')

backend=Aer.get_backend('statevector_simulator')
job=execute(qc_4,backend)
result=job.result()
sv=result.get_statevector()
print("Statvector :",sv)

sv.draw(output="latex")

#Create a Quantum Circuit with 2 qubits 
qc_5=QuantumCircuit(2)
qc_5.h(0)
qc_5.h(1)
qc_5.draw('mpl')

backend=Aer.get_backend('statevector_simulator')
job=execute(qc_5,backend)
result=job.result()
sv=result.get_statevector()
print("Statvector :",sv)

sv.draw(output="latex")

