qat.lang.AQASM.classarith.add_const

qat.lang.AQASM.classarith.add_const(reg_size: int, constant: int)

Implementation based on [CVBE96]. Builds a circuit performing an addition by a constant:

\[|a\rangle \mapsto |a + C\rangle\]
Parameters
  • reg_size (int) – the registers size

  • constant (int) – the constant to add

Warning

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