Пример #1
0
           ndown=param2.N_down,
           nx=param2.L,
           ny=0,
           U=param2.U,
           t=param2.t0,
           F0=param2.F0,
           a=param2.a,
           pbc=param2.pbc)
"""setup our evolution time parameters"""
t_p = time_evolution_params(perimeter_params=lat, cycles=10, nsteps=int(2e3))

# plt.figure('current')
# plt.plot(t_p.times, J_target(t_p.times))
# plt.plot(t_p.times, expectations['current'], ".")
"""setup quspin operators and lists"""
FHM1 = Fermi_Hubbard(lat, t_p.cycles)
FHM2 = Fermi_Hubbard(lat2, t_p.cycles)

print("Initial classes built. This took {:.2f} seconds".format(time() - ti))
"""get inital energy and state"""
print("Determining ground states of the two systems.")
ti = time()
E1, psi1_0 = FHM1.operator_dict['ham_init'].eigsh(k=1, which='SA')
psi1_0 = np.squeeze(psi1_0)
E2, psi2_0 = FHM2.operator_dict['ham_init'].eigsh(k=1, which='SA')
psi2_0 = np.squeeze(psi2_0)
print("Ground states determined. This took {:.2f}".format(time() - ti))
"""kick one of the systems for the initial state."""
print(
    "Generating Initial states by kicking the ground state of the two systems."
)
Пример #2
0
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))
print("Ground state energy was calculated to be {:.2f}".format(E[0]))

"""evolve that energy and state"""
print('Starting Evolution')
ti = time()
psi_t = FHM.operator_dict["H"].evolve(psi_0, 0.0, t_p.times)
psi_t = np.squeeze(psi_t)
print('Evolution finished. It took {:.2f} seconds to evolve the system'.format(time() - ti))

Пример #3
0
                            J_scale=1,
                            tracking=1)

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

# creating fermihubbard classes
FHM = Fermi_Hubbard(lat, 2)

FHM_track = Fermi_Hubbard(lat_track, 2)

FHM_track.create_commutator()

# generating groundstates
E, psi_0 = FHM.operator_dict['H'].eigsh(k=1, which='SA')

E_track, psi_0_track = FHM.operator_dict['H'].eigsh(k=1, which='SA')
"""start running R tracking and prelim simulation starting with 1000 steps incrimenting by 100 until 10000"""
t_a_absolute_err = []
t_a_absolute_err_R_track = []
t_a_relative_err_R_track = []
t_a_absolute_err_R_prime_track = []
t_a_relative_err_R_prime_track = []
Пример #4
0
param = unscaledparam(L=6, t0=0.52, U=1, pbc=True, 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(2e5))
"""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))
print("Ground state energy was calculated to be {:.2f}".format(E[0]))
"""evolve that energy and state"""
print('Starting Evolution')
ti = time()
psi_t = FHM.operator_dict["H"].evolve(psi_0, 0.0, t_p.times)
psi_t = np.squeeze(psi_t)
print('Evolution finished. It took {:.2f} seconds to evolve the system'.format(
    time() - ti))
"""creating additional operators"""
t_p = time_evolution_params(perimeter_params=lat, cycles=2, nsteps=int(2e4))

"""importing our data from preliminary simulation"""
loadfile = '../Preliminary simulation/Data/expectations:{}sites-{}up-{}down-{}t0-{}U-{}cycles-{}steps-{}pbc.npz'\
    .format(param.L, param.N_up, param.N_down, param.t0, param.U, t_p.cycles, t_p.n_steps, param.pbc)
expectations = dict(np.load(loadfile))

J_target = UnivariateSpline(t_p.times, param.J_scale * expectations['current'].real, s=0)
# J_target = interp1d(t_p.times, param.J_scale * expectations['current'].real, kind='cubic', fill_value='extrapolate')

# plt.figure('current')
# plt.plot(t_p.times, J_target(t_p.times))
# plt.plot(t_p.times, expectations['current'], ".")

"""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['ham_init'].eigsh(k=1, which='SA')
gamma_t = np.append(np.squeeze(psi_0), 0.0)
print("Initial state and energy calculated. It took {:.2f} seconds to calculate".format(time() - ti))
print("Ground state energy was calculated to be {:.2f}".format(E[0]))

"""create number operator"""

FHM.create_number_operator()

"""create current operator"""

FHM.create_current_operator()