qiskit-documentation/docs/api/qiskit-ibm-runtime/0.39/transpiler-passes-fold-rzz-...

131 lines
5.3 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: FoldRzzAngle (v0.39)
description: API reference for qiskit_ibm_runtime.transpiler.passes.FoldRzzAngle in qiskit-ibm-runtime v0.39
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit_ibm_runtime.transpiler.passes.FoldRzzAngle
---
# FoldRzzAngle
<Class id="qiskit_ibm_runtime.transpiler.passes.FoldRzzAngle" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.39/qiskit_ibm_runtime/transpiler/passes/basis/fold_rzz_angle.py#L28-L246" signature="FoldRzzAngle(*args, **kwargs)" modifiers="class">
Bases: [`TransformationPass`](/docs/api/qiskit/qiskit.transpiler.TransformationPass "(in Qiskit v2.0)")
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.
<Admonition title="Note" type="note">
This pass doesnt 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].
</Admonition>
## Attributes
### is\_analysis\_pass
<Attribute id="qiskit_ibm_runtime.transpiler.passes.FoldRzzAngle.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.
</Attribute>
### is\_transformation\_pass
<Attribute id="qiskit_ibm_runtime.transpiler.passes.FoldRzzAngle.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).
</Attribute>
## Methods
### \_\_call\_\_
<Function id="qiskit_ibm_runtime.transpiler.passes.FoldRzzAngle.__call__" signature="__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
</Function>
### execute
<Function id="qiskit_ibm_runtime.transpiler.passes.FoldRzzAngle.execute" signature="execute(passmanager_ir, state, callback=None)">
Execute optimization task for input Qiskit IR.
**Parameters**
* **passmanager\_ir** (*Any*) Qiskit IR to optimize.
* **state** ([*PassManagerState*](/docs/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v2.0)")) 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*](/docs/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v2.0)")]
</Function>
### name
<Function id="qiskit_ibm_runtime.transpiler.passes.FoldRzzAngle.name" signature="name()">
Name of the pass.
**Return type**
str
</Function>
### run
<Function id="qiskit_ibm_runtime.transpiler.passes.FoldRzzAngle.run" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.39/qiskit_ibm_runtime/transpiler/passes/basis/fold_rzz_angle.py#L54-L56" signature="run(dag)">
Run a pass on the DAGCircuit. This is implemented by the pass developer.
**Parameters**
**dag** ([*DAGCircuit*](/docs/api/qiskit/qiskit.dagcircuit.DAGCircuit "(in Qiskit v2.0)")) the dag on which the pass is run.
**Raises**
**NotImplementedError** when this is left unimplemented for a pass.
**Return type**
[*DAGCircuit*](/docs/api/qiskit/qiskit.dagcircuit.DAGCircuit "(in Qiskit v2.0)")
</Function>
### update\_status
<Function id="qiskit_ibm_runtime.transpiler.passes.FoldRzzAngle.update_status" signature="update_status(state, run_state)">
Update workflow status.
**Parameters**
* **state** ([*PassManagerState*](/docs/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v2.0)")) Pass manager state to update.
* **run\_state** (*RunState*) Completion status of current task.
**Returns**
Updated pass manager state.
**Return type**
[*PassManagerState*](/docs/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v2.0)")
</Function>
</Class>