Skip to content
This repository was archived by the owner on Dec 24, 2024. It is now read-only.

Commit 7baf8d4

Browse files
eunjongkimgalwiner
andauthored
Update core.py (#302)
* Update core.py Use variable length keyword argument to be passed on to QuantumMachinesManager when opening QuAM. This enables use of remote server, specified by host, port, and credentials. * reformatted with black Co-authored-by: GalW <[email protected]>
1 parent 8d88afa commit 7baf8d4

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

entropylab/quam/core.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@ def __init__(self, path: str):
1919

2020

2121
class QuAMManager(QuAMCore):
22-
def __init__(self, path: str, host: str = "127.0.0.1"):
22+
def __init__(self, path: str, **qmm_kwargs):
2323
"""Admin
2424
:param path: Path of the entropy DB
2525
:type path: str
26-
:param host: QM manager url
27-
:type host: str
2826
"""
2927
super().__init__(path=path)
30-
self.host = host
28+
self._qmm_kwargs = qmm_kwargs
3129
self._config_builder = ConfigBuilder()
3230
self._config_vars = ConfigVars()
3331

@@ -67,23 +65,20 @@ def open_quam(self):
6765
:rtype: QuAM
6866
"""
6967
self._set_config_vars()
70-
return QuAM(path=self.path, config=self.generate_config())
68+
return QuAM(path=self.path, config=self.generate_config(), **self._qmm_kwargs)
7169

7270

7371
class QuAM(QuAMCore):
74-
def __init__(self, path: str, config: dict = None, host: str = "127.0.0.1"):
72+
def __init__(self, path: str, config: dict = None, **qmm_kwargs):
7573
"""User class to facilitate writing and execution of QUA programs
7674
:param path: path to the entropy DB
7775
:type path: str
7876
:param config: a QUA configuration, defaults to an empty dictionary
7977
:type config: Dict, optional
80-
:param host: host url for Quantum Machine Manager, defaults to local host
81-
:type host: str, optional
8278
"""
8379
super().__init__(path=path)
8480
self.config = config if config is not None else {}
85-
self.host = host
86-
self.qmm = QuantumMachinesManager(host)
81+
self.qmm = QuantumMachinesManager(**qmm_kwargs)
8782

8883
@property
8984
def elements(self):

0 commit comments

Comments
 (0)