unitaria.IntegerAddition¶
- class unitaria.IntegerAddition(*, source_bits: int = None, target_bits: int = None)[source]¶
Bases:
ClassicalNode 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_bitstarget_bits – The size of the second register. The addition is performed modulo
2 ** target_bits.
- Raises:
ValueError – If
source_bits < 2ortarget_bits < source_bits.