mirror of
https://github.com/vale981/two_qubit_model
synced 2025-03-05 17:51:40 -05:00
add integrate_multi
This commit is contained in:
parent
2065b5be71
commit
a25c4f9b72
2 changed files with 17 additions and 3 deletions
|
@ -12,8 +12,7 @@ from filelock import FileLock
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from .one_qubit_model import QubitModel
|
from .one_qubit_model import QubitModel
|
||||||
from .two_qubit_model import TwoQubitModel
|
from .two_qubit_model import TwoQubitModel
|
||||||
import stocproc
|
from collections.abc import Sequence
|
||||||
import logging
|
|
||||||
|
|
||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
|
@ -61,6 +60,17 @@ def model_hook(dct: dict[str, Any]):
|
||||||
return object_hook(dct)
|
return object_hook(dct)
|
||||||
|
|
||||||
|
|
||||||
|
def integrate_multi(models: Sequence[Model], *args, **kwargs):
|
||||||
|
"""Integrate the hops equations for the ``models``.
|
||||||
|
Like :any:`integrate` just for many models.
|
||||||
|
|
||||||
|
A call to :any:`ray.init` may be required.
|
||||||
|
"""
|
||||||
|
|
||||||
|
for model in models:
|
||||||
|
integrate(model, *args, *kwargs)
|
||||||
|
|
||||||
|
|
||||||
def integrate(model: Model, n: int, data_path: str = "./.data"):
|
def integrate(model: Model, n: int, data_path: str = "./.data"):
|
||||||
"""Integrate the hops equations for the model.
|
"""Integrate the hops equations for the model.
|
||||||
|
|
||||||
|
@ -70,6 +80,10 @@ def integrate(model: Model, n: int, data_path: str = "./.data"):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
hash = model.hexhash
|
hash = model.hexhash
|
||||||
|
|
||||||
|
# with model_db(data_path) as db:
|
||||||
|
# if hash in db and "data" db[hash]
|
||||||
|
|
||||||
supervisor = HOPSSupervisor(
|
supervisor = HOPSSupervisor(
|
||||||
model.hops_config,
|
model.hops_config,
|
||||||
n,
|
n,
|
||||||
|
|
2
poetry.lock
generated
2
poetry.lock
generated
|
@ -287,7 +287,7 @@ typer = "^0.4.0"
|
||||||
type = "git"
|
type = "git"
|
||||||
url = "git@gitlab.hrz.tu-chemnitz.de:s8896854--tu-dresden.de/hops.git"
|
url = "git@gitlab.hrz.tu-chemnitz.de:s8896854--tu-dresden.de/hops.git"
|
||||||
reference = "BathMemoryTruncation"
|
reference = "BathMemoryTruncation"
|
||||||
resolved_reference = "36905de2e4f1b2e9c416c62e7bea20d18907b2aa"
|
resolved_reference = "2f5600c2044a9506e7eceb03c8a50706586884a3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hopsflow"
|
name = "hopsflow"
|
||||||
|
|
Loading…
Add table
Reference in a new issue