Create an :class:`~.circuit.Instruction` out of this circuit. .. seealso:: :func:`circuit_to_instruction` The underlying driver of this method. Args: parameter_map: For parameterized circuits, a mapping from parameters in the c
(
self,
parameter_map: dict[Parameter, ParameterValueType] | None = None,
label: str | None = None,
)
| 3771 | raise CircuitError("duplicate bit arguments") |
| 3772 | |
| 3773 | def to_instruction( |
| 3774 | self, |
| 3775 | parameter_map: dict[Parameter, ParameterValueType] | None = None, |
| 3776 | label: str | None = None, |
| 3777 | ) -> Instruction: |
| 3778 | """Create an :class:`~.circuit.Instruction` out of this circuit. |
| 3779 | |
| 3780 | .. seealso:: |
| 3781 | :func:`circuit_to_instruction` |
| 3782 | The underlying driver of this method. |
| 3783 | |
| 3784 | Args: |
| 3785 | parameter_map: For parameterized circuits, a mapping from |
| 3786 | parameters in the circuit to parameters to be used in the |
| 3787 | instruction. If None, existing circuit parameters will also |
| 3788 | parameterize the instruction. |
| 3789 | label: Optional gate label. |
| 3790 | |
| 3791 | Returns: |
| 3792 | qiskit.circuit.Instruction: a composite instruction encapsulating this circuit (can be |
| 3793 | decomposed back). |
| 3794 | """ |
| 3795 | |
| 3796 | from qiskit.converters.circuit_to_instruction import circuit_to_instruction |
| 3797 | |
| 3798 | return circuit_to_instruction(self, parameter_map, label=label) |
| 3799 | |
| 3800 | def to_gate( |
| 3801 | self, |