monster commit

This commit is contained in:
valentin.boettcher@mailbox.tu-dresden.de 2023-02-12 17:36:04 -05:00
parent 77e3bbaabd
commit 8be5d72685
No known key found for this signature in database
GPG key ID: E034E12B7AF56ACE
14 changed files with 7671 additions and 4792 deletions

View file

@ -107,7 +107,6 @@ All nice and good, but we need concrete plans.
***** TODO Cycle Length + Coupling Strength
:LOGBOOK:
CLOCK: [2022-12-12 Mon 15:39]
CLOCK: [2022-12-12 Mon 14:45]--[2022-12-12 Mon 15:34] => 0:49
CLOCK: [2022-12-12 Mon 14:05]--[2022-12-12 Mon 14:40] => 0:35
CLOCK: [2022-12-12 Mon 13:29]--[2022-12-12 Mon 13:58] => 0:29
@ -172,69 +171,5 @@ CLOCK: [2022-11-24 Thu 11:51]--[2022-11-24 Thu 12:06] => 0:15
** TODO sort out richards libraries
* Nice to Haves
** HOLD test online calc
** HOLD test dynamic matrix
* Clock Report
- the first days are pretty broken. emacs crashed etc...
#+BEGIN: clocktable :scope file :step day :tstart "<-1w>" :tend "<now>" :compact nil
Daily report: [2022-11-21 Mon]
| Headline | Time |
|--------------+--------|
| *Total time* | *0:00* |
Daily report: [2022-11-22 Tue]
| Headline | Time |
|--------------+--------|
| *Total time* | *0:00* |
Daily report: [2022-11-23 Wed]
| Headline | Time | |
|----------------+--------+------|
| *Total time* | *1:49* | |
|----------------+--------+------|
| Tasks | 1:49 | |
| \_ Merge HOPS | | 1:49 |
Daily report: [2022-11-24 Thu]
| Headline | Time | |
|------------------------------------------+--------+------|
| *Total time* | *2:01* | |
|------------------------------------------+--------+------|
| Tasks | 2:01 | |
| \_ Merge HOPS | | 0:03 |
| \_ Set up HO calcs with online analysis | | 1:58 |
Daily report: [2022-11-25 Fri]
| Headline | Time | |
|------------------------------------------+--------+------|
| *Total time* | *2:00* | |
|------------------------------------------+--------+------|
| Tasks | 2:00 | |
| \_ Set up HO calcs with online analysis | | 2:00 |
Daily report: [2022-11-26 Sat]
| Headline | Time | |
|------------------------------------------+--------+------|
| *Total time* | *1:52* | |
|------------------------------------------+--------+------|
| Tasks | 1:52 | |
| \_ Set up HO calcs with online analysis | | 1:52 |
Daily report: [2022-11-27 Sun]
| Headline | Time |
|--------------+--------|
| *Total time* | *0:00* |
Daily report: [2022-11-28 Mon]
| Headline | Time | |
|------------------------------------------+--------+------|
| *Total time* | *3:44* | |
|------------------------------------------+--------+------|
| Outline | 1:35 | |
| \_ Application | | 1:35 |
| Tasks | 2:09 | |
| \_ Set up HO calcs with online analysis | | 2:09 |
#+END:
** SOMEDAY test online calc
** SOMEDAY test dynamic matrix

View file

@ -41,3 +41,47 @@ model = OttoEngine(
streaming_mode=True,
# solver_args=dict(rtol=1e-3, atol=1e-3)
)
import figsaver as fs
import plot_utils as pu
from hiro_models.one_qubit_model import StocProcTolerances
from hiro_models.otto_cycle import OttoEngine
import hiro_models.model_auxiliary as aux
import numpy as np
import qutip as qt
import utilities as ut
import stocproc
import matplotlib.pyplot as plt
import otto_utilities as ot
import ray
ray.shutdown()
#ray.init(address='auto')
ray.init()
from hops.util.logging_setup import logging_setup
import logging
logging_setup(logging.INFO)
plt.rcParams['figure.figsize'] = (12,4)
model = OttoEngine(
δ=[0.4, 0.4],
ω_c=[1, 1],
ψ_0=qt.basis([2], [1]),
description=f"A basic near-markovian, weakly coupled Otto Cycle that actually works.",
k_max=4,
bcf_terms=[6] * 2,
truncation_scheme="simplex",
driving_process_tolerances=[StocProcTolerances(1e-4, 1e-4)] * 2,
thermal_process_tolerances=[StocProcTolerances(1e-4, 1e-4)] * 2,
T=[1, 10],
therm_methods=["tanhsinh", "fft"],
Δ=1,
num_cycles=5,
Θ=1.5 / 0.05,
dt=0.001,
timings_H=(0, 0.1, 0.5, 0.6),
timings_L=((0.6, 0.7, 0.9, 1), (0.1, 0.2, 0.4, 0.5)),
streaming_mode=True,
# solver_args=dict(rtol=1e-3, atol=1e-3)
)

View file

@ -42,3 +42,48 @@ model = OttoEngine(
)
ot.plot_cycle(model)
import figsaver as fs
import plot_utils as pu
from hiro_models.one_qubit_model import StocProcTolerances
from hiro_models.otto_cycle import OttoEngine
import hiro_models.model_auxiliary as aux
import numpy as np
import qutip as qt
import utilities as ut
import stocproc
import matplotlib.pyplot as plt
import otto_utilities as ot
import ray
ray.shutdown()
#ray.init(address='auto')
ray.init()
from hops.util.logging_setup import logging_setup
import logging
logging_setup(logging.INFO)
plt.rcParams['figure.figsize'] = (12,4)
model = OttoEngine(
δ=[0.4, 0.4],
ω_c=[1, 1],
ψ_0=qt.basis([2], [1]),
description=f"A basic near-markovian, weakly coupled Otto Cycle that actually works.",
k_max=4,
bcf_terms=[6] * 2,
truncation_scheme="simplex",
driving_process_tolerances=[StocProcTolerances(1e-4, 1e-4)] * 2,
thermal_process_tolerances=[StocProcTolerances(1e-4, 1e-4)] * 2,
T=[1, 10],
therm_methods=["tanhsinh", "fft"],
Δ=1,
num_cycles=5,
Θ=1.5 / 0.05,
dt=0.001,
timings_H=(0, 0.1, 0.5, 0.6),
timings_L=(None, None),
streaming_mode=True,
)
ot.plot_cycle(model)

View file

@ -97,3 +97,103 @@ model_fft.therm_methods = ["fft", "fft"]
ot.plot_cycle(model)
ot.plot_sd_overview(model)
import figsaver as fs
import plot_utils as pu
from hiro_models.one_qubit_model import StocProcTolerances
from hiro_models.otto_cycle import OttoEngine
import hiro_models.model_auxiliary as aux
import numpy as np
import qutip as qt
import utilities as ut
import stocproc
import matplotlib.pyplot as plt
import otto_utilities as ot
import ray
ray.shutdown()
#ray.init(address='auto')
ray.init()
from hops.util.logging_setup import logging_setup
import logging
logging_setup(logging.INFO)
plt.rcParams['figure.figsize'] = (12,4)
model = OttoEngine(
δ=[0.4, 0.4],
ω_c=[1, 1],
ψ_0=qt.basis([2], [1]),
description=f"A basic near-markovian, weakly coupled Otto Cycle that actually works.",
k_max=4,
bcf_terms=[6] * 2,
truncation_scheme="simplex",
driving_process_tolerances=[StocProcTolerances(1e-4, 1e-4)] * 2,
thermal_process_tolerances=[StocProcTolerances(1e-4, 1e-4)] * 2,
T=[1, 10],
therm_methods=["tanhsinh", "tanhsinh"],
Δ=1,
num_cycles=5,
Θ=1.5 / 0.05,
dt=0.001,
timings_H=(0, 0.1, 0.5, 0.6),
timings_L=((0.6, 0.7, 0.9, 1), (0.1, 0.2, 0.4, 0.5)),
streaming_mode=True,
shift_to_resonance=(False, False),
# solver_args=dict(rtol=1e-3, atol=1e-3)
)
ot.plot_cycle(model)
ot.plot_sd_overview(model)
import figsaver as fs
import plot_utils as pu
from hiro_models.one_qubit_model import StocProcTolerances
from hiro_models.otto_cycle import OttoEngine
import hiro_models.model_auxiliary as aux
import numpy as np
import qutip as qt
import utilities as ut
import stocproc
import matplotlib.pyplot as plt
import otto_utilities as ot
import ray
ray.shutdown()
#ray.init(address='auto')
ray.init()
from hops.util.logging_setup import logging_setup
import logging
logging_setup(logging.INFO)
plt.rcParams['figure.figsize'] = (12,4)
model = OttoEngine(
δ=[0.4, 0.4],
ω_c=[2, 2],
ψ_0=qt.basis([2], [1]),
description=f"A basic near-markovian, weakly coupled Otto Cycle without the shift.",
k_max=3,
bcf_terms=[4] * 2,
truncation_scheme="simplex",
driving_process_tolerances=[StocProcTolerances(1e-4, 1e-4)] * 2,
thermal_process_tolerances=[StocProcTolerances(1e-4, 1e-4)] * 2,
T=[0, 2],
therm_methods=["tanhsinh", "tanhsinh"],
Δ=1,
num_cycles=1,
Θ=1.5 / 0.05,
dt=0.001,
timings_H=(0, 0.1, 0.5, 0.6),
timings_L=((0.6, 0.7, 0.9, 1), (0.1, 0.2, 0.4, 0.5)),
streaming_mode=True,
shift_to_resonance=(False, False),
#ω_s_extra=[.1, .1],
)
model_fft = model.copy()
model_fft.therm_methods = ["fft", "fft"]
ot.plot_cycle(model)
ot.plot_sd_overview(model)

File diff suppressed because it is too large Load diff

View file

@ -19,3 +19,25 @@ from hops.util.logging_setup import logging_setup
import logging
logging_setup(logging.INFO)
plt.rcParams['figure.figsize'] = (12,4)
import figsaver as fs
import plot_utils as pu
from hiro_models.one_qubit_model import StocProcTolerances
from hiro_models.otto_cycle import OttoEngine
import hiro_models.model_auxiliary as aux
import numpy as np
import qutip as qt
import utilities as ut
import stocproc
import matplotlib.pyplot as plt
import otto_utilities as ot
import ray
ray.shutdown()
#ray.init(address='auto')
ray.init()
from hops.util.logging_setup import logging_setup
import logging
logging_setup(logging.INFO)
plt.rcParams['figure.figsize'] = (12,4)

View file

@ -165,20 +165,15 @@ def integrate_online(model, n, stream_folder=None, **kwargs):
def integrate_online_multi(models, n, *args, increment=1000, **kwargs):
target = increment
samples = []
while target < (n + target):
for model, s in zip(models, samples):
for model in models:
integrate_online(model, min([n, target]), *args, **kwargs)
target += increment
def plot_3d_heatmap(models, value_accessor, x_spec, y_spec):
f, _ = plt.subplots()
ax1 = plt.gcf().add_subplot(111, projection="3d")
@pu.wrap_plot
def plot_3d_heatmap(models, value_accessor, x_spec, y_spec, normalize=False, ax=None):
value_dict = {}
x_labels = set()
y_labels = set()
@ -221,8 +216,21 @@ def plot_3d_heatmap(models, value_accessor, x_spec, y_spec):
cmap = plt.get_cmap("plasma")
colors = [cmap(power) for power in normalized_values]
ax1.bar3d(x, y, np.zeros_like(values), dx, dy, values, color=colors)
ax1.set_xticks(x_labels)
ax1.set_yticks(y_labels)
ax.bar3d(
x,
y,
np.zeros_like(values),
dx,
dy,
values / abs(values).max() if normalize else values,
color=colors,
)
ax.set_xticks(x_labels)
ax.set_yticks(y_labels)
return f, ax1
def val_relative_to_steady(model, val, steady_idx):
begin_idx = model.strobe[1][steady_idx]
return model.t[begin_idx:], (
val.slice(slice(begin_idx - 1, -1, 1)) - val.slice(begin_idx - 1)
)

View file

@ -67,9 +67,23 @@ category = "main"
optional = false
python-versions = "*"
[[package]]
name = "bayesian-optimization"
version = "1.4.2"
description = "Bayesian Optimization package"
category = "main"
optional = false
python-versions = ">= 3.7"
[package.dependencies]
colorama = ">=0.4.6"
numpy = ">=1.9.0"
scikit-learn = ">=0.18.0"
scipy = ">=1.0.0"
[[package]]
name = "beartype"
version = "0.12.0"
version = "0.12.1"
description = "Unbearably fast runtime type checking in pure Python."
category = "main"
optional = false
@ -78,8 +92,8 @@ develop = false
[package.extras]
all = ["typing_extensions (>=3.10.0.0)"]
dev = ["autoapi (>=0.9.0)", "coverage (>=5.5)", "mypy (>=0.800)", "numpy", "pytest (>=4.0.0)", "sphinx", "sphinx (>=4.1.0)", "tox (>=3.20.1)", "typing_extensions"]
doc-rtd = ["furo (==2022.6.21)", "sphinx (==4.1.0)"]
dev = ["autoapi (>=0.9.0)", "coverage (>=5.5)", "furo (>=2022.6.21)", "mypy (>=0.800)", "numpy", "pytest (>=4.0.0)", "sphinx", "sphinx (>=4.2.0)", "tox (>=3.20.1)", "typing_extensions"]
doc-rtd = ["autoapi (>=0.9.0)", "furo (>=2022.6.21)", "sphinx (>=4.2.0)"]
test-tox = ["mypy (>=0.800)", "numpy", "pytest (>=4.0.0)", "sphinx", "typing_extensions"]
test-tox-coverage = ["coverage (>=5.5)"]
@ -87,7 +101,7 @@ test-tox-coverage = ["coverage (>=5.5)"]
type = "git"
url = "https://github.com/beartype/beartype"
reference = "main"
resolved_reference = "e69d7553a0f73746afe1f16eba551a31115f51f2"
resolved_reference = "09a48e8b07bf9faa1409aea7d24f49e6129fda1f"
[[package]]
name = "binfootprint"
@ -372,7 +386,7 @@ qutip = "^4.6.3"
type = "git"
url = "git@github.com:vale981/two_qubit_model.git"
reference = "main"
resolved_reference = "86ef9fa64661c31f30d64efc440f87282061abdd"
resolved_reference = "17c12cd8c99ae9c6c1076b2b16912e3bea3e6fba"
[[package]]
name = "hops"
@ -407,7 +421,7 @@ plotting = ["matplotlib (>=3.5.0,<4.0.0)"]
type = "git"
url = "git@gitlab.hrz.tu-chemnitz.de:s8896854--tu-dresden.de/hops.git"
reference = "main"
resolved_reference = "573274ec04be0a65f0e035885ce387247887b1e8"
resolved_reference = "768c58683e3f944da1bc0be54ea062f49141b5e8"
[[package]]
name = "hopsflow"
@ -433,7 +447,7 @@ tqdm = "^4.62.3"
type = "git"
url = "https://github.com/vale981/hopsflow"
reference = "main"
resolved_reference = "30f42cd654d5a525e823d55e60a6d2a68fe91875"
resolved_reference = "800b3e2c4a5ab0c3a956c74a19c3b824897332e4"
[[package]]
name = "humanfriendly"
@ -505,6 +519,14 @@ docs = ["Jinja2 (==2.11.3)", "MarkupSafe (==1.1.1)", "Pygments (==2.8.1)", "alab
qa = ["flake8 (==3.8.3)", "mypy (==0.782)"]
testing = ["Django (<3.1)", "attrs", "colorama", "docopt", "pytest (<7.0.0)"]
[[package]]
name = "joblib"
version = "1.2.0"
description = "Lightweight pipelining with Python functions"
category = "main"
optional = false
python-versions = ">=3.7"
[[package]]
name = "jsonschema"
version = "4.17.3"
@ -944,6 +966,26 @@ urllib3 = ">=1.21.1,<1.27"
socks = ["PySocks (>=1.5.6,!=1.5.7)"]
use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"]
[[package]]
name = "scikit-learn"
version = "1.2.1"
description = "A set of python modules for machine learning and data mining"
category = "main"
optional = false
python-versions = ">=3.8"
[package.dependencies]
joblib = ">=1.1.1"
numpy = ">=1.17.3"
scipy = ">=1.3.2"
threadpoolctl = ">=2.0.0"
[package.extras]
benchmark = ["matplotlib (>=3.1.3)", "memory-profiler (>=0.57.0)", "pandas (>=1.0.5)"]
docs = ["Pillow (>=7.1.2)", "matplotlib (>=3.1.3)", "memory-profiler (>=0.57.0)", "numpydoc (>=1.2.0)", "pandas (>=1.0.5)", "plotly (>=5.10.0)", "pooch (>=1.6.0)", "scikit-image (>=0.16.2)", "seaborn (>=0.9.0)", "sphinx (>=4.0.1)", "sphinx-gallery (>=0.7.0)", "sphinx-prompt (>=1.3.0)", "sphinxext-opengraph (>=0.4.2)"]
examples = ["matplotlib (>=3.1.3)", "pandas (>=1.0.5)", "plotly (>=5.10.0)", "pooch (>=1.6.0)", "scikit-image (>=0.16.2)", "seaborn (>=0.9.0)"]
tests = ["black (>=22.3.0)", "flake8 (>=3.8.2)", "matplotlib (>=3.1.3)", "mypy (>=0.961)", "numpydoc (>=1.2.0)", "pandas (>=1.0.5)", "pooch (>=1.6.0)", "pyamg (>=4.0.0)", "pytest (>=5.3.1)", "pytest-cov (>=2.9.0)", "scikit-image (>=0.16.2)"]
[[package]]
name = "scipy"
version = "1.8.1"
@ -1093,6 +1135,14 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
[package.extras]
widechars = ["wcwidth"]
[[package]]
name = "threadpoolctl"
version = "3.1.0"
description = "threadpoolctl"
category = "main"
optional = false
python-versions = ">=3.6"
[[package]]
name = "tomli"
version = "1.2.3"
@ -1212,7 +1262,7 @@ python-versions = "*"
[metadata]
lock-version = "1.1"
python-versions = ">=3.9,<3.11"
content-hash = "4cef9d772d2030a78b143bed3b00a87586bfb95e08673f5b740dad33856ead15"
content-hash = "6b3cbda9dcdbfa846987bc7a4293e3976438ab5b8820e924d4c7be02fe4cb83e"
[metadata.files]
aiosignal = [
@ -1239,6 +1289,10 @@ backcall = [
{file = "backcall-0.2.0-py2.py3-none-any.whl", hash = "sha256:fbbce6a29f263178a1f7915c1940bde0ec2b2a967566fe1c65c1dfb7422bd255"},
{file = "backcall-0.2.0.tar.gz", hash = "sha256:5cbdbf27be5e7cfadb448baf0aa95508f91f2bbc6c6437cd9cd06e2a4c215e1e"},
]
bayesian-optimization = [
{file = "bayesian-optimization-1.4.2.tar.gz", hash = "sha256:4e4e98cd0f0fb716202ea4c3b9e7c4c530270e69aa26f0eaf6ef715328f89c04"},
{file = "bayesian_optimization-1.4.2-py3-none-any.whl", hash = "sha256:c42a490eff0eea9f80d32c18d18f0ee4f2896390724cec57945f94dc0a267697"},
]
beartype = []
binfootprint = []
black = [
@ -1573,6 +1627,10 @@ jedi = [
{file = "jedi-0.18.2-py2.py3-none-any.whl", hash = "sha256:203c1fd9d969ab8f2119ec0a3342e0b49910045abe6af0a3ae83a5764d54639e"},
{file = "jedi-0.18.2.tar.gz", hash = "sha256:bae794c30d07f6d910d32a7048af09b5a39ed740918da923c6b780790ebac612"},
]
joblib = [
{file = "joblib-1.2.0-py3-none-any.whl", hash = "sha256:091138ed78f800342968c523bdde947e7a305b8594b910a0fea2ab83c3c6d385"},
{file = "joblib-1.2.0.tar.gz", hash = "sha256:e1cee4a79e4af22881164f218d4311f60074197fb707e082e803b61f6d137018"},
]
jsonschema = [
{file = "jsonschema-4.17.3-py3-none-any.whl", hash = "sha256:a870ad254da1a8ca84b6a2905cac29d265f805acc57af304784962a2aa6508f6"},
{file = "jsonschema-4.17.3.tar.gz", hash = "sha256:0f864437ab8b6076ba6707453ef8f98a6a0d512a80e93f8abdb676f737ecb60d"},
@ -2106,6 +2164,29 @@ requests = [
{file = "requests-2.28.1-py3-none-any.whl", hash = "sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349"},
{file = "requests-2.28.1.tar.gz", hash = "sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983"},
]
scikit-learn = [
{file = "scikit-learn-1.2.1.tar.gz", hash = "sha256:fbf8a5c893c9b4b99bcc7ed8fb3e8500957a113f4101860386d06635520f7cfb"},
{file = "scikit_learn-1.2.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:bed9f75763bd392c094bf474c7ab75a01d68b15146ea7a20c0f9ff6fb3063dad"},
{file = "scikit_learn-1.2.1-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:c9285275a435d1f8f47bbe3500346ab9ead2499e0e090518404d318ea90d1c1c"},
{file = "scikit_learn-1.2.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dc838b5a4057c55ba81b82316ea8bf443af445f96eb21500b0e40618017e0923"},
{file = "scikit_learn-1.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d8bcd303dd982494842a3f482f844d539484c6043b4eed896b43ea8e5f609a21"},
{file = "scikit_learn-1.2.1-cp310-cp310-win_amd64.whl", hash = "sha256:a9abf17d177df54e529154f26acfd42930e19117d045e8a9a8e893ca82dd94ec"},
{file = "scikit_learn-1.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:70fa30d146b7e9d0c256e73e271b3e17f23123b7c4adcbde1a385031adf59090"},
{file = "scikit_learn-1.2.1-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:5a8111f3c7a314017ebf90d6feab861c11d1ca14f3dbafb39abcc31aa4c54ba6"},
{file = "scikit_learn-1.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cba0c7c6bf1493f8ce670bab69f9317874826ee838988de377ae355abd4d74cf"},
{file = "scikit_learn-1.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:479aedd0abedbda6b8b4529145fe4cd8622f69f726a72cef8f75548a93eeb1e1"},
{file = "scikit_learn-1.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:5523e21ab2b4d52b2bd41bedd335dbe8f3c1b5f6dd7c9c001b2e17ec9818af8d"},
{file = "scikit_learn-1.2.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:dcfab6a19b236194af88771d8e6e778a60c3339248ab0018696ebf2b7c8bed4b"},
{file = "scikit_learn-1.2.1-cp38-cp38-macosx_12_0_arm64.whl", hash = "sha256:559f66e12f93b34c8c85c0a5728c3b8af98f04eb12f2c9ee18ea3c82c3d2fad1"},
{file = "scikit_learn-1.2.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dbb7831b2308c67bb6dd83c5ea3cdaf8e8cafd2de4000b93d78bb689126bd2cf"},
{file = "scikit_learn-1.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5b2c5d9930ced2b7821ad936b9940706ccb5471d89b8a516bb641cec87257d1c"},
{file = "scikit_learn-1.2.1-cp38-cp38-win_amd64.whl", hash = "sha256:54731e2c2fbff40da6d76cbb9022ace5f44a4020a10bd5cd92107e86882bad15"},
{file = "scikit_learn-1.2.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d00e46a2a7fce6e118ed0f4c6263785bf6c297a94ffd0cd7b32455043c508cc8"},
{file = "scikit_learn-1.2.1-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:da0e2d50a8435ea8dc5cd21f1fc1a45d329bae03dcca92087ebed859d22d184e"},
{file = "scikit_learn-1.2.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:61bb9c654b5d2e6cdd4b1c7e6048fc66270c1682bda1b0f7d2726fdae09010f4"},
{file = "scikit_learn-1.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e0ee4d4d32c94e082344308528f7b3c9294b60ab19c84eb37a2d9c88bdffd9d1"},
{file = "scikit_learn-1.2.1-cp39-cp39-win_amd64.whl", hash = "sha256:c722f3446ad8c4f1a93b2399fe1a188635b94709a3f25e6f4d61efbe75fe8eaa"},
]
scipy = [
{file = "scipy-1.8.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:65b77f20202599c51eb2771d11a6b899b97989159b7975e9b5259594f1d35ef4"},
{file = "scipy-1.8.1-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:e013aed00ed776d790be4cb32826adb72799c61e318676172495383ba4570aa4"},
@ -2203,6 +2284,10 @@ tabulate = [
{file = "tabulate-0.8.10-py3-none-any.whl", hash = "sha256:0ba055423dbaa164b9e456abe7920c5e8ed33fcc16f6d1b2f2d152c8e1e8b4fc"},
{file = "tabulate-0.8.10.tar.gz", hash = "sha256:6c57f3f3dd7ac2782770155f3adb2db0b1a269637e42f27599925e64b114f519"},
]
threadpoolctl = [
{file = "threadpoolctl-3.1.0-py3-none-any.whl", hash = "sha256:8b99adda265feb6773280df41eece7b2e6561b772d21ffd52e372f999024907b"},
{file = "threadpoolctl-3.1.0.tar.gz", hash = "sha256:a335baacfaa4400ae1f0d8e3a58d6674d2f8828e3716bb2802c44955ad391380"},
]
tomli = [
{file = "tomli-1.2.3-py3-none-any.whl", hash = "sha256:e3069e4be3ead9668e21cb9b074cd948f7b3113fd9c8bba083f48247aab8b11c"},
{file = "tomli-1.2.3.tar.gz", hash = "sha256:05b6166bff487dc068d322585c7ea4ef78deed501cc124060e0f238e89a9231f"},

View file

@ -18,6 +18,8 @@ traitlets = "==5.2.0"
Cython = "^0.29.30"
tabulate = "^0.8.9"
statsmodels = "^0.13.5"
bayesian-optimization = "^1.4.2"
colorama = "^0.4.6"
[tool.poetry.dev-dependencies]
black = "^21.12b0"

View file

@ -1,23 +1,124 @@
from speed_coupling_scan import *
import random
#powers = np.array([model.power().value for model in models])
powers = np.array([random.random() for model in models])
normalized_powers = powers - powers.min()
normalized_powers /= normalized_powers.max()
colors = [Blues(power) for power in normalized_powers]
ax1 = plt.gcf().add_subplot(111, projection='3d')
taurus_path = "taurus"
from hiro_models.model_auxiliary import import_results
_xx, _yy = np.meshgrid(δs, τ_Is)
x, y = _xx.ravel(), _yy.ravel()
dx = (δs[1] - δs[0])
dy = (τ_Is[1] - τ_Is[0])
x -= dx /2
y -= dy /2
ax1.bar3d(x, y, np.zeros_like(powers), dx, dy, powers, color=colors)
ax1.set_xticks(δs)
ax1.set_yticks(τ_Is)
import_results(
other_data_path="./taurus/.data",
other_results_path="./taurus/results",
interactive=False,
models_to_import=models,
force=True,
)
ax1.set_xlabel(r"$\delta$")
ax1.set_ylabel(r"$\tau_I$")
ax1.set_zlabel(r"$P$")
f, a = plt.subplots()
for model in models:
Δs = (model.steady_index(observable=model.system_energy()))
#Δ = (model.steady_index(observable=model.total_power(), fraction=.7))
# for Δ in Δs[2:]:
# pu.plot_with_σ(model.t[:model.strobe[1][1]], Δ, ax=a)
#plt.plot(Δ)
print(Δs)
try:
# pu.plot_with_σ(model.t, model.total_energy_from_power().sum_baths(), ax=a, label=fr"$\delta={model.δ[0]}$, $\tau_I={model.timings_L[0][1] - model.timings_L[0][0]:.3}$")
# pu.plot_with_σ(model.t, model.total_energy().sum_baths(), ax=a, label=fr"$\delta={model.δ[0]}$, $\tau_I={model.timings_L[0][1] - model.timings_L[0][0]:.3}$")
pu.plot_with_σ(model.t, model.total_energy_from_power(), ax=a, label=fr"$\delta={model.δ[0]}$, $\tau_I={model.timings_L[0][1] - model.timings_L[0][0]:.3}$")
pu.plot_with_σ(model.t, model.total_energy(), ax=a, label=fr"$\delta={model.δ[0]}$, $\tau_I={model.timings_L[0][1] - model.timings_L[0][0]:.3}$")
print(model.system_energy().N)
print(model.system_power().N)
print(model.interaction_power().N)
except:
pass
a.legend()
f, a =ot.plot_3d_heatmap(models, lambda model: -model.power(fraction=.3).value, lambda model: model.δ[0], lambda model: model.timings_L[0][1] - model.timings_L[0][0])
a.set_xlabel(r"$\delta$")
a.set_ylabel(r"$\tau_I$")
a.set_zlabel(r"$P$")
f, a = plt.subplots()
for model in models:
try:
power = model.power(fraction=.5)
a.plot(power.Ns, power.values, label=fr"$\delta={model.δ[0]}$, $\tau_I={model.timings_L[0][1] - model.timings_L[0][0]:.3}$")
except:
pass
a.legend()
from speed_coupling_scan import *
taurus_path = "taurus"
from hiro_models.model_auxiliary import import_results
import_results(
other_data_path="./taurus/.data",
other_results_path="./taurus/results",
interactive=False,
models_to_import=models,
# force=True,
)
f, a = plt.subplots()
for model in models:
Δs = (model.steady_index(observable=model.system_energy()))
#Δ = (model.steady_index(observable=model.total_power(), fraction=.7))
# for Δ in Δs[2:]:
# pu.plot_with_σ(model.t[:model.strobe[1][1]], Δ, ax=a)
#plt.plot(Δ)
print(Δs)
try:
# pu.plot_with_σ(model.t, model.total_energy_from_power().sum_baths(), ax=a, label=fr"$\delta={model.δ[0]}$, $\tau_I={model.timings_L[0][1] - model.timings_L[0][0]:.3}$")
# pu.plot_with_σ(model.t, model.total_energy().sum_baths(), ax=a, label=fr"$\delta={model.δ[0]}$, $\tau_I={model.timings_L[0][1] - model.timings_L[0][0]:.3}$")
pu.plot_with_σ(model.t, model.total_energy_from_power(), ax=a, label=fr"$\delta={model.δ[0]}$, $\tau_I={model.timings_L[0][1] - model.timings_L[0][0]:.3}$")
pu.plot_with_σ(model.t, model.total_energy(), ax=a, label=fr"$\delta={model.δ[0]}$, $\tau_I={model.timings_L[0][1] - model.timings_L[0][0]:.3}$")
print(model.system_energy().N)
print(model.system_power().N)
print(model.interaction_power().N)
except:
pass
a.legend()
f = plt.figure()
a_power = f.add_subplot(121, projection='3d')
a_efficiency = f.add_subplot(122, projection='3d')
ot.plot_3d_heatmap(
models,
lambda model: -model.power(fraction=0.5).value,
lambda model: model.δ[0],
lambda model: model.timings_L[0][1] - model.timings_L[0][0],
normalize=True,
ax=a_power,
)
a_power.set_xlabel(r"$\delta$")
a_power.set_ylabel(r"$\tau_I$")
a_power.set_zlabel(r"$P$ (normalized)")
ot.plot_3d_heatmap(
models,
lambda model: model.efficiency(fraction=0.5).value,
lambda model: model.δ[0],
lambda model: model.timings_L[0][1] - model.timings_L[0][0],
ax=a_efficiency,
)
a_efficiency.set_xlabel(r"$\delta$")
a_efficiency.set_ylabel(r"$\tau_I$")
a_efficiency.set_zlabel(r"$\eta$")
fs.export_fig("coupling_speed_scan", fig=f)
f
f, a = plt.subplots()
for model in models:
try:
power = model.power(fraction=.5)
a.plot(power.Ns, power.values, label=fr"$\delta={model.δ[0]}$, $\tau_I={model.timings_L[0][1] - model.timings_L[0][0]:.3}$")
except:
pass
a.legend()

View file

@ -1,3 +1,7 @@
from speed_coupling_scan import *
ot.integrate_online_multi(models, 10_000, increment=1000, analyze_kwargs=dict(every=100))
from speed_coupling_scan import *
ot.integrate_online_multi(models, 10_000, increment=1000, analyze_kwargs=dict(every=100))

View file

@ -75,3 +75,78 @@ for τ_I, δ in itertools.product(τ_Is, δs):
ot.plot_cycles(models[:: len(δs)])
import figsaver as fs
import plot_utils as pu
from hiro_models.one_qubit_model import StocProcTolerances
from hiro_models.otto_cycle import OttoEngine
import hiro_models.model_auxiliary as aux
import numpy as np
import qutip as qt
import utilities as ut
import stocproc
import matplotlib.pyplot as plt
import otto_utilities as ot
import ray
ray.shutdown()
#ray.init(address='auto')
ray.init()
from hops.util.logging_setup import logging_setup
import logging
logging_setup(logging.INFO)
plt.rcParams['figure.figsize'] = (12,4)
def timings(τ_c, τ_i):
τ_th = (1 - 2 * τ_c) / 2
τ_i_on = (τ_th - 2*τ_i)
timings_H = (0, τ_c, τ_c + τ_th, 2*τ_c + τ_th)
timings_L_hot = (τ_c, τ_c + τ_i, τ_c + τ_i + τ_i_on, τ_c + 2 * τ_i + τ_i_on)
timings_L_cold = tuple(time + timings_H[2] for time in timings_L_hot)
return timings_H, (timings_L_cold, timings_L_hot)
(p_H, p_L) = timings(0.1, 0.3)
prototype = OttoEngine(
δ=[0.4, 0.4],
ω_c=[2, 2],
ψ_0=qt.basis([2], [1]),
description=f"A model for scanning coupling strength and interactin switch times.",
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,
# driving_process_tolerances=[StocProcTolerances(1e-5, 1e-5)] * 2,
# thermal_process_tolerances=[StocProcTolerances(1e-5, 1e-5)] * 2,
T=[1, 4],
therm_methods=["tanhsinh", "tanhsinh"],
Δ=1,
num_cycles=5,
Θ=1.5 / 0.05,
dt=0.01/8,
timings_H=p_H,
timings_L=p_L,
streaming_mode=True,
shift_to_resonance=(False, False),
)
δs = np.round(np.linspace(.3, .5, 3), 3)
τ_Is = np.array([# .05,
.1, .15, .2])
δs, τ_Is
models = []
import itertools
for τ_I, δ in itertools.product(τ_Is, δs):
(p_H, p_L) = timings(0.1, τ_I)
model = prototype.copy()
model.δ = [δ, δ]
model.timings_H = p_H
model.timings_L = p_L
models.append(model)

View file

@ -79,3 +79,86 @@ for overlap, shift in itertools.product(overlaps, shifts):
ot.plot_cycles(models)
import figsaver as fs
import plot_utils as pu
from hiro_models.one_qubit_model import StocProcTolerances
from hiro_models.otto_cycle import OttoEngine
import hiro_models.model_auxiliary as aux
import numpy as np
import qutip as qt
import utilities as ut
import stocproc
import matplotlib.pyplot as plt
import otto_utilities as ot
import ray
ray.shutdown()
#ray.init(address='auto')
ray.init()
from hops.util.logging_setup import logging_setup
import logging
logging_setup(logging.INFO)
plt.rcParams['figure.figsize'] = (12,4)
def timings(τ_c, τ_i, percent_overlap=0):
τ_cI = τ_c * (1-percent_overlap)
τ_thI = (1 - 2 * τ_cI) / 2
τ_th = (1 - 2 * τ_c) / 2
τ_i_on = (τ_thI - 2*τ_i)
timings_H = (0, τ_c, τ_c + τ_th, 2*τ_c + τ_th)
timings_L_hot = (τ_cI, τ_cI + τ_i, τ_cI + τ_i + τ_i_on, τ_cI + 2 * τ_i + τ_i_on)
timings_L_cold = tuple(time + timings_H[2] for time in timings_L_hot)
return timings_H, (timings_L_cold, timings_L_hot)
τ_mod, τ_I = 0.1, 0.1
(p_H, p_L) = timings(τ_mod, τ_I, .5)
prototype = OttoEngine(
δ=[0.4, 0.4],
ω_c=[2, 2],
ψ_0=qt.basis([2], [1]),
description=f"A model for scanning coupling strength and interactin switch times.",
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, 4],
therm_methods=["tanhsinh", "tanhsinh"],
Δ=1,
num_cycles=4,
Θ=1.5 / 0.05,
dt=0.01/8,
timings_H=p_H,
timings_L=p_L,
streaming_mode=True,
shift_to_resonance=(False, False),
L_shift=(0.0, 0.0),
)
ot.plot_cycle(prototype)
overlaps = np.round(np.linspace(0, 1, 3), 3)
shifts = np.round(np.linspace(0, τ_mod, 3), 3)
models = []
import itertools
for overlap, shift in itertools.product(overlaps, shifts):
print(overlap, shift)
(p_H, p_L) = timings(τ_mod, τ_I, overlap)
model = prototype.copy()
model.timings_H = p_H
model.timings_L = p_L
model.L_shift = (shift, shift)
models.append(model)
ot.plot_cycles(models)
fs.export_fig("timing_scan_cycles")

View file

@ -1,12 +1,3 @@
from timing_scan import *
ot.integrate_online_multi(models, 10_000, increment=2000, analyze_kwargs=dict(every=100), data_path=".data_timing", results_path="results_timing")
aux.import_results(
data_path="./.data",
other_data_path="./.data_timing",
results_path="./results",
other_results_path="./results_timing",
interactive=False,
models_to_import=models,
)
ot.integrate_online_multi(models, 10_000, increment=2000, analyze_kwargs=dict(every=100), data_path=".data_timing", results_path="results_timing")