-
Couldn't load subscription status.
- Fork 46
Jasp-compatible Montgomery arithmetics #205
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
base: main
Are you sure you want to change the base?
Conversation
|
First of all: Massive work!! This is amazing. It's clear that you put a lot of work in it and this kind of feature underlines once more how we are truly pushing the state of the art in quantum compilation. Since this is a big commit, I have a couple of points, this however doesn't at all takes anything away from the fact how cool this is :)
|
|
Thank you very much for the feedback. I have pushed some changes that address the points you have made.
I am working on that.
This appears to be a bug in the controlled version of the
Fixed.
When executing the privided code, no error is thrown for me. However, I agree that the way to create a
Good catch.
I have implemented this method and the required bit operations. However, I think the added overhead by calling the bit operations is larger than that of the direct implementation.
Fixed.
I agree that this is interesting. This might be caused by different default adders. I will investigate further! |
|
Regarding the big_int initialization: You're right, the presented example doesn't reproduce the error. No idea why I posted that. This one however gives me an error: |
Yes, this is indeed a problem. The jax loop inside the function requires a dynamic jax integer which are limited in size (unlike Python integers). In this case, however, we can use a Python loop to create the BigInteger using the function |
Yields: TypeError: remaud_adder() missing 1 required positional argument: 'z' Not sure if this is a problem, with the remand adder, or caused by using this adder within the jasp_montgomery arithmetic. (The change was made to always use the jasp Montgomery arithmetic for quantum-classical.) |
…l mode in test as this is already performed within ithe gidney adder
|
An example like this, demonstrating how BigInteger can be used with QuantumModulus, would be helpful in the Scalable Integer Type documentation. However, even running a smaller example, like this: Yields the correct result, but: |
@renezander90 The Remaud adder still needs some more work to be used here. What is missing in particular is a classical-quantum addition. Considering it uses the input qubits as "dirty workspace" a lot, I don't think a more optimal version than this can be found: Furthermore we need to figure out how to deal with the carry value |
|
classical-quantum matrix multiplication for QuantumArray with type QuantumModulus does not work properly (are there any tests?): Yields:
Yields:
|
Adds jasp-compatible (and non-jasp-compatible) functions for montgomery arithmetics. Additionally, removes the length-check in the
qq_gidney_adder.