from sympy import *
from sympy.physics.quantum.state import Ket, Bra
import numpy as np
init_printing(use_unicode=True)

#in_1=Ket (0)
#in_1

in_1=Matrix([[1],[0],[0],[0]])
in_1

X_2 =Matrix([[0, 0, 1, 0], [0, 0, 0, 1], [1, 0, 0, 0], [0, 1, 0, 0]])
CNOT=Matrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]])
X_2, CNOT

#Apply to circuit
out=CNOT*X_2*CNOT*in_1
out


