mirror of
https://github.com/vale981/master-thesis
synced 2025-03-06 02:21:38 -05:00
the one config to rule them all
This commit is contained in:
parent
b9aae25b41
commit
9b704f67ea
1 changed files with 100 additions and 79 deletions
|
@ -10,44 +10,13 @@ from stocproc import StocProc_FFT
|
|||
np.__config__.blas_opt_info = np.__config__.blas_ilp64_opt_info # fix for qutip
|
||||
import qutip
|
||||
|
||||
|
||||
wc = 2
|
||||
s = 1
|
||||
Ω = 1
|
||||
Λ = 1
|
||||
γ = 0.1
|
||||
|
||||
# The BCF fit
|
||||
bcf_terms = 4
|
||||
g, w = get_ohm_g_w(bcf_terms, s, wc)
|
||||
|
||||
max_HO_level = 10
|
||||
integration = IntP(t_max=10, t_steps=int(10 // 0.1))
|
||||
|
||||
q_proto = qutip.operators.create(max_HO_level) + qutip.operators.destroy(max_HO_level)
|
||||
p_proto = (
|
||||
qutip.operators.destroy(max_HO_level) - qutip.operators.create(max_HO_level)
|
||||
) / 1j
|
||||
|
||||
q_1 = qutip.tensor(q_proto, qutip.qeye(max_HO_level))
|
||||
p_1 = qutip.tensor(p_proto, qutip.qeye(max_HO_level))
|
||||
q_2 = qutip.tensor(qutip.qeye(max_HO_level), q_proto)
|
||||
p_2 = qutip.tensor(qutip.qeye(max_HO_level), p_proto)
|
||||
system = SysP(
|
||||
H_sys=(
|
||||
0.25 * (p_1 ** 2 + q_1 ** 2 + p_2 ** 2 + q_2 ** 2)
|
||||
+ γ / 4 * (q_1 - q_2) ** 2
|
||||
).full(),
|
||||
L=[0.5 * q_1.full(), 0.5 * q_2.full()],
|
||||
psi0=qutip.tensor(
|
||||
qutip.states.fock(max_HO_level, n=0), qutip.states.fock(max_HO_level, n=0)
|
||||
)
|
||||
.full()
|
||||
.flatten(),
|
||||
g=[g, g],
|
||||
w=[w, w],
|
||||
bcf_scale=[0.5, 0.5],
|
||||
T=[0.3, 0],
|
||||
)
|
||||
|
||||
hops_bcf = hops.util.bcf.OhmicBCF_zeroTemp(
|
||||
s,
|
||||
|
@ -55,56 +24,108 @@ hops_bcf = hops.util.bcf.OhmicBCF_zeroTemp(
|
|||
wc,
|
||||
)
|
||||
|
||||
params = HIParams(
|
||||
SysP=system,
|
||||
IntP=integration,
|
||||
HiP=HiP(
|
||||
nonlinear=True,
|
||||
result_type=ResultType.ZEROTH_AND_FIRST_ORDER,
|
||||
truncation_scheme=TruncationScheme_Power_multi.from_g_w(
|
||||
g=system.g, w=system.w, p=[1, 1], q=[0.5, 0.5], kfac=[1.5, 1.5]
|
||||
),
|
||||
save_therm_rng_seed=True,
|
||||
),
|
||||
Eta=[
|
||||
StocProc_FFT(
|
||||
spectral_density=hops.util.bcf.OhmicSD_zeroTemp(
|
||||
s,
|
||||
1,
|
||||
wc,
|
||||
def make_config(
|
||||
max_HO_level: int,
|
||||
bcf_terms: int = 4,
|
||||
t_max: float = 10,
|
||||
k_fac: float = 1.4,
|
||||
sp_tol: float = 1e-3,
|
||||
):
|
||||
# The BCF fit
|
||||
g, w = get_ohm_g_w(bcf_terms, s, wc)
|
||||
|
||||
integration = IntP(t_max=t_max, t_steps=int(t_max // 0.1))
|
||||
|
||||
q_proto = qutip.operators.create(max_HO_level) + qutip.operators.destroy(
|
||||
max_HO_level
|
||||
)
|
||||
p_proto = (
|
||||
qutip.operators.destroy(max_HO_level) - qutip.operators.create(max_HO_level)
|
||||
) / 1j
|
||||
|
||||
q_1 = qutip.tensor(q_proto, qutip.qeye(max_HO_level))
|
||||
p_1 = qutip.tensor(p_proto, qutip.qeye(max_HO_level))
|
||||
q_2 = qutip.tensor(qutip.qeye(max_HO_level), q_proto)
|
||||
p_2 = qutip.tensor(qutip.qeye(max_HO_level), p_proto)
|
||||
|
||||
system = SysP(
|
||||
H_sys=(
|
||||
0.25 * (p_1 ** 2 + q_1 ** 2 + p_2 ** 2 + q_2 ** 2)
|
||||
+ γ / 4 * (q_1 - q_2) ** 2
|
||||
).full(),
|
||||
L=[0.5 * q_1.full(), 0.5 * q_2.full()],
|
||||
psi0=qutip.tensor(
|
||||
qutip.states.fock(max_HO_level, n=0), qutip.states.fock(max_HO_level, n=0)
|
||||
)
|
||||
.full()
|
||||
.flatten(),
|
||||
g=[g, g],
|
||||
w=[w, w],
|
||||
bcf_scale=[0.5, 0.5],
|
||||
T=[0.3, 0],
|
||||
)
|
||||
|
||||
|
||||
params = HIParams(
|
||||
SysP=system,
|
||||
IntP=integration,
|
||||
HiP=HiP(
|
||||
nonlinear=True,
|
||||
result_type=ResultType.ZEROTH_AND_FIRST_ORDER,
|
||||
truncation_scheme=TruncationScheme_Power_multi.from_g_w(
|
||||
g=system.g, w=system.w, p=[1, 1], q=[0.5, 0.5], kfac=[k_fac] * 2
|
||||
),
|
||||
alpha=hops_bcf,
|
||||
t_max=integration.t_max,
|
||||
intgr_tol=1e-5,
|
||||
intpl_tol=1e-5,
|
||||
negative_frequencies=False,
|
||||
save_therm_rng_seed=True,
|
||||
),
|
||||
StocProc_FFT(
|
||||
spectral_density=hops.util.bcf.OhmicSD_zeroTemp(
|
||||
s,
|
||||
1,
|
||||
wc,
|
||||
Eta=[
|
||||
StocProc_FFT(
|
||||
spectral_density=hops.util.bcf.OhmicSD_zeroTemp(
|
||||
s,
|
||||
1,
|
||||
wc,
|
||||
),
|
||||
alpha=hops_bcf,
|
||||
t_max=integration.t_max,
|
||||
intgr_tol=sp_tol,
|
||||
intpl_tol=sp_tol,
|
||||
negative_frequencies=False,
|
||||
),
|
||||
alpha=hops_bcf,
|
||||
t_max=integration.t_max,
|
||||
intgr_tol=1e-5,
|
||||
intpl_tol=1e-5,
|
||||
negative_frequencies=False,
|
||||
),
|
||||
],
|
||||
EtaTherm=[
|
||||
StocProc_TanhSinh(
|
||||
spectral_density=hops.util.bcf.Ohmic_StochasticPotentialDensity(
|
||||
s, 1, wc, beta=1 / system.__non_key__["T"][0]
|
||||
StocProc_FFT(
|
||||
spectral_density=hops.util.bcf.OhmicSD_zeroTemp(
|
||||
s,
|
||||
1,
|
||||
wc,
|
||||
),
|
||||
alpha=hops_bcf,
|
||||
t_max=integration.t_max,
|
||||
intgr_tol=sp_tol,
|
||||
intpl_tol=sp_tol,
|
||||
negative_frequencies=False,
|
||||
),
|
||||
alpha=hops.util.bcf.Ohmic_StochasticPotentialCorrelations(
|
||||
s, 1, wc, beta=1 / system.__non_key__["T"][0]
|
||||
],
|
||||
EtaTherm=[
|
||||
StocProc_TanhSinh(
|
||||
spectral_density=hops.util.bcf.Ohmic_StochasticPotentialDensity(
|
||||
s, 1, wc, beta=1 / system.__non_key__["T"][0]
|
||||
),
|
||||
alpha=hops.util.bcf.Ohmic_StochasticPotentialCorrelations(
|
||||
s, 1, wc, beta=1 / system.__non_key__["T"][0]
|
||||
),
|
||||
t_max=integration.t_max,
|
||||
intgr_tol=sp_tol,
|
||||
intpl_tol=sp_tol,
|
||||
negative_frequencies=False,
|
||||
),
|
||||
t_max=integration.t_max,
|
||||
intgr_tol=1e-5,
|
||||
intpl_tol=1e-5,
|
||||
negative_frequencies=False,
|
||||
),
|
||||
None,
|
||||
],
|
||||
None,
|
||||
],
|
||||
)
|
||||
|
||||
return params
|
||||
|
||||
params = make_config(
|
||||
max_HO_level=8,
|
||||
bcf_terms=5,
|
||||
t_max=10,
|
||||
k_fac=1.3,
|
||||
sp_tol=1e-6,
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue