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:

  1. Set up an environment for use with Fire Opal.
  2. Install the Fire Opal Python package.
  3. 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 the Fire Opal package, you'll need a Q-CTRL Fire Opal 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:

# 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"

credentials = {"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.

Was this useful?

Fire Opal

Optimize your quantum algorithms

Next up

Continue learning about Fire Opal

Importing OpenQASM

Importing OpenQASM from external files to Python