You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mitiq's Executor class as a method is_batched_executor which indicates whether it has the capability of running multiple circuits with a single call. It knows whether it can do this by looking at the annotation of the python function passed to the Executor upon instantiation.
The way this is written requires the annotated return type to use a typing class. We should generalize this code to allow for users to create batched executors while using modern python type-hints using data structure constructors (list, set, tuple, etc).
How to Reproduce
defbatched_ex(circuits: list[...]) ->list[float]: ...
ex=mitiq.Executor(batched_ex)
ex.is_batched_executor>>>False# this should be True
The text was updated successfully, but these errors were encountered:
Issue Description
Mitiq's
Executor
class as a methodis_batched_executor
which indicates whether it has the capability of running multiple circuits with a single call. It knows whether it can do this by looking at the annotation of the python function passed to theExecutor
upon instantiation.mitiq/mitiq/executor/executor.py
Lines 355 to 359 in f404e28
The way this is written requires the annotated return type to use a
typing
class. We should generalize this code to allow for users to create batched executors while using modern python type-hints using data structure constructors (list
,set
,tuple
, etc).How to Reproduce
The text was updated successfully, but these errors were encountered: