mirror of
https://github.com/vale981/master-thesis
synced 2025-03-04 17:41:43 -05:00
with continous coupling we still don't have a really converged res
but it seems to work
This commit is contained in:
parent
7689cbaba5
commit
84122d210a
5 changed files with 45 additions and 105 deletions
|
@ -15,7 +15,7 @@ import plot_utils as pu
|
|||
|
||||
import ray
|
||||
ray.shutdown()
|
||||
ray.init(address="auto")
|
||||
ray.init()
|
||||
|
||||
from hops.util.logging_setup import logging_setup
|
||||
import logging
|
||||
|
@ -291,7 +291,7 @@ vs = np.linspace(0.1, 10, 100)
|
|||
plt.plot(vs, chi(vs, ω_0))
|
||||
plt.plot(vs, G_h(vs))
|
||||
|
||||
aux.integrate(model, 10_000)
|
||||
aux.integrate(model, 50_000)
|
||||
|
||||
#_, ax = pu.plot_energy_overview(model, markersize=1, ensemble_args=dict(gc_sleep=0.05))
|
||||
|
||||
|
@ -305,15 +305,14 @@ with aux.get_data(model) as data:
|
|||
with aux.get_data(model) as data:
|
||||
pu.plot_with_σ(
|
||||
model.t,
|
||||
EnsembleValue(
|
||||
abs(EnsembleValue(
|
||||
(data.rho_t_accum.mean[:, 0, 0], data.rho_t_accum.ensemble_std[:, 0, 0])
|
||||
|
||||
),
|
||||
) - .5),
|
||||
)
|
||||
|
||||
plt.yscale("log")
|
||||
ρ_ee = data.rho_t_accum.mean[:, 0, 0].real
|
||||
|
||||
plt.plot(model.t, ut.smoothen(model.t, ρ_ee, frac=.5, it=0))
|
||||
plt.plot(model.t[101:], ut.smoothen(model.t[101:], ρ_ee[101:], frac=.5, it=0))
|
||||
|
||||
with aux.get_data(model) as data:
|
||||
_, ax = plt.subplots()
|
||||
|
@ -351,7 +350,7 @@ for t in ts_end:
|
|||
plt.axvline(t, linestyle="dotted", color="lightblue", linewidth=1)
|
||||
|
||||
pu.plot_with_σ(
|
||||
model.t[ind_begin[0]:], tot_power.slice(ind_begin[0], None, 1), ax=ax, linewidth=0.5
|
||||
model.t[ind_begin[0]:], tot_power.slice(slice(ind_begin[0], None, 1)), ax=ax, linewidth=0.5
|
||||
)
|
||||
ax.plot(
|
||||
model.t[ind_begin[0]:],
|
||||
|
@ -361,7 +360,7 @@ ax.plot(
|
|||
powers = []
|
||||
for begin, end in zip(ind_begin, ind_end):
|
||||
powers.append(
|
||||
(tot_power.slice(begin, end)).mean
|
||||
(tot_power.slice(slice(begin, end))).mean
|
||||
)
|
||||
|
||||
steady_index = 0
|
||||
|
@ -371,7 +370,8 @@ ax.set_ylabel(r"$\langle{P}\rangle$")
|
|||
ax.set_xlabel(r"$\tau$")
|
||||
|
||||
|
||||
#fs.export_fig("anti_zeno_with_cool")
|
||||
fig.suptitle(fr"$\omega_0={ω_0},\,\omega_c={1},\,N={tot_power.N},\,\delta={.5}\,\Delta={Δ},\,\lambda={.2},\, T_h={model.T[0]},\, T_c={model.T[1]},\,n={cycles}$")
|
||||
fs.export_fig("anti_zeno_maybe_note_quite_steady", tikz=False)
|
||||
fs.tex_value(
|
||||
(power.value),
|
||||
err=power.σ,
|
||||
|
|
|
@ -23,66 +23,11 @@ Init ray and silence stocproc.
|
|||
#+begin_src jupyter-python
|
||||
import ray
|
||||
ray.shutdown()
|
||||
ray.init(address="auto")
|
||||
ray.init()
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
:RESULTS:
|
||||
# [goto error]
|
||||
#+begin_example
|
||||
[0;31m---------------------------------------------------------------------------[0m
|
||||
[0;31mConnectionError[0m Traceback (most recent call last)
|
||||
Input [0;32mIn [2][0m, in [0;36m<cell line: 3>[0;34m()[0m
|
||||
[1;32m 1[0m [38;5;28;01mimport[39;00m [38;5;21;01mray[39;00m
|
||||
[1;32m 2[0m ray[38;5;241m.[39mshutdown()
|
||||
[0;32m----> 3[0m [43mray[49m[38;5;241;43m.[39;49m[43minit[49m[43m([49m[43maddress[49m[38;5;241;43m=[39;49m[38;5;124;43m"[39;49m[38;5;124;43mauto[39;49m[38;5;124;43m"[39;49m[43m)[49m
|
||||
|
||||
File [0;32m/nix/store/zm0dbvm6kc79il5713w847760r9wxs2m-python3-3.9.13-env/lib/python3.9/site-packages/ray/_private/client_mode_hook.py:105[0m, in [0;36mclient_mode_hook.<locals>.wrapper[0;34m(*args, **kwargs)[0m
|
||||
[1;32m 103[0m [38;5;28;01mif[39;00m func[38;5;241m.[39m[38;5;18m__name__[39m [38;5;241m!=[39m [38;5;124m"[39m[38;5;124minit[39m[38;5;124m"[39m [38;5;129;01mor[39;00m is_client_mode_enabled_by_default:
|
||||
[1;32m 104[0m [38;5;28;01mreturn[39;00m [38;5;28mgetattr[39m(ray, func[38;5;241m.[39m[38;5;18m__name__[39m)([38;5;241m*[39margs, [38;5;241m*[39m[38;5;241m*[39mkwargs)
|
||||
[0;32m--> 105[0m [38;5;28;01mreturn[39;00m [43mfunc[49m[43m([49m[38;5;241;43m*[39;49m[43margs[49m[43m,[49m[43m [49m[38;5;241;43m*[39;49m[38;5;241;43m*[39;49m[43mkwargs[49m[43m)[49m
|
||||
|
||||
File [0;32m/nix/store/zm0dbvm6kc79il5713w847760r9wxs2m-python3-3.9.13-env/lib/python3.9/site-packages/ray/worker.py:954[0m, in [0;36minit[0;34m(address, num_cpus, num_gpus, resources, object_store_memory, local_mode, ignore_reinit_error, include_dashboard, dashboard_host, dashboard_port, job_config, configure_logging, logging_level, logging_format, log_to_driver, namespace, runtime_env, storage, _enable_object_reconstruction, _redis_max_memory, _plasma_directory, _node_ip_address, _driver_object_store_memory, _memory, _redis_password, _temp_dir, _metrics_export_port, _system_config, _tracing_startup_hook, _node_name, **kwargs)[0m
|
||||
[1;32m 952[0m bootstrap_address, redis_address, gcs_address [38;5;241m=[39m [38;5;28;01mNone[39;00m, [38;5;28;01mNone[39;00m, [38;5;28;01mNone[39;00m
|
||||
[1;32m 953[0m [38;5;28;01mif[39;00m address:
|
||||
[0;32m--> 954[0m bootstrap_address [38;5;241m=[39m [43mservices[49m[38;5;241;43m.[39;49m[43mcanonicalize_bootstrap_address[49m[43m([49m[43maddress[49m[43m)[49m
|
||||
[1;32m 955[0m [38;5;28;01massert[39;00m bootstrap_address [38;5;129;01mis[39;00m [38;5;129;01mnot[39;00m [38;5;28;01mNone[39;00m
|
||||
[1;32m 956[0m logger[38;5;241m.[39minfo(
|
||||
[1;32m 957[0m [38;5;124mf[39m[38;5;124m"[39m[38;5;124mConnecting to existing Ray cluster at address: [39m[38;5;132;01m{[39;00mbootstrap_address[38;5;132;01m}[39;00m[38;5;124m"[39m
|
||||
[1;32m 958[0m )
|
||||
|
||||
File [0;32m/nix/store/zm0dbvm6kc79il5713w847760r9wxs2m-python3-3.9.13-env/lib/python3.9/site-packages/ray/_private/services.py:451[0m, in [0;36mcanonicalize_bootstrap_address[0;34m(addr)[0m
|
||||
[1;32m 441[0m [38;5;124;03m"""Canonicalizes Ray cluster bootstrap address to host:port.[39;00m
|
||||
[1;32m 442[0m [38;5;124;03mReads address from the environment if needed.[39;00m
|
||||
[1;32m 443[0m
|
||||
[0;32m (...)[0m
|
||||
[1;32m 448[0m [38;5;124;03m Ray cluster address string in <host:port> format.[39;00m
|
||||
[1;32m 449[0m [38;5;124;03m"""[39;00m
|
||||
[1;32m 450[0m [38;5;28;01mif[39;00m addr [38;5;129;01mis[39;00m [38;5;28;01mNone[39;00m [38;5;129;01mor[39;00m addr [38;5;241m==[39m [38;5;124m"[39m[38;5;124mauto[39m[38;5;124m"[39m:
|
||||
[0;32m--> 451[0m addr [38;5;241m=[39m [43mget_ray_address_from_environment[49m[43m([49m[43m)[49m
|
||||
[1;32m 452[0m [38;5;28;01mtry[39;00m:
|
||||
[1;32m 453[0m bootstrap_address [38;5;241m=[39m resolve_ip_for_localhost(addr)
|
||||
|
||||
File [0;32m/nix/store/zm0dbvm6kc79il5713w847760r9wxs2m-python3-3.9.13-env/lib/python3.9/site-packages/ray/_private/services.py:358[0m, in [0;36mget_ray_address_from_environment[0;34m()[0m
|
||||
[1;32m 356[0m addr [38;5;241m=[39m os[38;5;241m.[39menviron[38;5;241m.[39mget(ray_constants[38;5;241m.[39mRAY_ADDRESS_ENVIRONMENT_VARIABLE)
|
||||
[1;32m 357[0m [38;5;28;01mif[39;00m addr [38;5;129;01mis[39;00m [38;5;28;01mNone[39;00m [38;5;129;01mor[39;00m addr [38;5;241m==[39m [38;5;124m"[39m[38;5;124mauto[39m[38;5;124m"[39m:
|
||||
[0;32m--> 358[0m addr [38;5;241m=[39m [43m_find_gcs_address_or_die[49m[43m([49m[43m)[49m
|
||||
[1;32m 359[0m [38;5;28;01mreturn[39;00m addr
|
||||
|
||||
File [0;32m/nix/store/zm0dbvm6kc79il5713w847760r9wxs2m-python3-3.9.13-env/lib/python3.9/site-packages/ray/_private/services.py:333[0m, in [0;36m_find_gcs_address_or_die[0;34m()[0m
|
||||
[1;32m 331[0m gcs_addresses [38;5;241m=[39m _find_address_from_flag([38;5;124m"[39m[38;5;124m--gcs-address[39m[38;5;124m"[39m)
|
||||
[1;32m 332[0m [38;5;28;01mif[39;00m [38;5;28mlen[39m(gcs_addresses) [38;5;241m>[39m [38;5;241m1[39m:
|
||||
[0;32m--> 333[0m [38;5;28;01mraise[39;00m [38;5;167;01mConnectionError[39;00m(
|
||||
[1;32m 334[0m [38;5;124mf[39m[38;5;124m"[39m[38;5;124mFound multiple active Ray instances: [39m[38;5;132;01m{[39;00mgcs_addresses[38;5;132;01m}[39;00m[38;5;124m. [39m[38;5;124m"[39m
|
||||
[1;32m 335[0m [38;5;124m"[39m[38;5;124mPlease specify the one to connect to by setting `--address` flag [39m[38;5;124m"[39m
|
||||
[1;32m 336[0m [38;5;124m"[39m[38;5;124mor `RAY_ADDRESS` environment variable.[39m[38;5;124m"[39m
|
||||
[1;32m 337[0m )
|
||||
[1;32m 338[0m sys[38;5;241m.[39mexit([38;5;241m1[39m)
|
||||
[1;32m 339[0m [38;5;28;01melif[39;00m [38;5;129;01mnot[39;00m gcs_addresses:
|
||||
|
||||
[0;31mConnectionError[0m: Found multiple active Ray instances: {'141.30.17.225:62313', '141.30.17.225:50182', '141.30.17.225:65147'}. Please specify the one to connect to by setting `--address` flag or `RAY_ADDRESS` environment variable.
|
||||
#+end_example
|
||||
:END:
|
||||
: RayContext(dashboard_url='', python_version='3.9.13', ray_version='1.13.0', ray_commit='e4ce38d001dbbe09cd21c497fedd03d692b2be3e', address_info={'node_ip_address': '141.30.17.225', 'raylet_ip_address': '141.30.17.225', 'redis_address': None, 'object_store_address': '/tmp/ray/session_2022-08-11_09-46-25_383869_2847457/sockets/plasma_store', 'raylet_socket_name': '/tmp/ray/session_2022-08-11_09-46-25_383869_2847457/sockets/raylet', 'webui_url': '', 'session_dir': '/tmp/ray/session_2022-08-11_09-46-25_383869_2847457', 'metrics_export_port': 56801, 'gcs_address': '141.30.17.225:51407', 'address': '141.30.17.225:51407', 'node_id': '20d594bba4c81ab0975e22eb942834aae181e5cb4e9975c1bd486455'})
|
||||
|
||||
#+begin_src jupyter-python :results none
|
||||
from hops.util.logging_setup import logging_setup
|
||||
|
@ -374,8 +319,8 @@ Let's test the assumptions of the paper.
|
|||
|
||||
#+RESULTS:
|
||||
:RESULTS:
|
||||
: <matplotlib.legend.Legend at 0x7fa40b3d9cd0>
|
||||
[[file:./.ob-jupyter/21b83cf80d878c620249a970ecabcfa7ed8c3488.svg]]
|
||||
: <matplotlib.legend.Legend at 0x7f599c5a77f0>
|
||||
[[file:./.ob-jupyter/f1f3d1efbb8b9b6b8c3b2433d8c8013931023f85.svg]]
|
||||
:END:
|
||||
|
||||
#+begin_src jupyter-python :tangle nil
|
||||
|
@ -478,9 +423,16 @@ Let's test the assumptions of the paper.
|
|||
|
||||
** Integration
|
||||
#+begin_src jupyter-python
|
||||
aux.integrate(model, 10_000)
|
||||
aux.integrate(model, 50_000)
|
||||
#+End_src
|
||||
|
||||
#+RESULTS:
|
||||
: [INFO hops.core.integration 17042] Choosing the nonlinear integrator.
|
||||
: [INFO hops.core.integration 17042] Using 4 integrators.
|
||||
: [INFO hops.core.integration 17042] Some 1 trajectories have to be integrated.
|
||||
: [INFO hops.core.integration 17042] Using 1820 hierarchy states.
|
||||
: 100% 1/1 [10:19<00:00, 619.29s/it]
|
||||
|
||||
|
||||
#+Begin_src jupyter-python
|
||||
#_, ax = pu.plot_energy_overview(model, markersize=1, ensemble_args=dict(gc_sleep=0.05))
|
||||
|
@ -494,7 +446,7 @@ Let's test the assumptions of the paper.
|
|||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
[[file:./.ob-jupyter/cce3efaf063c82f06c7cf8127c730600cde163dc.svg]]
|
||||
[[file:./.ob-jupyter/7a93cb1d2d85d17491e6264047d0834d0b4ddf31.svg]]
|
||||
|
||||
- **too fast decoupling kills it**
|
||||
- no anti-zeno effects without detuning?
|
||||
|
@ -510,40 +462,27 @@ Let's test the assumptions of the paper.
|
|||
with aux.get_data(model) as data:
|
||||
pu.plot_with_σ(
|
||||
model.t,
|
||||
EnsembleValue(
|
||||
abs(EnsembleValue(
|
||||
(data.rho_t_accum.mean[:, 0, 0], data.rho_t_accum.ensemble_std[:, 0, 0])
|
||||
|
||||
),
|
||||
) - .5),
|
||||
)
|
||||
|
||||
plt.yscale("log")
|
||||
ρ_ee = data.rho_t_accum.mean[:, 0, 0].real
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
:RESULTS:
|
||||
: /nix/store/zm0dbvm6kc79il5713w847760r9wxs2m-python3-3.9.13-env/lib/python3.9/site-packages/matplotlib/cbook/__init__.py:1298: ComplexWarning: Casting complex values to real discards the imaginary part
|
||||
: return np.asarray(x, float)
|
||||
: /nix/store/zm0dbvm6kc79il5713w847760r9wxs2m-python3-3.9.13-env/lib/python3.9/site-packages/matplotlib/axes/_axes.py:5218: ComplexWarning: Casting complex values to real discards the imaginary part
|
||||
: pts[0] = start
|
||||
: /nix/store/zm0dbvm6kc79il5713w847760r9wxs2m-python3-3.9.13-env/lib/python3.9/site-packages/matplotlib/axes/_axes.py:5219: ComplexWarning: Casting complex values to real discards the imaginary part
|
||||
: pts[N + 1] = end
|
||||
: /nix/store/zm0dbvm6kc79il5713w847760r9wxs2m-python3-3.9.13-env/lib/python3.9/site-packages/matplotlib/axes/_axes.py:5222: ComplexWarning: Casting complex values to real discards the imaginary part
|
||||
: pts[1:N+1, 1] = dep1slice
|
||||
: /nix/store/zm0dbvm6kc79il5713w847760r9wxs2m-python3-3.9.13-env/lib/python3.9/site-packages/matplotlib/axes/_axes.py:5224: ComplexWarning: Casting complex values to real discards the imaginary part
|
||||
: pts[N+2:, 1] = dep2slice[::-1]
|
||||
[[file:./.ob-jupyter/510fac6208b7950e74134f1538f5e47e04e48f53.svg]]
|
||||
:END:
|
||||
[[file:./.ob-jupyter/f605108ee6f84ce245204313dae12f06305c2c62.svg]]
|
||||
|
||||
- no steady state ... but we have to average...
|
||||
|
||||
#+begin_src jupyter-python
|
||||
plt.plot(model.t, ut.smoothen(model.t, ρ_ee, frac=.5, it=0))
|
||||
plt.plot(model.t[101:], ut.smoothen(model.t[101:], ρ_ee[101:], frac=.5, it=0))
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
:RESULTS:
|
||||
| <matplotlib.lines.Line2D | at | 0x7f13b1ab4040> |
|
||||
[[file:./.ob-jupyter/26cbfca7cad147a1687d01c495ee0148dba1f8a8.svg]]
|
||||
| <matplotlib.lines.Line2D | at | 0x7f599d8bc880> |
|
||||
[[file:./.ob-jupyter/14aad48baa0c0d612ecae0fb09a5ddaeeea9d141.svg]]
|
||||
:END:
|
||||
|
||||
** TODO Power and Efficiency
|
||||
|
@ -567,12 +506,6 @@ We need the time points where we sample the total energy.
|
|||
#ax.plot(model.t, np.gradient(model.total_energy(data).value))
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
:RESULTS:
|
||||
: Loading: 0% 0/99999 [00:00<?, ?it/s]
|
||||
[[file:./.ob-jupyter/da54924ee7a3023ba22115cfd2d2c480e1194adc.svg]]
|
||||
:END:
|
||||
|
||||
#+begin_src jupyter-python
|
||||
ts_begin = τ_init + τ_off + ((τ_c + τ_off) * np.arange(0, n))
|
||||
ts_end = τ_c + ts_begin
|
||||
|
@ -601,7 +534,7 @@ We need the time points where we sample the total energy.
|
|||
plt.axvline(t, linestyle="dotted", color="lightblue", linewidth=1)
|
||||
|
||||
pu.plot_with_σ(
|
||||
model.t[ind_begin[0]:], tot_power.slice(ind_begin[0], None, 1), ax=ax, linewidth=0.5
|
||||
model.t[ind_begin[0]:], tot_power.slice(slice(ind_begin[0], None, 1)), ax=ax, linewidth=0.5
|
||||
)
|
||||
ax.plot(
|
||||
model.t[ind_begin[0]:],
|
||||
|
@ -611,7 +544,7 @@ We need the time points where we sample the total energy.
|
|||
powers = []
|
||||
for begin, end in zip(ind_begin, ind_end):
|
||||
powers.append(
|
||||
(tot_power.slice(begin, end)).mean
|
||||
(tot_power.slice(slice(begin, end))).mean
|
||||
)
|
||||
|
||||
steady_index = 0
|
||||
|
@ -621,7 +554,8 @@ We need the time points where we sample the total energy.
|
|||
ax.set_xlabel(r"$\tau$")
|
||||
|
||||
|
||||
#fs.export_fig("anti_zeno_with_cool")
|
||||
fig.suptitle(fr"$\omega_0={ω_0},\,\omega_c={1},\,N={tot_power.N},\,\delta={.5}\,\Delta={Δ},\,\lambda={.2},\, T_h={model.T[0]},\, T_c={model.T[1]},\,n={cycles}$")
|
||||
fs.export_fig("anti_zeno_maybe_note_quite_steady", tikz=False)
|
||||
fs.tex_value(
|
||||
(power.value),
|
||||
err=power.σ,
|
||||
|
@ -632,8 +566,8 @@ We need the time points where we sample the total energy.
|
|||
|
||||
#+RESULTS:
|
||||
:RESULTS:
|
||||
: \(P=-0.00081\pm 0.00020\)
|
||||
[[file:./.ob-jupyter/c6e1343e89d39c704cbb2e1c0d6de97ef9db8d44.svg]]
|
||||
: \(P=-0.00044\pm 0.00020\)
|
||||
[[file:./.ob-jupyter/8a85b404d79490cb1361ffbccb0c858f88afb4a6.svg]]
|
||||
:END:
|
||||
|
||||
|
||||
|
|
|
@ -12,7 +12,10 @@
|
|||
name = "10_antizeno_engine";
|
||||
shellPackages = (pkgs:
|
||||
(with pkgs;
|
||||
[ pyright python39Packages.jupyter sshfs]));
|
||||
[ pyright python39Packages.jupyter sshfs (pkgs.texlive.combine {
|
||||
inherit (pkgs.texlive) scheme-medium
|
||||
type1cm unicode-math;
|
||||
})]));
|
||||
|
||||
python = pkgs: pkgs.python39Full;
|
||||
shellOverride = (pkgs: oldAttrs: {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
sshfs -oIdentityFile=~/.ssh/id_ed25519_taurus s8896854@taurusexport.hrsk.tu-dresden.de:/beegfs/ws/0/s8896854-m_10t/project/python/energy_flow_proper/10_antizeno_engine/.data .data
|
||||
sshfs -oIdentityFile=~/.ssh/id_ed25519_taurus s8896854@taurusexport.hrsk.tu-dresden.de:/lustre/ssd/ws/s8896854-10_ssd/.data/ .data
|
||||
sshfs -oIdentityFile=~/.ssh/id_ed25519_taurus s8896854@taurusexport.hrsk.tu-dresden.de:/beegfs/ws/0/s8896854-m_10t/project/python/energy_flow_proper/10_antizeno_engine/results results
|
||||
|
||||
|
||||
sshfs -oIdentityFile=~/.ssh/id_ed25519_taurus s8896854@taurusexport.hrsk.tu-dresden.de:/beegfs/ws/0/s8896854-m_10t/project/python/energy_flow_proper/10_antizeno_engine/ taurus
|
||||
|
|
|
@ -1 +1 @@
|
|||
\(P=-6.1\pm 1.0\)
|
||||
\(P=-0.00044\pm 0.00020\)
|
Loading…
Add table
Reference in a new issue