bloqade-python icon indicating copy to clipboard operation
bloqade-python copied to clipboard

hardware transform functionality

Open jon-wurtz opened this issue 2 years ago • 5 comments

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.

jon-wurtz avatar Sep 05 '23 13:09 jon-wurtz

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

weinbe58 avatar Sep 05 '23 13:09 weinbe58

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.

jon-wurtz avatar Sep 05 '23 15:09 jon-wurtz

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

Roger-luo avatar Sep 07 '23 20:09 Roger-luo

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

jon-wurtz avatar Sep 13 '23 15:09 jon-wurtz

@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(...)

weinbe58 avatar Oct 16 '23 21:10 weinbe58