MCPcopy
hub / github.com/Qiskit/qiskit / to_instruction

Method to_instruction

qiskit/circuit/quantumcircuit.py:3773–3798  ·  view source on GitHub ↗

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,
    )

Source from the content-addressed store, hash-verified

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,

Callers 15

to_instructionMethod · 0.95
repeatMethod · 0.95
_buildMethod · 0.95
_buildMethod · 0.95
_defineMethod · 0.95
_defineMethod · 0.95
test_skip_non_qftMethod · 0.95

Calls 1

circuit_to_instructionFunction · 0.90