flake lock for 5th project

This commit is contained in:
Valentin Boettcher 2022-01-20 15:54:37 +01:00
parent ce16c285c0
commit c3929821d3
4 changed files with 189 additions and 57 deletions

View file

@ -15,7 +15,7 @@ This will be tangled into the [[file:config.py][config file]] that can be used w
np.__config__.blas_opt_info = np.__config__.blas_ilp64_opt_info # fix for qutip
import qutip
max_HO_level = 10
max_HO_level = 15
wc = 2
s = 1
@ -52,7 +52,7 @@ This will be tangled into the [[file:config.py][config file]] that can be used w
normalized_by_hand=True,
result_type=ResultType.ZEROTH_AND_FIRST_ORDER,
truncation_scheme=TruncationScheme_Power_multi.from_g_w(
g=g, w=w, p=1, q=0.5, kfac=1.4
g=g, w=w, p=1, q=0.5, kfac=1.7
),
save_therm_rng_seed=True,
),
@ -64,8 +64,8 @@ This will be tangled into the [[file:config.py][config file]] that can be used w
),
alpha=hops_bcf,
t_max=integration.t_max,
intgr_tol=1e-6,
intpl_tol=1e-6,
intgr_tol=1e-5,
intpl_tol=1e-5,
negative_frequencies=False,
),
EtaTherm=StocProc_FFT(
@ -76,8 +76,8 @@ This will be tangled into the [[file:config.py][config file]] that can be used w
s, 1, wc, beta=1 / system.__non_key__["T"]
),
t_max=integration.t_max,
intgr_tol=1e-6,
intpl_tol=1e-6,
intgr_tol=1e-5,
intpl_tol=1e-5,
negative_frequencies=False,
),
)
@ -109,7 +109,7 @@ This will be tangled into the [[file:config.py][config file]] that can be used w
#+end_src
#+RESULTS:
: 5000
: 10000
#+begin_src jupyter-python
_, e_sys, σ_e_sys = util.operator_expectation_ensemble(
@ -122,8 +122,8 @@ This will be tangled into the [[file:config.py][config file]] that can be used w
#+end_src
#+RESULTS:
: 100% 4999/4999 [00:11<00:00, 443.54it/s]
: INFO:root:Writing cache to: results/system_energy_sandwhich_operator_5000_None_2510a9c86a1f8e5d0ac36e134c0d438296b6077cfd285d71bbebe3616ef941da.npy
: 100% 9999/9999 [00:39<00:00, 255.45it/s]
: INFO:root:Writing cache to: results/system_energy_sandwhich_operator_10000_None_b732ef84d0489649e904cf6b7cf525761a9a9cd4fc61fcc9613a870ac4e0c09c.npy
#+begin_src jupyter-python
with ut.hiro_style():
@ -131,7 +131,7 @@ This will be tangled into the [[file:config.py][config file]] that can be used w
#+end_src
#+RESULTS:
[[file:./.ob-jupyter/2d7b40491f7ddfce2ac96e5951afeee07acbd979.svg]]
[[file:./.ob-jupyter/dbdd5fb75968cd91fba721995f017ded50c22f1e.svg]]
* Heat Flow
@ -157,8 +157,8 @@ This will be tangled into the [[file:config.py][config file]] that can be used w
#+end_src
#+RESULTS:
: 100% 4999/4999 [10:06<00:00, 8.25it/s]
: INFO:root:Writing cache to: results/heat_flow__heat_flow_ensemble_body_5000_1000_bf2512dd7d40b82bd07dc85ed12b4999d7e3b1fbdd019b612040ba5bac732e16.npy
: 100% 9999/9999 [04:47<00:00, 34.78it/s]
: INFO:root:Writing cache to: results/heat_flow__heat_flow_ensemble_body_10000_2000_5f1d1857f6e88f049e7a6ad13310daf235b5b888ef49a541774d1c706725f1bb.npy
#+begin_src jupyter-python
with ut.hiro_style():
@ -167,7 +167,8 @@ This will be tangled into the [[file:config.py][config file]] that can be used w
#+end_src
#+RESULTS:
[[file:./.ob-jupyter/67b03a82c224356fc2a72ffa5472dc127254277b.svg]]
[[file:./.ob-jupyter/e2f695d0cc2910195a294d7568573bab0f86c4c1.svg]]
* Analytic Solution
@ -214,7 +215,7 @@ LGTM.
#+end_src
#+RESULTS:
[[file:./.ob-jupyter/0f75298a51b4024c4ae3f56554b07343fa5ed46f.svg]]
[[file:./.ob-jupyter/f563c501f649e3348b98dc577197f116d04392b1.svg]]
#+begin_src jupyter-python :results none
sys = gf.SystemParams(Ω=1, η=system.bcf_scale, α_0=α_0)
@ -229,7 +230,7 @@ LGTM.
#+end_src
#+RESULTS:
[[file:./.ob-jupyter/0009cda538e75b6e66df38d71984a907bcb61dbd.svg]]
[[file:./.ob-jupyter/df18982e8eac932a9563e670ee145a83b22606e7.svg]]
* Compare
#+begin_src jupyter-python
@ -240,16 +241,16 @@ LGTM.
#+end_src
#+RESULTS:
[[file:./.ob-jupyter/30139ebc2ee6cba832208e58a9be5ed12fe18cc0.svg]]
[[file:./.ob-jupyter/0036e379b0dba46540ff1c0cb0961ab57b339642.svg]]
#+begin_src jupyter-python
with ut.hiro_style():
fig, ax = ut.plot_diff_vs_sigma(result.τ, full_flow[-1:], flow_τ, transform=lambda y: -y)
fig, ax = ut.plot_diff_vs_sigma(result.τ, full_flow, flow_τ, transform=lambda y: -y)
ax.legend()
#+end_src
#+RESULTS:
[[file:./.ob-jupyter/873861424371a6b84634b2315c415710640a74b8.svg]]
[[file:./.ob-jupyter/9f96530c7c59f74a7052dca1f859fa6d2cf01caa.svg]]
* Cleanup
#+begin_src jupyter-python :results none

View file

@ -1,50 +1,50 @@
import sys
sys.path.insert(0,'../')
sys.path.insert(0,'/home/hiro/src/hopsflow')
import numpy as np
import matplotlib.pyplot as plt
import hops.stg_helper as stg_helper
import stg as stg
from hopsflow import util, hopsflow
import utilities as ut
from cache_decorator import Cache
from hops.core.hierarchyData import HIMetaData
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
system_params = stg_helper.get_system_param(stg)
class result:
hd = stg_helper.get_hierarchy_data(stg, read_only=True)
N = hd.get_samples()
hd = HIMetaData("data", ".").get_HIData(params, read_only=True)
N = hd.samples
seeds = hd.rng_seed
τ = hd.get_time()
# ρ = hd.get_rho_t()
ψ_1 = hd.aux_states
ψ = hd.stoc_traj
rng_seed = hd.rng_seed
print(result.N)
result.N
_, e_sys, σ_e_sys = util.operator_expectation_ensemble(
iter(result.ψ),
system_params.H_sys.todense(),
system.H_sys,
result.N,
stg.__HI_nonlinear,
save="./stuff/energy.npy"
params.HiP.nonlinear,
save="system_energy"
)
with ut.hiro_style():
plt.errorbar(result.τ, e_sys.real, yerr=σ_e_sys.real, ecolor="yellow")
hf_system = ut.hopsflow_systemparams(stg)
hf_therm = ut.hopsflow_thermparams(stg, result.τ)
hf_system = hopsflow.SystemParams(
system.L, system.g, system.w, system.bcf_scale, params.HiP.nonlinear
)
ξ = params.EtaTherm
ξ.calc_deriv = True
hf_therm = hopsflow.ThermalParams(ξ=ξ, τ=result.τ, num_deriv=False)
full_flow = hopsflow.heat_flow_ensemble(
iter(result.ψ),
iter(result.ψ_1),
hf_system,
result.N,
(iter(result.rng_seed), hf_therm),
#only_therm=True,
(iter(result.seeds), hf_therm),
every=int(result.N / 5),
save="./stuff/flow.npy"
save="heat_flow"
)
with ut.hiro_style():
@ -54,24 +54,29 @@ with ut.hiro_style():
from hopsflow import gaussflow as gf
α = gf.BCF(
stg.t_max,
stg.__bcf,
params.IntP.t_max,
hops.util.bcf.OhmicBCF_nonZeroTemp(s=s, eta=1, w_c=wc, beta=1 / system.__non_key__["T"]),
num_terms=6,
resolution=0.01,
)
α_0 = gf.BCF(
stg.t_max,
stg.__bcf_zero_temp,
num_terms=6,
resolution=0.01,
params.IntP.t_max,
factors=params.SysP.g,
exponents=params.SysP.w,
# hops_bcf,
# num_terms=6,
# resolution=0.001,
)
α_0_dot = gf.BCF(
stg.t_max,
lambda t: 2 / (1j * np.pi) * (stg.wc / (1 + 1j * stg.wc * t)) ** 3,
num_terms=6,
resolution=0.01,
params.IntP.t_max,
factors=-params.SysP.w * params.SysP.g,
exponents=params.SysP.w,
# lambda t: 2 / (1j * np.pi) * (wc / (1 + 1j * wc * t)) ** 3,
# num_terms=6,
# resolution=0.001,
)
with ut.hiro_style():
@ -79,7 +84,7 @@ with ut.hiro_style():
ut.plot_complex(result.τ, α(result.τ)- α.approx(result.τ), label="finite", ax=ax)
ut.plot_complex(result.τ, α_0_dot(result.τ)- α_0_dot.approx(result.τ), label="finite", ax=ax)
sys = gf.SystemParams(Ω=stg.OMEGA, η=stg.eta, α_0=α_0)
sys = gf.SystemParams(Ω=1, η=system.bcf_scale, α_0=α_0)
flow = gf.Flow(sys, α, α_0_dot, n=0)
flow_τ = flow(result.τ) #+ flow.flow_therm_zero(result.τ)# + flow.flow_nontherm(result.τ)
@ -93,7 +98,7 @@ with ut.hiro_style():
ax.legend()
with ut.hiro_style():
fig, ax = ut.plot_diff_vs_sigma(result.τ, full_flow[-1:], flow_τ, transform=lambda y: -y)
fig, ax = ut.plot_diff_vs_sigma(result.τ, full_flow, flow_τ, transform=lambda y: -y)
ax.legend()
result.hd.close()

View file

@ -10,7 +10,7 @@ from stocproc import StocProc_FFT
np.__config__.blas_opt_info = np.__config__.blas_ilp64_opt_info # fix for qutip
import qutip
max_HO_level = 10
max_HO_level = 15
wc = 2
s = 1
@ -47,7 +47,7 @@ params = HIParams(
normalized_by_hand=True,
result_type=ResultType.ZEROTH_AND_FIRST_ORDER,
truncation_scheme=TruncationScheme_Power_multi.from_g_w(
g=g, w=w, p=1, q=0.5, kfac=1.4
g=g, w=w, p=1, q=0.5, kfac=1.7
),
save_therm_rng_seed=True,
),
@ -59,8 +59,8 @@ params = HIParams(
),
alpha=hops_bcf,
t_max=integration.t_max,
intgr_tol=1e-6,
intpl_tol=1e-6,
intgr_tol=1e-5,
intpl_tol=1e-5,
negative_frequencies=False,
),
EtaTherm=StocProc_FFT(
@ -71,8 +71,8 @@ params = HIParams(
s, 1, wc, beta=1 / system.__non_key__["T"]
),
t_max=integration.t_max,
intgr_tol=1e-6,
intpl_tol=1e-6,
intgr_tol=1e-5,
intpl_tol=1e-5,
negative_frequencies=False,
),
)

View file

@ -0,0 +1,126 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1638122382,
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1610051610,
"narHash": "sha256-U9rPz/usA1/Aohhk7Cmc2gBrEEKRzcW4nwPWMPwja4Y=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3982c9903e93927c2164caa727cd3f6a0e6d14cc",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1642281915,
"narHash": "sha256-jcMsXmmO1knyf99o242A+2cy1A0eKa9afly0cwBknPA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d5dae6569ea9952f1ae4e727946d93a71c507821",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1642104392,
"narHash": "sha256-m71b7MgMh9FDv4MnI5sg9MiBVW6DhE1zq+d/KlLWSC8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5aaed40d22f0d9376330b6fa413223435ad6fee5",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1610729867,
"narHash": "sha256-bk/SBaBLqZX/PEqal27DMQwAHHl0dcZMp8NNksQr80s=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "04af07c659c6723a2259bb6bc00a47ec53330f20",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"poetry2nix": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1641997288,
"narHash": "sha256-l/oldhMwpIhKbsHrm0Uzl+UbtS0p/2uL4fjV0KMw980=",
"owner": "nix-community",
"repo": "poetry2nix",
"rev": "cf1547ba2b009e20d92d5aab0691c5286408e2bb",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "poetry2nix",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"utils": "utils"
}
},
"utils": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2",
"poetry2nix": "poetry2nix"
},
"locked": {
"lastModified": 1642512830,
"narHash": "sha256-73733rniMobC1gGsqMjvEgEYkKtX7VfQj5eafWGx9dQ=",
"owner": "vale981",
"repo": "hiro-flake-utils",
"rev": "b8cca753d3cc543b7ecb1313b136cc95582fecb1",
"type": "github"
},
"original": {
"owner": "vale981",
"repo": "hiro-flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}