예제 #1
0
H.site_ops[1] = np.array([[0, 0], [1, 0]])
H.site_ops[2] = np.array([[0, 1], [0, 0]])
H.model = np.array([[0, 1, 2, 0], [0, 2, 1, 0]])
H.model_coef = np.array([1, 1])
k = [0]
H.gen(k)
# H.gen()

# H0=spin_Hamiltonian(pxp,"x",pxp_syms)
# H0.gen(k)
# # H = H_operations.add(H0,H,np.array([1,1/2]))
# H = H_operations.add(H0,H,np.array([1,1]))

# all states
# basis_labels = dict()
# for n in range(0,np.size(pxp.basis,axis=0)):
# basis_labels[n] = pxp.basis[n]
# plot_adjacency_graph(np.abs(H.sector.matrix()),labels=basis_labels)
# # plt.title(r"$P^0 X P^1 + P^1 X P^0$, N="+str(pxp.N))
# # plt.title(r"$P^0 X P^1$, N="+str(pxp.N))
# plt.show()

# k=0 sector
refs = pxp_syms.find_block_refs(k)
basis_labels = dict()
colors = range(20)
for n in range(0, np.size(refs, axis=0)):
    basis_labels[n] = pxp.basis[pxp.keys[refs[n]]]
plot_adjacency_graph(np.abs(H.sector.matrix(k)), labels=basis_labels)
plt.show()
예제 #2
0
pxp.gen_basis()
pxp = pxp.U1_sector(4)
print("DIM = " + str(pxp.dim))
# pxp_syms = model_sym_data(pxp,[translational_general(pxp,order=2),PT(pxp)])
pxp_syms = model_sym_data(pxp, [translational_general(pxp, order=2), PT(pxp)])

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

from Calculations import plot_adjacency_graph
plot_adjacency_graph(np.abs(H.sector.matrix()),
                     labels=None,
                     largest_comp=False)
plt.show()

Hp = Hamiltonian(pxp, pxp_syms)
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, 2, 0], [0, 2, 1, 0]])
Hp.model_coef = np.array([1, 1])
Hp.uc_size = np.array([2, 2])
Hp.uc_pos = np.array([1, 0])
Hp.gen()
Hm = Hp.herm_conj()
Hz = 1 / 2 * com(Hp.sector.matrix(), Hm.sector.matrix())
e, u = np.linalg.eigh(Hz)
psi = u[:, 0]