update 09

This commit is contained in:
Valentin Boettcher 2022-08-15 12:10:19 +02:00
parent ee86b20c93
commit 03802808e6
No known key found for this signature in database
GPG key ID: E034E12B7AF56ACE
7 changed files with 1051 additions and 715 deletions

View file

@ -1,28 +1,29 @@
#+PROPERTY: header-args :session 09_one_qubit_otto :kernel python :pandoc no :async yes :tangle no
#+PROPERTY: header-args :session 09_one_qubit_otto :kernel python :pandoc no :async yes :tangle otto_motor.py
Herein I'll try to get a basic two-bath cycle running and touch base
with the markovian result.
* Boilerplate
#+begin_src jupyter-python :results none
import figsaver as fs
import plot_utils as pu
from hiro_models.one_qubit_model import QubitModelMutliBath, StocProcTolerances
import hiro_models.model_auxiliary as aux
import numpy as np
import qutip as qt
import utilities as ut
import stocproc
#+end_src
Init ray and silence stocproc.
#+begin_src jupyter-python
import ray
ray.shutdown()
ray.init(address='auto')
#ray.init(address='auto')
ray.init()
#+end_src
#+RESULTS:
:RESULTS:
: 2022-07-13 14:56:26,440 INFO worker.py:956 -- Connecting to existing Ray cluster at address: 141.30.17.16:6379
: 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-07-07_19-11-40_930040_398742/sockets/plasma_store.6', 'raylet_socket_name': '/tmp/ray/session_2022-07-07_19-11-40_930040_398742/sockets/raylet.2', 'webui_url': '', 'session_dir': '/tmp/ray/session_2022-07-07_19-11-40_930040_398742', 'metrics_export_port': 53497, 'gcs_address': '141.30.17.16:6379', 'address': '141.30.17.16:6379', 'node_id': 'a1b9acc4f221cb88f7c445762b2f1afb56a05388fd4a986377513e20'})
:END:
: 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'})
#+begin_src jupyter-python :results none
from hops.util.logging_setup import logging_setup
@ -39,162 +40,197 @@ Now we build a basic otto cycle.
Let's lay down some basic functionality.
#+begin_src jupyter-python
H_op = (1/2 * (qt.sigmaz() + qt.identity(2))).full()
H_op = 2*(1/2 * (qt.sigmaz() + qt.identity(2))).full()
L_op = (1/2 * qt.sigmax()).full()
L_op_2 = (1/2 * qt.sigmay()).full()
L_op_2 = (1/2 * qt.sigmax()).full()
print(H_op, L_op, sep="\n")
#+end_src
#+RESULTS:
: [[1.+0.j 0.+0.j]
: [[2.+0.j 0.+0.j]
: [0.+0.j 0.+0.j]]
: [[0. +0.j 0.5+0.j]
: [0.5+0.j 0. +0.j]]
#+begin_src jupyter-python :results none
comp_ratio = .1
t_exp_end = .1
t_hot_modulation = .1
t_hot_end = .5
t_comp_end = .6
t_cold_modulation = .1
t_cold_end = 1
t_compression = .1
t_expansion = .1
comp_ratio = .5
hot_switch_ratio = .8
cold_switch_ratio = .8
t_hot = (1 - t_expansion - t_compression) / 2
t_hot_switch = t_hot * hot_switch_ratio / 2
t_cold = (1 - t_expansion - t_compression) / 2
t_cold_switch = t_cold * cold_switch_ratio / 2
t = np.linspace(0, 10, 1000)
#+end_src
** Expansion
#+begin_src jupyter-python
%matplotlib inline
H_exp = SmoothStep(comp_ratio * H_op, 0, t_exp_end, 3) + H_op * (1 - comp_ratio)
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.derivative().operator_norm(tt))
plt.plot(tt, H_exp.operator_norm(tt))
#+end_src
#+RESULTS:
:RESULTS:
| <matplotlib.lines.Line2D | at | 0x7f92066c9e50> |
[[file:./.ob-jupyter/586c97bae17d5d7684ecc3f9937e8183a3f3d3e1.svg]]
| <matplotlib.lines.Line2D | at | 0x7f4fcc5ac130> |
[[file:./.ob-jupyter/7d4003fe9d7b0b9dffdf0ac550823de40c40b89d.svg]]
:END:
** Hot Thermalization
#+begin_src jupyter-python
L_hot = SmoothStep(L_op, t_exp_end, t_exp_end + t_hot_modulation, 3) - SmoothStep(
L_op, t_hot_end - t_hot_modulation, t_hot_end, 3
)
L_hot = SmoothStep(L_op, t_expansion, t_expansion + t_hot_switch, 2) - SmoothStep(
L_op, t_expansion + t_hot - t_hot_switch, t_expansion + t_hot, 2
)
plt.plot(tt, L_hot.operator_norm(tt))
#+end_src
#+RESULTS:
:RESULTS:
| <matplotlib.lines.Line2D | at | 0x7f9206382070> |
[[file:./.ob-jupyter/7bed2d851ddc1cfc55317d2dff986662f609ca88.svg]]
| <matplotlib.lines.Line2D | at | 0x7f4fcbdd7cd0> |
[[file:./.ob-jupyter/34a09437b2b74d4bbe12efc5c9a3e868bd7ef7e5.svg]]
:END:
** Compression
#+begin_src jupyter-python
H_comp = ConstantMatrix(H_op) - SmoothStep(comp_ratio * H_op, t_hot_end, t_comp_end, 3)
H_comp = ConstantMatrix(H_op) - SmoothStep(comp_ratio * H_op, t_expansion + t_hot, t_expansion + t_hot + t_compression, 2)
plt.plot(tt, H_comp.operator_norm(tt))
#+end_src
#+RESULTS:
:RESULTS:
| <matplotlib.lines.Line2D | at | 0x7f9205fe38e0> |
[[file:./.ob-jupyter/e6b4df328725cf5e6fca48e4d52a890dafefb35e.svg]]
| <matplotlib.lines.Line2D | at | 0x7f4fb41475b0> |
[[file:./.ob-jupyter/6a32491bdbf52e88d8447cd4e1175d3f8e13a426.svg]]
:END:
** Cold Thermalization
#+begin_src jupyter-python
L_cold = SmoothStep(L_op_2, t_comp_end, t_comp_end + t_cold_modulation, 3) - SmoothStep(
L_op_2, t_cold_end - t_cold_modulation, t_cold_end, 3
L_cold = SmoothStep(L_op_2, t_expansion + t_hot + t_compression, t_expansion + t_hot + t_compression + t_cold_switch, 3) - SmoothStep(
L_op_2, t_expansion + t_hot + t_compression + t_cold - t_cold_switch, 1, 2
)
plt.plot(tt, L_cold.operator_norm(tt))
#+end_src
#+RESULTS:
:RESULTS:
| <matplotlib.lines.Line2D | at | 0x7f9205f7c3d0> |
[[file:./.ob-jupyter/a4b3dcee48e76c03405b365f1513fae0fb337d47.svg]]
| <matplotlib.lines.Line2D | at | 0x7f4fb4128c40> |
[[file:./.ob-jupyter/e4d12af68c3403047d6de687c0d98e22db4b026c.svg]]
:END:
** Full Cycle
Now we turn the system around after each fill-cycle.
#+begin_src jupyter-python
H_cyc = Periodic(Piecewise([H_exp, H_comp], [0, t_exp_end, 1]), 1)
H_cyc = Periodic(Piecewise([H_exp, H_comp], [0, t_expansion, 1]), 1)
L = [Periodic(L_i, 1) for L_i in (L_cold, L_hot)]
H_cyc, *L = [ScaleTime(op, 2) for op in [H_cyc, *L]]
period = 1
scale = .1
H_cyc, *L = [ScaleTime(op, scale) for op in [H_cyc, *L]]
ω_mod = 2*np.pi / (period) * scale
plt.plot(t, H_cyc.operator_norm(t))
plt.plot(t, L[0].operator_norm(t))
plt.plot(t, L[1].operator_norm(t))
ω_mod
t_cycle = period/scale
periods = 20
t_max = t_cycle * periods
dt = .01
#+end_src
#+RESULTS:
:RESULTS:
| <matplotlib.lines.Line2D | at | 0x7f9205edbca0> |
[[file:./.ob-jupyter/bafb9c982efbee26edc0e3e20cd25059793ee4f3.svg]]
:END:
[[file:./.ob-jupyter/9fe28aca2667d52381ce08ef48407c6dca2028fb.svg]]
* Model
#+begin_src jupyter-python :results none
model = QubitModelMutliBath(
δ=[1, 1],
δ=[.5, .1],
ω_c=[1] * 2,
ω_s=[0, 10],
t=np.arange(0, 60, .01),
ψ_0=(qt.basis([2], [0]) + qt.basis([2], [1])*0),
ω_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),
ψ_0=(qt.basis([2], [0])*0 + qt.basis([2], [1])*1),
description=f"A simple otto cycle.",
k_max=5,
bcf_terms=[5]*2,
k_max=4,
bcf_terms=[6]*2,
truncation_scheme="simplex",
driving_process_tolerances=[StocProcTolerances(1e-3, 1e-3)] * 2,
thermal_process_tolerances=[StocProcTolerances(1e-3, 1e-3)] * 2,
T = [0, 2],
T = [1, 20],
L = L,
H = H_cyc * 10,
H = H_cyc,
therm_methods=["tanhsinh", "fft"],
)
#+end_src
#+begin_src jupyter-python
aux.integrate(model, 100)
aux.integrate(model, 200)
#+end_src
#+RESULTS:
: fc74a430-fac5-467e-ab88-1bb8c9da7e74
: [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]
#+begin_src jupyter-python
%matplotlib inline
f, a = pu.plot_energy_overview(model, strobe_frequency=ω_mod)
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))
a.legend()
#+end_src
#+RESULTS:
:RESULTS:
: <matplotlib.legend.Legend at 0x7f4f97d30be0>
[[file:./.ob-jupyter/dcb781a84fce870deba7b071bc96c4e16b39e164.svg]]
:END:
#+begin_src jupyter-python
fig, ax = plt.subplots()
with aux.get_data(model) as data:
fs.plot_with_σ(model.t, model.total_energy_from_power(data), ax=ax, label=r"$\langle H(t)\rangle$")
fs.plot_with_σ(model.t, model.bath_energy(data).for_bath(0), ax=ax, label=r"$\langle H_{B}^{(1)}\rangle$")
fs.plot_with_σ(model.t, model.bath_energy(data).for_bath(1), ax=ax, label=r"$\langle H_{B}^{(2)}\rangle$")
fs.plot_with_σ(model.t, model.system_energy(data), ax=ax, label=r"$\langle H_{S}\rangle$")
# fs.plot_with_σ(model.t, model.total_power(data), ax=ax, label=r"Power")
# ax.plot(model.t, model.H(model.t)[:,0,0].real, label="$H_{\mathrm{sys}}(t)$")
# ax.plot(model.t, model.L[0](model.t)[:,0,1].real, label="$L_C(t)$")
# ax.plot(model.t, model.L[1](model.t)[:,0,1].real, label="$L_H(t)$")
power = model.interaction_power(data).sum_baths()
power_sys = model.system_power(data).sum_baths()
energy = model.total_energy_from_power(data).sum_baths()
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)
ax.legend()
#+end_src
#+RESULTS:
: 5179bed6-d693-43de-8969-bf0dedacc8f3
:RESULTS:
: <matplotlib.legend.Legend at 0x7f4f974eff10>
[[file:./.ob-jupyter/c08974c4e215e1890b26e9fc9a31a376b518bfe1.svg]]
:END:
#+begin_src jupyter-python :results none
#+begin_src jupyter-python
with aux.get_data(model) as data:
ρ = data.rho_t_accum.mean[:]
σ_ρ = data.rho_t_accum.ensemble_std[:]
plt.plot(model.t, ρ[:, 1, 1])
xs = np.einsum("tij,ji->t", ρ, qt.sigmax().full())
ys = np.einsum("tij,ji->t", ρ, qt.sigmay().full())
zs = np.einsum("tij,ji->t", ρ, qt.sigmaz().full())
#+end_src
#+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
: return np.asarray(x, float)
[[file:./.ob-jupyter/5dec5cced33bb9d2ede9b8805dd77daf9dfc5a24.svg]]
:END:
#+begin_src jupyter-python
%matplotlib tk
b = qt.Bloch()
b.add_points([xs, ys, zs])
b.view = [20, 20]
@ -207,4 +243,10 @@ Now we turn the system around after each fill-cycle.
#+RESULTS:
[[file:./.ob-jupyter/ceddb27aeff1174b98ec49f0d1e712f58591b14c.svg]]
: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
: 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
: fig.canvas.print_figure(bytes_io, **kw)
[[file:./.ob-jupyter/b356a7697a8328d1eb85611295a8b5bfbff2e66b.svg]]
:END:

