mirror of
https://github.com/vale981/two_qubit_model
synced 2025-03-05 09:41:41 -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 .one_qubit_model import QubitModel
|
||||
from .two_qubit_model import TwoQubitModel
|
||||
import stocproc
|
||||
import logging
|
||||
from collections.abc import Sequence
|
||||
|
||||
|
||||
@contextmanager
|
||||
|
@ -61,6 +60,17 @@ def model_hook(dct: dict[str, Any]):
|
|||
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"):
|
||||
"""Integrate the hops equations for the model.
|
||||
|
||||
|
@ -70,6 +80,10 @@ def integrate(model: Model, n: int, data_path: str = "./.data"):
|
|||
"""
|
||||
|
||||
hash = model.hexhash
|
||||
|
||||
# with model_db(data_path) as db:
|
||||
# if hash in db and "data" db[hash]
|
||||
|
||||
supervisor = HOPSSupervisor(
|
||||
model.hops_config,
|
||||
n,
|
||||
|
|
2
poetry.lock
generated
2
poetry.lock
generated
|
@ -287,7 +287,7 @@ typer = "^0.4.0"
|
|||
type = "git"
|
||||
url = "git@gitlab.hrz.tu-chemnitz.de:s8896854--tu-dresden.de/hops.git"
|
||||
reference = "BathMemoryTruncation"
|
||||
resolved_reference = "36905de2e4f1b2e9c416c62e7bea20d18907b2aa"
|
||||
resolved_reference = "2f5600c2044a9506e7eceb03c8a50706586884a3"
|
||||
|
||||
[[package]]
|
||||
name = "hopsflow"
|
||||
|
|
Loading…
Add table
Reference in a new issue