DAGCircuit.apply_operation_front

DAGCircuit.apply_operation_front(op, qargs, cargs, condition=None)[source]

Apply an operation to the input of the circuit.

Parameters
  • op (qiskit.circuit.Instruction) – the operation associated with the DAG node

  • qargs (list[Qubit]) – qubits that op will be applied to

  • cargs (list[Clbit]) – cbits that op will be applied to

  • condition (tuple or None) – optional condition (ClassicalRegister, value)

Returns

the current max node

Return type

DAGNode

Raises

DAGCircuitError – if initial nodes connected to multiple out edges