Conversation
| ( | ||
| result_list, | ||
| postselect_mgr_list, | ||
| postselect_mgr_list, # type: ignore |
There was a problem hiding this comment.
This is required since PostselectMgr, is not a recognised wire type. Simply adding it to the list of recognised wire types induces cyclic imports.
I don't really know what the right solution to this is...
I assume there must be a way to define a type annotation for PostselectMgr within mittask.py although I have tried and failed to do that. User defined generic types might also help -> https://docs.python.org/3/library/typing.html#user-defined-generic-types but I think that only works for python 3.12. If you happen to know how to do something like that then I would be very interested to know about that.
Another solution is to move serialised versions of PostselectMgr along wires. As far as I can tell that is the best solution, but would be some significant work.
Another solution would be to allow Any as a wire type, which I don't want to do...
| WireList = Union[ | ||
| 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], | ||
| ] | ||
|
|
There was a problem hiding this comment.
I don't know if there is a more succinct way of doing this. I would like Tuple[List[Wire], ...] to work but that assumes every List[Wire] in Tuple uses the same Wire.
Very minor change. As this change touches everything I though I would double check incase I have misunderstood something.
Is this typing the way we have used MitTask in practice?
This was all done in an effort to get
working.