diff --git a/python/energy_flow_proper/11_new_ho_comparison/ho_analytic_two_baths.org b/python/energy_flow_proper/11_new_ho_comparison/ho_analytic_two_baths.org index 7dd8dc4..0480373 100644 --- a/python/energy_flow_proper/11_new_ho_comparison/ho_analytic_two_baths.org +++ b/python/energy_flow_proper/11_new_ho_comparison/ho_analytic_two_baths.org @@ -114,18 +114,25 @@ return params - model_keys = [dict(bcf_scale=0.2, wc=ω_c, γ=.5, T=.6, k_max=4, bcf_terms=5, max_HO_level=5) for ω_c in [2]] + model_keys = [dict(bcf_scale=0.2, wc=ω_c, γ=.5, T=.6, k_max=3, bcf_terms=5, max_HO_level=9) for ω_c in [2]] multi_params = [ho_duo(**keys) for keys in model_keys] multi_params = multi_params #+end_src #+RESULTS: -: stocproc.stocproc - INFO - Loaded instance from cache. -: INFO:stocproc.stocproc:Loaded instance from cache. -: stocproc.stocproc - INFO - Loaded instance from cache. -: INFO:stocproc.stocproc:Loaded instance from cache. -: stocproc.stocproc - INFO - Loaded instance from cache. -: INFO:stocproc.stocproc:Loaded instance from cache. +#+begin_example + INFO:stocproc.stocproc:Loaded instance from cache. + stocproc.stocproc - INFO - Loaded instance from cache. + INFO:stocproc.stocproc:Loaded instance from cache. + stocproc.stocproc - INFO - Loaded instance from cache. + INFO:stocproc.stocproc:Loaded instance from cache. + stocproc.stocproc - INFO - Loaded instance from cache. + INFO:stocproc.stocproc:Loaded instance from cache. + stocproc.stocproc - INFO - Loaded instance from cache. + INFO:stocproc.stocproc:Loaded instance from cache. + stocproc.stocproc - INFO - Loaded instance from cache. + INFO:stocproc.stocproc:Loaded instance from cache. +#+end_example #+begin_src jupyter-python @@ -135,7 +142,10 @@ #+end_src #+RESULTS: +:RESULTS: +: 2022-08-04 09:20:43,308 INFO worker.py:956 -- Connecting to existing Ray cluster at address: 141.30.17.225:48665 : 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-03_16-51-50_330688_106699/sockets/plasma_store', 'raylet_socket_name': '/tmp/ray/session_2022-08-03_16-51-50_330688_106699/sockets/raylet', 'webui_url': '', 'session_dir': '/tmp/ray/session_2022-08-03_16-51-50_330688_106699', 'metrics_export_port': 40539, 'gcs_address': '141.30.17.225:48665', 'address': '141.30.17.225:48665', 'node_id': '2b485e9daf283f489d86e8256bde8e8a015de5563d8e1923adda5db4'}) +:END: #+begin_src jupyter-python @@ -143,7 +153,7 @@ for params in multi_params: supervisor = HOPSSupervisor( params, - 10_000, + 2_000, data_path="ho_data", data_name="two_baths", ) @@ -154,8 +164,111 @@ #+end_src #+RESULTS: -: ho_data/two_baths/_f/two_baths_fbeb4100da4ff052f0c2153129535231_1.h5 -: 0it [00:00, ?it/s] +:RESULTS: +: 0% 1/10000 [02:21<394:12:56, 141.93s/it] +: 2022-08-04 09:48:05,978 ERROR worker.py:94 -- Unhandled error (suppress with 'RAY_IGNORE_UNHANDLED_ERRORS=1'): The worker died unexpectedly while executing this task. Check python-core-worker-*.log files for more information. +: 2022-08-04 09:48:05,981 ERROR worker.py:94 -- Unhandled error (suppress with 'RAY_IGNORE_UNHANDLED_ERRORS=1'): The worker died unexpectedly while executing this task. Check python-core-worker-*.log files for more information. +: 2022-08-04 09:48:05,984 ERROR worker.py:94 -- Unhandled error (suppress with 'RAY_IGNORE_UNHANDLED_ERRORS=1'): The worker died unexpectedly while executing this task. Check python-core-worker-*.log files for more information. +: 2022-08-04 09:48:05,986 ERROR worker.py:94 -- Unhandled error (suppress with 'RAY_IGNORE_UNHANDLED_ERRORS=1'): The worker died unexpectedly while executing this task. Check python-core-worker-*.log files for more information. +# [goto error] +#+begin_example + --------------------------------------------------------------------------- + KeyboardInterrupt Traceback (most recent call last) + Input In [47], in () +  3 supervisor = HOPSSupervisor( +  4 params, +  5 10_000, +  6 data_path="ho_data", +  7 data_name="two_baths", +  8 ) +  9 print(supervisor.get_data(True).hdf5_name) + ---> 10 supervisor.integrate() +  11 supervisors.append(supervisor) + + File ~/src/hops/hops/core/integration.py:1288, in HOPSSupervisor.integrate(self, clear_pd) +  1285 break +  1287 integration.update() + -> 1288 data.new_samples( +  1289 idx=index, +  1290 incomplete=incomplete, +  1291 psi0=psi0, +  1292 aux_states=aux_states, +  1293 stoc_proc=stoc_proc, +  1294 result_type=self.params.HiP.result_type, +  1295 normed=self._normed_average, +  1296 rng_seed=seed, +  1297 ) + + File ~/src/hops/hops/core/signal_delay.py:87, in sig_delay.__exit__(self, exc_type, exc_val, exc_tb) +  84 if len(self.sigh.sigs_caught) > 0 and self.handler is not None: +  85 self.handler(self.sigh.sigs_caught) + ---> 87 self._restore() + + File ~/src/hops/hops/core/signal_delay.py:68, in sig_delay._restore(self) +  66 for i, s in enumerate(self.sigs): +  67 signal.signal(s, self.old_handlers[i]) + ---> 68 self.sigh.emit() + + File ~/src/hops/hops/core/signal_delay.py:42, in SigHandler.emit(self) +  40 for s in self.sigs_caught: +  41 log.info("emit signal '{}'".format(SIG_MAP[s])) + ---> 42 os.kill(os.getpid(), s) + + KeyboardInterrupt: + ho_data/two_baths/_4/two_baths_449cdb9aeeb1a354762f4a6b2f69bcee_1.h5 + 2% 44/2000 [09:32<7:04:09, 13.01s/it] + 2022-08-04 09:57:41,769 ERROR worker.py:94 -- Unhandled error (suppress with 'RAY_IGNORE_UNHANDLED_ERRORS=1'): The worker died unexpectedly while executing this task. Check python-core-worker-*.log files for more information. + 2022-08-04 09:57:41,771 ERROR worker.py:94 -- Unhandled error (suppress with 'RAY_IGNORE_UNHANDLED_ERRORS=1'): The worker died unexpectedly while executing this task. Check python-core-worker-*.log files for more information. + 2022-08-04 09:57:41,780 ERROR worker.py:94 -- Unhandled error (suppress with 'RAY_IGNORE_UNHANDLED_ERRORS=1'): The worker died unexpectedly while executing this task. Check python-core-worker-*.log files for more information. + 2022-08-04 09:57:41,782 ERROR worker.py:94 -- Unhandled error (suppress with 'RAY_IGNORE_UNHANDLED_ERRORS=1'): The worker died unexpectedly while executing this task. Check python-core-worker-*.log files for more information. +#+end_example +# [goto error] +#+begin_example + --------------------------------------------------------------------------- + KeyboardInterrupt Traceback (most recent call last) + Input In [50], in () +  3 supervisor = HOPSSupervisor( +  4 params, +  5 2_000, +  6 data_path="ho_data", +  7 data_name="two_baths", +  8 ) +  9 print(supervisor.get_data(True).hdf5_name) + ---> 10 supervisor.integrate() +  11 supervisors.append(supervisor) + + File ~/src/hops/hops/core/integration.py:1288, in HOPSSupervisor.integrate(self, clear_pd) +  1285 break +  1287 integration.update() + -> 1288 data.new_samples( +  1289 idx=index, +  1290 incomplete=incomplete, +  1291 psi0=psi0, +  1292 aux_states=aux_states, +  1293 stoc_proc=stoc_proc, +  1294 result_type=self.params.HiP.result_type, +  1295 normed=self._normed_average, +  1296 rng_seed=seed, +  1297 ) + + File ~/src/hops/hops/core/signal_delay.py:87, in sig_delay.__exit__(self, exc_type, exc_val, exc_tb) +  84 if len(self.sigh.sigs_caught) > 0 and self.handler is not None: +  85 self.handler(self.sigh.sigs_caught) + ---> 87 self._restore() + + File ~/src/hops/hops/core/signal_delay.py:68, in sig_delay._restore(self) +  66 for i, s in enumerate(self.sigs): +  67 signal.signal(s, self.old_handlers[i]) + ---> 68 self.sigh.emit() + + File ~/src/hops/hops/core/signal_delay.py:42, in SigHandler.emit(self) +  40 for s in self.sigs_caught: +  41 log.info("emit signal '{}'".format(SIG_MAP[s])) + ---> 42 os.kill(os.getpid(), s) + + KeyboardInterrupt: +#+end_example +:END: * Flow #+begin_src jupyter-python :results none @@ -202,8 +315,8 @@ #+RESULTS: :RESULTS: : WARNING:matplotlib.legend:No artists with labels found to put in legend. Note that artists whose label start with an underscore are ignored when legend() is called with no argument. -: -[[file:./.ob-jupyter/eae302d599fab252f5be9982c699f16f4bf0d274.svg]] +: +[[file:./.ob-jupyter/b0eb1c317bdf1184cddc45ce8f2d1b5a7e1d661c.svg]] :END: * Analytic @@ -250,6 +363,32 @@ exact_flows.append(exact_flow) #+end_src +#+begin_src jupyter-python + params = multi_params[0] + tt = params.IntP.t + α_0 = util.BCF( + params.IntP.t_max, + hops.util.bcf.OhmicBCF_zeroTemp(s=1, eta=1, w_c=keys["wc"]), + num_terms=7, + resolution=0.01, + ) + α_alt = gf.BCF( + params.IntP.t_max, + factors=params.SysP.g[0] / params.SysP.bcf_scale[0], + exponents=params.SysP.w[0], + ) + + pu.plot_complex( + tt, + hops.util.bcf.OhmicBCF_zeroTemp(s=1, eta=1, w_c=keys["wc"])(tt) - α_alt.approx(tt), + ) +#+end_src + +#+RESULTS: +:RESULTS: +|
| | +[[file:./.ob-jupyter/8359947a3fe7de0ee3390e3803949d14be4af47f.svg]] +:END: #+begin_src jupyter-python fig, ax = plt.subplots() @@ -283,7 +422,10 @@ #+end_src #+RESULTS: -[[file:./.ob-jupyter/6f4f530dfd0f24c23fbf75506a97fb37981c8475.svg]] +:RESULTS: +: WARNING:matplotlib.legend:No artists with labels found to put in legend. Note that artists whose label start with an underscore are ignored when legend() is called with no argument. +[[file:./.ob-jupyter/7ad76b73dba0620873d9a9ceb124cffd520ecafd.svg]] +:END: #+begin_src jupyter-python pu.plot_convergence( diff --git a/python/energy_flow_proper/11_new_ho_comparison/two_ho.py b/python/energy_flow_proper/11_new_ho_comparison/two_ho.py index 76413b7..697014c 100644 --- a/python/energy_flow_proper/11_new_ho_comparison/two_ho.py +++ b/python/energy_flow_proper/11_new_ho_comparison/two_ho.py @@ -109,7 +109,7 @@ def ho_duo( return params -model_keys = [dict(bcf_scale=0.2, wc=ω_c, γ=.5, T=.6, k_max=4, bcf_terms=5, max_HO_level=5) for ω_c in [2]] +model_keys = [dict(bcf_scale=0.2, wc=ω_c, γ=.5, T=.6, k_max=3, bcf_terms=5, max_HO_level=9) for ω_c in [2]] multi_params = [ho_duo(**keys) for keys in model_keys] multi_params = multi_params @@ -121,7 +121,7 @@ supervisors = [] for params in multi_params: supervisor = HOPSSupervisor( params, - 10_000, + 2_000, data_path="ho_data", data_name="two_baths", ) @@ -200,6 +200,25 @@ for params, keys in zip(multi_params, model_keys): exact_flow = [C.flow(params.IntP.t, 0, False), C.flow(params.IntP.t, 1, False)] exact_flows.append(exact_flow) +params = multi_params[0] +tt = params.IntP.t +α_0 = util.BCF( + params.IntP.t_max, + hops.util.bcf.OhmicBCF_zeroTemp(s=1, eta=1, w_c=keys["wc"]), + num_terms=7, + resolution=0.01, +) +α_alt = gf.BCF( + params.IntP.t_max, + factors=params.SysP.g[0] / params.SysP.bcf_scale[0], + exponents=params.SysP.w[0], +) + +pu.plot_complex( + tt, + hops.util.bcf.OhmicBCF_zeroTemp(s=1, eta=1, w_c=keys["wc"])(tt) - α_alt.approx(tt), +) + fig, ax = plt.subplots() for params, flow, ex_flow, keys in zip(multi_params, flow_hops, exact_flows, model_keys): consistency = (-1 * flow.for_bath(0)).consistency(ex_flow[0])