pyqir
pyqir copied to clipboard
Integer division and remainder instructions
Division by constant is supported in pytket
and our lower level compiler. It would be good (but not critical) to have it supported in pyqir
. The division by zero issue is also easier.
From PyQIR's side, I think it would be easiest and consistent with the other instructions to support any value (constant or not constant) as the operands, but you could of course restrict yourself to constant denominators. Also, I think we might as well add the whole suite of unsigned and signed division and remainder instructions udiv
, urem
, sdiv
and srem
, since it's not much work.
This will be handled when updating to support the adaptive profile specification.