-
Notifications
You must be signed in to change notification settings - Fork 86
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
Controlled Increment and Decrement Gates #43
Comments
Thank you @AbdullahKazi500 for this issue. If I understand correctly, you are suggesting an addition of several functions to our open-library. Could you please explicitly specify what are the qmod declarations of these functions? (see examples of declarations in The Increment/Decrement functions are essentially referred to in-place modular addition/subtraction by 1. Why are you interested in the controlled version of these? If you implement these then the controlled-operation can be achieved by the usual |
I Think it would be |
OK @AbdullahKazi500 , shouldn't |
Yes you are correct here . Quipper, control (ctrl) and auxiliary (aux) qubits are typically represented as arrays or lists of qubits rather than single qubits. |
Maybe something like this |
@AbdullahKazi500 our new tutorial on discrete quantum walks are now out, see here. I see two orthogonal ways to proceed:
|
of course that would be great let me think of someway to add this new functions @TomerGoldfriend |
Great @AbdullahKazi500 , I have opened an issue for the notebook modification: #56. Let us start with it, and then we can discuss the addition of new functions. |
Description
The current quantum computing framework lacks built-in functionalities for performing controlled increment and decrement operations on quantum registers. These operations are essential for various quantum algorithms and simulations.
Proposed Solution
Introduce two new gates:
Controlled Increment Gate (increment function):
This gate performs a controlled increment operation on a quantum register.
Iterates over each qubit in the register, applying multi-controlled Toffoli gates to increment the binary number by 1.
Controlled Decrement Gate (decrement function):
This gate performs a controlled decrement operation on a quantum register.
Iterates over each qubit in the register, applying multi-controlled Toffoli gates to decrement the binary number by 1.
Operation Details
Controlled Increment Gate (increment function):
Iterates over each qubit in the register qr (from least significant to second-to-last qubit).
For each qubit qr[j]:
Apply a multi-controlled Toffoli gate with controls from qr[0] to qr[j], targeting qr[j+1].
Controlled Decrement Gate (decrement function):
Iterates over each qubit in the register qr (from least significant to second-to-last qubit).
For each qubit qr[i]:
Apply a multi-controlled Toffoli gate with controls from qr[0] to qr[i], targeting qr[i+1].
Motivation
These gates are fundamental for implementing quantum arithmetic operations and can significantly enhance the capabilities of the quantum computing framework for algorithm development and simulations.
Additional Notes
Ensure the gates are implemented efficiently using multi-controlled Toffoli gates (mct gates).
Consider compatibility with various quantum simulators and hardware platforms supported by the framework.
Proposed Changes
Implement the increment(qc, qr) function to perform a controlled increment operation on the quantum register qr.
Implement the decrement(qc, qr) function to perform a controlled decrement operation on the quantum register qr.
The text was updated successfully, but these errors were encountered: