qat.lang.AQASM.qftarith.add

qat.lang.AQASM.qftarith.add(reg_size: int, reg_size_2: int)

Builds a circuit performing an addition using two qbits registers. The addition is done ‘in place’. Only the content of the first register is changed:

\[|a\rangle|b\rangle \mapsto |a + b\rangle|b\rangle\]

All additions, unless specified, are modulo \(2^n\) where n is the size of the register holding the result.

Parameters
  • reg_size (int) – the number of qbits on which to perform the addition

  • reg_size_2 (int) – the number of qbits holding the value of the number to add