OqtopusClient¶
- class OqtopusClient¶
Bases:
QuantumBaseClient[AlgoType,OqtopusJobMeta,QiskitCircuit]Client that executes quantum circuits on OQTOPUS Cloud.
Authenticates with the OQTOPUS platform using an
OqtopusConfiginstance passed asproviderwhen set. Otherwise, falls back tourl/token(and an optionalproxy) when both are set. If bothurlandtokenare unset, falls back to whateverquri-parts-oqtopusresolves by default (seeOqtopusSamplingBackend). Accepts any algorithm conforming toQuantumAlgoProtocolvia the algo parameter.Methods
Initialize an OqtopusClient.
Call the solver service to solve the given optimization problem.
Return the installed
quri-parts-oqtopuspackage version.Attributes
OqtopusConfigused to authenticate with the OQTOPUS service.Proxy server URL.
OQTOPUS API token.
OQTOPUS service URL.
Polynomial degrees accepted by the algorithm for the objective and constraints.
The algorithm class used by this client.
Description to assign to submitted OQTOPUS jobs.
Name of the target OQTOPUS device, or
Noneto select automatically.Job type forwarded to OQTOPUS.
Error-mitigation information forwarded to OQTOPUS.
Name to assign to submitted OQTOPUS jobs.
Qiskit transpilation pass manager.
Simulator information forwarded to OQTOPUS.
Transpiler information forwarded to OQTOPUS.
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,
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) –
OqtopusConfigused to authenticate with the OQTOPUS service. Takes precedence over token/url/proxy when given. WhenNone, falls back to token/url/proxy if both token and url are set; if both are unset, falls back to whateverquri-parts-oqtopusresolves by default (seeOqtopusSamplingBackend).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. PassNoneto 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,
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 returnNone.
- Returns:
The algorithm result, or
Noneif dry_run isTrue.- Return type:
CustomClientResultProtocol | None
- property acceptable_degrees: AcceptableDegrees¶
Polynomial degrees accepted by the algorithm for the objective and constraints.
- parameters¶
Algorithm parameters instance. The concrete type depends on the algorithm; for
QAOAthis isQAOA.Parameters. Modify this to configure the algorithm before callingsolve().