IBMClient

class IBMClient

Bases: QuantumBaseClient[AlgoType, QiskitJobMeta, QiskitCircuit], Generic[AlgoType]

Client that executes quantum circuits on IBM Quantum hardware.

Connects to the IBM Quantum platform using an API token and runs circuits on the specified QPU (or the least-busy available one). Accepts any algorithm conforming to QuantumAlgoProtocol via the algo parameter.

Methods

__init__

Initialize an IBMClient.

solve

Call the solver service to solve the given optimization problem.

version

Return the IBM Quantum backend version.

Attributes

acceptable_degrees

Polynomial degrees accepted by the algorithm for the objective and constraints.

algo

The algorithm class used by this client.

channel

IBM Quantum channel type (e.g., "ibm_quantum_platform"), or None.

device

Name of the target IBM Quantum backend, or None to select automatically.

proxy

Proxy server URL used for network requests, or None for no proxy.

qiskit_pass_manager

Qiskit transpilation pass manager.

token

IBM Quantum API token used to authenticate, or None if not set.

url

IBM Quantum service URL, or None to use the default endpoint.

verify

Whether to verify SSL certificates, or None to use the system default.

parameters

Algorithm parameters instance.

__init__(
algo: type[AlgoType],
token: str | None = None,
url: str | None = None,
proxy: str | None = None,
verify: bool | None = None,
device: str | None = None,
channel: ChannelType | None = None,
qiskit_pass_manager: PassManager | EllipsisType | None = Ellipsis,
) None

Initialize an IBMClient.

Parameters:
  • algo (type[AlgoType]) – The algorithm class to use (e.g., QAOA).

  • token (str | None) – IBM Quantum API token. Required to access real hardware.

  • url (str | None) – IBM Quantum service URL. Uses the default endpoint if None.

  • proxy (str | None) – Proxy server URL for network requests.

  • verify (bool | None) – Whether to verify SSL certificates. Uses the system default if None.

  • device (str | None) – Name of the IBM Quantum backend (e.g., "ibm_brisbane"). If None, the least-busy available backend is selected automatically.

  • channel (ChannelType | None) – IBM Quantum channel type (e.g., "ibm_quantum_platform").

  • qiskit_pass_manager (PassManager | EllipsisType | None) – Custom Qiskit transpilation pass manager. If ... (default), a preset pass manager is generated automatically. Pass None to skip transpilation.

solve(objective: Poly | Matrix, constraints: ConstraintList | None, dry_run: bool = False) CustomClientResultProtocol | None

Call the solver service to solve the given optimization problem.

Parameters:
  • objective (Poly | Matrix) – The objective function to minimize.

  • constraints (ConstraintList | None) – Constraints for the problem. If None, no constraints are applied.

  • dry_run (bool) – If True, validate inputs without executing circuits and return None.

Returns:

The algorithm result, or None if dry_run is True.

Return type:

CustomClientResultProtocol | None

version() str

Return the IBM Quantum backend version.

Raises:

RuntimeError – If the backend cannot be initialized (e.g., invalid or missing token).

property acceptable_degrees: AcceptableDegrees

Polynomial degrees accepted by the algorithm for the objective and constraints.

property algo: type[AlgoType]

The algorithm class used by this client.

property channel: Literal['ibm_quantum_platform', 'ibm_cloud', 'local'] | None

IBM Quantum channel type (e.g., "ibm_quantum_platform"), or None.

property device: str | None

Name of the target IBM Quantum backend, or None to select automatically.

parameters

Algorithm parameters instance. The concrete type depends on the algorithm; for QAOA this is QAOA.Parameters. Modify this to configure the algorithm before calling solve().

property proxy: str | None

Proxy server URL used for network requests, or None for no proxy.

property qiskit_pass_manager: PassManager | EllipsisType | None

Qiskit transpilation pass manager.

... (default) generates a preset pass manager automatically; None skips transpilation.

property token: str | None

IBM Quantum API token used to authenticate, or None if not set.

property url: str | None

IBM Quantum service URL, or None to use the default endpoint.

property verify: bool | None

Whether to verify SSL certificates, or None to use the system default.