How to set up and install Fire Opal
Get the accounts and development tools required to run Fire Opal
Fire Opal delivers effective error suppression technology for quantum computers as a simple, fully-automated solution suitable for any user.
In this guide, you will learn how to:
- Set up an environment for use with Fire Opal.
- Install the Fire Opal Python package.
- Set up accounts with Q-CTRL and IBM Quantum for use with Fire Opal.
1. Set up your local development environment
To get started quickly and easily with Fire Opal and other Python packages, it's recommended to use Anaconda—a free and open-source distribution of the Python and R programming languages for scientific computing that aims to simplify package management and deployment.
Once you have Anaconda downloaded, use it to create and activate a virtual environment with a valid Python version. Fire Opal is compatible with Python versions >=3.8 and <3.12. You can either use Anaconda from the command line or through their visual Anaconda Navigator. If using command line, run the following commands:
conda create --name your_env_name python=3.9
conda activate your_env_name
Alternatively, you can use a web-based development platform, such as Google Colab or qBraid Lab. If using a web-based IDE, you will have to authenticate using an API key in Step 3.
2. Install the Fire Opal Python package
If using a command line interface, install the Fire Opal Python package by running the following command within the virtual environment created in step 1.
pip install fire-opal
If you already have the fire-opal
package installed and wish to update to the latest version, use the upgrade
flag in pip
.
pip install --upgrade fire-opal
3. Set up Q-CTRL account
To use Fire Opal, you'll need a Q-CTRL account. Once you have your account, you can either authenticate to Fire Opal via browser when executing a function for the first time, or you can authenticate using an API key.
Note: When using a browser-based development platform, you must authenticate using an API key.
import fireopal as fo
api_key = "YOUR_QCTRL_API_KEY"
fo.authenticate_qctrl_account(api_key=api_key)
If you are a member of multiple organizations, you must specify your organization_slug
, which is the unique ID used to identify this the organization with access to Fire Opal. You can check organization names and other details by visiting your Q-CTRL account.
fo.config.configure_organization(organization_slug="organization_slug")
4. Set up hardware provider account
Fire Opal supports submission of circuits to IBM Quantum Platform and Amazon Braket.
The following code demonstrates how to generate a credentials dictionary for use with IBM Quantum backends. Learn how to authenticate with your IBM Quantum account.
# Enter your IBM token here.
ibm_token = "your_IBMQ_token"
# These are the properties for the publicly available provider for IBM backends.
# If you have access to a private provider and wish to use it, replace these values.
hub = "ibm-q"
group = "open"
project = "main"
# Launch browser-based authentication page if running the notebook locally
ibm_credentials = fo.credentials.make_credentials_for_ibmq(
token=ibm_token, hub=hub, group=group, project=project
)
The following code demonstrates how to generate a credentials dictionary for use with Amazon Braket backends. Learn how to authenticate with Amazon Braket credentials.
arn = "<YOUR_ROLE_ARN>"
credentials = fo.credentials.make_credentials_for_braket(arn=arn)
Next, try running jobs on quantum hardware with Fire Opal.
The package versions below were used to produce this notebook.
from fireopal import print_package_versions
print_package_versions()
| Package | Version |
| --------- | ------- |
| Python | 3.11.3 |
| networkx | 2.8.8 |
| numpy | 1.23.5 |
| sympy | 1.12 |
| fire-opal | 5.3.1 |