with continous coupling we still don't have a really converged res

but it seems to work
This commit is contained in:
Valentin Boettcher 2022-08-11 10:04:01 +02:00
parent 7689cbaba5
commit 84122d210a
5 changed files with 45 additions and 105 deletions

View file

@ -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.σ,

View file

@ -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
---------------------------------------------------------------------------
ConnectionError Traceback (most recent call last)
Input In [2], in <cell line: 3>()
 1 import ray
 2 ray.shutdown()
----> 3 ray.init(address="auto")
File /nix/store/zm0dbvm6kc79il5713w847760r9wxs2m-python3-3.9.13-env/lib/python3.9/site-packages/ray/_private/client_mode_hook.py:105, in client_mode_hook.<locals>.wrapper(*args, **kwargs)
 103 if func.__name__ != "init" or is_client_mode_enabled_by_default:
 104 return getattr(ray, func.__name__)(*args, **kwargs)
--> 105 return func(*args, **kwargs)
File /nix/store/zm0dbvm6kc79il5713w847760r9wxs2m-python3-3.9.13-env/lib/python3.9/site-packages/ray/worker.py:954, in init(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)
 952 bootstrap_address, redis_address, gcs_address = None, None, None
 953 if address:
--> 954 bootstrap_address = services.canonicalize_bootstrap_address(address)
 955 assert bootstrap_address is not None
 956 logger.info(
 957 f"Connecting to existing Ray cluster at address: {bootstrap_address}"
 958 )
File /nix/store/zm0dbvm6kc79il5713w847760r9wxs2m-python3-3.9.13-env/lib/python3.9/site-packages/ray/_private/services.py:451, in canonicalize_bootstrap_address(addr)
 441 """Canonicalizes Ray cluster bootstrap address to host:port.
 442 Reads address from the environment if needed.
 443
 (...)
 448  Ray cluster address string in <host:port> format.
 449 """
 450 if addr is None or addr == "auto":
--> 451 addr = get_ray_address_from_environment()
 452 try:
 453 bootstrap_address = resolve_ip_for_localhost(addr)
File /nix/store/zm0dbvm6kc79il5713w847760r9wxs2m-python3-3.9.13-env/lib/python3.9/site-packages/ray/_private/services.py:358, in get_ray_address_from_environment()
 356 addr = os.environ.get(ray_constants.RAY_ADDRESS_ENVIRONMENT_VARIABLE)
 357 if addr is None or addr == "auto":
--> 358 addr = _find_gcs_address_or_die()
 359 return addr
File /nix/store/zm0dbvm6kc79il5713w847760r9wxs2m-python3-3.9.13-env/lib/python3.9/site-packages/ray/_private/services.py:333, in _find_gcs_address_or_die()
 331 gcs_addresses = _find_address_from_flag("--gcs-address")
 332 if len(gcs_addresses) > 1:
--> 333 raise ConnectionError(
 334 f"Found multiple active Ray instances: {gcs_addresses}. "
 335 "Please specify the one to connect to by setting `--address` flag "
 336 "or `RAY_ADDRESS` environment variable."
 337 )
 338 sys.exit(1)
 339 elif not gcs_addresses:
ConnectionError: 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:

View file

@ -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: {

View file

@ -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

View file

@ -1 +1 @@
\(P=-6.1\pm 1.0\)
\(P=-0.00044\pm 0.00020\)