2022-02-05 11:21:44 +01:00
|
|
|
|
from hops.core.hierarchy_parameters import HIParams, HiP, IntP, SysP, ResultType
|
|
|
|
|
from stocproc.stocproc import StocProc_TanhSinh
|
|
|
|
|
from hops.util.bcf_fits import get_ohm_g_w
|
2022-02-25 21:18:20 +01:00
|
|
|
|
from hops.util.truncation_schemes import (
|
|
|
|
|
TruncationScheme_Power_multi,
|
|
|
|
|
BathMemory,
|
|
|
|
|
)
|
|
|
|
|
from hops.util.abstract_truncation_scheme import (
|
|
|
|
|
TruncationScheme_Simplex
|
|
|
|
|
)
|
2022-02-05 11:21:44 +01:00
|
|
|
|
import hops.util.bcf
|
|
|
|
|
import numpy as np
|
|
|
|
|
from stocproc import StocProc_FFT
|
|
|
|
|
|
|
|
|
|
np.__config__.blas_opt_info = np.__config__.blas_ilp64_opt_info # fix for qutip
|
|
|
|
|
import qutip
|
|
|
|
|
|
2022-02-08 21:01:49 +01:00
|
|
|
|
|
2022-02-05 11:21:44 +01:00
|
|
|
|
wc = 2
|
|
|
|
|
s = 1
|
|
|
|
|
Ω = 1
|
|
|
|
|
Λ = 1
|
2022-03-15 11:44:23 +01:00
|
|
|
|
γ = 1
|
2022-02-05 11:21:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hops_bcf = hops.util.bcf.OhmicBCF_zeroTemp(
|
|
|
|
|
s,
|
|
|
|
|
1,
|
|
|
|
|
wc,
|
|
|
|
|
)
|
|
|
|
|
|
2022-02-08 21:41:59 +01:00
|
|
|
|
|
2022-03-15 11:44:23 +01:00
|
|
|
|
max_HO_level_set = 10
|
2022-02-08 21:01:49 +01:00
|
|
|
|
def make_config(
|
|
|
|
|
max_HO_level: int,
|
|
|
|
|
bcf_terms: int = 4,
|
|
|
|
|
t_max: float = 10,
|
|
|
|
|
k_fac: float = 1.4,
|
2022-02-25 21:18:20 +01:00
|
|
|
|
inf_tol: float = 0.1,
|
2022-03-15 11:44:23 +01:00
|
|
|
|
k_max: int = 7,
|
2022-02-08 21:01:49 +01:00
|
|
|
|
sp_tol: float = 1e-3,
|
2022-02-08 21:42:41 +01:00
|
|
|
|
bcf_scale: list[float] = [0.5, 0.5],
|
2022-02-25 21:18:20 +01:00
|
|
|
|
truncation_scheme: str = "power",
|
2022-02-08 21:41:59 +01:00
|
|
|
|
T: float = 0.3,
|
2022-02-08 21:01:49 +01:00
|
|
|
|
):
|
2022-03-15 11:44:23 +01:00
|
|
|
|
global max_HO_level_set
|
|
|
|
|
max_HO_level_set = max_HO_level
|
|
|
|
|
|
2022-02-08 21:01:49 +01:00
|
|
|
|
# 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],
|
2022-02-08 21:42:41 +01:00
|
|
|
|
bcf_scale=bcf_scale,
|
2022-02-08 21:41:59 +01:00
|
|
|
|
T=[T, 0],
|
2022-02-08 21:01:49 +01:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
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
|
2022-02-25 21:18:20 +01:00
|
|
|
|
)
|
|
|
|
|
if truncation_scheme == "power"
|
|
|
|
|
else BathMemory.from_system(
|
|
|
|
|
system, nonlinear=True, influence_tolerance=inf_tol
|
|
|
|
|
)
|
|
|
|
|
if truncation_scheme == "bath_memory"
|
2022-03-15 11:44:23 +01:00
|
|
|
|
else TruncationScheme_Simplex(k_max),
|
2022-02-08 21:01:49 +01:00
|
|
|
|
save_therm_rng_seed=True,
|
2022-02-05 11:21:44 +01:00
|
|
|
|
),
|
2022-02-08 21:01:49 +01:00
|
|
|
|
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,
|
2022-02-05 11:21:44 +01:00
|
|
|
|
),
|
2022-02-08 21:01:49 +01:00
|
|
|
|
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,
|
2022-02-05 11:21:44 +01:00
|
|
|
|
),
|
2022-02-08 21:01:49 +01:00
|
|
|
|
],
|
|
|
|
|
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,
|
2022-02-05 11:21:44 +01:00
|
|
|
|
),
|
2022-02-08 21:01:49 +01:00
|
|
|
|
None,
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
return params
|
|
|
|
|
|
2022-03-15 11:44:23 +01:00
|
|
|
|
γ = .5
|
2022-03-04 16:28:11 +01:00
|
|
|
|
params = make_config(
|
2022-03-15 11:44:23 +01:00
|
|
|
|
max_HO_level=9,
|
|
|
|
|
bcf_terms=5,
|
|
|
|
|
t_max=50,
|
|
|
|
|
inf_tol=.05,
|
|
|
|
|
sp_tol=1e-5,
|
|
|
|
|
bcf_scale=[0.2, 0.2],
|
|
|
|
|
T=.6,
|
|
|
|
|
k_max=5,
|
|
|
|
|
truncation_scheme="simplex",
|
2022-02-05 11:21:44 +01:00
|
|
|
|
)
|