Configure Q-CTRL on IBM Quantum services
Set Q-CTRL as your Qiskit Runtime performance management strategy
On the IBM Cloud channel, you have the option to select a performance management strategy when creating a Qiskit Runtime instance. Q-CTRL offers a fully automated error suppression pipeline that enables you to reduce noise and boost algorithm performance at no additional cost. For more information on the benefits of this performance management option, refer to the Overview.
This guide will walk you through how to:
- Create a Qiskit Runtime instance on IBM Cloud with Q-CTRL.
- Set Q-CTRL as your channel strategy.
1. Create an IBM Cloud account
If you do not already have one, set up an IBM Cloud account from the IBM Cloud registration page.
2. Create a Qiskit Runtime instance on IBM Cloud with Q-CTRL
To use the Q-CTRL performance management option, you must create a new instance of Qiskit Runtime. Creating a new instance does not incur any additional charges.
- Go to the Qiskit Runtime instance creation page.
You will need to log in to create an instance.
- Choose a plan.
Select the Standard plan, which provides access to both physical quantum systems and simulators.
- Select performance management strategy.
Under "Performance management strategy" there is a drop-down menu. Select the "Q-CTRL: Automated error suppression" option.
- Finalize and create instance.
Agree to the license agreements by checking the box in the bottom right corner of the page, and then click Create.
- Copy your Cloud Resource Name (CRN).
After creating your instance, you will be taken directly to the your instance information. From this page, click the icon to copy your CRN. Save it in a secure location so you can use it for authentication. You can also save it locally to disk in a later step.
3. Install or update Qiskit packages
Install or update the following packages in your development environment. They let you create circuits and work with primitive programs with Qiskit Runtime. You'll need the updated Qiskit Runtime package to set the channel strategy.
If you already have Python and a package manager installed, you can use the following command to install the necessary packages:
pip install -U qiskit qiskit-ibm-runtime
For detailed instructions, refer to the Qiskit install and setup topic. Periodically check the Qiskit release notes (or rerun these commands) so that you always have the latest version.
4. Authenticate to Qiskit Runtime service with your CRN and set the channel strategy
To enable the performance management strategy, authenticate to the service and call QiskitRuntimeService
with your IBM Cloud API key, the CRN, and channel_strategy="q-ctrl"
.
from qiskit_ibm_runtime import QiskitRuntimeService
service = QiskitRuntimeService(
channel="ibm_cloud",
channel_strategy="q-ctrl",
token="<IBM Cloud API key>",
instance="<IBM Cloud CRN>",
)
5. Save your credentials to disk (optional)
You might want to save your credentials to disk (in the $HOME/.qiskit/qiskit-ibm.json
file). If you don't save your credentials to disk, you must specify your credentials and set the channel strategy every time you start a new session.
If you save your credentials to disk, you can use QiskitRuntimeService()
in the future to initialize your account, and Q-CTRL performance management will be enabled by default.
from qiskit_ibm_runtime import QiskitRuntimeService
# Save account to disk and save it as the default.
QiskitRuntimeService.save_account(
channel="ibm_cloud",
channel_strategy="q-ctrl",
token="<IBM Cloud API key>",
instance="<IBM Cloud CRN>",
name="q-ctrl",
set_as_default=True,
)
# Load the saved credentials.
service = QiskitRuntimeService(name="q-ctrl")
That's it! You're now set up to use the Q-CTRL performance management strategy. No other configuration is required, and whenever you use the saved account or Qiskit Runtime instance with Q-CTRL enabled, you will automatically get the benefits of error suppression to maximize algorithmic performance.
Next, try running a circuit using Q-CTRL performance management on IBM Quantum services.