

# Submitting quantum tasks to QPUs


Amazon Braket provides access to several devices that can run quantum tasks. You can submit quantum tasks individually or you can set up [quantum task batching](https://docs.aws.amazon.com/braket/latest/developerguide/braket-batching-tasks.html).

 **Quantum processing units (QPUs)** 

You can submit quantum tasks to QPUs at any time, but the task runs within certain availability windows that are displayed on the **Devices** page of the Amazon Braket console. You can retrieve the results of the quantum task with the quantum task ID, which is introduced in the next section.
+  ** AQT IBEX-Q1 ** : `arn:aws:braket:eu-north-1::device/qpu/aqt/Ibex-Q1` 
+  ** IonQ Forte-1 ** : `arn:aws:braket:us-east-1::device/qpu/ionq/Forte-1` 
+  ** IonQ Forte-Enterprise-1 ** : `arn:aws:braket:us-east-1::device/qpu/ionq/Forte-Enterprise-1` 
+  ** IQM Garnet ** : `arn:aws:braket:eu-north-1::device/qpu/iqm/Garnet` 
+  ** IQM Emerald ** : `arn:aws:braket:eu-north-1::device/qpu/iqm/Emerald` 
+  ** QuEra Aquila ** : `arn:aws:braket:us-east-1::device/qpu/quera/Aquila` 
+  ** Rigetti Ankaa-3 ** : `arn:aws:braket:us-west-1::device/qpu/rigetti/Ankaa-3` 
+  ** Rigetti Cepheus-1-108Q ** : `arn:aws:braket:us-west-1::device/qpu/rigetti/Cepheus-1-108Q` 

**Note**  
You can cancel quantum tasks in the `CREATED` state for QPUs and on-demand simulators. You can cancel quantum tasks in the `QUEUED` state on a best-effort basis for on-demand simulators and QPUs. Note that QPU `QUEUED` quantum tasks are unlikely to be cancelled successfully during QPU availability windows.

**Topics**
+ [

## AQT
](#braket-qpu-partner-aqt)
+ [

## IonQ
](#braket-qpu-partner-ionq)
+ [

## IQM
](#braket-qpu-partner-iqm)
+ [

## Rigetti
](#braket-qpu-partner-rigetti)
+ [

## QuEra
](#braket-qpu-partner-quera)
+ [

# Example: Submitting a quantum task to a QPU
](braket-submit-to-qpu.md)
+ [

# Inspecting compiled circuits
](braket-compiled-circuits-inspecting.md)

## AQT


AQT's IBEX-Q1 QPU is based on a crystal of 40Ca\$1 ions in a macroscopic radio frequency trap sitting in ultra-high vacuum chamber. The device runs at room temperature and fits into two 19-inch datacenter compatible racks.

High-fidelity gates are enabled by the low heating rates of the trap and the use of a direct optical transition for qubit rotation. The qubit transition is driven by a narrow linewidth laser with a very high relative frequency stability. The qubits also feature efficient state preparation and readout through optical shelfing. All-to-all connectivity is achieved by the long-range Coulomb interaction in the ion crystal. Single-ion addressing and readout are achieved by use of a high numerical aperture lens.

The AQT device support the following quantum gates.

```
'ccnot', 'cnot', 'cphaseshift', 'cphaseshift00', 'cphaseshift01', 'cphaseshift10', 'cswap', 'swap', 'iswap', 'pswap', 'ecr', 'cy', 'cz', 'xy', 'xx', 'yy', 'zz', 'h', 'i', 'phaseshift', 'rx', 'ry', 'rz', 's', 'si', 't', 'ti', 'v', 'vi', 'x', 'y', 'z', 'prx'
```

With verbatim compilation, the AQT device supports the following native gates.

```
'prx', 'xx', 'rz'
```

**Note**  
The following describes equivalent gates between AQT native gates and Amazon Braket:  
The AQT Mølmer-Sørensen (MS or RXX) gate corresponds to Braket's `'xx'` gate
The AQT R gate corresponds to Braket's `'prx'` gate
The `'rz'` gate naming is the same

## IonQ


IonQ offers gate-based QPUs based on ion trap technology. IonQ's trapped ion QPUs are built on a chain of trapped 171Yb\$1 ions that are spatially confined by means of a microfabricated surface electrode trap within a vacuum chamber.

IonQ devices support the following quantum gates.

```
'x', 'y', 'z', 'rx', 'ry', 'rz', 'h', 'cnot', 's', 'si', 't', 'ti', 'v', 'vi', 'xx', 'yy', 'zz', 'swap'
```

With verbatim compilation, the IonQ QPUs support the following native gates.

```
'gpi', 'gpi2', 'ms'
```

If you only specify two phase parameters when using the native MS gate, a fully- entangling MS gate runs. A fully-entangling MS gate always performs a π/2 rotation. To specify a different angle and run a partially-entangling MS gate, you specify the desired angle by adding a third parameter. For more information, see the [ braket.circuits.gate module](https://amazon-braket-sdk-python.readthedocs.io/en/latest/_apidoc/braket.circuits.gate.html).

These native gates can only be used with verbatim compilation. To learn more about verbatim compilation, see [Verbatim Compilation](https://docs.aws.amazon.com/braket/latest/developerguide/braket-constructing-circuit.html#verbatim-compilation).

## IQM


IQM quantum processors are universal gate-model devices based on superconducting transmon qubits. The IQM Garnet is a 20-qubit device, while IQM Emerald is a 54-qubit device. Both these devices use a square lattice topology, also known as a Crystal lattice topology.

The IQM devices support the following quantum gates.

```
"ccnot", "cnot", "cphaseshift", "cphaseshift00", "cphaseshift01", "cphaseshift10", "cswap", "swap", "iswap", "pswap", "ecr", "cy", "cz", "xy", "xx", "yy", "zz", "h", "i", "phaseshift", "rx", "ry", "rz", "s", "si", "t", "ti", "v", "vi", "x", "y", "z"
```

With verbatim compilation, the IQM devices support the following native gates.

```
'cz', 'prx'
```



## Rigetti


Rigetti quantum processors are universal, gate-model machines based on all-tunable superconducting qubits.
+ The Ankaa-3 system is an 84-qubit device that utilizes scalable multi-chip technology.
+ The Cepheus-1-108Q system is a 108-qubit device that utilizes scalable multi-chip technology.

The Rigetti device supports the following quantum gates.

```
'cz', 'xy', 'ccnot', 'cnot', 'cphaseshift', 'cphaseshift00', 'cphaseshift01', 'cphaseshift10', 'cswap', 'h', 'i', 'iswap', 'phaseshift', 'pswap', 'rx', 'ry', 'rz', 's', 'si', 'swap', 't', 'ti', 'x', 'y', 'z'
```

With verbatim compilation, Ankaa-3 supports the following native gates.

```
'rx', 'rz', 'iswap'
```

 Rigetti superconducting quantum processors can run the 'rx' gate with only the angles of ±π/2 or ±π.

Pulse-level control is available on the Rigetti devices, which support a set of predefined frames of the following types for the Ankaa-3 system.

```
`flux_tx`, `charge_tx`, `readout_rx`, `readout_tx`
```

The Ankaa-3 device has a maximum limit of 20,000 gates per circuit. Circuits that exceed this limit are rejected with a validation error. This is a fixed limit that cannot be increased. The gate count refers to the compiled circuit, which may differ from the gate count of the original uncompiled circuit. To estimate the compiled gate count before submitting to the QPU, you can use verbatim compilation locally or transpile your circuit to the native gate set (`rx`, `rz`, `iswap`).

## QuEra


QuEra offers neutral-atom based devices that can run Analog Hamiltonian Simulation (AHS) quantum tasks. These special-purpose devices faithfully reproduce the time-dependent quantum dynamics of hundreds of simultaneously interacting qubits.

One can program these devices in the paradigm of Analog Hamiltonian Simulation by prescribing the layout of the qubit register and the temporal and spatial dependence of the manipulating fields. Amazon Braket provides utilities to construct such programs through the AHS module of the python SDK, `braket.ahs`.

For more information, see the [Analog Hamiltonian Simulation example notebooks](https://github.com/aws/amazon-braket-examples/tree/main/examples/analog_hamiltonian_simulation) or the [Submit an analog program using QuEra's Aquila](braket-quera-submitting-analog-program-aquila.md) page.

# Example: Submitting a quantum task to a QPU


Amazon Braket allows you to run a quantum circuit on a QPU device. The following example shows how to submit a quantum task to Rigetti or IonQ devices.

 **Choose the Rigetti Ankaa-3 device, then look at the associated connectivity graph** 

```
# import the QPU module
from braket.aws import AwsDevice
# choose the Rigetti device
device = AwsDevice("arn:aws:braket:us-west-1::device/qpu/rigetti/Ankaa-3")

# take a look at the device connectivity graph
device.properties.dict()['paradigm']['connectivity']
```

```
{'fullyConnected': False,
 'connectivityGraph': {'0': ['1', '7'],
  '1': ['0', '2', '8'],
  '2': ['1', '3', '9'],
  '3': ['2', '4', '10'],
  '4': ['3', '5', '11'],
  '5': ['4', '6', '12'],
  '6': ['5', '13'],
  '7': ['0', '8', '14'],
  '8': ['1', '7', '9', '15'],
  '9': ['2', '8', '10', '16'],
  '10': ['3', '9', '11', '17'],
  '11': ['4', '10', '12', '18'],
  '12': ['5', '11', '13', '19'],
  '13': ['6', '12', '20'],
  '14': ['7', '15', '21'],
  '15': ['8', '14', '22'],
  '16': ['9', '17', '23'],
  '17': ['10', '16', '18', '24'],
  '18': ['11', '17', '19', '25'],
  '19': ['12', '18', '20', '26'],
  '20': ['13', '19', '27'],
  '21': ['14', '22', '28'],
  '22': ['15', '21', '23', '29'],
  '23': ['16', '22', '24', '30'],
  '24': ['17', '23', '25', '31'],
  '25': ['18', '24', '26', '32'],
  '26': ['19', '25', '33'],
  '27': ['20', '34'],
  '28': ['21', '29', '35'],
  '29': ['22', '28', '30', '36'],
  '30': ['23', '29', '31', '37'],
  '31': ['24', '30', '32', '38'],
  '32': ['25', '31', '33', '39'],
  '33': ['26', '32', '34', '40'],
  '34': ['27', '33', '41'],
  '35': ['28', '36', '42'],
  '36': ['29', '35', '37', '43'],
  '37': ['30', '36', '38', '44'],
  '38': ['31', '37', '39', '45'],
  '39': ['32', '38', '40', '46'],
  '40': ['33', '39', '41', '47'],
  '41': ['34', '40', '48'],
  '42': ['35', '43', '49'],
  '43': ['36', '42', '44', '50'],
  '44': ['37', '43', '45', '51'],
  '45': ['38', '44', '46', '52'],
  '46': ['39', '45', '47', '53'],
  '47': ['40', '46', '48', '54'],
  '48': ['41', '47', '55'],
  '49': ['42', '56'],
  '50': ['43', '51', '57'],
  '51': ['44', '50', '52', '58'],
  '52': ['45', '51', '53', '59'],
  '53': ['46', '52', '54'],
  '54': ['47', '53', '55', '61'],
  '55': ['48', '54', '62'],
  '56': ['49', '57', '63'],
  '57': ['50', '56', '58', '64'],
  '58': ['51', '57', '59', '65'],
  '59': ['52', '58', '60', '66'],
  '60': ['59'],
  '61': ['54', '62', '68'],
  '62': ['55', '61', '69'],
  '63': ['56', '64', '70'],
  '64': ['57', '63', '65', '71'],
  '65': ['58', '64', '66', '72'],
  '66': ['59', '65', '67'],
  '67': ['66', '68'],
  '68': ['61', '67', '69', '75'],
  '69': ['62', '68', '76'],
  '70': ['63', '71', '77'],
  '71': ['64', '70', '72', '78'],
  '72': ['65', '71', '73', '79'],
  '73': ['72', '80'],
  '75': ['68', '76', '82'],
  '76': ['69', '75', '83'],
  '77': ['70', '78'],
  '78': ['71', '77', '79'],
  '79': ['72', '78', '80'],
  '80': ['73', '79', '81'],
  '81': ['80', '82'],
  '82': ['75', '81', '83'],
  '83': ['76', '82']}}
```

The preceding dictionary `connectivityGraph` lists the neighboring qubits for each qubit in the Rigetti device.

 **Choose the IonQ Forte-Enterprise-1 device** 

For the IonQ Forte-Enterprise-1 device, the `connectivityGraph` is empty, as shown in the following example, because the device offers *all-to-all* connectivity. Therefore, a detailed `connectivityGraph` is not needed.

```
# or choose the IonQ Forte-Enterprise-1 device
device = AwsDevice("arn:aws:braket:us-east-1::device/qpu/ionq/Forte-Enterprise-1")

# take a look at the device connectivity graph
device.properties.dict()['paradigm']['connectivity']
```

```
{'fullyConnected': True, 'connectivityGraph': {...}}
```

As shown in the following example, you have the option to adjust the shots (default=1000), the `poll_timeout_seconds` (default = 432000 = 5 days), the `poll_interval_seconds` (default = 1), and the location of the S3 bucket (`s3_location`) where your results will be stored if you choose to specify a location other than the default bucket.

```
my_task = device.run(circ, s3_location = 'amazon-braket-my-folder', shots=100, poll_timeout_seconds = 100, poll_interval_seconds = 10)
```

The IonQ and Rigetti devices compile the provided circuit into their respective native gate sets automatically, and they map the abstract qubit indices to physical qubits on the respective QPU.

**Note**  
QPU devices have limited capacity. You can expect longer wait times when capacity is reached.

 Amazon Braket can run QPU quantum tasks within certain availability windows, but you can still submit quantum tasks any time (24/7) because all corresponding data and metadata are stored reliably in the appropriate S3 bucket. As shown in the next section, you can recover your quantum task using `AwsQuantumTask` and your unique quantum task ID.

# Inspecting compiled circuits


When a quantum circuit needs to be run on a hardware device, such as a quantum processing unit (QPU), the circuit must first be compiled into an acceptable format that the device can understand and process. For example, transpiling the high-level quantum circuit down to the specific native gates supported by the target QPU hardware. Inspecting the actual compiled output of the quantum circuit can be extremely useful for debugging and optimization purposes. This knowledge can help identify potential issues, bottlenecks, or opportunities for improving the performance and efficiency of the quantum application. You can view and analyze the compiled output of your quantum circuits for both Rigetti and IQM quantum computing devices using the code provided below. 

```
task = AwsQuantumTask(arn=task_id, aws_session=session)
# After the task has finished running
task_result = task.result()
compiled_circuit = task_result.get_compiled_circuit()
```

**Note**  
Currently, viewing the compiled circuit output for IonQ devices is not supported.