<commit_before>from timeit import default_timer as timer
import numpy as np
import os
import Grid
import CoherentState
import PolaronHamiltonian
import matplotlib
import matplotlib.pyplot as plt

matplotlib.rcParams.update({'font.size': 12, 'text.usetex': True})

# Initialization Grid
k_max = 1
dk = 0.1
Ntheta = 10
dtheta = np.pi / (Ntheta - 1)

grid_space = Grid.Grid("SPHERICAL_2D")
grid_space.init1d('k', dk, k_max, dk)
grid_space.init1d('th', dtheta, np.pi, dtheta)

# Initialization CoherentState
cs = CoherentState.CoherentState(grid_space)

# Initialization PolaronHamiltonian

mI = 1
mB = 1
n0 = 1
gBB = (4 * np.pi / mB) * 0.05
P = 0.85
aIBi = -20

Params = [P, aIBi, mI, mB, n0, gBB]
ham = PolaronHamiltonian.PolaronHamiltonian(cs, Params)


# Time evolution
tMax = 1
dt = 1e-5

start = timer()

tVec = np.arange(0, tMax, dt)
PB_Vec = np.zeros(tVec.size, dtype=float)
NB_Vec = np.zeros(tVec.size, dtype=float)
DynOv_Vec = np.zeros(tVec.size, dtype=complex)

for ind, t in enumerate(tVec):
    PB_Vec[ind] = cs.get_PhononMomentum()
    NB_Vec[ind] = cs.get_PhononNumber()
    DynOv_Vec[ind] = cs.get_DynOverlap()

    cs.evolve(dt, ham)


# save data
data = [ham.Params, tVec, PB_Vec, NB_Vec, DynOv_Vec]

dirpath = os.path.dirname(os.path.realpath(__file__))
np.save(dirpath + '/data/gquench_aIBi:%.2f_P:%.2f.npy' % (aIBi, P), data)

end = timer()

print(end - start)

figN, axN = plt.subplots()<commit_msg>testing slowdown times<commit_after>from timeit import default_timer as timer
import numpy as np
import os
import Grid
import CoherentState
import PolaronHamiltonian
import matplotlib
import matplotlib.pyplot as plt

matplotlib.rcParams.update({'font.size': 12, 'text.usetex': True})

# Initialization Grid
kcutoff = 20
dk = 0.05

Ntheta = 10
dtheta = np.pi / (Ntheta - 1)

grid_space = Grid.Grid("SPHERICAL_2D")
grid_space.init1d('k', dk, kcutoff, dk)
grid_space.init1d('th', dtheta, np.pi, dtheta)

# Initialization CoherentState
cs = CoherentState.CoherentState(grid_space)

# Initialization PolaronHamiltonian

mI = 1
mB = 1
n0 = 1
gBB = (4 * np.pi / mB) * 0.05
P = 0.85
aIBi = -20

Params = [P, aIBi, mI, mB, n0, gBB]
ham = PolaronHamiltonian.PolaronHamiltonian(cs, Params)


# Time evolution
tMax = 3
dt = 1e-5

start = timer()

tVec = np.arange(0, tMax, dt)
PB_Vec = np.zeros(tVec.size, dtype=float)
NB_Vec = np.zeros(tVec.size, dtype=float)
DynOv_Vec = np.zeros(tVec.size, dtype=complex)

for ind, t in enumerate(tVec):
    PB_Vec[ind] = cs.get_PhononMomentum()
    NB_Vec[ind] = cs.get_PhononNumber()
    # DynOv_Vec[ind] = cs.get_DynOverlap()

    cs.evolve(dt, ham)


# save data
data = [ham.Params, tVec, PB_Vec, NB_Vec, DynOv_Vec]

dirpath = os.path.dirname(os.path.realpath(__file__))
np.save(dirpath + '/data/gquench_aIBi:%.2f_P:%.2f.npy' % (aIBi, P), data)

end = timer()

print(end - start)

figN, axN = plt.subplots()
{'fraction_non_alphanumeric': 0.13779803646563815, 'fraction_numerical': 0.02244039270687237, 'mean_word_length': 4.497109826589595, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5138874', 'n_tokens_mistral': 1278, 'n_tokens_neox': 1208, 'n_words': 275}