Run your circuits with OpenQASM 3.0
Amazon Braket now supports OpenQASM
3.0
The topics in this guide walk you through various examples of how to complete the following quantum tasks.
This guide also provides an introduction to certain hardware-specific features that can be implemented with OpenQASM 3.0 on Braket and links to further resources.
In this section:
- What is OpenQASM 3.0?
- When to use OpenQASM 3.0
- How OpenQASM 3.0 works
- Prerequisites
- What OpenQASM features does Braket support?
- Create and submit an example OpenQASM 3.0 quantum task
- Support for OpenQASM on different Braket Devices
- Simulate noise with OpenQASM 3.0
- Qubit rewiring with OpenQASM 3.0
- Verbatim Compilation with OpenQASM 3.0
- The Braket console
- More resources
- Computing gradients with OpenQASM 3.0
- Measuring specific qubits with OpenQASM 3.0
What is OpenQASM 3.0?
The Open Quantum Assembly Language (OpenQASM) is an intermediate
representation
The new version of OpenQASM (3.0) extends the previous version to include more
features, such as pulse-level control, gate timing, and classical control flow to bridge
the gap between end-user interface and hardware description language. Details and
specification on the current version 3.0 are available on the GitHub OpenQASM 3.x Live Specification
When to use OpenQASM 3.0
OpenQASM provides an expressive framework to specify quantum programs through low-level controls that are not architecture specific, making it well suited as a representation across multiple gate-based devices. The Braket support for OpenQASM furthers its adoption as a consistent approach to developing gate-based quantum algorithms, reducing the need for users to learn and maintain libraries in multiple frameworks.
If you have existing libraries of programs in OpenQASM 3.0, you can adapt them for use with Braket rather than completely rewriting these circuits. Researchers and developers should also benefit from an increasing number of available third-party libraries with support for algorithm development in OpenQASM.
How OpenQASM 3.0 works
Support for OpenQASM 3.0 from Braket provides feature parity with the current Intermediate Representation. This means that anything you can do today on hardware devices and on-demand simulators with Braket, you can do with OpenQASM using the Braket API. You can run OpenQASM 3.0 programs by directly supplying OpenQASM strings to all gate-based devices in a manner that is similar to how circuits are currently supplied to devices on Braket. Braket users can also integrate third-party libraries that support OpenQASM 3.0. The rest of this guide details how to develop OpenQASM representations for use with Braket.
Prerequisites
To use OpenQASM 3.0 on Amazon Braket, you must have version v1.8.0
of the Amazon Braket
Python Schemas
If you are a first time user of Amazon Braket, you need to enable Amazon Braket. For instructions, see Enable Amazon Braket.
The Braket console
OpenQASM 3.0 tasks are available and can be managed within the Amazon Braket console. On the console, you have the same experience submitting quantum tasks in OpenQASM 3.0 as you had submitting existing quantum tasks.
More resources
OpenQASM is available in all Amazon Braket Regions.
For an example notebook for getting started with OpenQASM on Amazon
Braket, see Braket Tutorials GitHub