Reservations - Amazon Braket

Reservations

Reservations give you exclusive access to the quantum device of your choice. You can schedule a reservation at your convenience, so you know exactly when your workload starts and ends execution. Reservations are available in 1-hour increments and can be cancelled up to 48 hours in advance, at no additional charge. You can choose to queue quantum tasks and hybrid jobs for an upcoming reservation in advance, or submit workloads during your reservation.

The cost of dedicated device access is based on the duration of your reservation, regardless of how many quantum tasks and hybrid jobs you run on the Quantum Processing Unit (QPU).

The following quantum computers are available for reservations:

  • IonQ’s Aria

  • IQM’s Garnet

  • QuEra’s Aquila

  • Rigetti’s Aspen-M-3

When to use a reservation

Leveraging dedicated device access with reservations provides you with the convenience and predictability of knowing exactly when your quantum workload starts and ends execution. Compared to submitting tasks and hybrid jobs on-demand, you do not have wait in a queue with other customer tasks. Because you have exclusive access to the device during your reservation, only your workloads run on the device for the entirety of the reservation.

We recommend using on-demand access for the design and prototyping phase of your research, enabling quick and cost-efficient iteration of your algorithms. Once you are ready to produce final experiment results, consider scheduling a device reservation at your convenience to ensure that you can meet project or publication deadlines. We also recommend using reservations when you desire task execution during specific times, such as when you're running a live demo or workshop on a quantum computer.

Create a reservation

To create a reservation, contact the Braket team by following these steps:

  1. Open the Amazon Braket console.

  2. Choose Braket Direct in the left pane, and then in the Reservations section, choose Reserve device .

  3. Select the Device that you would like to reserve.

  4. Provide your contact information including Name and Email. Be sure to provide a valid email address that you regularly check.

  5. Under Tell us about your workload, provide any details about the workload to run using your reservation. For example, desired reservation length, relevant constraints, or desired schedule.

  6. If you are interested in connecting with a Braket expert for a reservation prep session after your reservation is confirmed, optionally select I’m interested in a prep session.

You can also contact us to create a reservation by following these steps:

  1. Open the Amazon Braket console.

  2. Choose Devices in the left pane and choose the device that you would like to reserve.

  3. In the Summary section, choose Reserve device.

  4. Follow steps 4-6 in the previous procedure.

After you submit the form, you receive an email from the Braket team with the next steps to create your reservation. Once your reservation is confirmed, you receive the reservation ARN via email.

Note

Your reservation is only confirmed once you receive the reservation ARN.

Reservations are available in minimum 1-hour increments and certain devices might have additional reservation length constraints (including minimum and maximum reservation durations). The Braket team shares any relevant information with you prior to confirming the reservation.

If you indicated interest in a reservation prep session, the Braket team contacts you via email to arrange a 30-minute session with a Braket expert.

Run your workload with a reservation

During a reservation only your workloads run on the device. To designate the quantum tasks and hybrid jobs to run during a device reservation, you must use a valid reservation ARN.

Note

Reservations are AWS account and device-specific. Only the AWS account that created the reservation can use your reservation ARN. Additionally, the reservation ARN is only valid on the reserved device at the chosen start and end times.

To make the most of your reserved time, you can choose to queue tasks and jobs before your reservation. These workloads remain in the QUEUED status until the reservation starts. When the reservation starts, any queued workloads run in the order submitted. Job tasks are prioritized ahead of standalone quantum tasks.

Note

Because only your workloads run during your reservation, there is no queue visibility for tasks and jobs submitted with a reservation ARN.

Code examples for creating a quantum task for a reservation:

  1. Define a circuit to prepare the GHZ state in OpenQASM fomat.

    // ghz.qasm // Prepare a GHZ state OPENQASM 3; qubit[3] q; bit[3] c; h q[0]; cnot q[0], q[1]; cnot q[1], q[2]; c = measure q;
  2. Create a quantum task using your circuit and the reservation ARN.

    with open("ghz.qasm", "r") as ghz: ghz_qasm_string = ghz.read() # import the device module from braket.aws import AwsDevice from braket.ir.openqasm import Program # choose the IonQ Aria 1 device device = AwsDevice("arn:aws:braket:us-east-1::device/qpu/ionq/Aria-1") program = Program(source=ghz_qasm_string) # Reservation ARN will be of the form arn:aws:braket:us-east-1:<AccountId>:reservation/<ReservationId> # Example: arn:aws:braket:us-east-1:123456789012:reservation/f17cc20b-1ba4-461f-8854-de4bb2aa64c1 ############################################################################## # IMPORTANT: If the reservation ARN is not specified, the created task # queues and runs outside of the reservation. # (The only exception is when the task is created by the script of a hybrid # job that had the reservation ARN passed at the time of its creation. # See “Code example for creating a hybrid job for a Braket Direct reservation:” # in the following section.) ############################################################################# my_task = device.run( program, reservation_arn="arn:aws:braket:us-east-1:<AccountId>:reservation/<ReservationId>" ) # You can also specify a particular Amazon S3 bucket location # and the desired number of shots, when running the program. # If no S3 location is specified, a default Amazon S3 bucket is chosen at amazon-braket-{region}-{account_id} # If no shot count is specified, 1000 shots are applied by default. s3_location = ("amazon-braket-my-bucket", "openqasm-tasks") my_task = device.run( program, s3_location, shots=100, reservation_arn="arn:aws:braket:us-east-1:<AccountId>:reservation/<ReservationId>" )

Code example for creating a hybrid job for a Braket Direct reservation:

  1. Define your algorithm script.

    //algorithm_script.py from braket.aws import AwsDevice from braket.circuits import Circuit def start_here(): print("Test job started!!!!!") # Use the device declared in the job script device = AwsDevice(os.environ["AMZN_BRAKET_DEVICE_ARN"]) bell = Circuit().h(0).cnot(0, 1) for count in range(5): task = device.run(bell, shots=100) print(task.result().measurement_counts) print("Test job completed!!!!!")
  2. Create the hybrid job using your algorithm script and the reservation ARN.

    from braket.aws import AwsQuantumJob job = AwsQuantumJob.create( "arn:aws:braket:us-east-1::device/qpu/ionq/Aria-1", source_module="algorithm_script.py", entry_point="algorithm_script:start_here", reservation_arn="arn:aws:braket:us-east-1:<AccountId>:reservation/<ReservationId>" )
  3. Create the hybrid job using the remote decorator..

    from braket.aws import AwsDevice from braket.circuits import Circuit from braket.devices import Devices from braket.jobs import hybrid_job, get_job_device_arn @hybrid_job(device=Devices.IonQ.Aria1, reservation_arn="arn:aws:braket:us-east-1:<AccountId>:reservation/<ReservationId>") def sample_job(): device = AwsDevice(get_job_device_arn()) bell = Circuit().h(0).cnot(0, 1) task = device.run(bell, shots=10) measurements = task.result().measurements return measurements

What happens at the end of your reservation

After your reservation ends, you no longer have dedicated access to the device. Any remaining workloads that are queued with this reservation are automatically canceled.

Note

Any job that was in RUNNING status when the reservation ends is canceled. We recommend using checkpoints to save and restart jobs at your convenience.

An ongoing reservation, such as after reservation start and before reservation end, can't be extended because each reservation represents standalone dedicated device access. For example, two back-to-back reservations are considered separate and any pending tasks from the first reservation are automatically canceled. They do not resume in the second reservation.

Note

Reservations represent dedicated device access for your AWS account. Even if the device remains idle, no other customers can use it. Therefore, you are charged for the length of the reserved time, regardless of the utilized time.

Cancel or reschedule an existing reservation

You can cancel your reservation no less than 48 hours before the scheduled reservation start time. To cancel, respond to the reservation confirmation email you received with your cancellation request.

To reschedule, you have to cancel your existing reservation, and then create a new one.