Ejemplo n.º 1
0
    'axes.labelsize': 30,
    # 'legend.fontsize': 28,
    'legend.fontsize': 23,
    'xtick.labelsize': 22,
    'ytick.labelsize': 22,
    'figure.figsize': [5.2 * 3.375, 3.5 * 3.375],
    'text.usetex': True
}
plt.rcParams.update(pltparams)
"""Generate our class for the unscaled parameters"""
"""these are primarily used for saving our data"""
param = unscaledparam(L=6,
                      t0=0.52,
                      U=1,
                      pbc=True,
                      field=32.9,
                      F0=10,
                      a=4,
                      a_scale=1,
                      J_scale=1,
                      tracking=1)
"""generating our class of scaled parameters"""
"""this is used for most of the calculations"""
lat = hhg(field=param.field,
          nup=param.N_up,
          ndown=param.N_down,
          nx=param.L,
          ny=0,
          U=param.U,
          t=param.t0,
          F0=param.F0,
          a=param.a,
Ejemplo n.º 2
0
import psutil
import numpy as np  # general math functions
from time import time  # tool for calculating computation time

"""Open MP and MKL should speed up the time required to run these simulations!"""
threads = 6
os.environ['OMP_NUM_THREADS'] = '{}'.format(threads)
os.environ['MKL_NUM_THREADS'] = '{}'.format(threads)
sys.path.append('../')
# note cpu_count for logical=False returns the wrong number for multi-socket CPUs.
print("logical cores available {}".format(psutil.cpu_count(logical=True)))
t_init = time()
np.__config__.show()

"""Generate our class for the unscaled parameters. These are primarily used for saving our data"""
param = unscaledparam(L=6, t0=0.52, U=0.6, pbc=False, field=32.9, F0=10, a=4)

"""Generating our class of scaled parameters. This is used for most of the calculations"""
lat = hhg(field=param.field, nup=param.N_up, ndown=param.N_down, nx=param.L, ny=0, U=param.U, t=param.t0, F0=param.F0
          , a=param.a, pbc=param.pbc)

"""setup our evolution time parameters"""
t_p = time_evolution_params(perimeter_params=lat, cycles=2, nsteps=int(4e3))

"""setup quspin operators and lists"""
FHM = Fermi_Hubbard(lat, t_p.cycles)

"""get inital energy and state"""
ti = time()
E, psi_0 = FHM.operator_dict['H'].eigsh(k=1, which='SA')
print("Initial state and energy calculated. It took {:.2f} seconds to calculate".format(time() - ti))
Ejemplo n.º 3
0
from classes.unscaled_parameters.unscaledparam import unscaledparam
from classes.time_param.t_param import time_evolution_params

pltparams = {
    'axes.labelsize': 30,
    # 'legend.fontsize': 28,
    'legend.fontsize': 23,
    'xtick.labelsize': 22,
    'ytick.labelsize': 22,
    'figure.figsize': [5.2 * 3.375, 3.5 * 3.375],
    'text.usetex': True
}
plt.rcParams.update(pltparams)
"""Generate our class for the unscaled parameters"""
"""these are primarily used for saving our data"""
param = unscaledparam(L=6, t0=0.52, U=0.5, pbc=True, field=32.9, F0=3, a=4)
"""prepare to load our data to be plotted"""
outfile = './Data/errors:{}sites-{}up-{}down-{}t0-{}U-{}cycles-{}pbc.npz'.format(
    param.L, param.N_up, param.N_down, param.t0, param.U, 2, param.pbc)
errors = np.load(outfile)

steps = np.linspace(1000, 10000, len(errors['taa_err']))
"""plot out expectations"""

plt.figure("absolute error of untracked simulation")
plt.title("Absolute time-averaged error of untracked simulation")
plt.xlabel("Number of Steps")
plt.ylabel("$\\langle \\epsilon_{abs} \\rangle_t$")
plt.loglog(steps, errors['taa_err'])
plt.grid(True)
plt.tight_layout()
Ejemplo n.º 4
0
print("logical cores available {}".format(psutil.cpu_count(logical=True)))
t_init = time()
np.__config__.show()
"""pull data from an acceptable preliminary simulation"""
### MAKE SURE THAT THE DATA PULLED FROM THIS HAS A LOW F0, OR ELSE THE ERROR ANALYSIS MAY GO CRAZY ###
acceptable_data = \
    '../Preliminary simulation/Data/expectations:6sites-3up-3down-0.52t0-0.26U-2cycles-10000steps-Truepbc.npz'
a_d = dict(np.load(acceptable_data))
"""build everything needed for both simulations"""

# generating parameter classes
param = unscaledparam(L=6,
                      t0=0.52,
                      U=0.5,
                      pbc=True,
                      field=32.9,
                      F0=9,
                      a=4,
                      a_scale=1,
                      J_scale=1,
                      tracking=1)

lat = hhg(field=param.field,
          nup=param.N_up,
          ndown=param.N_down,
          nx=param.L,
          ny=0,
          U=param.U,
          t=param.t0,
          F0=param.F0,
          a=param.a,
          pbc=param.pbc)