QuantumCircuit.to_gate

QuantumCircuit.to_gate(parameter_map=None, label=None)[source]

Create a Gate out of this circuit.

Parameters
  • parameter_map (dict) – For parameterized circuits, a mapping from parameters in the circuit to parameters to be used in the gate. If None, existing circuit parameters will also parameterize the gate.

  • label (str) – Optional gate label.

Returns

a composite gate encapsulating this circuit (can be decomposed back)

Return type

Gate