# QPU Reservations

{% hint style="info" %}
Reserving time on a QPU requires an existing QCS account. If you don't already have a QCS account, you can [request one](https://www.rigetti.com/get-quantum).
{% endhint %}

## What is a QPU Reservation?

A QPU reservation gives you maximum-priority access to a particular QPU for a period of time, scheduled in advance in increments of 15 minutes. See the instructions below for how to schedule a reservation.

#### Parallelization

During a reservation, programs which use different sections of the QPU may be safely run in parallel with one another. This means that, during a 15-minute reservation, it's possible to run more than 15 minutes worth of programs!

<details>

<summary>What sections does a QPU have, and how do I know if my programs will run in parallel?</summary>

On our 84-Qubit Ankaa QPUs, each row of 7 qubits is such a section:

```
0   1   2   3   4   5   6 <-- programs on only these qubits...
7   8   9  10  11  12  13 <-- ...can be parallelized with programs on these.
...
```

</details>

#### Pricing

Reservations are priced by minute of reservation time, rather than by the number of programs that are run. Programs run within a reservation are, themselves, free of cost.

## Make a Reservation

There are two ways to reserve time on a Rigetti QPU:

* [Using the QCS dashboard](#using-the-qcs-dashboard)
* [Using the QCS CLI](#using-the-qcs-cli)

### Using the QCS Dashboard

From the [QCS dashboard](https://qcs.rigetti.com), start by selecting a desired reservation duration, date, and time, then click the search icon.

![](https://2751305033-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZEieIEeLjYyh3wXFpS%2Fuploads%2FNuwRhmiidbPykRTgQ3Qj%2FScreen%20Shot%202022-05-20%20at%206.11.16%20PM.png?alt=media\&token=f00920fc-c1a4-4116-b623-cd012de5f38f)

You'll be presented with a list of available QPUs, including information about each QPU's topology and fidelities. Simply select a desired QPU and follow the confirmation prompts.

Once finished, you'll receive an email confirming the reservation.

#### Viewing or Cancelling a Reservation

To view upcoming reservations, visit the QCS dashboard and scroll down until you see the `Upcoming Reservations` section.

From there, click [`View all your reservations`](https://qcs.rigetti.com/reservations) to see past and future reservations, or click the trash can icon next to a reservation to cancel it.

### Using the QCS CLI

{% hint style="success" %}
If you're using the QCS CLI from a local computer instead of your provisioned [JupyterLab IDE](https://docs.rigetti.com/qcs/getting-started/set-up-your-environment/jupyterlab-ide), ensure you've [downloaded and configured the CLI](https://docs.rigetti.com/qcs/guides/using-the-qcs-cli). While you are not able to run programs on a QPU from your local computer, you can otherwise interact with the QCS API from wherever you are.
{% endhint %}

First, view a list of available QPUs:

```bash
qcs api list-quantum-processors
```

{% hint style="info" %}
If you'd like to inspect the topology and fidelity information for a QPU, you can use `qcs api get-instruction-set-architecture <quantum-processor-id>`.

For example, to inspect `Aspen-9`, run:

```bash
qcs api get-instruction-set-architecture Aspen-9
```

{% endhint %}

Once you've selected a QPU, interactively select an available reservation with the [`qcs tools reserve`](https://docs.rigetti.com/qcs/references/qcs-cli#reserve) command.

For example, to book a reservation on `Aspen-9`, run:

```bash
qcs tools reserve --quantum-processor-id Aspen-9
```

{% hint style="info" %}
There are more options available to this command than shown above. See the [QCS CLI reference](https://docs.rigetti.com/qcs/references/qcs-cli#reserve) for more details.
{% endhint %}

Once finished, you'll receive an email confirming the reservation.

#### Viewing or Cancelling a Reservation

To list reservations, run:

```bash
qcs api list-reservations
```

{% hint style="info" %}
The above command will list all reservations, past and future. If you'd like to filter based on properties like QPU or start time, you can supply a [`--filter`](https://docs.api.qcs.rigetti.com/#tag/filterParameter) option.

For example:

```bash
qcs api list-reservations --filter 'quantumProcessorId = "Aspen-9"'
qcs api list-reservations --filter 'startTime >= "2021-05-13T00:00:00Z"'
```

For a list of available filter fields for `list-reservations`, see the [endpoint's documentation](https://docs.api.qcs.rigetti.com/#tag/reservations).

For more details on formatting filters, see our [API documentation](https://docs.api.qcs.rigetti.com/#tag/filterParameter).

For help formatting timestamps, see the CLI's [`format-date`](https://docs.rigetti.com/qcs/references/qcs-cli#format-date) command.
{% endhint %}

To cancel an upcoming reservation, run the following command (supplying the ID for the reservation in place of `<reservation-id>`):

```bash
qcs api delete-reservation <reservation-id>
```

{% hint style="info" %}
A reservation's ID can be found by looking at the `id` field in the results of running `qcs api list-reservations`, as described above.
{% endhint %}
