-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arithmetic circuit library: Adders #6164
Conversation
* Implement initial draft of ripple-carry adder circuit * Switch to ancilla register for ancilla qubits * Remove padding for simpler implementation * Add small fixes from review * Add initial unit tests Co-authored-by: Julien Gacon <[email protected]> * Switch carry out from ancilla to usual register * Update __init__ docstring with raises * Add suggestions from review; Clean-up Co-authored-by: Julien Gacon <[email protected]> * Add additional test for ripple-carry adder Co-authored-by: Julien Gacon <[email protected]>
* Implement initial draft of ripple-carry adder circuit * Switch to ancilla register for ancilla qubits * Remove padding for simpler implementation * Add small fixes from review * Add initial unit tests Co-authored-by: Julien Gacon <[email protected]> * Switch carry out from ancilla to usual register * Update __init__ docstring with raises * Add suggestions from review; Clean-up Co-authored-by: Julien Gacon <[email protected]> * Add additional test for ripple-carry adder * Implement initial QFT adder circuit Co-authored-by: Julien Gacon <[email protected]> * Fix QFT adder carry out; Switch to non-modular as default * Expand adder tests with QFT adder * Rename test_adder.py -> test_adders.py * Include additional QFT adder documentation * Fix typos * Fix documentation math Co-authored-by: Julien Gacon <[email protected]> * Add non-modular test as default Co-authored-by: Julien Gacon <[email protected]> * Remove duplicate file after merge Co-authored-by: Julien Gacon <[email protected]>
* empty * empty * Implemented classical adder in QFT paper * Implemented classical adder in QFT paper * fix classicaladd imports * fix missing imports * Added the tests part for ClassicalAdd * move cin to bottom * Updated the documentation and test parts for ClassicalAdder * Updated init files * Deleted adder folder from the git repository * Deleted test_classicaladd.py * Deleted old classicaladder file * Deleted __init__.py file from repository * Updated classical_adder file Co-authored-by: Cryoris <[email protected]> Co-authored-by: Julien Gacon <[email protected]>
* modular RippleCarryAdder * test that ancillas are uncomputed * fix ClassicalAdder ancilla uncompute * replace all to_instruction by to_gate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some notes on naming:
-
The classical adder has been called "Plain Adder" here - fig 2. I think that's better than "classical" because many adders are classical circuits (it is just called "classical" in Draper's paper to contrast it with the quantum-ness of QFT).
-
It is customary for these adders to be referred to by their author's names. So for example the ripple-carry one you have here is often referred to as Cuccaro's adder or CDKM adder (there are other ripple carry adders e.g. VBE adder or TTK adder). Similarly the QFT one is often referred to as Draper's adder. Although I like the idea of a descriptive name also. How about
CuccaroRippleCarryAdder
andDraperQFTAdder
?
Co-authored-by: Cryoris <[email protected]>
and fix lint
Summary
Part of qiskit-advocate/qamp-spring-21#12 with @mantcep and @ManjulaGandhi.
Add a new circuit library submodule to perform classical addition of two equally-sized
qubit registers including:
Details and comments
Example: