Qiskit IBM Experiment

raw JSON →
0.4.8 verified Fri May 01 auth: no python

Provides access to the IBM Quantum experiment service, allowing users to manage experiments, retrieve experiment results, and work with analysis results from IBM Quantum backends. Current version 0.4.8, released on a monthly/quarterly cadence.

pip install qiskit-ibm-experiment
error ImportError: cannot import name 'ExperimentService' from 'qiskit_ibm_experiment'
cause Outdated package version or incorrect import path.
fix
Upgrade the package: pip install --upgrade qiskit-ibm-experiment. Also ensure you are using the correct import: from qiskit_ibm_experiment import ExperimentService.
error QiskitIBMExperimentError: 'IBMExperimentService' object has no attribute 'experiments'
cause Using an older API where the method might be named differently or not yet available.
fix
Upgrade the package to the latest version. If using v0.4.x, the method is experiments(). For older versions, refer to documentation.
error TypeError: __init__() got an unexpected keyword argument 'account'
cause In v0.4.0+, the 'account' parameter was removed; use 'token' instead.
fix
Replace account='my_account' with token='your_token_here'.
breaking In v0.4.0, the default authentication method changed from account-based to token-based. Using `account` parameter is deprecated and will be removed in a future version.
fix Pass a 'token' parameter or set the IBM_QUANTUM_TOKEN environment variable instead of using 'account'.
deprecated The `IBMExperimentService` class is deprecated in favor of `ExperimentService`. It will be removed in a future release.
fix Use `ExperimentService` instead of `IBMExperimentService`.
gotcha The `experiments()` method returns a paginated iterator; to get all experiments, you need to iterate over it. Calling it without iteration returns an iterator object, not a list.
fix Convert to list: `experiments = list(service.experiments())` or iterate directly.

Initializes the ExperimentService using an IBM Quantum API token and lists available experiments.

import os
from qiskit_ibm_experiment import ExperimentService

# Initialize with token from environment variable or IBM Quantum account
token = os.environ.get('IBM_QUANTUM_TOKEN', '')
service = ExperimentService(token=token)

# List experiments
experiments = service.experiments()
print(experiments)