This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Open
Conversation
cgranade
reviewed
Sep 1, 2020
Contributor
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!
| /// 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) |
Contributor
There was a problem hiding this comment.
We can defer to API review, but I'd suggest maybe something like "CompareLessThanConstantUsingRippleCarry"?
Member
Author
There was a problem hiding this comment.
Sounds good, but we need further discussion because we also have CompareUsingRippleCarry at the moment.
Contributor
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
Member
Author
|
Thanks for your feedback @cgranade, I have incorporated your comments. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.)