View file

@ -2,11 +2,11 @@
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1656065134,
"narHash": "sha256-oc6E6ByIw3oJaIyc67maaFcnjYOz1mMcOtHxbEf9NwQ=",
"lastModified": 1656928814,
"narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "bee6a7250dd1b01844a2de7e02e4df7d8a0a206c",
"rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249",
"type": "github"
},
"original": {
@ -17,11 +17,11 @@
},
"flake-utils_2": {
"locked": {
"lastModified": 1656065134,
"narHash": "sha256-oc6E6ByIw3oJaIyc67maaFcnjYOz1mMcOtHxbEf9NwQ=",
"lastModified": 1656928814,
"narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "bee6a7250dd1b01844a2de7e02e4df7d8a0a206c",
"rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249",
"type": "github"
},
"original": {
@ -32,11 +32,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1657533762,
"narHash": "sha256-/cxTFSMmpAb8tBp1yVga1fj+i8LB9aAxnMjYFpRMuVs=",
"lastModified": 1660305968,
"narHash": "sha256-r0X1pZCSEA6mzt5OuTA7nHuLmvnbkwgpFAh1iLIx4GU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "38860c9e91cb00f4d8cd19c7b4e36c45680c89b5",
"rev": "c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d",
"type": "github"
},
"original": {
@ -47,11 +47,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1656492412,
"narHash": "sha256-CdTRqPFyE/t/nRfnfN3fxm+OOKjeJdaDbXm7E7k+Fxc=",
"lastModified": 1658311025,
"narHash": "sha256-GqagY5YmaZB3YaO41kKcQhe5RcpS83wnsW8iCu5Znqo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "72f17cca89ec773e5845f5fa1bffcf0b7a4e2094",
"rev": "cd8d1784506a7c7eb0796772b73437e0b82fad57",
"type": "github"
},
"original": {
@ -66,11 +66,11 @@
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1656405165,
"narHash": "sha256-p2c9QAnKsiUu0a3iHAkpHkO9jAkMWCbG1HCU7/TrYc0=",
"lastModified": 1657626303,
"narHash": "sha256-O/JJ0hSBCmlx0oP8QGAlRrWn0BvlC5cj7/EZ0CCWHTU=",
"owner": "nix-community",
"repo": "poetry2nix",
"rev": "abc47c71a4920e654e7b2e4261e3e6399bbe2be6",
"rev": "920ba682377d5c0d87945c5eb6141ab8447ca509",
"type": "github"
},
"original": {
@ -94,11 +94,11 @@
"poetry2nix": "poetry2nix"
},
"locked": {
"lastModified": 1656499586,
"narHash": "sha256-tx99W8VI8xxsnPRK0zZs5V2xFo5/hfhxhrTxCQi/mQ8=",
"lastModified": 1658314126,
"narHash": "sha256-rEoZSb8bBafEd6m3xu/yQtSFlP8GZxKN15YqMZkeMaQ=",
"owner": "vale981",
"repo": "hiro-flake-utils",
"rev": "3c96df6681a2475d131a5f30e7cb02c223b7c567",
"rev": "316cd25ffd9d7afd331cbbc1429f62f30567e288",
"type": "github"
},
"original": {

View file

@ -12,7 +12,10 @@
name = "09_dynamic_two_bath_one_qubit";
shellPackages = (pkgs:
(with pkgs;
[ pyright python39Packages.jupyter sshfs arb]));
[ pyright python39Packages.jupyter sshfs arb (pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-medium
type1cm unicode-math;
})]));
python = pkgs: pkgs.python39Full;
shellOverride = (pkgs: oldAttrs: {

View file

@ -0,0 +1,125 @@
import figsaver as fs
import plot_utils as pu
from hiro_models.one_qubit_model import QubitModelMutliBath, StocProcTolerances
import hiro_models.model_auxiliary as aux
import numpy as np
import qutip as qt
import utilities as ut
import stocproc
import ray
ray.shutdown()
#ray.init(address='auto')
ray.init()
from hops.util.logging_setup import logging_setup
import logging
logging_setup(logging.INFO)
from hops.util.dynamic_matrix import SmoothStep, Periodic, ConstantMatrix, ScaleTime, Shift, Piecewise
H_op = 2*(1/2 * (qt.sigmaz() + qt.identity(2))).full()
L_op = (1/2 * qt.sigmax()).full()
L_op_2 = (1/2 * qt.sigmax()).full()
print(H_op, L_op, sep="\n")
t_compression = .1
t_expansion = .1
comp_ratio = .5
hot_switch_ratio = .8
cold_switch_ratio = .8
t_hot = (1 - t_expansion - t_compression) / 2
t_hot_switch = t_hot * hot_switch_ratio / 2
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))
L_hot = SmoothStep(L_op, t_expansion, t_expansion + t_hot_switch, 2) - SmoothStep(
L_op, t_expansion + t_hot - t_hot_switch, t_expansion + t_hot, 2
)
plt.plot(tt, L_hot.operator_norm(tt))
H_comp = ConstantMatrix(H_op) - SmoothStep(comp_ratio * H_op, t_expansion + t_hot, t_expansion + t_hot + t_compression, 2)
plt.plot(tt, H_comp.operator_norm(tt))
L_cold = SmoothStep(L_op_2, t_expansion + t_hot + t_compression, t_expansion + t_hot + t_compression + t_cold_switch, 3) - SmoothStep(
L_op_2, t_expansion + t_hot + t_compression + t_cold - t_cold_switch, 1, 2
)
plt.plot(tt, L_cold.operator_norm(tt))
H_cyc = Periodic(Piecewise([H_exp, H_comp], [0, t_expansion, 1]), 1)
L = [Periodic(L_i, 1) for L_i in (L_cold, L_hot)]
period = 1
scale = .1
H_cyc, *L = [ScaleTime(op, scale) for op in [H_cyc, *L]]
ω_mod = 2*np.pi / (period) * scale
plt.plot(t, H_cyc.operator_norm(t))
plt.plot(t, L[0].operator_norm(t))
plt.plot(t, L[1].operator_norm(t))
ω_mod
t_cycle = period/scale
periods = 20
t_max = t_cycle * periods
dt = .01
model = QubitModelMutliBath(
δ=[.5, .1],
ω_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),
ψ_0=(qt.basis([2], [0])*0 + qt.basis([2], [1])*1),
description=f"A simple otto cycle.",
k_max=4,
bcf_terms=[6]*2,
truncation_scheme="simplex",
driving_process_tolerances=[StocProcTolerances(1e-3, 1e-3)] * 2,
thermal_process_tolerances=[StocProcTolerances(1e-3, 1e-3)] * 2,
T = [1, 20],
L = L,
H = H_cyc,
therm_methods=["tanhsinh", "fft"],
)
aux.integrate(model, 200)
%matplotlib inline
f, a = pu.plot_energy_overview(model, strobe_frequency=ω_mod)
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))
a.legend()
fig, ax = plt.subplots()
with aux.get_data(model) as data:
power = model.interaction_power(data).sum_baths()
power_sys = model.system_power(data).sum_baths()
energy = model.total_energy_from_power(data).sum_baths()
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)
ax.legend()
with aux.get_data(model) as data:
ρ = data.rho_t_accum.mean[:]
σ_ρ = data.rho_t_accum.ensemble_std[:]
plt.plot(model.t, ρ[:, 1, 1])
xs = np.einsum("tij,ji->t", ρ, qt.sigmax().full())
ys = np.einsum("tij,ji->t", ρ, qt.sigmay().full())
zs = np.einsum("tij,ji->t", ρ, qt.sigmaz().full())
b = qt.Bloch()
b.add_points([xs, ys, zs])
b.view = [20, 20]
b.point_size = [0.1]
b.sphere_alpha = 0.1
b.size = [20, 20]
b.render()
b.fig

View file

@ -0,0 +1 @@
../plot_utils.py

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,2 @@
[FFT]
use_normalized_diff = True