OqtopusClient

class OqtopusClient

Bases: QuantumBaseClient[AlgoType, OqtopusJobMeta, QiskitCircuit]

Client that executes quantum circuits on OQTOPUS Cloud.

Authenticates with the OQTOPUS platform using an OqtopusConfig instance passed as provider when set. Otherwise, falls back to url/ token (and an optional proxy) when both are set. If both url and token are unset, falls back to whatever quri-parts-oqtopus resolves by default (see OqtopusSamplingBackend). Accepts any algorithm conforming to QuantumAlgoProtocol via the algo parameter.

Methods

__init__

Initialize an OqtopusClient.

solve

Call the solver service to solve the given optimization problem.

version

Return the installed quri-parts-oqtopus package version.

Attributes

provider

OqtopusConfig used to authenticate with the OQTOPUS service.

proxy

Proxy server URL.

token

OQTOPUS API token.

url

OQTOPUS service URL.

acceptable_degrees

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

algo

The algorithm class used by this client.

description

Description to assign to submitted OQTOPUS jobs.

device

Name of the target OQTOPUS device, or None to select automatically.

job_type

Job type forwarded to OQTOPUS.

mitigation_info

Error-mitigation information forwarded to OQTOPUS.

name

Name to assign to submitted OQTOPUS jobs.

qiskit_pass_manager

Qiskit transpilation pass manager.

simulator_info

Simulator information forwarded to OQTOPUS.

transpiler_info

Transpiler information forwarded to OQTOPUS.

parameters

Algorithm parameters instance.

__init__(
algo: type[AlgoType],
token: str | None = None,
url: str | None = None,
proxy: str | None = None,
provider: OqtopusConfig | None = None,
device: str | None = None,
qiskit_pass_manager: PassManager | EllipsisType | None = Ellipsis,
name: str | None = None,
description: str | None = None,
transpiler_info: dict | None = None,
simulator_info: dict | None = None,
mitigation_info: dict | None = None,
job_type: str | None = None,
) None

Initialize an OqtopusClient.

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

  • token (str | None) – OQTOPUS API token. Used together with url when provider is not given.

  • url (str | None) – OQTOPUS service URL. Used together with token when provider is not given.

  • proxy (str | None) – Proxy server URL. Used when provider is not given.

  • provider (OqtopusConfig | None) – OqtopusConfig used to authenticate with the OQTOPUS service. Takes precedence over token/url/proxy when given. When None, falls back to token/url/proxy if both token and url are set; if both are unset, falls back to whatever quri-parts-oqtopus resolves by default (see OqtopusSamplingBackend).

  • device (str | None) – Name of the target OQTOPUS device. If None, the first available device is selected automatically.

  • 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.

  • name (str | None) – Name to assign to submitted OQTOPUS jobs.

  • description (str | None) – Description to assign to submitted OQTOPUS jobs.

  • transpiler_info (dict | None) – Transpiler information forwarded to OQTOPUS.

  • simulator_info (dict | None) – Simulator information forwarded to OQTOPUS.

  • mitigation_info (dict | None) – Error-mitigation information forwarded to OQTOPUS.

  • job_type (str | None) – Job type forwarded to OQTOPUS.

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 installed quri-parts-oqtopus package version.

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 description: str | None

Description to assign to submitted OQTOPUS jobs.

property device: str | None

Name of the target OQTOPUS device, or None to select automatically.

property job_type: str | None

Job type forwarded to OQTOPUS.

property mitigation_info: dict | None

Error-mitigation information forwarded to OQTOPUS.

property name: str | None

Name to assign to submitted OQTOPUS jobs.

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().

provider: OqtopusConfig | None

OqtopusConfig used to authenticate with the OQTOPUS service.

proxy: str | None

Proxy server URL. Ignored when provider is set.

property qiskit_pass_manager: PassManager | EllipsisType | None

Qiskit transpilation pass manager.

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

property simulator_info: dict | None

Simulator information forwarded to OQTOPUS.

token: str | None

OQTOPUS API token. Ignored when provider is set.

property transpiler_info: dict | None

Transpiler information forwarded to OQTOPUS.

url: str | None

OQTOPUS service URL. Ignored when provider is set.