import numpy as np
# Pauli matrices
s1=np.array([[0,1],[1,0]])
s2=np.array([[0,-1j],[1j,0]])
s3=np.array([[1,0],[0,-1]])
print(np.linalg.eig(s1))
print(np.linalg.eig(s2))
print(np.linalg.eig(s3))
(array([ 1., -1.]), array([[ 0.70710678, -0.70710678],
[ 0.70710678, 0.70710678]]))
(array([ 1.+0.j, -1.+0.j]), array([[-0. -0.70710678j, 0.70710678+0.j ],
[ 0.70710678+0.j , 0. -0.70710678j]]))
(array([ 1., -1.]), array([[1., 0.],
[0., 1.]]))
import numpy as np
# Pauli matrices
s1=np.array([[0,1],[1,0]])
s2=np.array([[0,-1j],[1j,0]])
s3=np.array([[1,0],[0,-1]])
print(s1@s1)
print(s2@s2)
print(s2@s2)
[[1 0]
[0 1]]
[[1.+0.j 0.+0.j]
[0.+0.j 1.+0.j]]
[[1.+0.j 0.+0.j]
[0.+0.j 1.+0.j]]
import numpy as np
# Pauli matrices
s0=np.array([[1,0],[0,1]])
s1=np.array([[0,1],[1,0]])
s2=np.array([[0,-1j],[1j,0]])
s3=np.array([[1,0],[0,-1]])
print(np.real(np.kron(np.kron(np.kron(s1,s2),s0),s3)))
print(np.imag(np.kron(np.kron(np.kron(s1,s2),s0),s3)))
print(np.kron(np.kron(np.kron(s0,s0),s0),s0))
print(np.real(np.kron(np.kron(np.kron(s1,s2),s0),s3)@np.kron(np.kron(np.kron(s1,s2),s0),s3)))
print(np.imag(np.kron(np.kron(np.kron(s1,s2),s0),s3)@np.kron(np.kron(np.kron(s1,s2),s0),s3)))