From d59b23f0a17a81649515f62722ba837e10f416cb Mon Sep 17 00:00:00 2001 From: Valentin Boettcher Date: Sun, 7 Aug 2022 10:41:36 +0200 Subject: [PATCH] looking good, need longer init --- .../10_antizeno_engine/10_first_anti_zeno.py | 7 +- .../10_antizeno_engine/anti_zeno_engine.org | 95 +++++++++++++++---- 2 files changed, 77 insertions(+), 25 deletions(-) diff --git a/python/energy_flow_proper/10_antizeno_engine/10_first_anti_zeno.py b/python/energy_flow_proper/10_antizeno_engine/10_first_anti_zeno.py index 10c854d..3e9a221 100644 --- a/python/energy_flow_proper/10_antizeno_engine/10_first_anti_zeno.py +++ b/python/energy_flow_proper/10_antizeno_engine/10_first_anti_zeno.py @@ -313,9 +313,7 @@ with aux.get_data(model) as data: ρ_ee = data.rho_t_accum.mean[:, 0, 0].real -# plt.plot(model.t, ρ_ee) - -plt.plot(model.t, ut.smoothen(model.t, ρ_ee, frac=.06, it=0)) +plt.plot(model.t, ut.smoothen(model.t, ρ_ee, frac=.5, it=0)) with aux.get_data(model) as data: _, ax = plt.subplots() @@ -326,7 +324,6 @@ with aux.get_data(model) as data: pu.plot_with_σ(model.t, model.total_energy(data), ax=ax) #pu.plot_with_σ(model.t, model.interaction_energy(data).for_bath(1), ax=ax) - #pu.plot_with_σ(model.t, model.system_energy(data), ax=ax) #pu.plot_with_σ(model.t, model.system_energy(data) + model.bath_energy(data).sum_baths(), ax=ax) #ax.plot(model.t, ut.smoothen(model.t, model.total_energy(data).value, frac=.1)) @@ -367,7 +364,7 @@ for begin, end in zip(ind_begin, ind_end): (tot_power.slice(begin, end)).mean ) -steady_index = 4 +steady_index = 0 power = sum(powers[steady_index:]) * (1/(len(powers[steady_index:]))) ax.set_ylabel(r"$\langle{P}\rangle$") diff --git a/python/energy_flow_proper/10_antizeno_engine/anti_zeno_engine.org b/python/energy_flow_proper/10_antizeno_engine/anti_zeno_engine.org index 39cb82c..0872b85 100644 --- a/python/energy_flow_proper/10_antizeno_engine/anti_zeno_engine.org +++ b/python/energy_flow_proper/10_antizeno_engine/anti_zeno_engine.org @@ -27,7 +27,62 @@ Init ray and silence stocproc. #+end_src #+RESULTS: -: 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-04_11-17-18_747252_106699/sockets/plasma_store', 'raylet_socket_name': '/tmp/ray/session_2022-08-04_11-17-18_747252_106699/sockets/raylet', 'webui_url': '', 'session_dir': '/tmp/ray/session_2022-08-04_11-17-18_747252_106699', 'metrics_export_port': 62354, 'gcs_address': '141.30.17.225:53570', 'address': '141.30.17.225:53570', 'node_id': '079f1adbf34279fae2fd8852983a78a23ac1e68ab6ead506e1bb1467'}) +:RESULTS: +# [goto error] +#+begin_example + --------------------------------------------------------------------------- + ConnectionError Traceback (most recent call last) + Input In [2], in () +  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..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 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: #+begin_src jupyter-python :results none from hops.util.logging_setup import logging_setup @@ -319,8 +374,8 @@ Let's test the assumptions of the paper. #+RESULTS: :RESULTS: -: -[[file:./.ob-jupyter/84c423a9401fb0410819d4df4fd07089f24fa24e.svg]] +: +[[file:./.ob-jupyter/6731a563bc8b20945d52b785667f2e8efee540e9.svg]] :END: #+begin_src jupyter-python :tangle nil @@ -439,7 +494,7 @@ Let's test the assumptions of the paper. #+end_src #+RESULTS: -[[file:./.ob-jupyter/50d1bb2a98247cea870e723c788bae09a3eb04ea.svg]] +[[file:./.ob-jupyter/cce3efaf063c82f06c7cf8127c730600cde163dc.svg]] - **too fast decoupling kills it** - no anti-zeno effects without detuning? @@ -466,31 +521,29 @@ Let's test the assumptions of the paper. #+RESULTS: :RESULTS: -: /nix/store/akzgacnj2l97sldws5cnxjlgv27317xd-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 +: /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/akzgacnj2l97sldws5cnxjlgv27317xd-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 +: /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/akzgacnj2l97sldws5cnxjlgv27317xd-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 +: /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/akzgacnj2l97sldws5cnxjlgv27317xd-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 +: /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/akzgacnj2l97sldws5cnxjlgv27317xd-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 +: /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/6c7dd6320634995333544d0d20997d252a9cfece.svg]] +[[file:./.ob-jupyter/510fac6208b7950e74134f1538f5e47e04e48f53.svg]] :END: - no steady state ... but we have to average... #+begin_src jupyter-python - # plt.plot(model.t, ρ_ee) - - plt.plot(model.t, ut.smoothen(model.t, ρ_ee, frac=.06, it=0)) + plt.plot(model.t, ut.smoothen(model.t, ρ_ee, frac=.5, it=0)) #+end_src #+RESULTS: :RESULTS: -| | -[[file:./.ob-jupyter/585df3b23fc95829cde1d1a31b416a1cb10d760d.svg]] +| | +[[file:./.ob-jupyter/26cbfca7cad147a1687d01c495ee0148dba1f8a8.svg]] :END: ** TODO Power and Efficiency @@ -508,7 +561,6 @@ We need the time points where we sample the total energy. pu.plot_with_σ(model.t, model.total_energy(data), ax=ax) #pu.plot_with_σ(model.t, model.interaction_energy(data).for_bath(1), ax=ax) - #pu.plot_with_σ(model.t, model.system_energy(data), ax=ax) #pu.plot_with_σ(model.t, model.system_energy(data) + model.bath_energy(data).sum_baths(), ax=ax) #ax.plot(model.t, ut.smoothen(model.t, model.total_energy(data).value, frac=.1)) @@ -516,7 +568,10 @@ We need the time points where we sample the total energy. #+end_src #+RESULTS: -[[file:./.ob-jupyter/a7a655d96af4b59356371e5f4164ad83ea2a6f15.svg]] +:RESULTS: +: Loading: 0% 0/99999 [00:00