QuEraComputing / bloqade-python

QuEra's Neutral Atom SDK for Analog QPUs
https://bloqade.quera.com/
Other
51 stars 13 forks source link

hardware transform functionality #529

Open jon-wurtz opened 10 months ago

jon-wurtz commented 10 months ago

When converting a program to one that should run on Aquila, we should have a function that adds all of the adjustments to make the program valid to run on Aquila. For example, a user will very reasonably demand the following program

program = (
    start
    .add_position((0, 0))
    .rydberg.detuning.uniform.
    piecewise_constant(
        durations = [1.0],
        values = [-1]
    )
    .amplitude.uniform.
    piecewise_constant(
        durations = [1.0],
        values = [15.8]
    )
)

Which will fail validation due to Rabi not having the correct beginning and end. Implementing

program_aquila = program.braket.aquila()

should nudge the program so that it minimally adjusts the waveforms to conform to Aquila restrictions.

weinbe58 commented 10 months ago

I don't think automatically doing this is the best idea, I recall this being a bit of an issue in Bloqade.jl

jon-wurtz commented 10 months ago

I believe that this should be a critical feature of Bloqade, and it is a bit surprising that we do not have it already.

It would also be great to have functionality that scales time so that Rabi frequency is maximized. For example, you start in units of 1, then call program_aquila.scale() or a similar command which converts to units of rad/usec so that the maximum Rabi frequency is the hardware maximum.

Roger-luo commented 10 months ago

from triage, we think we can provide this functionality in the same sense like gcc --fastmath

jon-wurtz commented 10 months ago

What do you mean by this and why does it reference a compiler? This does not need anything compiler-like; instead, it should seek to make minimal modifications to the waveforms and positions to obey hardware constraints

weinbe58 commented 9 months ago

@jon-wurtz He means is would be something on the level of parallelize so you would do something like:

program.assign(...).batch_assign(...).args(...).transform("Aquila").braket.aquila().run_async(...)