repo
stringlengths
2
99
file
stringlengths
13
225
code
stringlengths
0
18.3M
file_length
int64
0
18.3M
avg_line_length
float64
0
1.36M
max_line_length
int64
0
4.26M
extension_type
stringclasses
1 value
dmrgpy
dmrgpy-master/examples/fermionic_energy/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np import matplotlib.pyplot as plt from dmrgpy import fermionchain n = 6 fc = fermionchain.Fermionic_Chain(n) # create the chain h = 0 for i in range(n-1): h = h + fc.C[i]*fc.Cdag[i+1] h = h...
542
17.724138
66
py
dmrgpy
dmrgpy-master/examples/highly_excited/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain n = 4 spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin chain h = 0 for i in range(n-1): h = ...
646
21.310345
66
py
dmrgpy
dmrgpy-master/examples/site_superconducting/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import fermionchain n = 1 # number of spinful fermionic sites fc = fermionchain.Spinful_Fermionic_Chain(n) # create the chain h = fc.Cup[0]*fc.Cdn[0] h = h + h.get_dagger() fc.set...
1,033
24.219512
70
py
dmrgpy
dmrgpy-master/examples/heisenberg_12_correlator/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain n = 100 spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin chain h = 0 for i in range(n-1): h ...
564
18.482759
66
py
dmrgpy
dmrgpy-master/examples/majorana_chain/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np import matplotlib.pyplot as plt from dmrgpy import fermionchain n = 2 fc = fermionchain.Majorana_Chain(n) # create the chain for i in range(n): for j in range(n): h = fc.G[i]*fc.G[j]*n...
607
16.371429
66
py
dmrgpy
dmrgpy-master/examples/scaling_time_evolution/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np import spinchain import time ns = np.array(range(4,30,2)) es = [] n = 4 def compute(n): spins = [2 for i in range(n)] sc = spinchain.Spin_Chain(spins) # create the chain sc.clean() sc...
1,167
20.62963
67
py
dmrgpy
dmrgpy-master/examples/correlation_matrix_spinless/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import fermionchain n = 60 # number of fermionic sites fc = fermionchain.Fermionic_Chain(n) # create the chain h = 0 U = -0.95 for i in range(n-1): # hopping h = h + fc.Cdag[i...
829
19.75
66
py
dmrgpy
dmrgpy-master/examples/chain_correlation/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain ns = np.array(range(4,10,2)) es = [] n = 10 spins = [2 for i in range(n)] sc = spinchain.Spin_Chain(spins) # create the chain h = 0 for i in range(n-1): h = ...
868
23.138889
76
py
dmrgpy
dmrgpy-master/examples/spinless_fermions/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np import matplotlib.pyplot as plt from dmrgpy import fermionchain n = 2 fc = fermionchain.Fermionic_Chain(n) # create the chain h = fc.C[0]*fc.C[1] h = h + h.get_dagger() fc.set_hamiltonian(h)...
528
16.633333
66
py
dmrgpy
dmrgpy-master/examples/dimer_site/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import fermionchain n = 2 # number of spinful fermionic sites fc = fermionchain.Fermionic_Chain(n) # create the chain h = fc.N[0] + fc.N[1] fc.set_hamiltonian(h) #################...
955
23.512821
70
py
dmrgpy
dmrgpy-master/examples/density_matrix/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np import matplotlib.pyplot as plt from dmrgpy import fermionchain n = 6 fc = fermionchain.Fermionic_Chain(n) # create the chain def get(U): h = 0 for i in range(n-1): h = h + ...
765
15.297872
66
py
dmrgpy
dmrgpy-master/examples/fermionic_charge_response/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np import matplotlib.pyplot as plt from dmrgpy import fermionchain n = 6 fc = fermionchain.Fermionic_Chain(n) # create the chain m = np.random.random((n,n)) + 1j*np.random.random((n,n)) m = m +...
1,556
20.328767
76
py
dmrgpy
dmrgpy-master/examples/algebra/multiply_operators/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 6 # number of sites in the spin chain spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin ch...
1,474
30.382979
77
py
dmrgpy
dmrgpy-master/examples/algebra/eigenvalue_degeneracy/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 2 spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin chain h = 0 # generate a Heisenberg Ha...
810
21.527778
86
py
dmrgpy
dmrgpy-master/examples/algebra/trace/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 6 spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin chain h = 0 # generate a Heisenberg Ha...
669
19.30303
69
py
dmrgpy
dmrgpy-master/examples/parallel/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain def get(u): n = 16 spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin chain h = 0...
755
20.6
67
py
dmrgpy
dmrgpy-master/examples/total_spin/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np # conventional numpy library import matplotlib.pyplot as plt # library to plot the results from dmrgpy import spinchain ns = 6 # number of sites in the spin chain spins = ["S=1" for i in ran...
927
22.794872
68
py
dmrgpy
dmrgpy-master/examples/hubbard_gap/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import fermionchain ns = 10 # number of spinful fermionic sites def get_fc(U): n = ns*2 fc = fermionchain.Fermionic_Chain(n) # create the chain C = fc.C Cdag = fc....
960
18.612245
66
py
dmrgpy
dmrgpy-master/examples/hubbard_gap/plot.py
import numpy as np import matplotlib.pyplot as plt m = np.genfromtxt("D_VS_MU.OUT").transpose() x,y = m[0],m[1] from scipy.interpolate import interp1d from scipy.signal import savgol_filter xs = np.linspace(np.min(x),np.max(x),len(x)*10) ys = interp1d(x,y,fill_value=0.0,bounds_error=False)(xs) #ys = savgol_filter(y...
428
21.578947
56
py
dmrgpy
dmrgpy-master/examples/heisenberg_VS_spinfermion/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain from dmrgpy import spinfermionchain n = 7 spins = [2 for i in range(n)] # spin 1/2 heisenberg chain def geth(sc): h = 0 for i in range(n-1): h = h + sc...
769
19.810811
69
py
dmrgpy
dmrgpy-master/examples/magnetization_distribution_maxent/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain n = 20 # number of sites in your chain spins = ["S=1" for i in range(n)] # create the sites sc = spinchain.Spin_Chain(spins) # create the chain #sc.itensor_versi...
1,777
27.222222
81
py
dmrgpy
dmrgpy-master/examples/transverse_2d_ising_model/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.environ["DMRGROOT"]) import os ; import sys ; sys.path.append(os.environ["PYQULAROOT"]) import numpy as np from dmrgpy import spinchain from pyqula import geometry def get(n=2,bx=0.): g = geometry.single_square_lattice() m ...
1,079
24.116279
83
py
dmrgpy
dmrgpy-master/examples/IsingDM/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import simplechains # This example shows the quantum phase transition in the transverse Ising model # generate a 1D Ising chain def get_dm(bx): """ Compute the distance be...
1,297
27.844444
79
py
dmrgpy
dmrgpy-master/examples/multiply_mpo_operator/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain n = 6 # number of sites in the spin chain spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin chain...
1,254
28.880952
77
py
dmrgpy
dmrgpy-master/examples/bilinear_biquadratic/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np # conventional numpy library import matplotlib.pyplot as plt # library to plot the results from dmrgpy import spinchain ns = 6 # number of sites in the spin chain spins = [3 for i in range(n...
824
25.612903
69
py
dmrgpy
dmrgpy-master/examples/non_hermitian/non_hermitian_chain/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import fermionchain n = 4 fc = fermionchain.Fermionic_Chain(n) # create the fermion chain mh = np.zeros((n,n),dtype=np.complex) # TB matrix for i in range(n-1): mh[i,i+1] =...
817
22.371429
69
py
dmrgpy
dmrgpy-master/examples/non_hermitian/non_hermitian_degeneracy/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain def get(delta): n = 4 spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin chain ...
847
24.69697
69
py
dmrgpy
dmrgpy-master/examples/non_hermitian/skin_effect/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import fermionchain def get(gamma): n = 8 fc = fermionchain.Fermionic_Chain(n) # create the fermion chain mh = np.zeros((n,n),dtype=np.complex) # TB matrix # gam...
969
21.55814
69
py
dmrgpy
dmrgpy-master/examples/non_hermitian/non_hermitian_edge_modes/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import fermionchain,mpsalgebra import numpy as np # this is a minimal example of an interacting non-Hermitian system # with edge zero modes def get(V=0.0,c=1.0): """Retur...
1,871
23.96
90
py
dmrgpy
dmrgpy-master/examples/non_hermitian/non_hermitian_correlator/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import fermionchain n = 2 # number of unit cells ns = 4*n # total number of sites # create the tight binding matrix mh = np.zeros((ns,ns),dtype=np.complex) # TB matrix for i ...
2,223
23.988764
79
py
dmrgpy
dmrgpy-master/examples/non_hermitian/non_hermitian_ground_state/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 4 spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin chain h = 0 for i in range(n-1): h...
1,117
26.268293
74
py
dmrgpy
dmrgpy-master/examples/non_hermitian/non_hermitian_energies/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 6 spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin chain h = 0 for i in range(n-1): h...
699
22.333333
69
py
dmrgpy
dmrgpy-master/examples/non_hermitian/iterations_GS/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 12 spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin chain h = 0 for i in range(n-1): ...
1,160
30.378378
75
py
dmrgpy
dmrgpy-master/examples/non_hermitian/non_hermitian_fermionic_energies/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import fermionchain n = 6 fc = fermionchain.Fermionic_Chain(n) # create the spin chain h = 0 for i in range(n-1): h = h +fc.Cdag[i]*fc.C[i+1] h = h + h.get_dagger() for i...
615
20.241379
69
py
dmrgpy
dmrgpy-master/examples/kondo/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import fermionchain def get(JK): n = 10 # number of spinful fermionic sites fc = fermionchain.Spinful_Fermionic_Chain(n) # create the chain h = 0 mu = 0. for ...
1,388
28.553191
67
py
dmrgpy
dmrgpy-master/examples/convergence_excited_states/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain import time n = 6 # take n different sites spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin chai...
864
23.027778
75
py
dmrgpy
dmrgpy-master/examples/parafermion_energy/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np import matplotlib.pyplot as plt from dmrgpy import parafermionchain n = 4 pc = parafermionchain.Parafermionic_Chain(n) # create the chain h = 0 for i in range(n): for j in range(n): ...
760
22.060606
66
py
dmrgpy
dmrgpy-master/examples/Haldane_chain/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') # you may need to uncomment next line to add the library from dmrgpy import simplechains # basic library for spin chains s = 1 # spin in the chain n = 10 # length of the chain ssc = simplechains.SSC(s=s,n=n) # ...
906
28.258065
76
py
dmrgpy
dmrgpy-master/examples/bosonic_chain/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import bosonchain n = 4 bc = bosonchain.Bosonic_Chain(n) # create the bosonic chain h = 0 t = 1.0 # hopping U = 1.0 # Hubbard mu = 0.0 # chemical potential for i in range(n-1): h...
1,016
26.486486
78
py
dmrgpy
dmrgpy-master/examples/bosonic_hubbard/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np import matplotlib.pyplot as plt from dmrgpy import bosonchain from dmrgpy import multioperator n = 3 bc = bosonchain.Bosonic_Hamiltonian(n) # create the chain h = 0 # initialize for i in ran...
749
21.058824
76
py
dmrgpy
dmrgpy-master/examples/effective_hamiltonian_correlator/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain n = 6 spins = [2 for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin chain e = sc.gs_energy() # compute the ground s...
597
18.290323
66
py
dmrgpy
dmrgpy-master/examples/MPS_VS_ED/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain n = 6 for i in range(5): # spins = [np.random.randint(2,6) for i in range(n)] # spin 1/2 heisenberg chain spins = [np.random.randint(2,5) for i in range(n)] # ...
1,058
24.829268
81
py
dmrgpy
dmrgpy-master/examples/mutual_information/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain n = 4 spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain # This example shows how compute the mutual information # (2,3) of a spin chain with 4 site...
1,184
23.183673
67
py
dmrgpy
dmrgpy-master/examples/haldane_chain_correlation/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain ns = np.array(range(4,30,2)) es = [] n = 30 spins = [3 for i in range(n)] # spin 1 chain sc = spinchain.Spin_Chain(spins) # create the chain pairs = [(i,i+1) for ...
719
23
70
py
dmrgpy
dmrgpy-master/examples/multioperator_vev/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np # conventional numpy library from dmrgpy import spinchain # library dealing with DMRG for spin chains import matplotlib.pyplot as plt # library to plot the results n = 10 # total number of s...
875
25.545455
76
py
dmrgpy
dmrgpy-master/examples/finite_temperature_ground_state/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np # conventional numpy library from dmrgpy import spinchain # library dealing with DMRG for spin chains from dmrgpy import thermal # library dealing with DMRG for spin chains import matplotlib....
1,039
26.368421
72
py
dmrgpy
dmrgpy-master/examples/staticVSdefault_operator/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain n = 60 # number of sites in your chain spins = ["S=1/2" for i in range(n)] # create the sites sc = spinchain.Spin_Chain(spins) # create the chain wf0 = sc.rando...
812
24.40625
66
py
dmrgpy
dmrgpy-master/examples/hubbard_site/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import fermionchain n = 1 # number of spinful fermionic sites fc = fermionchain.Spinful_Fermionic_Chain(n) # create the chain h = (fc.Nup[0]-.5)*(fc.Ndn[0]-.5) # interaction h = h...
1,036
24.925
70
py
dmrgpy
dmrgpy-master/examples/multiply_exponentials/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain n = 6 # number of sites in your chain spins = ["S=1/2" for i in range(n)] # create the sites sc = spinchain.Spin_Chain(spins) # create the chain #sc.itensor_vers...
696
20.78125
78
py
dmrgpy
dmrgpy-master/examples/sum_mps/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain n = 10 # number of sites in your chain spins = ["S=1/2" for i in range(n)] # create the sites sc = spinchain.Spin_Chain(spins) # create the chain hfe = sum(sc.S...
989
24.384615
70
py
dmrgpy
dmrgpy-master/examples/anisotropic_heisenberg_S1/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain n = 200 spins = ["S=1/2"]+["S=1" for i in range(n)]+["S=1/2"] # spin 1/2 heisenberg chain def get(D): sc = spinchain.Spin_Chain(spins) # create the spin chai...
992
20.586957
81
py
dmrgpy
dmrgpy-master/examples/magnetization_VS_field/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain n = 10 # number of sites in your chain spins = ["S=1/2" for i in range(n)] # create the sites sc = spinchain.Spin_Chain(spins) # create the chain # now define t...
937
20.318182
66
py
dmrgpy
dmrgpy-master/examples/UV_chain/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import fermionchain n = 4 # number of spinful fermionic sites fc = fermionchain.Spinful_Fermionic_Chain(n) # create the chain h = 0 for i in range(n-1): # hopping h = h + fc.C...
768
31.041667
66
py
dmrgpy
dmrgpy-master/examples/full_hamiltonian/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain n = 2 spins = ["S=1/2" for i in range(n)] sc = spinchain.Spin_Chain(spins) # create the chain h = 0 # initialize Hamiltonian for i in range(n-1): h = h + sc.S...
582
18.433333
66
py
dmrgpy
dmrgpy-master/examples/SYK_chain/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np import matplotlib.pyplot as plt from dmrgpy import fermionchain n = 4 L = 3 fc = fermionchain.Fermionic_Chain(n*L) # create the chain h = 0 #for i in range(n): # for j in range(i): # h = ...
1,749
21.151899
75
py
dmrgpy
dmrgpy-master/examples/energy_fluctuation/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np # conventional numpy library import matplotlib.pyplot as plt # library to plot the results from dmrgpy import spinchain spins = ["S=1" for i in range(10)] # 2*S+1=2 for S=1/2 sc = spinchain....
823
22.542857
66
py
dmrgpy
dmrgpy-master/examples/local_magnetization/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain import matplotlib.pyplot as plt #################################### ### Create the spin chain object ### #################################### n = 6 # total numbe...
1,696
27.762712
80
py
dmrgpy
dmrgpy-master/examples/time_evolution/time_evolution_quench/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 6 # number of sites in the chain spins = [2 for i in range(n)] # S=1/2 sc = spinchain.Spin_Chain(spins) # create the chain # create two Hamiltonians h0 = ...
1,166
22.34
76
py
dmrgpy
dmrgpy-master/examples/time_evolution/time_evolution_wavefunction/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 2 # number of sites in the chain spins = ["S=1/2" for i in range(n)] # S=1/2 sc = spinchain.Spin_Chain(spins) # create the chain # first Hamiltonian, to c...
1,237
21.509091
77
py
dmrgpy
dmrgpy-master/examples/time_evolution/time_evolution_fermions/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import fermionchain ns = np.array(range(4,30,2)) es = [] n = 8 fc = fermionchain.Fermionic_Chain(n) # create the chain h = 0 for i in range(n-1): h = h +fc.Cdag[i]*fc.C[i+1] ...
1,044
19.9
73
py
dmrgpy
dmrgpy-master/examples/time_evolution/time_evolution_ABA/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 3 # number of sites in the chain spins = [2 for i in range(n)] # S=1/2 sc = spinchain.Spin_Chain(spins) # create the chain ###############################...
1,725
26.83871
76
py
dmrgpy
dmrgpy-master/examples/julia_VS_cpp_dynamical_correlator/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain def get(n): spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin chain h = 0 for i in range(...
1,168
18.813559
66
py
dmrgpy
dmrgpy-master/examples/correlation_matrix/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import fermionchain n = 20 # number of spinful fermionic sites fc = fermionchain.Spinful_Fermionic_Chain(n) # create the chain h = 0 U = 2.0 for i in range(n-1): # hopping h =...
1,000
20.297872
66
py
dmrgpy
dmrgpy-master/examples/heisenberg_square/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain n = 4 spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin chain h1,h2 = 0,0 h1 = sc.SS(0,1) + sc.S...
637
18.333333
66
py
dmrgpy
dmrgpy-master/examples/dimer/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain n = 2 spins = ["S=1" for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin chain h = 0 h = h +sc.Sx[0]*sc.Sx[1] h = h ...
549
16.1875
66
py
dmrgpy
dmrgpy-master/examples/GS_enforce_maximum_fluctuation/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain from dmrgpy import fermionchain n = 20 spins = ["S=1" for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin chain h = ...
562
18.413793
66
py
dmrgpy
dmrgpy-master/examples/mean_field/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np import spinchain import meanfield ns = np.array(range(4,30,2)) es = [] n = 6 spins = [2 for i in range(n)] fo = open("SWEEP.OUT","w") ps = np.linspace(0.,1.,20) for p in ps: # loop over poara...
711
19.342857
70
py
dmrgpy
dmrgpy-master/examples/XXZ_correlator/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain n = 20 spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin chain h = 0 # D = 0.5 for i in range(n-...
909
24.277778
66
py
dmrgpy
dmrgpy-master/examples/1dIsing/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain # This example shows the quantum phase transition in the transverse Ising model # generate a 1D Ising chain def get_gap(bx): """ Compute the gap of the 1D...
1,024
24.625
80
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_extrapolate_moments/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 10 # create a random spin chain spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain # create first neighbor exchange sc = spinchain.Spin_Ch...
1,870
22.098765
73
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_fermionic_ED_VS_DMRG/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np import matplotlib.pyplot as plt from dmrgpy import fermionchain n = 4 fc = fermionchain.Fermionic_Chain(n) # create the chain h = 0 for i in range(n): h = h + fc.Cdag[i]*fc.C[i] # for ...
1,847
23
72
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_fermionic_excited/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np import matplotlib.pyplot as plt from dmrgpy import fermionchain n = 4 fc = fermionchain.Fermionic_Chain(n) # create the chain m = np.matrix(np.random.random((n,n)) + 1j*np.random.random((n...
1,483
21.830769
72
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_spatial/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 10 # create an S=1/2 spin chain spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain # create first neighbor exchange sc = spinchain.Spin_Chain(...
1,191
19.551724
69
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_maxent/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 10 # create a random spin chain spins = [2 for i in range(n)] # spin 1/2 heisenberg chain # create first neighbor exchange sc = spinchain.Spin_Chain(spin...
1,437
18.69863
86
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_time_evolution/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain ns = np.array(range(4,30,2)) es = [] n = 5 spins = [2 for i in range(n)] sc = spinchain.Spin_Chain(spins) # create the chain def fj(i,j): if 0.9<abs(i-j)<1...
979
19
69
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_kondo/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np import matplotlib.pyplot as plt from dmrgpy import fermionchain nb = 10 n = nb*2 + 1 + 1 # total number of sites fc = fermionchain.Spinful_Fermionic_Chain(n) # create the chain ic = nb # ...
1,675
23.647059
69
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_parafermions/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np import matplotlib.pyplot as plt from dmrgpy import parafermionchain n = 3 pc = parafermionchain.Parafermionic_Chain(n,Z=3) # create the chain pc.test_ED() h = 0 for i in range(n): for j...
1,458
23.728814
74
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_minimal/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 6 # create a random spin chain #spins = [np.random.randint(2,5) for i in range(n)] # spin 1/2 heisenberg chain spins = ["S=1/2" for i in range(n)] # spin 1...
1,686
20.35443
79
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_sharpen/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 8 # create a random spin chain spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain # create first neighbor exchange sc = spinchain.Spin_Cha...
1,591
21.111111
69
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_cvm/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 4 # create a random spin chain spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain # create first neighbor exchange sc = spinchain.Spin_Chain(...
1,568
19.115385
95
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_non_local/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 6 # create an S=1/2 spin chain spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain # create first neighbor exchange (Heisenberg model) sc = s...
1,493
21.984615
76
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_three_spins/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 2 spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin chain # create the Hamiltonian Sx,S...
821
19.04878
69
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_entropy/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 10 spins = [2 for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin chain def fj(i,j): if j==(i+1): return 1....
727
19.8
75
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_simple/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 6 # create a random spin chain #spins = [np.random.randint(2,5) for i in range(n)] # spin 1/2 heisenberg chain spins = ["S=1/2" for i in range(n)] # spin 1...
929
19.217391
79
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_fermionic_ED_VS_KPM_VS_CVM/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np import matplotlib.pyplot as plt from dmrgpy import fermionchain n = 4 fc = fermionchain.Fermionic_Chain(n) # create the chain h = 0 raise # this should be double checked for i in range(n...
1,641
22.797101
72
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_excited/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 6 # create a random spin chain spins = [2 for i in range(n)] # spin 1/2 heisenberg chain # create first neighbor exchange sc = spinchain.Spin_Chain(spins...
1,769
20.071429
75
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_JW/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain,fermionchain n = 6 site = 0 def get_spin(): # create a random spin chain spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain # create...
1,359
21.295082
69
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_maxent_reconstruct/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 20 # create a random spin chain spins = ["S=1/2" for i in range(n)] # spin 1 heisenberg chain # create first neighbor exchange sc = spinchain.Spin_Chain(...
1,461
19.027397
69
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_v2_VS_v3/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 4 # create a random spin chain spins = [np.random.randint(2,5) for i in range(n)] # spin 1/2 heisenberg chain spins = [2 for i in range(n)] # spin 1/2 heis...
1,376
19.25
78
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_accelerated/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 6 # create a random spin chain spins = [np.random.randint(2,5) for i in range(n)] # spin 1/2 heisenberg chain spins = [2 for i in range(n)] # spin 1/2 heis...
1,468
19.402778
78
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_spatial_inhomogeneous/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np ### This script will compute the dynamical correlator for a # S=1/2 chain with an S=1 impurity in the middle # and save it to the file CORRELATOR_VS_SITE.OUT from dmrgpy import spinchain...
1,978
23.432099
79
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_cvm_imaginary/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain n = 10 # create a random spin chain spins = [2 for i in range(n)] # spin 1/2 heisenberg chain # create first neighbor exchange sc = spinchain.Spin_Chain(spin...
1,418
18.438356
87
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_spinons/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import fermionchain,spinchain n = 4 # create first neighbor exchange sc = fermionchain.Spinon_Chain(n) # create the spin chain #sc = spinchain.Spin_Chain(["S=1/2" for i in ran...
1,259
18.384615
79
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_fermionic_time_evolution/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np import matplotlib.pyplot as plt from dmrgpy import fermionchain n = 4 fc = fermionchain.Fermionic_Chain(n) # create the chain m = np.matrix(np.random.random((n,n)) + 1j*np.random.random((n...
1,649
21.916667
72
py
dmrgpy
dmrgpy-master/examples/dynamical_correlator/dynamical_correlator_shift/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import spinchain import time def get(a): n = 10 # create a random spin chain spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain # create first neigh...
1,355
18.652174
72
py
dmrgpy
dmrgpy-master/examples/hubbard_magnetization_with_edge_pinning/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import fermionchain n = 20 # number of spinful fermionic sites fc = fermionchain.Spinful_Fermionic_Chain(n) # create the chain h = 0 U = 2.0 # hubbard J = 1.0 # local exchange # ...
963
23.717949
72
py
dmrgpy
dmrgpy-master/examples/excited_fluctuations/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain import time n = 16 # take n different sites spins = [2 for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin chain h =...
683
21.064516
66
py
dmrgpy
dmrgpy-master/examples/central_charge_critical/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np from dmrgpy import spinchain n = 100 # number of sites spins = ["S=1/2" for i in range(n)] # spin 1/2 heisenberg chain sc = spinchain.Spin_Chain(spins) # create the spin chain h = 0 # initial...
672
41.0625
76
py
dmrgpy
dmrgpy-master/examples/Hubbard_correlator_VS_size/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../src') import numpy as np def get(n): from dmrgpy import fermionchain U = 2.0 # value of U fc = fermionchain.Spinful_Fermionic_Chain(n) # create the chain h = 0 for i in range(n-1): # hopping ...
966
23.175
71
py
dmrgpy
dmrgpy-master/examples/entanglement_entropy/correlation_entropy_nambu/main.py
# Add the root path of the dmrgpy library import os ; import sys ; sys.path.append(os.getcwd()+'/../../../src') import numpy as np from dmrgpy import fermionchain def get(U): n = 4 # number of spinful fermionic sites fc = fermionchain.Fermionic_Chain(n) # create the chain h = 0 for i in range(n-1): # ...
914
19.333333
69
py