mirror of
https://github.com/vale981/master-thesis
synced 2025-03-05 10:01:43 -05:00
updates in project 05
This commit is contained in:
parent
aac009846b
commit
7cfdd80c07
51 changed files with 174 additions and 102 deletions
|
@ -204,7 +204,7 @@ This will be tangled into the [[file:config.py][config file]] that can be used w
|
|||
- better
|
||||
*** 8 HO Levels
|
||||
#+begin_src jupyter-python :results none :async no :tangle config.py
|
||||
make_config(
|
||||
params = make_config(
|
||||
max_HO_level=8,
|
||||
bcf_terms=4,
|
||||
t_max=50,
|
||||
|
@ -344,8 +344,8 @@ This will be tangled into the [[file:config.py][config file]] that can be used w
|
|||
|
||||
#+RESULTS:
|
||||
:RESULTS:
|
||||
[[file:./.ob-jupyter/eb3f1978b8663a27a45d24124456861cbb22b4c1.svg]]
|
||||
[[file:./.ob-jupyter/fd3c2dabd7d087e246a11747045d85fe0947099b.svg]]
|
||||
[[file:./.ob-jupyter/7860e5186a807c5b41a3d8b01e841284e959ff4b.svg]]
|
||||
[[file:./.ob-jupyter/23c7abbd150839cddfec7ce4f096451f25b6fa04.svg]]
|
||||
:END:
|
||||
|
||||
#+begin_src jupyter-python :results none
|
||||
|
@ -367,69 +367,7 @@ This will be tangled into the [[file:config.py][config file]] that can be used w
|
|||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
: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:
|
||||
: 10000
|
||||
|
||||
* System Energy
|
||||
#+begin_src jupyter-python
|
||||
|
@ -445,7 +383,7 @@ This will be tangled into the [[file:config.py][config file]] that can be used w
|
|||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
: INFO:root:Loading cache from: results/system_energy_sandwhich_operator_10000_1000_d0ed047dab9d3ae1be74b1e5b17755f0c1a41bd611212b504a35555740e6bf85.npy
|
||||
: WARNING:root:Loading cache from: results/system_energy_sandwhich_operator_10000_1000_a34265c8f80fbc84d6a3b074cffc30d9abe302353134db3cf684ee0c0fded8ea.npy
|
||||
|
||||
|
||||
#+begin_src jupyter-python
|
||||
|
@ -454,7 +392,7 @@ This will be tangled into the [[file:config.py][config file]] that can be used w
|
|||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
[[file:./.ob-jupyter/5bd904b9184abb5bc91b85d68a42bebe5ba1f5ae.svg]]
|
||||
[[file:./.ob-jupyter/222be3d5cd5d5b527ea800e08bf73b2ee0de89ef.svg]]
|
||||
|
||||
Now with Gaussflow.
|
||||
#+begin_src jupyter-python
|
||||
|
@ -474,7 +412,7 @@ Now with Gaussflow.
|
|||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
[[file:./.ob-jupyter/9975e4a825c9842e39abf68b76523672581c7c2d.svg]]
|
||||
[[file:./.ob-jupyter/78cf68864d651dd1405f0dfa80f7c831a7bde996.svg]]
|
||||
|
||||
|
||||
#+begin_src jupyter-python
|
||||
|
@ -486,7 +424,7 @@ Now with Gaussflow.
|
|||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
[[file:./.ob-jupyter/2f82b9edaf51d90e93a9cbc50fda894b9a8d96fb.svg]]
|
||||
[[file:./.ob-jupyter/4e49054f9b64e79c49a9c4af01b2daf9ffa0124d.svg]]
|
||||
|
||||
* Thermal State
|
||||
#+begin_src jupyter-python
|
||||
|
@ -536,3 +474,95 @@ Now with Gaussflow.
|
|||
|
||||
#+RESULTS:
|
||||
: 0.07726133069400465
|
||||
|
||||
* Heat Flow
|
||||
#+begin_src jupyter-python :results none
|
||||
from hopsflow import hopsflow as hf
|
||||
#+end_src
|
||||
|
||||
#+begin_src jupyter-python
|
||||
sys = hf.SystemParams(
|
||||
L=params.SysP.L,
|
||||
G=params.SysP.g,
|
||||
W=params.SysP.w,
|
||||
bcf_scale=[1, 1],
|
||||
fock_hops=True
|
||||
)
|
||||
run = hf.HOPSRun(np.array(result.ψ[0, :]), np.array(result.ψ_1[0, :]), sys)
|
||||
ξ_1 = params.EtaTherm[0]
|
||||
ξ_1.set_scale(params.SysP.bcf_scale[0])
|
||||
ξ_1.calc_deriv = True
|
||||
therm_params = hf.ThermalParams([ξ_1, None], result.τ)
|
||||
therm_run = hf.ThermalRunParams(therm_params, result.seeds[0])
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
|
||||
#+begin_src jupyter-python :results none
|
||||
flow = hf.flow_trajectory(run, sys, therm_run)
|
||||
#+end_src
|
||||
|
||||
|
||||
#+begin_src jupyter-python
|
||||
plt.plot(result.τ, flow[0])
|
||||
plt.plot(result.τ, flow[1])
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
:RESULTS:
|
||||
| <matplotlib.lines.Line2D | at | 0x7f6f9892ae80> |
|
||||
[[file:./.ob-jupyter/1d3f0e09cc8a1373f485a5feded2f90d6a589871.svg]]
|
||||
:END:
|
||||
|
||||
#+begin_src jupyter-python
|
||||
full_flow = hopsflow.heat_flow_ensemble(
|
||||
iter(result.ψ),
|
||||
iter(result.ψ_1),
|
||||
sys,
|
||||
500,
|
||||
(iter(result.seeds), therm_params),
|
||||
every=int(result.N / 5),
|
||||
save="heat_flow"
|
||||
)
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
: 100% 499/499 [01:15<00:00, 6.60it/s]
|
||||
: INFO:root:Writing cache to: results/heat_flow__heat_flow_ensemble_body_500_2000_682ce0d1b2d8b028cb7c6a02e6faff13ee5fb01582be1253db6bbe9db4e15312.npy
|
||||
|
||||
#+begin_src jupyter-python
|
||||
with ut.hiro_style():
|
||||
_, ax = ut.plot_convergence(result.τ, full_flow, transform=lambda y: -y, bath=0)
|
||||
ut.plot_convergence(result.τ, full_flow, transform=lambda y: -y, bath=1, ax=ax)
|
||||
ax.legend()
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
[[file:./.ob-jupyter/bac8b6fe9327df5899f5d317aa4af42cfb092b43.svg]]
|
||||
|
||||
|
||||
#+begin_src jupyter-python :results none
|
||||
exact_flow = [C.flow(result.τ, 0), C.flow(result.τ, 1)]
|
||||
#+end_src
|
||||
|
||||
#+begin_src jupyter-python
|
||||
plt.plot(result.τ, exact_flow[0])
|
||||
plt.plot(result.τ, -full_flow[-1][1][0])
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
:RESULTS:
|
||||
| <matplotlib.lines.Line2D | at | 0x7f6f70916670> |
|
||||
[[file:./.ob-jupyter/755f01900a0ee80481360bbf33eea3c62c2c717d.svg]]
|
||||
:END:
|
||||
|
||||
#+begin_src jupyter-python
|
||||
with ut.hiro_style():
|
||||
ut.plot_diff_vs_sigma(result.τ, [(n, flow[1], tol[1]) for (n, flow, tol) in full_flow], -exact_flow[1])
|
||||
# plt.xlim(35,40)
|
||||
# plt.ylim(0,.01)D
|
||||
plt.legend()
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
[[file:./.ob-jupyter/9620d5702095804e22f9572a2266d3e4a3699180.svg]]
|
||||
|
|
|
@ -175,3 +175,50 @@ 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)
|
||||
|
||||
from hopsflow import hopsflow as hf
|
||||
|
||||
sys = hf.SystemParams(
|
||||
L=params.SysP.L,
|
||||
G=params.SysP.g,
|
||||
W=params.SysP.w,
|
||||
bcf_scale=[1, 1],
|
||||
fock_hops=True
|
||||
)
|
||||
run = hf.HOPSRun(np.array(result.ψ[0, :]), np.array(result.ψ_1[0, :]), sys)
|
||||
ξ_1 = params.EtaTherm[0]
|
||||
ξ_1.set_scale(params.SysP.bcf_scale[0])
|
||||
ξ_1.calc_deriv = True
|
||||
therm_params = hf.ThermalParams([ξ_1, None], result.τ)
|
||||
therm_run = hf.ThermalRunParams(therm_params, result.seeds[0])
|
||||
|
||||
flow = hf.flow_trajectory(run, sys, therm_run)
|
||||
|
||||
plt.plot(result.τ, flow[0])
|
||||
plt.plot(result.τ, flow[1])
|
||||
|
||||
full_flow = hopsflow.heat_flow_ensemble(
|
||||
iter(result.ψ),
|
||||
iter(result.ψ_1),
|
||||
sys,
|
||||
500,
|
||||
(iter(result.seeds), therm_params),
|
||||
every=int(result.N / 5),
|
||||
save="heat_flow"
|
||||
)
|
||||
|
||||
with ut.hiro_style():
|
||||
_, ax = ut.plot_convergence(result.τ, full_flow, transform=lambda y: -y, bath=0)
|
||||
ut.plot_convergence(result.τ, full_flow, transform=lambda y: -y, bath=1, ax=ax)
|
||||
ax.legend()
|
||||
|
||||
exact_flow = [C.flow(result.τ, 0), C.flow(result.τ, 1)]
|
||||
|
||||
plt.plot(result.τ, exact_flow[0])
|
||||
plt.plot(result.τ, -full_flow[-1][1][0])
|
||||
|
||||
with ut.hiro_style():
|
||||
ut.plot_diff_vs_sigma(result.τ, [(n, flow[1], tol[1]) for (n, flow, tol) in full_flow], -exact_flow[1])
|
||||
# plt.xlim(35,40)
|
||||
# plt.ylim(0,.01)D
|
||||
plt.legend()
|
||||
|
|
|
@ -137,7 +137,7 @@ def make_config(
|
|||
|
||||
return params
|
||||
|
||||
make_config(
|
||||
params = make_config(
|
||||
max_HO_level=8,
|
||||
bcf_terms=4,
|
||||
t_max=50,
|
||||
|
|
|
@ -56,7 +56,7 @@ Let us set up the system with some arbitrary parameters.
|
|||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
[[file:./.ob-jupyter/507739453e96adcb21a75433edb50250d1bc49fe.svg]]
|
||||
[[file:./.ob-jupyter/3640b2dcf13a8267e9318699695747fb7e0dd296.svg]]
|
||||
|
||||
#+begin_src jupyter-python :results none
|
||||
params = gf.SystemParams(Ω=1, Λ=1, η=[.5, .5], γ=.1, α_0=[α_0_1, α_0_1])
|
||||
|
@ -78,7 +78,7 @@ coordinate operators in a coherent state.
|
|||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
[[file:./.ob-jupyter/75baafbe4ae2c43b4bf91e8b7a3e91e335c64a36.svg]]
|
||||
[[file:./.ob-jupyter/f0b1b1c19cf787ada6ba4019b7e064aeeabb1472.svg]]
|
||||
|
||||
* Correlations
|
||||
And now the correlation matrix when both oscillators start in the excited state.
|
||||
|
@ -97,7 +97,7 @@ This allows us to calculate the system energy.
|
|||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
[[file:./.ob-jupyter/22efb914cba42853def8243dd5dc5d8b05bb31d9.svg]]
|
||||
[[file:./.ob-jupyter/b1ad7d91b497a32ea28f5ce9477a3eb40bb781c7.svg]]
|
||||
|
||||
The fast oscillations come from the inter-oscillator coupling. We
|
||||
arrive at some sort of steady state by virtue of the temperature
|
||||
|
@ -109,13 +109,13 @@ difference bytween the baths.
|
|||
|
||||
#+begin_src jupyter-python
|
||||
with ut.hiro_style():
|
||||
plt.plot(t_points, flow[0] + flow[1])
|
||||
plt.plot(t_points, flow[0])
|
||||
|
||||
#plt.plot(t_points, flow[1])
|
||||
plt.plot(t_points, flow[1])
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
[[file:./.ob-jupyter/821fb7d3798c55116d1f62bcdcd208233c420fca.svg]]
|
||||
[[file:./.ob-jupyter/94827d6dc906bee81ec076020f2479caeb368bce.svg]]
|
||||
|
||||
Interestingly these flows don't seem to cancel out.
|
||||
|
||||
|
@ -124,7 +124,7 @@ Interestingly these flows don't seem to cancel out.
|
|||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
: -2.467210888582958
|
||||
: nan
|
||||
|
||||
* Notes
|
||||
- precision of nonzero BCF fit is important: zero and nonzero have to be conistent
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
{"N": 100, "every": 2000, "const_args": ["<not serializable>", "<not serializable>", false], "const_kwargs": {}, "function_name": "_heat_flow_ensemble_body", "first_iterator_value": "<not serializable>"}
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
{"N": 200, "every": 2000, "const_args": ["<not serializable>", "<not serializable>", false], "const_kwargs": {}, "function_name": "_heat_flow_ensemble_body", "first_iterator_value": "<not serializable>"}
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
{"N": 500, "every": 2000, "const_args": ["<not serializable>", "<not serializable>", false], "const_kwargs": {}, "function_name": "_heat_flow_ensemble_body", "first_iterator_value": "<not serializable>"}
|
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
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
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
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
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
Binary file not shown.
|
@ -113,18 +113,30 @@ def plot_complex(x, y, *args, ax=None, label="", **kwargs):
|
|||
|
||||
@wrap_plot
|
||||
def plot_convergence(
|
||||
x, y, ax=None, label="", transform=lambda y: y, slice=None, linestyle="-"
|
||||
x,
|
||||
y,
|
||||
ax=None,
|
||||
label="",
|
||||
transform=lambda y: y,
|
||||
slice=None,
|
||||
linestyle="-",
|
||||
bath: int = 0,
|
||||
):
|
||||
label = label + ", " if (len(label) > 0) else ""
|
||||
slice = (0, -1) if not slice else slice
|
||||
for n, val, _ in y[slice[0] : slice[1]]:
|
||||
plt.plot(
|
||||
x, transform(val), label=f"{label}n={n}", alpha=n / y[-1][0], linestyle="--"
|
||||
x,
|
||||
transform(val[bath]),
|
||||
label=f"{label}n={n}",
|
||||
alpha=n / y[-1][0],
|
||||
linestyle="--",
|
||||
)
|
||||
|
||||
ax.errorbar(
|
||||
x,
|
||||
transform(y[-1][1]),
|
||||
yerr=y[-1][2],
|
||||
transform(y[-1][1][bath]),
|
||||
yerr=y[-1][2][bath],
|
||||
ecolor="yellow",
|
||||
label=f"{label}n={y[-1][0]}",
|
||||
color="red",
|
||||
|
|
Loading…
Add table
Reference in a new issue