mirror of
https://github.com/vale981/two_qubit_model
synced 2025-03-06 02:01:40 -05:00
support reading the multi bath model from the db
This commit is contained in:
parent
1475df6dd6
commit
23aea98c45
1 changed files with 4 additions and 1 deletions
|
@ -11,7 +11,7 @@ from contextlib import contextmanager
|
||||||
from .utility import JSONEncoder, object_hook
|
from .utility import JSONEncoder, object_hook
|
||||||
from filelock import FileLock
|
from filelock import FileLock
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from .one_qubit_model import QubitModel
|
from .one_qubit_model import QubitModel, QubitModelMutliBath
|
||||||
from .two_qubit_model import TwoQubitModel
|
from .two_qubit_model import TwoQubitModel
|
||||||
from collections.abc import Sequence, Iterator, Iterable
|
from collections.abc import Sequence, Iterator, Iterable
|
||||||
import shutil
|
import shutil
|
||||||
|
@ -70,6 +70,9 @@ def model_hook(dct: dict[str, Any]):
|
||||||
if model == "TwoQubitModel":
|
if model == "TwoQubitModel":
|
||||||
return TwoQubitModel.from_dict(treated_vals)
|
return TwoQubitModel.from_dict(treated_vals)
|
||||||
|
|
||||||
|
if model == "QubitModelMutliBath":
|
||||||
|
return QubitModelMutliBath.from_dict(treated_vals)
|
||||||
|
|
||||||
return object_hook(dct)
|
return object_hook(dct)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue