Пример #1
0
    'size': 26
})
## for Palatino and other serif fonts use:
#rc('font',**{'family':'serif','serif':['Palatino']})
rc('text', usetex=True)
# matplotlib.rcParams['figure.dpi'] = 400

import numpy as np
import scipy as sp
import math
from Calculations import plot_adjacency_graph

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

H = Hamiltonian(pxp, pxp_syms)
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]))
from matplotlib import rc
rc('font', **{
    'family': 'sans-serif',
    'sans-serif': ['Computer Modern'],
    'size': 26
})
## for Palatino and other serif fonts use:
#rc('font',**{'family':'serif','serif':['Palatino']})
rc('text', usetex=True)
# matplotlib.rcParams['figure.dpi'] = 400

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

H = spin_Hamiltonian(pxp, "x", pxp_syms)
k = [0, 0]
H.gen(k)
H.sector.find_eig(k)
e = H.sector.eigvalues(k)
to_del = []
for n in range(0, np.size(e, axis=0)):
    if np.abs(e[n]) < 1e-10:
        to_del = np.append(to_del, n)
for n in range(np.size(to_del, axis=0) - 1, -1, -1):
    e = np.delete(e, to_del[n])

#rectangular billiards
# n_max = 200
Пример #3
0
import matplotlib.pyplot as plt
from progressbar import ProgressBar
from scipy.sparse import linalg as sparse_linalg

from Hamiltonian_Classes import Hamiltonian, H_table, clock_Hamiltonian, spin_Hamiltonian
from System_Classes import unlocking_System
from Symmetry_Classes import translational, parity, model_sym_data, charge_conjugation
from Construction_functions import bin_to_int_base_m, int_to_bin_base_m, cycle_bits_state
from Search_functions import find_index_bisection
from State_Classes import zm_state, sym_state, prod_state
from rw_functions import save_obj, load_obj

pxp = unlocking_System([0], "periodic", 3, 8)
pxp.gen_basis()
pxp_syms = model_sym_data(pxp, [
    translational(pxp),
    parity(pxp),
])
# pxp_syms = model_sym_data(pxp,[translational(pxp)])

H1 = clock_Hamiltonian(pxp, pxp_syms)
H2 = spin_Hamiltonian(pxp, "x", pxp_syms)
e_clock, u_clock = np.linalg.eigh(H1.site_ops[1])
e_spin, u_spin = np.linalg.eigh(H2.site_ops[1])

spin2clock_u = np.dot(u_spin, np.conj(np.transpose(u_clock)))
clock2spin_u = np.dot(u_clock, np.conj(np.transpose(u_spin)))
root6 = np.power(6, 0.5)
root23 = np.power(2 / 3, 0.5)
clock2spin_u = np.array([[1 / root6, root23, -1 / root6],
                         [1 / root6 - 1j / 2, -1 / root6, -1 / root6 - 1j / 2],
Пример #4
0
from matplotlib import rc
rc('font', **{
    'family': 'sans-serif',
    'sans-serif': ['Computer Modern'],
    'size': 26
})
## for Palatino and other serif fonts use:
#rc('font',**{'family':'serif','serif':['Palatino']})
rc('text', usetex=True)
# matplotlib.rcParams['figure.dpi'] = 400

N = 8
base = 3
pxp = unlocking_System([0], "periodic", base, N)
pxp.gen_basis()
pxp_syms = model_sym_data(pxp, [translational(pxp)])

H = clock_Hamiltonian(pxp, pxp_syms)
# H = spin_Hamiltonian(pxp,"x",pxp_syms)
# H = clock_Hamiltonian(pxp,pxp_syms)
H.gen()
H.sector.find_eig()

z = zm_state(2, 1, pxp)
krylov_dim = 2 * pxp.N


def gen_krylov_basis(H, dim, init_state, system, orth=False):
    krylov_basis = init_state.prod_basis()
    current_state = krylov_basis
    for n in range(0, dim):
    'sans-serif': ['Computer Modern'],
    'size': 26
})
## for Palatino and other serif fonts use:
#rc('font',**{'family':'serif','serif':['Palatino']})
rc('text', usetex=True)
# matplotlib.rcParams['figure.dpi'] = 400

N = 10
J = 1
hx = 1
hz = 1
#init system
system = unlocking_System([0, 1], "periodic", 2, N)
system.gen_basis()
system_syms = model_sym_data(system, [translational(system)])

#create Hamiltonian
H = Hamiltonian(system, system_syms)
H.site_ops[1] = np.array([[0, 1], [1, 0]])
H.site_ops[2] = np.array([[-1, 0], [0, 1]])
H.model = np.array([[1, 1], [2], [1]])
H.model_coef = np.array([J, hz, hx])

#dynamics following quench from |00000>
psi = ref_state(0, system)
k = system_syms.find_k_ref(psi.ref)
for n in range(0, np.size(k, axis=0)):
    H.gen(k[n])
    H.sector.find_eig(k[n])
    print(H.sector.eigvalues(k[n]))
Пример #6
0
from Construction_functions import bin_to_int_base_m,int_to_bin_base_m,cycle_bits_state
from Search_functions import find_index_bisection
from State_Classes import zm_state,sym_state,prod_state,bin_state,ref_state
from rw_functions import save_obj,load_obj
from Calculations import level_stats,fidelity,eig_overlap,entropy,site_precession,site_projection

def cm2inch(*tupl):
    inch = 2.54
    if isinstance(tupl[0], tuple):
        return tuple(i/inch for i in tupl[0])
    else:
        return tuple(i/inch for i in tupl)

N=4
pxp = unlocking_System([0,1],"periodic",2,N)
pxp_syms = model_sym_data(pxp,[translational(pxp),parity(pxp),])
pxp_half = unlocking_System([0],"periodic",2,N)

# #pauli ops
X = Hamiltonian(pxp,pxp_syms)
Y = Hamiltonian(pxp,pxp_syms)
Z = Hamiltonian(pxp,pxp_syms)

X.site_ops[1] = np.array([[0,1],[1,0]])
Y.site_ops[1] = np.array([[0,-1j],[1j,0]])
Z.site_ops[1] = np.array([[-1,0],[0,1]])

X.model,X.model_coef = np.array([[1]]),np.array((1))
Y.model,Y.model_coef = np.array([[1]]),np.array((1))
Z.model,Z.model_coef = np.array([[1]]),np.array((1))