UnitaryBuilder.apply_right

UnitaryBuilder.apply_right(utry, location, inverse=False, check_arguments=True)[source]

Apply the specified unitary on the right of this UnitaryBuilder.

Parameters:
  • utry (UnitaryMatrix) – The unitary to apply.

  • location (CircuitLocationLike) – The qudits to apply the unitary on.

  • inverse (bool) – If true, apply the inverse of the unitary.

  • check_arguments (bool) – If true, check the inputs for type and value errors.

Raises:
  • ValueError – If utry’s size does not match the given location.

  • ValueError – if utry’s radixes does not match the given location.

Notes

  • Applying the unitary on the right is equivalent to multiplying the unitary on the left of the tensor. The notation comes from the quantum circuit perspective.

  • This operation is performed using tensor contraction.