Skip to content
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

Support for higher precision in QROMs #1056

Open
kjm538 opened this issue Jun 7, 2024 · 0 comments
Open

Support for higher precision in QROMs #1056

kjm538 opened this issue Jun 7, 2024 · 0 comments

Comments

@kjm538
Copy link

kjm538 commented Jun 7, 2024

This line in QROMBase limits the precision for the data used in SelectSwapQROM.

_data = tuple([np.array(d, dtype=int) for d in data])

For some applications, the target bitsize for the data I need to load is quite high. I am able to represent them as integers since Python integers have unlimited precision, but the use of a numpy array above results in the error RuntimeWarning: invalid value encountered in cast and prevents resource analysis.

To reproduce the error:

powers = [61,62,63,64]
for p in powers:
    data = [2**p,2**p-2**32,2**p-2**50]
    qroam_gate = SelectSwapQROM([data],target_bitsizes=(max(data).bit_length(),),selection_bitsizes=(len(data),))
    print(t_complexity(qroam_gate))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants