Circuit.batch_replace

Circuit.batch_replace(points, ops)[source]

Replace the operations at points with ops.

Parameters:
  • points (Sequence[CircuitPointLike]) – The indices of the operations to replace.

  • ops (Sequence[Operation]) – The to-be-inserted operations.

Raises:
  • IndexError – If there is no operation at some point.

  • ValueError – If any op cannot be placed on the circuit due to either an invalid location or gate radix mismatch.

  • ValueError – If any point.qudit is not in op.location

  • ValueError – If points and ops have different lengths.