unitaria.IntegerAddition

class unitaria.IntegerAddition(*, source_bits: int = None, target_bits: int = None)[source]

Bases: Classical

Node implementing the (wrapping) addition of two integers.

This is a bilinear operation.

Parameters:
  • source_bits – The size of the first register. The first summand can be at most 2 ** source_bits

  • target_bits – The size of the second register. The addition is performed modulo 2 ** target_bits.

Raises:

ValueError – If source_bits < 2 or target_bits < source_bits.