otto: new settings

This commit is contained in:
Valentin Boettcher 2022-08-15 13:48:33 +02:00
parent 96e07cea12
commit 61be4d4fba
No known key found for this signature in database
GPG key ID: E034E12B7AF56ACE
2 changed files with 93 additions and 40 deletions

View file

@ -23,7 +23,7 @@ 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': '192.168.100.170', 'raylet_ip_address': '192.168.100.170', 'redis_address': None, 'object_store_address': '/tmp/ray/session_2022-08-15_11-00-55_094481_7214/sockets/plasma_store', 'raylet_socket_name': '/tmp/ray/session_2022-08-15_11-00-55_094481_7214/sockets/raylet', 'webui_url': '', 'session_dir': '/tmp/ray/session_2022-08-15_11-00-55_094481_7214', 'metrics_export_port': 57106, 'gcs_address': '192.168.100.170:59797', 'address': '192.168.100.170:59797', 'node_id': '9026d4f7c22bee0643e9faa61b56e25e2a8eed0568554be81b1fafe2'})
: RayContext(dashboard_url='', python_version='3.9.13', ray_version='1.13.0', ray_commit='e4ce38d001dbbe09cd21c497fedd03d692b2be3e', address_info={'node_ip_address': '192.168.100.170', 'raylet_ip_address': '192.168.100.170', 'redis_address': None, 'object_store_address': '/tmp/ray/session_2022-08-15_13-45-28_971048_59572/sockets/plasma_store', 'raylet_socket_name': '/tmp/ray/session_2022-08-15_13-45-28_971048_59572/sockets/raylet', 'webui_url': '', 'session_dir': '/tmp/ray/session_2022-08-15_13-45-28_971048_59572', 'metrics_export_port': 53281, 'gcs_address': '192.168.100.170:61047', 'address': '192.168.100.170:61047', 'node_id': '19344eac29e15d6404c14920662bd8259981954f0a9fde73ef5f8b4b'})
#+begin_src jupyter-python :results none
from hops.util.logging_setup import logging_setup
@ -55,7 +55,7 @@ Let's lay down some basic functionality.
#+begin_src jupyter-python :results none
t_compression = .1
t_expansion = .1
comp_ratio = .5
comp_ratio = .25
hot_switch_ratio = .8
cold_switch_ratio = .8
@ -68,7 +68,6 @@ Let's lay down some basic functionality.
** Expansion
#+begin_src jupyter-python
%matplotlib inline
H_exp = SmoothStep(comp_ratio * H_op, 0, t_expansion, 2) + H_op * (1 - comp_ratio)
tt = np.linspace(0, 1, 1000)
plt.plot(tt, H_exp.operator_norm(tt))
@ -76,8 +75,8 @@ Let's lay down some basic functionality.
#+RESULTS:
:RESULTS:
| <matplotlib.lines.Line2D | at | 0x7f4fcc5ac130> |
[[file:./.ob-jupyter/7d4003fe9d7b0b9dffdf0ac550823de40c40b89d.svg]]
| <matplotlib.lines.Line2D | at | 0x7fbff84a3340> |
[[file:./.ob-jupyter/3cc22c46295a7b959768d60bfea0e4c0142e2b43.svg]]
:END:
** Hot Thermalization
@ -90,8 +89,8 @@ Let's lay down some basic functionality.
#+RESULTS:
:RESULTS:
| <matplotlib.lines.Line2D | at | 0x7f4fcbdd7cd0> |
[[file:./.ob-jupyter/34a09437b2b74d4bbe12efc5c9a3e868bd7ef7e5.svg]]
| <matplotlib.lines.Line2D | at | 0x7fbff840e1c0> |
[[file:./.ob-jupyter/98aec1955458432d8e29d21e1675b698b47b50fb.svg]]
:END:
** Compression
@ -102,8 +101,8 @@ Let's lay down some basic functionality.
#+RESULTS:
:RESULTS:
| <matplotlib.lines.Line2D | at | 0x7f4fb41475b0> |
[[file:./.ob-jupyter/6a32491bdbf52e88d8447cd4e1175d3f8e13a426.svg]]
| <matplotlib.lines.Line2D | at | 0x7fbff83eeb20> |
[[file:./.ob-jupyter/8ebe76752707b723232c25684baa8b2b3a0af60e.svg]]
:END:
** Cold Thermalization
@ -116,8 +115,8 @@ Let's lay down some basic functionality.
#+RESULTS:
:RESULTS:
| <matplotlib.lines.Line2D | at | 0x7f4fb4128c40> |
[[file:./.ob-jupyter/e4d12af68c3403047d6de687c0d98e22db4b026c.svg]]
| <matplotlib.lines.Line2D | at | 0x7fbfddd4deb0> |
[[file:./.ob-jupyter/ffdfdc73f371b6485c38c7714e3d6f2075350606.svg]]
:END:
** Full Cycle
@ -141,12 +140,12 @@ Now we turn the system around after each fill-cycle.
#+end_src
#+RESULTS:
[[file:./.ob-jupyter/9fe28aca2667d52381ce08ef48407c6dca2028fb.svg]]
[[file:./.ob-jupyter/c6fcbae6c5d076e45f48b0d4e003265146c48409.svg]]
* Model
#+begin_src jupyter-python :results none
model = QubitModelMutliBath(
δ=[.5, .1],
δ=[.05*4, .01*4],
ω_c=[1] * 2,
ω_s=[H_cyc.operator_norm(0) - 1, H_cyc.operator_norm(t_expansion/scale) - 1],
t=ut.linspace_with_strobe(0, t_max, int(t_max // dt), ω_mod),
@ -166,20 +165,19 @@ Now we turn the system around after each fill-cycle.
#+begin_src jupyter-python
aux.integrate(model, 200)
aux.integrate(model, 1000)
#+end_src
#+RESULTS:
: [INFO hops.core.integration 7214] Choosing the nonlinear integrator.
: [INFO hops.core.integration 7214] Using 8 integrators.
: [INFO hops.core.integration 7214] Some 151 trajectories have to be integrated.
: [INFO hops.core.integration 7214] Using 1820 hierarchy states.
: 100% 151/151 [19:43<00:00, 7.84s/it]
: [INFO hops.core.integration 59572] Choosing the nonlinear integrator.
: [INFO hops.core.integration 59572] Using 8 integrators.
: [INFO hops.core.integration 59572] Some 0 trajectories have to be integrated.
: [INFO hops.core.integration 59572] Using 1820 hierarchy states.
: 0it [00:00, ?it/s]
#+begin_src jupyter-python
%matplotlib inline
f, a = pu.plot_energy_overview(model, strobe_frequency=ω_mod)
f, a = pu.plot_energy_overview(model)
a.plot(model.t, model.H.operator_norm(model.t))
a.plot(model.t, model.L[0].operator_norm(model.t))
a.plot(model.t, model.L[1].operator_norm(model.t))
@ -188,16 +186,28 @@ Now we turn the system around after each fill-cycle.
#+RESULTS:
:RESULTS:
: <matplotlib.legend.Legend at 0x7f4f97d30be0>
[[file:./.ob-jupyter/dcb781a84fce870deba7b071bc96c4e16b39e164.svg]]
#+begin_example
Loading: 100% 8/8 [00:00<00:00, 192.76it/s]
[INFO root 59572] Writing cache to: results/5e8c8c2b39bd3b8ad75fb0da753ca3989cec2ca758e5b60d542cfb0c39e6009d_12db9adeba3a9d05eee93dba02bb24bbd2bd553fa5e391b4607f3101447ce076_op_exp_task_33_None_7b4b9e9cfa38e0c95465b4087684ba9103d527ed24c440718c98f01d3693d041.npy
Loading: 100% 16/16 [00:00<00:00, 50.04it/s]
[INFO root 59572] Writing cache to: results/flow_12db9adeba3a9d05eee93dba02bb24bbd2bd553fa5e391b4607f3101447ce076_flow_worker_33_None_c15d067b912279587be3d3939223173fe5368154834a5a60648fc0a46950f8cf.npy
Loading: 100% 16/16 [00:00<00:00, 86.42it/s]
[INFO root 59572] Writing cache to: results/interaction_12db9adeba3a9d05eee93dba02bb24bbd2bd553fa5e391b4607f3101447ce076_interaction_energy_task_33_None_58455bf5ce6e35b96d04516e2a659a907e0c44b588167e00faa3fdf3e226bb11.npy
Loading: 100% 16/16 [00:00<00:00, 79.44it/s]
[INFO root 59572] Writing cache to: results/interaction_power_12db9adeba3a9d05eee93dba02bb24bbd2bd553fa5e391b4607f3101447ce076_interaction_energy_task_33_None_58455bf5ce6e35b96d04516e2a659a907e0c44b588167e00faa3fdf3e226bb11.npy
Loading: 100% 8/8 [00:00<00:00, 245.72it/s]
[INFO root 59572] Writing cache to: results/143e514d782a0bf3369be86475c494b0df4baa9952cf06bbf576d262f2dd27a4_12db9adeba3a9d05eee93dba02bb24bbd2bd553fa5e391b4607f3101447ce076_op_exp_task_33_None_7b4b9e9cfa38e0c95465b4087684ba9103d527ed24c440718c98f01d3693d041.npy
#+end_example
: <matplotlib.legend.Legend at 0x7fbfc42bd580>
[[file:./.ob-jupyter/229ace105ac0a848d7b968ebdfd79d9fd38dbe9e.svg]]
:END:
#+begin_src jupyter-python
fig, ax = plt.subplots()
with aux.get_data(model) as data:
power = model.interaction_power(data).sum_baths()
power = model.interaction_power(data).for_bath(0)
power_sys = model.system_power(data).sum_baths()
energy = model.total_energy_from_power(data).sum_baths()
energy = model.total_energy_from_power(data)
pu.plot_with_σ(model.t, power, ax=ax)
pu.plot_with_σ(model.t, power_sys, ax=ax, label="sys")
pu.plot_with_σ(model.t, energy, ax=ax)
@ -207,11 +217,56 @@ Now we turn the system around after each fill-cycle.
#+RESULTS:
:RESULTS:
: <matplotlib.legend.Legend at 0x7f4f974eff10>
[[file:./.ob-jupyter/c08974c4e215e1890b26e9fc9a31a376b518bfe1.svg]]
# [goto error]
#+begin_example
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Input In [97], in <cell line: 2>()
 1 fig, ax = plt.subplots()
----> 2 with aux.get_data(model) as data:
 3 power = model.interaction_power(data).for_bath(0)
 4 power_sys = model.system_power(data).sum_baths()
File ~/src/two_qubit_model/hiro_models/model_auxiliary.py:146, in get_data(model, data_path, read_only, **kwargs)
 135 return HIData(
 136 path,
 137 hi_key=model.hops_config,
 (...)
 142 **kwargs,
 143 )
 145 else:
--> 146 raise RuntimeError(f"No data found for model with hash '{hexhash}'.")
RuntimeError: No data found for model with hash '2676c736eb2bf1d2a1f37e21cda1823a3dc6b3f2cedb82509cfa6231a5232b2f'.
#+end_example
[[file:./.ob-jupyter/5285f6b51867d45830747c7d1501193929fe8fd1.svg]]
:END:
#+begin_src jupyter-python
steady_index = 6
cycle_times, cycle_indices = ut.strobe_times(model.t, ω_mod)
with aux.get_data(model) as data:
total_energies = model.total_energy_from_power(data).slice(
cycle_indices[steady_index:]
)
hot_bath_energies = (
model.bath_energy(data).for_bath(1).slice(cycle_indices[steady_index:])
)
e_diff = total_energies.slice(0) - total_energies.slice(-1)
mean_power = e_diff * (1 / (model.t[-1] - model.t[steady_index]))
efficiency = e_diff * (
1 / (hot_bath_energies.slice(0) - hot_bath_energies.slice(-1)).value
)
mean_power.value, mean_power.σ, efficiency.value
#+end_src
#+RESULTS:
| -0.011704395396932077 | 8.941753951852788e-05 | -0.6487259446355118 |
#+begin_src jupyter-python
with aux.get_data(model) as data:
ρ = data.rho_t_accum.mean[:]
@ -224,9 +279,9 @@ Now we turn the system around after each fill-cycle.
#+RESULTS:
:RESULTS:
: /nix/store/yf7vf1pic6xfwr035xywcczjm08psvpa-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/dbz51ji4p5pcppra5h7yqhwcrbqgq40v-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)
[[file:./.ob-jupyter/5dec5cced33bb9d2ede9b8805dd77daf9dfc5a24.svg]]
[[file:./.ob-jupyter/9b6dbfd5d863d78fc20ce574cf7e282bc8341b0c.svg]]
:END:
@ -244,9 +299,9 @@ Now we turn the system around after each fill-cycle.
#+RESULTS:
:RESULTS:
: /nix/store/yf7vf1pic6xfwr035xywcczjm08psvpa-python3-3.9.13-env/lib/python3.9/site-packages/qutip/bloch.py:639: UserWarning: There are no gridspecs with layoutgrids. Possibly did not call parent GridSpec with the "figure" keyword
: /nix/store/dbz51ji4p5pcppra5h7yqhwcrbqgq40v-python3-3.9.13-env/lib/python3.9/site-packages/qutip/bloch.py:639: UserWarning: There are no gridspecs with layoutgrids. Possibly did not call parent GridSpec with the "figure" keyword
: self.fig.canvas.draw()
: /nix/store/yf7vf1pic6xfwr035xywcczjm08psvpa-python3-3.9.13-env/lib/python3.9/site-packages/IPython/core/pylabtools.py:151: UserWarning: There are no gridspecs with layoutgrids. Possibly did not call parent GridSpec with the "figure" keyword
: /nix/store/dbz51ji4p5pcppra5h7yqhwcrbqgq40v-python3-3.9.13-env/lib/python3.9/site-packages/IPython/core/pylabtools.py:151: UserWarning: There are no gridspecs with layoutgrids. Possibly did not call parent GridSpec with the "figure" keyword
: fig.canvas.print_figure(bytes_io, **kw)
[[file:./.ob-jupyter/b356a7697a8328d1eb85611295a8b5bfbff2e66b.svg]]
[[file:./.ob-jupyter/7806ea3a984dc21f51c7f09f8720ae8e361465a5.svg]]
:END:

View file

@ -25,7 +25,7 @@ print(H_op, L_op, sep="\n")
t_compression = .1
t_expansion = .1
comp_ratio = .5
comp_ratio = .25
hot_switch_ratio = .8
cold_switch_ratio = .8
@ -35,7 +35,6 @@ t_cold = (1 - t_expansion - t_compression) / 2
t_cold_switch = t_cold * cold_switch_ratio / 2
t = np.linspace(0, 10, 1000)
%matplotlib inline
H_exp = SmoothStep(comp_ratio * H_op, 0, t_expansion, 2) + H_op * (1 - comp_ratio)
tt = np.linspace(0, 1, 1000)
plt.plot(tt, H_exp.operator_norm(tt))
@ -70,7 +69,7 @@ t_max = t_cycle * periods
dt = .01
model = QubitModelMutliBath(
δ=[.5, .1],
δ=[.05*4, .01*4],
ω_c=[1] * 2,
ω_s=[H_cyc.operator_norm(0) - 1, H_cyc.operator_norm(t_expansion/scale) - 1],
t=ut.linspace_with_strobe(0, t_max, int(t_max // dt), ω_mod),
@ -87,10 +86,9 @@ model = QubitModelMutliBath(
therm_methods=["tanhsinh", "fft"],
)
aux.integrate(model, 100)
aux.integrate(model, 1000)
%matplotlib inline
f, a = pu.plot_energy_overview(model, strobe_frequency=ω_mod)
f, a = pu.plot_energy_overview(model)
a.plot(model.t, model.H.operator_norm(model.t))
a.plot(model.t, model.L[0].operator_norm(model.t))
a.plot(model.t, model.L[1].operator_norm(model.t))
@ -98,9 +96,9 @@ a.legend()
fig, ax = plt.subplots()
with aux.get_data(model) as data:
power = model.interaction_power(data).sum_baths()
power = model.interaction_power(data).for_bath(0)
power_sys = model.system_power(data).sum_baths()
energy = model.total_energy_from_power(data).sum_baths()
energy = model.total_energy_from_power(data)
pu.plot_with_σ(model.t, power, ax=ax)
pu.plot_with_σ(model.t, power_sys, ax=ax, label="sys")
pu.plot_with_σ(model.t, energy, ax=ax)