update bath memory models

This commit is contained in:
valentin.boettcher@mailbox.tu-dresden.de 2023-05-08 13:38:45 -04:00
parent 4d76950a55
commit 0068785f47
No known key found for this signature in database
GPG key ID: E034E12B7AF56ACE
2 changed files with 458 additions and 51 deletions

View file

@ -0,0 +1,413 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="872.39952pt" height="296.39952pt" viewBox="0 0 872.39952 296.39952" xmlns="http://www.w3.org/2000/svg" version="1.1">
<metadata>
<rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<cc:Work>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:date>1980-01-01T00:00:00+00:00</dc:date>
<dc:format>image/svg+xml</dc:format>
<dc:creator>
<cc:Agent>
<dc:title>Matplotlib v3.6.2, https://matplotlib.org/</dc:title>
</cc:Agent>
</dc:creator>
</cc:Work>
</rdf:RDF>
</metadata>
<defs>
<style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style>
</defs>
<g id="figure_1">
<g id="patch_1">
<path d="M 0 296.39952
L 872.39952 296.39952
L 872.39952 0
L 0 0
z
" style="fill: #ffffff"/>
</g>
<g id="axes_1">
<g id="patch_2">
<path d="M 27.12069 273.014973
L 859.789175 273.014973
L 859.789175 9.967401
L 27.12069 9.967401
z
" style="fill: #ffffff"/>
</g>
<g id="matplotlib.axis_1">
<g id="xtick_1">
<g id="line2d_1">
<defs>
<path id="m76e8991670" d="M 0 0
L 0 3.5
" style="stroke: #000000; stroke-width: 0.8"/>
</defs>
<g>
<use xlink:href="#m76e8991670" x="27.12069" y="273.014973" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_1">
<!-- $\mathdefault{0.0}$ -->
<g transform="translate(21.710345 287.649774) scale(0.08 -0.08)">
<defs>
<path id="CMR17-30" d="M 2688 2025
C 2688 2416 2682 3080 2413 3591
C 2176 4039 1798 4198 1466 4198
C 1158 4198 768 4058 525 3597
C 269 3118 243 2524 243 2025
C 243 1661 250 1106 448 619
C 723 -39 1216 -128 1466 -128
C 1760 -128 2208 -7 2470 600
C 2662 1042 2688 1559 2688 2025
z
M 1466 -26
C 1056 -26 813 325 723 812
C 653 1188 653 1738 653 2096
C 653 2588 653 2997 736 3387
C 858 3929 1216 4096 1466 4096
C 1728 4096 2067 3923 2189 3400
C 2272 3036 2278 2607 2278 2096
C 2278 1680 2278 1169 2202 792
C 2067 95 1690 -26 1466 -26
z
" transform="scale(0.015625)"/>
<path id="CMMI12-3a" d="M 1178 307
C 1178 492 1024 619 870 619
C 685 619 557 466 557 313
C 557 128 710 0 864 0
C 1050 0 1178 153 1178 307
z
" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#CMR17-30" transform="scale(0.996264)"/>
<use xlink:href="#CMMI12-3a" transform="translate(45.690477 0) scale(0.996264)"/>
<use xlink:href="#CMR17-30" transform="translate(72.787654 0) scale(0.996264)"/>
</g>
</g>
</g>
<g id="xtick_2">
<g id="line2d_2">
<g>
<use xlink:href="#m76e8991670" x="193.654387" y="273.014973" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_2">
<!-- $\mathdefault{0.2}$ -->
<g transform="translate(188.244042 287.649774) scale(0.08 -0.08)">
<defs>
<path id="CMR17-32" d="M 2669 989
L 2554 989
C 2490 536 2438 459 2413 420
C 2381 369 1920 369 1830 369
L 602 369
C 832 619 1280 1072 1824 1597
C 2214 1967 2669 2402 2669 3035
C 2669 3790 2067 4224 1395 4224
C 691 4224 262 3604 262 3030
C 262 2780 448 2748 525 2748
C 589 2748 781 2787 781 3010
C 781 3207 614 3264 525 3264
C 486 3264 448 3258 422 3245
C 544 3790 915 4058 1306 4058
C 1862 4058 2227 3617 2227 3035
C 2227 2479 1901 2000 1536 1584
L 262 146
L 262 0
L 2515 0
L 2669 989
z
" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#CMR17-30" transform="scale(0.996264)"/>
<use xlink:href="#CMMI12-3a" transform="translate(45.690477 0) scale(0.996264)"/>
<use xlink:href="#CMR17-32" transform="translate(72.787654 0) scale(0.996264)"/>
</g>
</g>
</g>
<g id="xtick_3">
<g id="line2d_3">
<g>
<use xlink:href="#m76e8991670" x="360.188084" y="273.014973" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_3">
<!-- $\mathdefault{0.4}$ -->
<g transform="translate(354.777739 287.649774) scale(0.08 -0.08)">
<defs>
<path id="CMR17-34" d="M 2150 4122
C 2150 4256 2144 4256 2029 4256
L 128 1254
L 128 1088
L 1779 1088
L 1779 457
C 1779 224 1766 160 1318 160
L 1197 160
L 1197 0
C 1402 0 1747 0 1965 0
C 2182 0 2528 0 2733 0
L 2733 160
L 2611 160
C 2163 160 2150 224 2150 457
L 2150 1088
L 2803 1088
L 2803 1254
L 2150 1254
L 2150 4122
z
M 1798 3703
L 1798 1254
L 256 1254
L 1798 3703
z
" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#CMR17-30" transform="scale(0.996264)"/>
<use xlink:href="#CMMI12-3a" transform="translate(45.690477 0) scale(0.996264)"/>
<use xlink:href="#CMR17-34" transform="translate(72.787654 0) scale(0.996264)"/>
</g>
</g>
</g>
<g id="xtick_4">
<g id="line2d_4">
<g>
<use xlink:href="#m76e8991670" x="526.721781" y="273.014973" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_4">
<!-- $\mathdefault{0.6}$ -->
<g transform="translate(521.311436 287.649774) scale(0.08 -0.08)">
<defs>
<path id="CMR17-36" d="M 678 2176
C 678 3690 1395 4032 1811 4032
C 1946 4032 2272 4009 2400 3776
C 2298 3776 2106 3776 2106 3553
C 2106 3381 2246 3323 2336 3323
C 2394 3323 2566 3348 2566 3560
C 2566 3954 2246 4179 1805 4179
C 1043 4179 243 3390 243 1984
C 243 253 966 -128 1478 -128
C 2099 -128 2688 427 2688 1283
C 2688 2081 2170 2662 1517 2662
C 1126 2662 838 2407 678 1960
L 678 2176
z
M 1478 25
C 691 25 691 1200 691 1436
C 691 1896 909 2560 1504 2560
C 1613 2560 1926 2560 2138 2120
C 2253 1870 2253 1609 2253 1289
C 2253 944 2253 690 2118 434
C 1978 171 1773 25 1478 25
z
" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#CMR17-30" transform="scale(0.996264)"/>
<use xlink:href="#CMMI12-3a" transform="translate(45.690477 0) scale(0.996264)"/>
<use xlink:href="#CMR17-36" transform="translate(72.787654 0) scale(0.996264)"/>
</g>
</g>
</g>
<g id="xtick_5">
<g id="line2d_5">
<g>
<use xlink:href="#m76e8991670" x="693.255478" y="273.014973" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_5">
<!-- $\mathdefault{0.8}$ -->
<g transform="translate(687.845133 287.649774) scale(0.08 -0.08)">
<defs>
<path id="CMR17-38" d="M 1741 2264
C 2144 2467 2554 2773 2554 3263
C 2554 3841 1990 4179 1472 4179
C 890 4179 378 3759 378 3180
C 378 3021 416 2747 666 2505
C 730 2442 998 2251 1171 2130
C 883 1983 211 1634 211 934
C 211 279 838 -128 1459 -128
C 2144 -128 2720 362 2720 1010
C 2720 1590 2330 1857 2074 2029
L 1741 2264
z
M 902 2822
C 851 2854 595 3051 595 3351
C 595 3739 998 4032 1459 4032
C 1965 4032 2336 3676 2336 3262
C 2336 2669 1670 2331 1638 2331
C 1632 2331 1626 2331 1574 2370
L 902 2822
z
M 2080 1519
C 2176 1449 2483 1240 2483 851
C 2483 381 2010 25 1472 25
C 890 25 448 438 448 940
C 448 1443 838 1862 1280 2060
L 2080 1519
z
" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#CMR17-30" transform="scale(0.996264)"/>
<use xlink:href="#CMMI12-3a" transform="translate(45.690477 0) scale(0.996264)"/>
<use xlink:href="#CMR17-38" transform="translate(72.787654 0) scale(0.996264)"/>
</g>
</g>
</g>
<g id="xtick_6">
<g id="line2d_6">
<g>
<use xlink:href="#m76e8991670" x="859.789175" y="273.014973" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_6">
<!-- $\mathdefault{1.0}$ -->
<g transform="translate(854.37883 287.649774) scale(0.08 -0.08)">
<defs>
<path id="CMR17-31" d="M 1702 4058
C 1702 4192 1696 4192 1606 4192
C 1357 3916 979 3827 621 3827
C 602 3827 570 3827 563 3808
C 557 3795 557 3782 557 3648
C 755 3648 1088 3686 1344 3839
L 1344 461
C 1344 236 1331 160 781 160
L 589 160
L 589 0
C 896 0 1216 0 1523 0
C 1830 0 2150 0 2458 0
L 2458 160
L 2266 160
C 1715 160 1702 230 1702 458
L 1702 4058
z
" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#CMR17-31" transform="scale(0.996264)"/>
<use xlink:href="#CMMI12-3a" transform="translate(45.690477 0) scale(0.996264)"/>
<use xlink:href="#CMR17-30" transform="translate(72.787654 0) scale(0.996264)"/>
</g>
</g>
</g>
</g>
<g id="matplotlib.axis_2">
<g id="ytick_1">
<g id="line2d_7">
<defs>
<path id="m49a7d799ff" d="M 0 0
L -3.5 0
" style="stroke: #000000; stroke-width: 0.8"/>
</defs>
<g>
<use xlink:href="#m49a7d799ff" x="27.12069" y="273.014973" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_7">
<!-- $\mathdefault{0.0}$ -->
<g transform="translate(7.2 275.782373) scale(0.08 -0.08)">
<use xlink:href="#CMR17-30" transform="scale(0.996264)"/>
<use xlink:href="#CMMI12-3a" transform="translate(45.690477 0) scale(0.996264)"/>
<use xlink:href="#CMR17-30" transform="translate(72.787654 0) scale(0.996264)"/>
</g>
</g>
</g>
<g id="ytick_2">
<g id="line2d_8">
<g>
<use xlink:href="#m49a7d799ff" x="27.12069" y="220.405458" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_8">
<!-- $\mathdefault{0.2}$ -->
<g transform="translate(7.2 223.172859) scale(0.08 -0.08)">
<use xlink:href="#CMR17-30" transform="scale(0.996264)"/>
<use xlink:href="#CMMI12-3a" transform="translate(45.690477 0) scale(0.996264)"/>
<use xlink:href="#CMR17-32" transform="translate(72.787654 0) scale(0.996264)"/>
</g>
</g>
</g>
<g id="ytick_3">
<g id="line2d_9">
<g>
<use xlink:href="#m49a7d799ff" x="27.12069" y="167.795944" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_9">
<!-- $\mathdefault{0.4}$ -->
<g transform="translate(7.2 170.563345) scale(0.08 -0.08)">
<use xlink:href="#CMR17-30" transform="scale(0.996264)"/>
<use xlink:href="#CMMI12-3a" transform="translate(45.690477 0) scale(0.996264)"/>
<use xlink:href="#CMR17-34" transform="translate(72.787654 0) scale(0.996264)"/>
</g>
</g>
</g>
<g id="ytick_4">
<g id="line2d_10">
<g>
<use xlink:href="#m49a7d799ff" x="27.12069" y="115.18643" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_10">
<!-- $\mathdefault{0.6}$ -->
<g transform="translate(7.2 117.95383) scale(0.08 -0.08)">
<use xlink:href="#CMR17-30" transform="scale(0.996264)"/>
<use xlink:href="#CMMI12-3a" transform="translate(45.690477 0) scale(0.996264)"/>
<use xlink:href="#CMR17-36" transform="translate(72.787654 0) scale(0.996264)"/>
</g>
</g>
</g>
<g id="ytick_5">
<g id="line2d_11">
<g>
<use xlink:href="#m49a7d799ff" x="27.12069" y="62.576915" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_11">
<!-- $\mathdefault{0.8}$ -->
<g transform="translate(7.2 65.344316) scale(0.08 -0.08)">
<use xlink:href="#CMR17-30" transform="scale(0.996264)"/>
<use xlink:href="#CMMI12-3a" transform="translate(45.690477 0) scale(0.996264)"/>
<use xlink:href="#CMR17-38" transform="translate(72.787654 0) scale(0.996264)"/>
</g>
</g>
</g>
<g id="ytick_6">
<g id="line2d_12">
<g>
<use xlink:href="#m49a7d799ff" x="27.12069" y="9.967401" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_12">
<!-- $\mathdefault{1.0}$ -->
<g transform="translate(7.2 12.734802) scale(0.08 -0.08)">
<use xlink:href="#CMR17-31" transform="scale(0.996264)"/>
<use xlink:href="#CMMI12-3a" transform="translate(45.690477 0) scale(0.996264)"/>
<use xlink:href="#CMR17-30" transform="translate(72.787654 0) scale(0.996264)"/>
</g>
</g>
</g>
</g>
<g id="patch_3">
<path d="M 27.12069 273.014973
L 27.12069 9.967401
" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/>
</g>
<g id="patch_4">
<path d="M 859.789175 273.014973
L 859.789175 9.967401
" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/>
</g>
<g id="patch_5">
<path d="M 27.12069 273.014973
L 859.789175 273.014973
" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/>
</g>
<g id="patch_6">
<path d="M 27.12069 9.967401
L 859.789175 9.967401
" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -35,16 +35,18 @@ We take the same baseline as in [[id:c06111fd-d719-433d-a316-c163f6e1d384][cycle
But we vary the cycle speed while keeping a fixed proportion
coupling-change/cycle time.
#+begin_src jupyter-python
def make_shift_model(shift_c, shift_h, switch_t=3):
switch_time = switch_t / 50
T = 50
def make_model_orig(shift_c, shift_h, switch_t=6.0, switch_t_sys=None, only_cold=False):
switch_time = switch_t / T
switch_time_sys = (switch_t_sys if switch_t_sys else switch_t) / T
(p_H, p_L) = ot.timings(switch_time, switch_time)
(p_H, p_L) = ot.timings(switch_time_sys, switch_time)
return OttoEngine(
δ=[.7, .7],
δ=[0.7, 0.7],
ω_c=[1, 1],
ψ_0=qt.basis([2], [1]),
description=f"Classic Cycle",
k_max=5,
k_max=4,
bcf_terms=[5] * 2,
truncation_scheme="simplex",
driving_process_tolerances=[StocProcTolerances(1e-3, 1e-3)] * 2,
@ -59,30 +61,11 @@ coupling-change/cycle time.
timings_L=p_L,
streaming_mode=True,
shift_to_resonance=(False, False),
L_shift=(shift_c, shift_h),
L_shift=(shift_c, 0 if only_cold else shift_h),
)
def overlap(shift_model, N, step, switch_t=6):
switch_time = switch_t / 50
next_model = shift_model.copy()
(p_H, p_L) = ot.timings(switch_time, switch_time)
#next_model.timings_H=p_H
next_model.timings_L=p_L
(a, b, c, d) = next_model.timings_L[0]
(e, f, g, h) = next_model.timings_L[1]
next_step = step * N
(s1, s2) = next_model.L_shift
next_model.L_shift = (s1 + next_step, s2 - next_step)
next_model.timings_L = (
(a - 2 * next_step, b - 2 * next_step, c, d),
(e, f, g + 2 * next_step, h + 2 * next_step),
)
return next_model
def make_model(ω_c, T_c):
model = make_shift_model(0,0, switch_t = 6)
model = make_model_orig(0, 0, switch_t = 6)
model.T[0] = T_c
@ -133,33 +116,44 @@ coupling-change/cycle time.
#+RESULTS:
:RESULTS:
# [goto error]
#+begin_example
-0.006065467070030933 0.4 0.5
-0.005591602311099003 0.45 0.5
-0.005066588783212114 0.5 0.5
-0.0046201846177245775 0.55 0.5
-0.00408269304017506 0.6 0.5
-0.006277295645870186 0.4 0.75
-0.005888697577101804 0.45 0.75
-0.005484333955351765 0.5 0.75
-0.005117002574808731 0.55 0.75
[WARNING root 224434] Adding values with unequal snapshot count discards the snapshots.
-0.004696002795276426 0.6 0.75
-0.006000498375072689 0.4 1.0
-0.005633957523771339 0.45 1.0
-0.00525600486961774 0.5 1.0
-0.004911341531730341 0.55 1.0
-0.004569773623536163 0.6 1.0
-0.005729676547086812 0.4 1.25
-0.00534616431006602 0.45 1.25
-0.0051525733640570715 0.5 1.25
[WARNING root 224434] Adding values with unequal snapshot count discards the snapshots.
-0.004753746829381626 0.55 1.25
-0.004446193855257419 0.6 1.25
-0.00565830944810612 0.4 1.5
-0.005324957406115274 0.45 1.5
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[19], line 3
 1 fig, ax = plt.subplots()
 2 for model in models[:22]:
----> 3 pu.plot_with_σ(models[0].t, model.interaction_power().sum_baths().integrate(model.t), ax=ax)
 4 print(model.power(steady_idx=2).value, model.T[0], model.ω_c[0])
File ~/src/two_qubit_model/hiro_models/model_base.py:560, in Model.interaction_power(self, data, results_path, **kwargs)
 550 """Calculates interaction power from the hierarchy data
 551 ``data`` or, if not supplied, tries to load the online results from ``results_path``.
 552
 (...)
 556 :returns: See :any:`hopsflow.util.interaction_energy_ensemble`.
 557 """
 559 if data is None:
--> 560 return self.try_get_online_data(
 561  results_path, self.online_interaction_power_name
 562  )
 564 N, kwargs = _get_N_kwargs(kwargs, data)
 566 return hopsflow.hopsflow.interaction_energy_ensemble(
 567 data.valid_sample_iterator(data.stoc_traj), # type: ignore
 568 data.valid_sample_iterator(data.aux_states), # type: ignore
 (...)
 574 **kwargs,
 575 )
File ~/src/two_qubit_model/hiro_models/model_base.py:298, in Model.try_get_online_data(self, path, results_path)
 296 file_path = os.path.join(path, results_path)
 297 if not os.path.exists(file_path):
--> 298 raise RuntimeError(f"No data found under '{file_path}'.")
 300 return hopsflow.util.get_online_values_from_cache(file_path)
RuntimeError: No data found under 'results/interaction_power_922443c7c9913a4ba2ddbfd8792ec54f664d39dabe87377a2ab559a7fb96e0c4.npz'.
#+end_example
[[file:./.ob-jupyter/4dedad5fb97c7875383b7ce3db9307f295f3cd18.svg]]
[[file:./.ob-jupyter/ab84f357c909d82e98cfd1f6037a2cadeea34ed0.svg]]
:END:
#+begin_src jupyter-python