-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
677816f
commit 52d081e
Showing
9 changed files
with
85 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
""" Qblox Cluster QCM driver.""" | ||
|
||
from qibolab.instruments.abstract import Instrument | ||
from qibolab.instruments.qblox.port import QbloxInputPort, QbloxOutputPort | ||
|
||
|
||
class ClusterModule(Instrument): | ||
DEFAULT_SEQUENCERS = {} | ||
|
||
def __init__(self, name: str, address: str): | ||
""" """ | ||
super().__init__(name, address) | ||
self.ports: dict = {} | ||
|
||
def port(self, name: str, out: bool = True): | ||
def count(cls): | ||
return len(list(filter(lambda x: isinstance(x, cls), self.ports))) | ||
|
||
if hasattr(self, "acquire"): | ||
print(type(self)) | ||
if out: | ||
self.ports[name] = QbloxOutputPort( | ||
self, self.DEFAULT_SEQUENCERS["o1"], port_number=count(QbloxOutputPort), port_name=name | ||
) | ||
else: | ||
self.ports[name] = QbloxInputPort( | ||
self, | ||
output_sequencer_number=self.DEFAULT_SEQUENCERS["o1"], | ||
input_sequencer_number=self.DEFAULT_SEQUENCERS["i1"], | ||
port_number=count(QbloxOutputPort), | ||
port_name=name, | ||
) | ||
else: | ||
print(type(self)) | ||
self.ports[name] = QbloxOutputPort( | ||
self, self.DEFAULT_SEQUENCERS[name], port_number=len(self.ports), port_name=name | ||
) | ||
return self.ports[name] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters