qat.lang.AQASM.arithmetic.add_const_mod

qat.lang.AQASM.arithmetic.add_const_mod(reg_size: int, constant: int, modulus: int)

Generates a QRoutine performing the following operation:

\[|a\rangle \mapsto |a + \textrm{constant} \mod \textrm{modulus}\rangle\]
Parameters
  • reg_size (int) – the register’s size

  • constant (int) – the constant to add

  • modulus (int) – the modulus

Warning

This routine has public arity reg_size but uses 2 additional qubits (these will be automatically allocated at circuit generation time, in the to_circ() method).

Some additional qubits might be allocated by sub-routines inside this routine.

This routine calls: