return exp(Q2,psi)-exp(Q,psi)**2

#init system
N=10
pxp = unlocking_System([0],"periodic",3,N)
pxp.gen_basis()
pxp_syms = model_sym_data(pxp,[translational_general(pxp,order=2),PT(pxp)])

#orig H
Ip = dict()
Ip[0] = Hamiltonian(pxp,pxp_syms)
Ip[0].site_ops[1] = np.array([[0,1,0],[0,0,0],[0,0,0]])
Ip[0].site_ops[2] = np.array([[0,0,0],[1,0,0],[0,0,0]])
Ip[0].model = np.array([[0,1,0],[0,2,0]])
Ip[0].model_coef = np.array([1,-1])
Ip[0].uc_size = np.array([2,2])
Ip[0].uc_pos = np.array([1,0])

Ip[1] = Hamiltonian(pxp,pxp_syms)
Ip[1].site_ops[1] = np.array([[0,1,0],[0,0,0],[0,0,0]])
Ip[1].site_ops[2] = np.array([[0,0,0],[1,0,0],[0,0,0]])
Ip[1].model = np.array([[0,2,0,0],[0,0,2,0],[0,1,0,0],[0,0,1,0]])
Ip[1].model_coef = np.array([1,1,-1,-1])
Ip[1].uc_size = np.array([2,2,2,2])
Ip[1].uc_pos = np.array([0,1,1,0])

Im = dict()
Im[0] = Hamiltonian(pxp,pxp_syms)
Im[0].site_ops[1] = np.array([[0,1,0],[0,0,0],[0,0,0]])
Im[0].site_ops[2] = np.array([[0,0,0],[1,0,0],[0,0,0]])
Im[0].model = np.array([[0,2,0],[0,1,0]])
#rc('font',**{'family':'serif','serif':['Palatino']})
rc('text', usetex=True)
# matplotlib.rcParams['figure.dpi'] = 400

N = 16
pxp = unlocking_System([0], "periodic", 2, N)
pxp.gen_basis()
pxp_syms = model_sym_data(pxp, [translational(pxp), parity(pxp)])

Hp = dict()
Hp[0] = Hamiltonian(pxp)
Hp[0].site_ops[1] = np.array([[0, 0], [1, 0]])
Hp[0].site_ops[2] = np.array([[0, 1], [0, 0]])
Hp[0].model = np.array([[0, 2, 0], [0, 1, 0], [0, 1, 0], [0, 1, 0]])
Hp[0].model_coef = np.array([1, 1, 1, 1])
Hp[0].uc_size = np.array([4, 4, 4, 4])
Hp[0].uc_pos = np.array([3, 0, 1, 2])

# Hp[1] = Hamiltonian(pxp)
# Hp[1].site_ops[1] = np.array([[0,0],[1,0]])
# Hp[1].site_ops[2] = np.array([[0,1],[0,0]])
# Hp[1].site_ops[3] = np.array([[-1/2,0],[0,1/2]])
# Hp[1].model = np.array([[0,0,1,0],[0,1,0,0],[0,2,0,0],[0,0,2,0]])
# Hp[1].model_coef = np.array([1,1,1,1])
# Hp[1].uc_size = np.array([4,4,4,4])
# Hp[1].uc_pos = np.array([3,2,3,2])

# Hp[2] = Hamiltonian(pxp)
# Hp[2].site_ops[1] = np.array([[0,0],[1,0]])
# Hp[2].site_ops[2] = np.array([[0,1],[0,0]])
# Hp[2].site_ops[3] = np.array([[-1/2,0],[0,1/2]])
示例#3
0
#rc('font',**{'family':'serif','serif':['Palatino']})
rc('text', usetex=True)
# matplotlib.rcParams['figure.dpi'] = 400

N = 16
pxp = unlocking_System([0], "periodic", 2, N)
pxp.gen_basis()
pxp_syms = model_sym_data(pxp, [translational(pxp), parity(pxp)])

Hp = dict()
Hp[0] = Hamiltonian(pxp)
Hp[0].site_ops[1] = np.array([[0, 0], [1, 0]])
Hp[0].site_ops[2] = np.array([[0, 1], [0, 0]])
Hp[0].model = np.array([[0, 1, 0], [0, 2, 0]])
Hp[0].model_coef = np.array([1, 1])
Hp[0].uc_size = np.array([2, 2])
Hp[0].uc_pos = np.array([1, 0])

#1st order pert
Hp[1] = Hamiltonian(pxp)
Hp[1].site_ops[1] = np.array([[0, 0], [1, 0]])
Hp[1].site_ops[2] = np.array([[0, 1], [0, 0]])
Hp[1].model = np.array([[0, 0, 1, 0], [0, 1, 0, 0], [0, 0, 2, 0], [0, 2, 0,
                                                                   0]])
Hp[1].model_coef = np.array([1, 1, 1, 1])
Hp[1].uc_size = np.array([2, 2, 2, 2])
Hp[1].uc_pos = np.array([0, 1, 1, 0])

