Skip to content

Support for higher precision in QROMs #1056

Open
@kjm538

Description

@kjm538

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))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions