Uh oh!
There was an error while loading. Please reload this page.
Less-than comparison with a constant - #318
Conversation
Cassandra Granade (cgranade)
left a comment
There was a problem hiding this comment.
Looks good to me, modulo a few comments here and there. Happy to approve once we complete API review. Thanks!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| /// Dominic W. Berry, Craig Gidney, Mario Motta, Jarrod R. McClean, Ryan Babbush | ||
| /// Quantum 3, 208 (2019) | ||
| /// https://arxiv.org/abs/1902.02134v4 | ||
| operation LessThanConstantUsingRippleCarry(c : BigInt, x : LittleEndian, output : Qubit) |
There was a problem hiding this comment.
We can defer to API review, but I'd suggest maybe something like "CompareLessThanConstantUsingRippleCarry"?
There was a problem hiding this comment.
Sounds good, but we need further discussion because we also have CompareUsingRippleCarry at the moment.
There was a problem hiding this comment.
Good point; that can definitely create some confusion. Agreed with the need for further discussion.
Co-authored-by: Chris Granade <chgranad@microsoft.com>
…aries into msoeken/arithmetic
Mathias Soeken (msoeken)
commented
Sep 2, 2020
Thanks for your feedback Cassandra Granade (@cgranade), I have incorporated your comments. |
This operation implements an optimised version of Fig. 17 in arXiv:1902.02134. Constant input bits are propagated into the circuits, and no qubits are allocated for them. Further optimisations are applied for trailing 0s in the bit representation of the constant. The circuit uses AND gates instead of Toffoli gates to further reduce costs.
API review is necessary for consistent naming of arithmetic operations (e.g., compare to
CompareUsingRippleCarrywhich performs greater-than comparison.)