FoldRzzAngle
class FoldRzzAngle(*args, **kwargs)
Bases: TransformationPass
Fold Rzz gate angle into calibrated range of 0-pi/2 with local gate tweaks.
In the IBM Quantum ISA, the instruction Rzz(theta) has valid “theta” value of [0, pi/2] and any instruction outside this range becomes a non-ISA operation for the quantum backend. The transpiler pass discovers such non-ISA Rzz gates and folds the gate angle into the calibrated range with addition of single qubit gates while preserving logical equivalency of the input quantum circuit. Added local gates might be efficiently merged into neighboring single qubit gates by the following single qubit optimization passes.
This pass allows the Qiskit users to naively use the Rzz gates with angle of arbitrary real numbers.
This pass doesn’t transform the circuit when the Rzz gate angle is an unbound parameter. In this case, the user must assign a gate angle before transpilation, or be responsible for choosing parameters from the calibrated range of [0, pi/2].
Attributes
is_analysis_pass
Check if the pass is an analysis pass.
If the pass is an AnalysisPass, that means that the pass can analyze the DAG and write the results of that analysis in the property set. Modifications on the DAG are not allowed by this kind of pass.
is_transformation_pass
Check if the pass is a transformation pass.
If the pass is a TransformationPass, that means that the pass can manipulate the DAG, but cannot modify the property set (but it can be read).
Methods
__call__
__call__(circuit, property_set=None)
Runs the pass on circuit.
Parameters
- circuit (QuantumCircuit) – The dag on which the pass is run.
- property_set (PropertySet | dict | None) – Input/output property set. An analysis pass might change the property set in-place. If not given, the existing
property_set
attribute of the pass will be used (if set).
Returns
If on transformation pass, the resulting QuantumCircuit. If analysis pass, the input circuit.
Return type
QuantumCircuit
execute
execute(passmanager_ir, state, callback=None)
Execute optimization task for input Qiskit IR.
Parameters
- passmanager_ir (Any) – Qiskit IR to optimize.
- state (PassManagerState) – State associated with workflow execution by the pass manager itself.
- callback (Callable | None) – A callback function which is caller per execution of optimization task.
Returns
Optimized Qiskit IR and state of the workflow.
Return type
tuple[Any, PassManagerState]
name
name()
Name of the pass.
Return type
str
run
run(dag)
Run a pass on the DAGCircuit. This is implemented by the pass developer.
Parameters
dag (DAGCircuit) – the dag on which the pass is run.
Raises
NotImplementedError – when this is left unimplemented for a pass.
Return type
update_status
update_status(state, run_state)
Update workflow status.
Parameters
- state (PassManagerState) – Pass manager state to update.
- run_state (RunState) – Completion status of current task.
Returns
Updated pass manager state.
Return type