qat.lang.AQASM.qftarith.mult

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

Builds a circuit performing a multiplication using two qbits registers and storing the result in a third. . Only the content of the third register is changed:

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

The multiplication is performed by b repeated additions of a into the third register. 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 of the first register

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

  • res_reg_size (int) – the number of qbits holding the final result