ParallelDo
- class ParallelDo(pass_sequences, less_than, pick_first=False)[source]
Bases:
BasePassThe ParallelDo class.
This is a control pass that executes a sequence of workflows in parallel. The branch that is accepted can either be the first to complete or one selected by a provided ordering.
- __init__(pass_sequences, less_than, pick_first=False)[source]
Construct a ParallelDo.
- Parameters:
pass_sequences (
Iterable[Workflow|Iterable[BasePass] |BasePass]) – The group of workflows to run in parallel.less_than (
Callable[[Circuit,Circuit],bool]) – Return True if the first circuit is preferred to the second one. This will be used to determine which output circuit to select.pick_first (
bool) – If true, then the pass will complete as soon as one of the workflows finishes and will return the first result. Defaults to False.
Attributes
The name of the pass.
Methods
execute(*args, **kwargs)Map a function over iterable arguments in parallel.
get_connectivity(_, data)Retrieve the current connectivity of the circuit.
get_model(_, data)Retrieve the machine model from the data dictionary.
get_placement(_, data)Retrieve the logical to physical qubit map from the data dictionary.
get_target(_, data)Retrieve the target from the data dictionary.
in_parallel(data)Return true if pass is being executed in a parallel.
run(circuit, data)Perform the pass's operation, see
BasePassfor more.