mirror of
https://github.com/vale981/master-thesis
synced 2025-03-04 17:41:43 -05:00
add data for 05
This commit is contained in:
parent
76b5b2df30
commit
6a1a883c57
14 changed files with 217 additions and 40 deletions
3
hops_data/mount_workhorse.sh
Normal file
3
hops_data/mount_workhorse.sh
Normal file
|
@ -0,0 +1,3 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
sudo mount.nfs 141.30.17.16:/data_local/hiro/hops $(dirname "$0")
|
2
hops_data/readme.md
Normal file
2
hops_data/readme.md
Normal file
|
@ -0,0 +1,2 @@
|
|||
This is the directory for hops simulation data.
|
||||
If there's nothing in it, it means that you have to mount it first.
|
|
@ -220,9 +220,10 @@ This will be tangled into the [[file:config.py][config file]] that can be used w
|
|||
from hopsflow import gaussflow_two as gf
|
||||
from hopsflow import util as util
|
||||
|
||||
α_0 = util.BCF(params.IntP.t_max, hops_bcf, num_terms=8, resolution=0.1)
|
||||
α_0 = util.BCF(params.IntP.t_max, hops_bcf, num_terms=12, resolution=0.1/2)
|
||||
#+end_src
|
||||
|
||||
|
||||
#+begin_src jupyter-python :results none
|
||||
α = util.BCF(
|
||||
params.IntP.t_max,
|
||||
|
@ -232,13 +233,13 @@ This will be tangled into the [[file:config.py][config file]] that can be used w
|
|||
wc,
|
||||
beta=1.0 / (params.SysP.__non_key__["T"][0]),
|
||||
),
|
||||
num_terms=7,
|
||||
resolution=0.1,
|
||||
num_terms=9,
|
||||
resolution=0.1/2,
|
||||
)
|
||||
#+end_src
|
||||
|
||||
#+begin_src jupyter-python
|
||||
t_test = np.linspace(0, α.t_max, 500)
|
||||
t_test = np.linspace(0, α.t_max, 4000)
|
||||
with ut.hiro_style():
|
||||
fig, ax = ut.plot_complex(t_test, α(t_test) - α.approx(t_test), label="finite")
|
||||
fig, ax = ut.plot_complex(t_test, α_0(t_test) - α_0.approx(t_test), label="zero")
|
||||
|
@ -246,8 +247,8 @@ This will be tangled into the [[file:config.py][config file]] that can be used w
|
|||
|
||||
#+RESULTS:
|
||||
:RESULTS:
|
||||
[[file:./.ob-jupyter/4869651a72aa97ebc614977ef2209cc6d04cf1fd.svg]]
|
||||
[[file:./.ob-jupyter/9a7489ea460c1f7af4a4b8d3a5a6ad6c08879e88.svg]]
|
||||
[[file:./.ob-jupyter/eb3f1978b8663a27a45d24124456861cbb22b4c1.svg]]
|
||||
[[file:./.ob-jupyter/fd3c2dabd7d087e246a11747045d85fe0947099b.svg]]
|
||||
:END:
|
||||
|
||||
#+begin_src jupyter-python :results none
|
||||
|
@ -269,7 +270,69 @@ This will be tangled into the [[file:config.py][config file]] that can be used w
|
|||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
: 3135
|
||||
:RESULTS:
|
||||
: hi_key_bin could not be read from file data/_c/data_cb704de6c6755c80309dd26a16aadc98_1.h5
|
||||
# [goto error]
|
||||
#+begin_example
|
||||
[0;31m---------------------------------------------------------------------------[0m
|
||||
[0;31mOSError[0m Traceback (most recent call last)
|
||||
Input [0;32mIn [322][0m, in [0;36m<module>[0;34m[0m
|
||||
[0;32m----> 1[0m [38;5;28;01mclass[39;00m [38;5;21;01mresult[39;00m:
|
||||
[1;32m 2[0m hd [38;5;241m=[39m HIMetaData([38;5;124m"[39m[38;5;124mdata[39m[38;5;124m"[39m, [38;5;124m"[39m[38;5;124m.[39m[38;5;124m"[39m)[38;5;241m.[39mget_HIData(params, read_only[38;5;241m=[39m[38;5;28;01mTrue[39;00m)
|
||||
[1;32m 3[0m N [38;5;241m=[39m hd[38;5;241m.[39msamples
|
||||
|
||||
Input [0;32mIn [322][0m, in [0;36mresult[0;34m()[0m
|
||||
[1;32m 1[0m [38;5;28;01mclass[39;00m [38;5;21;01mresult[39;00m:
|
||||
[0;32m----> 2[0m hd [38;5;241m=[39m [43mHIMetaData[49m[43m([49m[38;5;124;43m"[39;49m[38;5;124;43mdata[39;49m[38;5;124;43m"[39;49m[43m,[49m[43m [49m[38;5;124;43m"[39;49m[38;5;124;43m.[39;49m[38;5;124;43m"[39;49m[43m)[49m[38;5;241;43m.[39;49m[43mget_HIData[49m[43m([49m[43mparams[49m[43m,[49m[43m [49m[43mread_only[49m[38;5;241;43m=[39;49m[38;5;28;43;01mTrue[39;49;00m[43m)[49m
|
||||
[1;32m 3[0m N [38;5;241m=[39m hd[38;5;241m.[39msamples
|
||||
[1;32m 4[0m seeds [38;5;241m=[39m hd[38;5;241m.[39mrng_seed
|
||||
|
||||
File [0;32m/nix/store/403l2yqlsk1rs7kdyjk3qhdakdwq6a28-python3-3.9.9-env/lib/python3.9/site-packages/hops/core/hierarchy_data.py:1240[0m, in [0;36mHIMetaData.get_HIData[0;34m(self, key, read_only, overwrite_key)[0m
|
||||
[1;32m 1231[0m [38;5;28;01mdef[39;00m [38;5;21mget_HIData[39m(
|
||||
[1;32m 1232[0m [38;5;28mself[39m, key: HIParams, read_only: [38;5;28mbool[39m [38;5;241m=[39m [38;5;28;01mFalse[39;00m, overwrite_key: [38;5;28mbool[39m [38;5;241m=[39m [38;5;28;01mFalse[39;00m
|
||||
[1;32m 1233[0m ) [38;5;241m-[39m[38;5;241m>[39m HIData:
|
||||
[1;32m 1234[0m [38;5;124;03m"""Returns a :any:`HIData` instance initialized with ``key`` and an[39;00m
|
||||
[1;32m 1235[0m [38;5;124;03m auto-generated file name.[39;00m
|
||||
[1;32m 1236[0m
|
||||
[1;32m 1237[0m [38;5;124;03m For the arguments see :any:`hops.core.hierarchy_data.HIData`.[39;00m
|
||||
[1;32m 1238[0m [38;5;124;03m """[39;00m
|
||||
[0;32m-> 1240[0m hdf5_name, bin_key, hashed_key [38;5;241m=[39m [38;5;28;43mself[39;49m[38;5;241;43m.[39;49m[43mget_HIData_fname[49m[43m([49m
|
||||
[1;32m 1241[0m [43m [49m[43mkey[49m[43m,[49m[43m [49m[43mret_bin_and_hash[49m[38;5;241;43m=[39;49m[38;5;28;43;01mTrue[39;49;00m
|
||||
[1;32m 1242[0m [43m [49m[43m)[49m
|
||||
[1;32m 1244[0m [38;5;28;01massert[39;00m [38;5;28misinstance[39m(bin_key, [38;5;28mbytes[39m)
|
||||
[1;32m 1245[0m [38;5;28;01mreturn[39;00m HIData(
|
||||
[1;32m 1246[0m [38;5;28mstr[39m([38;5;28mself[39m[38;5;241m.[39mpath [38;5;241m/[39m hdf5_name),
|
||||
[1;32m 1247[0m read_only[38;5;241m=[39mread_only,
|
||||
[0;32m (...)[0m
|
||||
[1;32m 1251[0m overwrite_key[38;5;241m=[39moverwrite_key,
|
||||
[1;32m 1252[0m )
|
||||
|
||||
File [0;32m/nix/store/403l2yqlsk1rs7kdyjk3qhdakdwq6a28-python3-3.9.9-env/lib/python3.9/site-packages/hops/core/hierarchy_data.py:1217[0m, in [0;36mHIMetaData.get_HIData_fname[0;34m(self, key, ret_bin_and_hash)[0m
|
||||
[1;32m 1213[0m [38;5;28;01mwith[39;00m h5py[38;5;241m.[39mFile(
|
||||
[1;32m 1214[0m [38;5;28mstr[39m([38;5;28mself[39m[38;5;241m.[39mpath [38;5;241m/[39m hdf5_name), [38;5;124m"[39m[38;5;124mr[39m[38;5;124m"[39m, swmr[38;5;241m=[39m[38;5;28;01mTrue[39;00m, libver[38;5;241m=[39m[38;5;124m"[39m[38;5;124mlatest[39m[38;5;124m"[39m
|
||||
[1;32m 1215[0m ) [38;5;28;01mas[39;00m h5File:
|
||||
[1;32m 1216[0m hkb [38;5;241m=[39m h5File[[38;5;124m"[39m[38;5;124mhi_key_bin[39m[38;5;124m"[39m]
|
||||
[0;32m-> 1217[0m hkb [38;5;241m=[39m [38;5;28mbytearray[39m([43mhkb[49m[43m[[49m[43m:[49m[43m][49m) [38;5;66;03m# type: ignore[39;00m
|
||||
[1;32m 1218[0m [38;5;28;01mif[39;00m hkb [38;5;241m==[39m bin_key: [38;5;66;03m# this is the file we are looking for![39;00m
|
||||
[1;32m 1219[0m [38;5;28;01mbreak[39;00m
|
||||
|
||||
File [0;32mh5py/_objects.pyx:54[0m, in [0;36mh5py._objects.with_phil.wrapper[0;34m()[0m
|
||||
|
||||
File [0;32mh5py/_objects.pyx:55[0m, in [0;36mh5py._objects.with_phil.wrapper[0;34m()[0m
|
||||
|
||||
File [0;32m/nix/store/403l2yqlsk1rs7kdyjk3qhdakdwq6a28-python3-3.9.9-env/lib/python3.9/site-packages/h5py/_hl/dataset.py:710[0m, in [0;36mDataset.__getitem__[0;34m(self, args, new_dtype)[0m
|
||||
[1;32m 708[0m [38;5;28;01mif[39;00m [38;5;28mself[39m[38;5;241m.[39m_fast_read_ok [38;5;129;01mand[39;00m (new_dtype [38;5;129;01mis[39;00m [38;5;28;01mNone[39;00m):
|
||||
[1;32m 709[0m [38;5;28;01mtry[39;00m:
|
||||
[0;32m--> 710[0m [38;5;28;01mreturn[39;00m [38;5;28;43mself[39;49m[38;5;241;43m.[39;49m[43m_fast_reader[49m[38;5;241;43m.[39;49m[43mread[49m[43m([49m[43margs[49m[43m)[49m
|
||||
[1;32m 711[0m [38;5;28;01mexcept[39;00m [38;5;167;01mTypeError[39;00m:
|
||||
[1;32m 712[0m [38;5;28;01mpass[39;00m [38;5;66;03m# Fall back to Python read pathway below[39;00m
|
||||
|
||||
File [0;32mh5py/_selector.pyx:366[0m, in [0;36mh5py._selector.Reader.read[0;34m()[0m
|
||||
|
||||
[0;31mOSError[0m: [Errno 5] Can't read data (file read failed: time = Tue Feb 15 14:17:54 2022
|
||||
, filename = 'data/_c/data_cb704de6c6755c80309dd26a16aadc98_1.h5', file descriptor = 55, errno = 5, error message = 'Input/output error', buf = 0x9d57510, total read size = 203999, bytes this sub-read = 203999, bytes actually read = 18446744073709551615, offset = 0)
|
||||
#+end_example
|
||||
:END:
|
||||
|
||||
* System Energy
|
||||
#+begin_src jupyter-python
|
||||
|
@ -285,8 +348,7 @@ This will be tangled into the [[file:config.py][config file]] that can be used w
|
|||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
: 100% 3134/3134 [01:06<00:00, 46.88it/s]
|
||||
: INFO:root:Writing cache to: results/system_energy_sandwhich_operator_3135_1000_bdddf4a64ad8bc388abd582bceb8d039f8815ee5a66beea77716ab355baa3949.npy
|
||||
: INFO:root:Loading cache from: results/system_energy_sandwhich_operator_10000_1000_d0ed047dab9d3ae1be74b1e5b17755f0c1a41bd611212b504a35555740e6bf85.npy
|
||||
|
||||
|
||||
#+begin_src jupyter-python
|
||||
|
@ -295,7 +357,7 @@ This will be tangled into the [[file:config.py][config file]] that can be used w
|
|||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
[[file:./.ob-jupyter/379210c06234a6a5a5d340133be180e808247f50.svg]]
|
||||
[[file:./.ob-jupyter/5bd904b9184abb5bc91b85d68a42bebe5ba1f5ae.svg]]
|
||||
|
||||
Now with Gaussflow.
|
||||
#+begin_src jupyter-python
|
||||
|
@ -304,35 +366,34 @@ Now with Gaussflow.
|
|||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
: 32a8d025-ef3b-4ce6-80d2-1489d98eb193
|
||||
|
||||
|
||||
#+begin_src jupyter-python
|
||||
with ut.hiro_style():
|
||||
ax.plot(result.τ, energy_gf, color="green", linestyle="dashdot")
|
||||
#plt.xlim(30,40)
|
||||
#plt.xlim(30,40)
|
||||
#plt.ylim(-.005,.005)
|
||||
fig
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
[[file:./.ob-jupyter/5222fd8000ff9df3cc5ea289ac13ae17e062c8d7.svg]]
|
||||
[[file:./.ob-jupyter/9975e4a825c9842e39abf68b76523672581c7c2d.svg]]
|
||||
|
||||
|
||||
#+begin_src jupyter-python
|
||||
with ut.hiro_style():
|
||||
ut.plot_diff_vs_sigma(result.τ, e_sys, energy_gf)
|
||||
# plt.xlim(35,40)
|
||||
# plt.ylim(0,.01)
|
||||
# plt.ylim(0,.01)D
|
||||
plt.legend()
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
[[file:./.ob-jupyter/9c1bdc31919fb6a74990e6570510914cfa14e8d7.svg]]
|
||||
[[file:./.ob-jupyter/2f82b9edaf51d90e93a9cbc50fda894b9a8d96fb.svg]]
|
||||
|
||||
* Thermal State
|
||||
#+begin_src jupyter-python
|
||||
v, w = np.linalg.eig(system.H_sys)
|
||||
v, w = np.linalg.eig(params.SysP.H_sys)
|
||||
v = np.sort(v.real)
|
||||
v
|
||||
#+end_src
|
||||
|
@ -364,37 +425,17 @@ Now with Gaussflow.
|
|||
#+end_src
|
||||
|
||||
#+begin_src jupyter-python
|
||||
thermal_e(v, 1 / .3)
|
||||
thermal_e(v, 1.0 / (params.SysP.__non_key__["T"][0]))
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
: 1.1140772133416454
|
||||
: 1.0591063695586198
|
||||
|
||||
#+begin_src jupyter-python
|
||||
ρ_therm = sc.linalg.expm(-system.H_sys/(system.__non_key__["T"][0]))
|
||||
ρ_therm = sc.linalg.expm(-params.SysP.H_sys/(params.SysP.__non_key__["T"][0]))
|
||||
ρ_therm = ρ_therm / np.trace(ρ_therm)
|
||||
trace_norm(result.ρ[-1] - ρ_therm)
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
: 0.16441343359804375
|
||||
|
||||
* Propagator
|
||||
#+begin_src jupyter-python
|
||||
_, q_1_traj, σ_q_1_traj = util.operator_expectation_ensemble(
|
||||
iter(result.ψ),
|
||||
p_1.full(),
|
||||
result.N,
|
||||
params.HiP.nonlinear,
|
||||
save="q_1"
|
||||
)
|
||||
plt.errorbar(result.τ, q_1_traj.real, yerr=σ_q_1_traj.real, ecolor="yellow")
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
:RESULTS:
|
||||
: 100% 1021/1021 [00:02<00:00, 428.10it/s]
|
||||
: INFO:root:Writing cache to: results/q_1_sandwhich_operator_1022_None_3422a7089748f5a2a9b27570e4c85e3ea7e48865e48733fd74e8438c6fa0c512.npy
|
||||
: <ErrorbarContainer object of 3 artists>
|
||||
[[file:./.ob-jupyter/4bbc638bea9e95d5b2c8ef3e17a14a718e177eef.svg]]
|
||||
:END:
|
||||
: 0.07726133069400465
|
||||
|
|
|
@ -0,0 +1,126 @@
|
|||
params = make_config(
|
||||
max_HO_level=6,
|
||||
bcf_terms=4,
|
||||
t_max=40,
|
||||
k_fac=1.6,
|
||||
sp_tol=1e-5,
|
||||
)
|
||||
|
||||
params = make_config(
|
||||
max_HO_level=8,
|
||||
bcf_terms=4,
|
||||
t_max=30,
|
||||
k_fac=1.3,
|
||||
sp_tol=1e-5,
|
||||
bcf_scale=[.3, .3],
|
||||
T=.2
|
||||
)
|
||||
|
||||
params = make_config(
|
||||
max_HO_level=5,
|
||||
bcf_terms=4,
|
||||
t_max=50,
|
||||
k_fac=1.3,
|
||||
sp_tol=1e-5,
|
||||
bcf_scale=[.3, .3],
|
||||
T=.2
|
||||
)
|
||||
|
||||
params = make_config(
|
||||
max_HO_level=8,
|
||||
bcf_terms=4,
|
||||
t_max=50,
|
||||
k_fac=1.4,
|
||||
sp_tol=1e-5,
|
||||
bcf_scale=[.3, .3],
|
||||
T=.2
|
||||
)
|
||||
|
||||
import numpy as np
|
||||
import scipy as sc
|
||||
import matplotlib.pyplot as plt
|
||||
from hopsflow import util, hopsflow
|
||||
import utilities as ut
|
||||
from hops.core.hierarchy_data import HIMetaData
|
||||
import logging
|
||||
logger = logging.getLogger()
|
||||
logger.setLevel(logging.INFO)
|
||||
|
||||
from hopsflow import gaussflow_two as gf
|
||||
from hopsflow import util as util
|
||||
|
||||
α_0 = util.BCF(params.IntP.t_max, hops_bcf, num_terms=12, resolution=0.1/2)
|
||||
|
||||
α = util.BCF(
|
||||
params.IntP.t_max,
|
||||
hops.util.bcf.OhmicBCF_nonZeroTemp(
|
||||
s,
|
||||
1,
|
||||
wc,
|
||||
beta=1.0 / (params.SysP.__non_key__["T"][0]),
|
||||
),
|
||||
num_terms=9,
|
||||
resolution=0.1/2,
|
||||
)
|
||||
|
||||
t_test = np.linspace(0, α.t_max, 4000)
|
||||
with ut.hiro_style():
|
||||
fig, ax = ut.plot_complex(t_test, α(t_test) - α.approx(t_test), label="finite")
|
||||
fig, ax = ut.plot_complex(t_test, α_0(t_test) - α_0.approx(t_test), label="zero")
|
||||
|
||||
gf_params = gf.SystemParams(Ω=Ω, Λ=Λ, η=params.SysP.bcf_scale, γ=γ, α_0=[α_0] * 2)
|
||||
|
||||
class result:
|
||||
hd = HIMetaData("data", ".").get_HIData(params, read_only=True)
|
||||
N = hd.samples
|
||||
seeds = hd.rng_seed
|
||||
τ = hd.get_time()
|
||||
ψ_1 = hd.aux_states
|
||||
ψ = hd.stoc_traj
|
||||
ρ = hd.get_rho_t()
|
||||
|
||||
result.N
|
||||
|
||||
e_sys = util.operator_expectation_ensemble(
|
||||
iter(result.ψ),
|
||||
params.SysP.H_sys,
|
||||
result.N,
|
||||
params.HiP.nonlinear,
|
||||
every=1000,
|
||||
real=True,
|
||||
save="system_energy"
|
||||
)
|
||||
|
||||
with ut.hiro_style():
|
||||
fig, ax = ut.plot_convergence(result.τ, e_sys, transform=np.real, linestyle="dashdot")
|
||||
|
||||
C = gf.CorrelationMatrix(gf_params, gf.initial_correlation_pure_osci(0, 0), αs=[α, None])
|
||||
energy_gf = C.system_energy(result.τ)
|
||||
|
||||
with ut.hiro_style():
|
||||
ax.plot(result.τ, energy_gf, color="green", linestyle="dashdot")
|
||||
#plt.xlim(30,40)
|
||||
#plt.ylim(-.005,.005)
|
||||
fig
|
||||
|
||||
with ut.hiro_style():
|
||||
ut.plot_diff_vs_sigma(result.τ, e_sys, energy_gf)
|
||||
# plt.xlim(35,40)
|
||||
# plt.ylim(0,.01)D
|
||||
plt.legend()
|
||||
|
||||
v, w = np.linalg.eig(params.SysP.H_sys)
|
||||
v = np.sort(v.real)
|
||||
v
|
||||
|
||||
def thermal_e(v: np.ndarray, β: float):
|
||||
return np.sum(v * np.exp(-β * v)) / np.sum(np.exp(-β * v))
|
||||
|
||||
def trace_norm(ρ: np.ndarray):
|
||||
return np.trace(sc.linalg.sqrtm(ρ @ ρ.conj().T)).real
|
||||
|
||||
thermal_e(v, 1.0 / (params.SysP.__non_key__["T"][0]))
|
||||
|
||||
ρ_therm = sc.linalg.expm(-params.SysP.H_sys/(params.SysP.__non_key__["T"][0]))
|
||||
ρ_therm = ρ_therm / np.trace(ρ_therm)
|
||||
trace_norm(result.ρ[-1] - ρ_therm)
|
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue