somewhat working state

This commit is contained in:
valentin.boettcher@mailbox.tu-dresden.de 2022-12-12 18:40:27 -05:00
parent 2136db2dbf
commit 1309bc1adb
No known key found for this signature in database
GPG key ID: E034E12B7AF56ACE
11 changed files with 810 additions and 550 deletions

View file

@ -8,43 +8,44 @@
outputs = { self, nixpkgs, flake-utils }:
with flake-utils.lib; eachSystem allSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
tex = pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-medium latexmk koma-script babel-english
physics mathtools amsmath fontspec booktabs siunitx caption biblatex float
pgfplots microtype fancyvrb csquotes setspace newunicodechar hyperref
cleveref multirow bbold unicode-math biblatex-phys xpatch beamerposter
type1cm changepage lualatex-math footmisc wrapfig2 curve2e pict2e wrapfig blindtext
appendixnumberbeamer sidecap appendix orcidlink ncctools bigfoot crop xcolor revtex;
};
in rec {
packages = {
document = pkgs.stdenvNoCC.mkDerivation rec {
name = "eflow_paper";
src = self;
buildInputs = [ pkgs.coreutils tex pkgs.biber ];
phases = ["unpackPhase" "buildPhase" "installPhase"];
buildPhase = ''
export PATH="${pkgs.lib.makeBinPath buildInputs}";
mkdir -p .cache/texmf-var
mkdir -p output/src
env TEXMFHOME=.cache TEXMFVAR=.cache/texmf-var \
OSFONTDIR=${pkgs.gyre-fonts}/share/fonts:${pkgs.liberation_ttf}/share/fonts:${pkgs.lato}/share/fonts/lato:${pkgs.raleway}/share/fonts:${pkgs.lmodern}/share/fonts \
latexmk ./index.tex
'';
installPhase = ''
mkdir -p $out
cp output/index.pdf $out/
let
pkgs = nixpkgs.legacyPackages.${system};
tex = pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-medium latexmk koma-script babel-english
physics mathtools amsmath fontspec booktabs siunitx caption biblatex float
pgfplots microtype fancyvrb csquotes setspace newunicodechar hyperref
cleveref multirow bbold unicode-math biblatex-phys xpatch beamerposter
type1cm changepage lualatex-math footmisc wrapfig2 curve2e pict2e wrapfig blindtext
appendixnumberbeamer sidecap appendix orcidlink ncctools bigfoot crop xcolor revtex;
};
in
rec {
packages = {
document = pkgs.stdenvNoCC.mkDerivation rec {
name = "eflow_paper";
src = self;
buildInputs = [ pkgs.coreutils tex pkgs.biber ];
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
buildPhase = ''
export PATH="${pkgs.lib.makeBinPath buildInputs}";
mkdir -p .cache/texmf-var
mkdir -p output/src
env TEXMFHOME=.cache TEXMFVAR=.cache/texmf-var \
OSFONTDIR=${pkgs.gyre-fonts}/share/fonts:${pkgs.liberation_ttf}/share/fonts:${pkgs.lato}/share/fonts/lato:${pkgs.raleway}/share/fonts:${pkgs.lmodern}/share/fonts \
latexmk ./index.tex
'';
installPhase = ''
mkdir -p $out
cp output/index.pdf $out/
'';
};
};
defaultPackage = packages.document;
devShell = pkgs.mkShellNoCC {
buildInputs = [ pkgs.openjdk ] ++ packages.document.buildInputs;
shellHook = ''
export OSFONTDIR=${pkgs.gyre-fonts}/share/fonts:${pkgs.liberation_ttf}/share/fonts:${pkgs.lato}/share/fonts/lato:${pkgs.raleway}/share/fonts:${pkgs.lmodern}/share/fonts
'';
};
};
defaultPackage = packages.document;
devShell = pkgs.mkShellNoCC {
buildInputs = [pkgs.openjdk] ++ packages.document.buildInputs;
shellHook = ''
export OSFONTDIR=${pkgs.gyre-fonts}/share/fonts:${pkgs.liberation_ttf}/share/fonts:${pkgs.lato}/share/fonts/lato:${pkgs.raleway}/share/fonts:${pkgs.lmodern}/share/fonts
'';
};
});
});
}

View file

@ -106,6 +106,12 @@ CLOCK: [2022-12-01 Thu 10:33]--[2022-12-01 Thu 10:56] => 0:23
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
:END:
- 2D grid with fixed numeber of cycles
- maybe ~5x5~ for now and later more

View file

@ -13,8 +13,8 @@ import otto_utilities as ot
import ray
ray.shutdown()
#ray.init(address='auto')
ray.init()
ray.init(address='auto')
#ray.init()
from hops.util.logging_setup import logging_setup
import logging
logging_setup(logging.INFO)
@ -39,4 +39,5 @@ model = OttoEngine(
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

@ -13,8 +13,8 @@ import otto_utilities as ot
import ray
ray.shutdown()
#ray.init(address='auto')
ray.init()
ray.init(address='auto')
#ray.init()
from hops.util.logging_setup import logging_setup
import logging
logging_setup(logging.INFO)
@ -42,5 +42,3 @@ model = OttoEngine(
)
ot.plot_cycle(model)
ot.integrate_online(model, 5000)

View file

@ -13,8 +13,56 @@ import otto_utilities as ot
import ray
ray.shutdown()
#ray.init(address='auto')
ray.init()
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)
@ -26,22 +74,26 @@ model = OttoEngine(
ψ_0=qt.basis([2], [1]),
description=f"A basic near-markovian, weakly coupled Otto Cycle without the shift.",
k_max=3,
bcf_terms=[6] * 2,
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=[1, 10],
T=[0, 2],
therm_methods=["tanhsinh", "tanhsinh"],
Δ=1,
num_cycles=5,
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)
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)

View file

@ -12,19 +12,26 @@
name = "09_dynamic_two_bath_one_qubit";
shellPackages = (pkgs:
(with pkgs;
[ pyright python39Packages.jupyter sshfs arb (pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-medium
type1cm unicode-math;
})]));
[
pyright
python39Packages.jupyter
sshfs
arb
(pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-medium
type1cm unicode-math;
})
]));
python = pkgs: pkgs.python39Full;
shellOverride = (pkgs: oldAttrs: {
shellHook = ''
export PYTHONPATH=/home/hiro/src/two_qubit_model/:$PYTHONPATH
export PYTHONPATH=/home/hiro/src/hops/:$PYTHONPATH
export PYTHONPATH=/home/hiro/src/hopsflow/:$PYTHONPATH
export LD_LIBRARY_PATH="${(pkgs.lib.makeLibraryPath [pkgs.arb])}"
# '';
export PYTHONPATH=/home/hiro/src/stocproc/:$PYTHONPATH
export PYTHONPATH=/home/hiro/src/two_qubit_model/:$PYTHONPATH
export PYTHONPATH=/home/hiro/src/hops/:$PYTHONPATH
export PYTHONPATH=/home/hiro/src/hopsflow/:$PYTHONPATH
export LD_LIBRARY_PATH="${(pkgs.lib.makeLibraryPath [pkgs.arb])}"
# '';
});
noPackage = true;
poetryArgs = {

File diff suppressed because it is too large Load diff

View file

@ -13,8 +13,8 @@ import otto_utilities as ot
import ray
ray.shutdown()
#ray.init(address='auto')
ray.init()
ray.init(address='auto')
#ray.init()
from hops.util.logging_setup import logging_setup
import logging
logging_setup(logging.INFO)

View file

@ -85,7 +85,7 @@ def plot_sd_overview(model: OttoEngine, ax=None):
assert ax is not None
gaps = model.energy_gaps
ω = np.linspace(0.001, gaps[-1] + gaps[0], 1000)
ω = np.linspace(0.0001, gaps[-1] + gaps[0], 1000)
for ω_i, label, i in zip(gaps, ["Cold", "Hot"], range(len(gaps))):
lines = ax.plot(
@ -151,13 +151,14 @@ def plot_energy(model):
return f, a
def integrate_online(model, n, stream_folder=None):
def integrate_online(model, n, stream_folder=None, **kwargs):
aux.integrate(
model,
n,
stream_file=("" if stream_folder is None else stream_folder)
+ f"results_{model.hexhash}.fifo",
analyze=True,
**kwargs,
)

View file

@ -135,7 +135,7 @@ test-tox-coverage = ["coverage (>=5.5)"]
type = "git"
url = "https://github.com/beartype/beartype"
reference = "main"
resolved_reference = "b48a56fb497b36aa9640c107caa6bc85e02f5782"
resolved_reference = "ecb059a5200c460d76a9741f788e06059ab48a9d"
[[package]]
name = "beautifulsoup4"
@ -497,7 +497,7 @@ qutip = "^4.6.3"
type = "git"
url = "git@github.com:vale981/two_qubit_model.git"
reference = "main"
resolved_reference = "0e34b40d32e1ee960482b01940851fd011bb10d6"
resolved_reference = "098c83ab44b811e22b6c9d69be83c522596e3577"
[[package]]
name = "hops"
@ -558,7 +558,7 @@ tqdm = "^4.62.3"
type = "git"
url = "https://github.com/vale981/hopsflow"
reference = "main"
resolved_reference = "8ede222312e67970c07d72356d756d6e24a3e94c"
resolved_reference = "e27e38b656b18e0bf3066d72e76ed1d467f26a5c"
[[package]]
name = "humanfriendly"
@ -1706,7 +1706,7 @@ setuptools = "*"
type = "git"
url = "https://github.com/vale981/stocproc"
reference = "HEAD"
resolved_reference = "06b692b20fe45071839b8fdd8995a557a46e662b"
resolved_reference = "7d735091dea36f4f63b5dbaaec78df9c1af1abbf"
[[package]]
name = "tabulate"

View file

@ -13,8 +13,8 @@ import otto_utilities as ot
import ray
ray.shutdown()
#ray.init(address='auto')
ray.init()
ray.init(address='auto')
#ray.init()
from hops.util.logging_setup import logging_setup
import logging
logging_setup(logging.INFO)
@ -36,7 +36,7 @@ prototype = OttoEngine(
ω_c=[2, 2],
ψ_0=qt.basis([2], [1]),
description=f"A model for scanning coupling strength and interactin switch times.",
k_max=3,
k_max=4,
bcf_terms=[6] * 2,
truncation_scheme="simplex",
driving_process_tolerances=[StocProcTolerances(1e-3, 1e-3)] * 2,
@ -46,7 +46,7 @@ prototype = OttoEngine(
Δ=1,
num_cycles=4,
Θ=1.5 / 0.05,
dt=0.001,
dt=0.01,
timings_H=p_H,
timings_L=p_L,
streaming_mode=True,