from sympy import *
import numpy as np
init_printing(use_unicode=True)

a, b, d, f = symbols('alpha beta theta phi')
a, b, d, f

p1=exp(I*f)
H=Matrix([[1/sqrt(2), 1/sqrt(2)],[1/sqrt(2), -1/sqrt(2)]])
S=Matrix([[0, 1],[1, I]])
X=Matrix([[0, 1],[1, 0]])
Y=Matrix([[0, -I],[I, 0]])
Z=Matrix([[1, 0],[0, -1]])
H, S, X, Y, Z

#option A
lhs=H*X*H
rhs=-1*Z
print (lhs)
print (rhs)
if (lhs==rhs):
    print ("It is true")
else:
    print ("It is false")

#option B
lhs=H*Y*H
rhs=-1*Y
print (lhs)
print (rhs)
if (lhs==rhs):
    print ("It is true")
else:
    print ("It is false")

#option C
lhs=H
rhs=1/sqrt(2)*(X+Z)
print (lhs)
print (rhs)
if (lhs==rhs):
    print ("It is true")
else:
    print ("It is false")

#option D
lhs=H*Z*H
rhs=X
print (lhs)
print (rhs)
if (lhs==rhs):
    print ("It is true")
else:
    print ("It is false")