To run a problem on Aquila, the first step is to convert the Hamiltonian from its standard Bloqade format to one that can be taken by the Amazon Braket service. We need the
Bloqade_schema package, and then use
hardware_transform to make the conversion.
using BloqadeSchema transformed_h, transform_info = hardware_transform(Hamiltonian);
Still, one should always check if the transformed Hamiltonian is acceptable given hardware constraints. We can test that via the function
To submit jobs to Aquila, all one needs now is their AWS Braket credentials, which can be generated from the
AWS Braket package, and the function
submit_to_braket, which takes as input the desired Hamiltonian, the number of shots for the experiment, and, of course, the credentials.
submit_to_braket can take as input the original Bloqade Hamiltonian as well, before transforming.
hardware_transform is invoked automatically to make sure the Hamiltonian satisfies the hardware requirements. Still, the process of transforming and validating a Hamiltonian by hand is advised, to ensure calculations don’t go wrong.
using AWS access_key_id = "your_access_key_id" secret_key = "your_secret_key" token = "your_token" credentials = AWS.AWSCredentials(access_key_id, secret_key, token) task = submit_to_braket(transformed_h, 100; credentials=credentials)
And that is it! The final disclaimer is that once jobs have been sent to Braket, the data that comes back is not really part of the Bloqade infrastructure. To interact with the results, one has to rely on the
Braket.jl package and functions like
state (that will tell you if your task ran, is in the queue, was cancelled, or failed) and
get_measurements, to read the actual data. For more info, take a lookt at Braket.jl’s documentation