Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Correct MitTask type #197

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Allow lists of wire
  • Loading branch information
daniel-mills-cqc committed Dec 9, 2024
commit 212d85048fc79b3f79542e9e3c0a36da1b03dddd
19 changes: 18 additions & 1 deletion qermit/taskgraph/mittask.py
Original file line number Diff line number Diff line change
@@ -57,6 +57,23 @@ class IOTask(Enum):
Dict,
]

WireList = Union[
List[PostselectMgr],
List[CircuitShots],
List[Circuit],
List[BackendResult],
List[ResultHandle],
List[AnsatzCircuit],
List[ObservableExperiment],
List[int],
List[float],
List[bool],
List[str],
List[QubitPauliOperator],
List[Dict[Qubit, Bit]],
List[Dict],
]


class MitTask:
"""
@@ -100,7 +117,7 @@ def n_in_wires(self):
def n_out_wires(self):
return self._n_out_wires

def __call__(self, input_wires: Tuple[List[Wire], ...]) -> Tuple[List[Wire], ...]:
def __call__(self, input_wires: Tuple[WireList, ...]) -> Tuple[WireList, ...]:
return self.run(*input_wires)

def __str__(self):
Loading