FermionicPassManager¶
- class FermionicPassManager¶
Bases:
BasePassManagerA transpiler pass manager converting one
FermionicCircuitto another.Note
Qiskit is currently working on native support of transpiler pipelines involving more than a single intermediate representation. Once that gets more formalized, the implementation here will be aligned with the resulting interfaces. See also this tracking issue.
Inherited Methods
- append(tasks)¶
Append tasks to the schedule of passes.
- remove(index)¶
Removes a particular pass in the scheduler.
- replace(index, tasks)¶
Replace a particular pass in the scheduler.
- Parameters:
- Raises:
TypeError – When any element of tasks is not a subclass of passmanager Task.
PassManagerError – If the index is not found.
- Return type:
None
- run(in_programs, callback=None, num_processes=None, *, property_set=None, **kwargs)¶
Run all the passes on the specified
in_programs.- Parameters:
in_programs (Any | list[Any]) – Input programs to transform via all the registered passes. A single input object cannot be a Python builtin list object. A list object is considered as multiple input objects to optimize.
callback (Callable | None) –
A callback function that will be called after each pass execution. The function will be called with 5 keyword arguments:
task (GenericPass): the pass being run passmanager_ir (Any): depending on pass manager subclass property_set (PropertySet): the property set running_time (float): the time to execute the pass count (int): the index for the pass execution
The exact arguments passed expose the internals of the pass manager and are subject to change as the pass manager internals change. If you intend to reuse a callback function over multiple releases be sure to check that the arguments being passed are the same.
To use the callback feature you define a function that will take in kwargs dict and access the variables. For example:
def callback_func(**kwargs): task = kwargs['task'] passmanager_ir = kwargs['passmanager_ir'] property_set = kwargs['property_set'] running_time = kwargs['running_time'] count = kwargs['count'] ...
num_processes (int | None) – The maximum number of parallel processes to launch if parallel execution is enabled. This argument overrides
num_processesin the user configuration file, and theQISKIT_NUM_PROCSenvironment variable. If set toNonethe system default or local user configuration will be used.property_set (dict[str, object] | None) – If given, the initial value to use as the
PropertySetfor the pass manager pipeline. This can be used to persist analysis from one run to another, in cases where you know the analysis is safe to share. Beware that some analysis will be specific to the input circuit and the particularTarget, so you should take a lot of care when using this argument.kwargs – Arbitrary arguments passed to the compiler frontend and backend.
- Returns:
The transformed program(s).
- Return type:
- to_flow_controller()¶
Linearize this manager into a single
FlowControllerLinear, so that it can be nested inside another pass manager.- Returns:
A linearized pass manager.
- Return type: