circuit_knitting.cutting.cut_gates

cut_gates(circuit, gate_ids, inplace=False)[source]

Transform specified gates into TwoQubitQPDGates.

Parameters:
  • circuit (QuantumCircuit) – The circuit containing gates to be decomposed

  • gate_ids (Sequence[int]) – The indices of the gates to decompose

  • inplace (bool) – Flag denoting whether to copy the input circuit before acting on it

Return type:

tuple[QuantumCircuit, list[QPDBasis]]

Returns:

A copy of the input circuit with the specified gates replaced with TwoQubitQPDGates and a list of QPDBasis instances – one for each decomposed gate.

Raises:

ValueError – The input circuit should contain no classical bits or registers.