#2nd order perts
Hp[2] = Hamiltonian(pxp)
Hp[2].site_ops[1] = np.array([[0, 0], [1, 0]])
# H.gen()

H = spin_Hamiltonian(pxp2, "x")
H.gen()

Hp = Hamiltonian(pxp2)
Hp.site_ops[1] = np.array([[0, 0], [1, 0]])
Hp.site_ops[2] = np.array([[0, 1], [0, 0]])
# Hp.model = np.array([[0,1,0],[0,2,0],[0,0,1,0],[0,1,0,0],[0,2,0,0],[0,0,2,0]])
# Hp.model_coef = np.array([1,1,a,a,a,a])
# Hp.uc_size = np.array([2,2,2,2,2,2])
# Hp.uc_pos = np.array([1,0,0,1,0,1])

Hp.model = np.array([[0, 1, 0], [0, 2, 0]])
Hp.model_coef = np.array([1, 1])
Hp.uc_size = np.array([2, 2])
Hp.uc_pos = np.array([1, 0])

Hp.gen()

z = zm_state(2, 1, pxp2, 1)
fsa_basis = z.prod_basis()
current_state = fsa_basis
for n in range(0, pxp.N):
    next_state = np.dot(Hp.sector.matrix(), current_state)
    next_state = next_state / np.power(np.vdot(next_state, next_state), 0.5)
    fsa_basis = np.vstack((fsa_basis, next_state))
    current_state = next_state
fsa_basis = np.transpose(fsa_basis)
H_fsa = np.dot(np.conj(np.transpose(fsa_basis)),
               np.dot(H.sector.matrix(), fsa_basis))

N = 14
pxp = unlocking_System([0, 1], "periodic", 2, N)
pxp.gen_basis()
pxp = pxp.U1_sector([int(N / 2)])
print(pxp.dim)
pxp_syms = model_sym_data(pxp, [translational_general(pxp, order=2), PT(pxp)])

Hp = dict()
Hp[0] = Hamiltonian(pxp, pxp_syms)
Hp[0].site_ops[1] = np.array([[0, 0], [1, 0]])
Hp[0].site_ops[2] = np.array([[0, 1], [0, 0]])
Hp[0].model = np.array([[1, 2], [2, 1]])
Hp[0].model_coef = np.array([1, 1])
Hp[0].uc_size = np.array([2, 2])
Hp[0].uc_pos = np.array([0, 1])

Hp[1] = Hamiltonian(pxp, pxp_syms)
Hp[1].site_ops[1] = np.array([[0, 0], [1, 0]])
Hp[1].site_ops[2] = np.array([[0, 1], [0, 0]])
Hp[1].site_ops[3] = np.array([[-1, 0], [0, 1]])
Hp[1].site_ops[4] = np.array([[0, 0], [0, 1]])
Hp[1].model = np.array([[0, 1, 2], [
    4,
    1,
    2,
], [1, 2, 0], [1, 2, 4], [0, 2, 1], [4, 2, 1], [2, 1, 0], [2, 1, 4]])
Hp[1].model_coef = np.array([1, 1, 1, 1, 1, 1, 1, 1])
Hp[1].uc_size = np.array([2, 2, 2, 2, 2, 2, 2, 2])
Hp[1].uc_pos = np.array([1, 1, 0, 0, 0, 0, 1, 1])
示例#6
0
    Q2 = np.dot(Q,Q)
    return exp(Q2,psi)-exp(Q,psi)**2

#init system
N=12
pxp = unlocking_System([0],"periodic",2,N)
pxp.gen_basis()
pxp_syms = model_sym_data(pxp,[translational_general(pxp,order=3),PT(pxp)])

Hp = dict()
Hp[0] = Hamiltonian(pxp,pxp_syms)
Hp[0].site_ops[1] = np.array([[0,0],[1,0]])
Hp[0].site_ops[2] = np.array([[0,1],[0,0]])
Hp[0].model = np.array([[0,2,0],[0,1,0],[0,1,0]])
Hp[0].model_coef = np.array([1,1,1])
Hp[0].uc_size = np.array([3,3,3])
Hp[0].uc_pos = np.array([2,0,1])

#1st order
Hp[1] = Hamiltonian(pxp,pxp_syms)
Hp[1].site_ops[1] = np.array([[0,0],[1,0]])
Hp[1].site_ops[2] = np.array([[0,1],[0,0]])
Hp[1].model = np.array([[0,0,1,0],[0,1,0,0],[0,2,0,0],[0,0,2,0]])
Hp[1].model_coef = np.array([1,1,1,1])
Hp[1].uc_size = np.array([3,3,3,3])
Hp[1].uc_pos = np.array([2,1,2,1])

Hp[2] = Hamiltonian(pxp,pxp_syms)
Hp[2].site_ops[1] = np.array([[0,0],[1,0]])
Hp[2].site_ops[2] = np.array([[0,1],[0,0]])
Hp[2].model = np.array([[0,1,0,0],[0,0,1,0]])