How to set up your environment 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. (Recommended) Install and activate Anaconda
To get started quickly and easily, we recommend 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.
pip install anaconda-client
Next, use Anaconda to create and activate a virtual environment with a valid Python version. Fire Opal is compatible with Python 3.8, 3.9, or 3.10. For example:
conda create --name your_env_name python=3.9
conda activate your_env_name
2. Install the Fire Opal Python package
From within your Anaconda virtual environment, install the Fire Opal Python package using pip on the command line.
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 and IBM Quantum accounts
To use Fire Opal, you'll need a Q-CTRL account.
Fire Opal supports submission of circuits to IBM Quantum devices. Visit IBM Quantum to sign up for an account. Once you have an account, you can provide your credentials to Fire Opal through a dictionary in the format below:
from fireopal import credentials
# Enter your IBM token here.
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"
ibm_credentials = credentials.make_credentials_for_ibmq(
token=token,
hub=hub,
group=group,
project=project,
)
4. Start a Q-CTRL Fire Opal session
Import functions directly from the Fire Opal Python package in your Python script or Jupyter notebook. A session will automatically begin upon calling any Fire Opal function. When a session starts, a browser window will open to perform authentication (unless you've recently authenticated). Enter your Q-CTRL Fire Opal credentials in the browser window to continue.
# Import functions from the Fire Opal Client package.
from fireopal import execute, validate
# Start a session by calling either function after assigning the appropriate parameters.
real_hardware_results = execute(circuits, shot_count, credentials, backend_name)
You have now started a Fire Opal session.
5. Specify your organization
If you are a member of multiple organizations, you must specify which organization to use by setting the organization parameter, as shown below.
fireopal.config.configure_organization(organization_slug="organization_slug")
where organization_slug
is the unique ID used to identify this organization. You can check organization names and other details by visiting your Q-CTRL account.
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 |