qir-alliance / pyqir

PyQIR is a set of APIs for generating, parsing, and evaluating Quantum Intermediate Representation (QIR).
https://qir-alliance.github.io/pyqir
MIT License
54 stars 24 forks source link

Integer division and remainder instructions #165

Open Roland-djee opened 1 year ago

Roland-djee commented 1 year ago

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.

bamarsha commented 1 year ago

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.

idavis commented 10 months ago

This will be handled when updating to support the adaptive profile specification.