IBMClient¶
- class IBMClient¶
ベースクラス:
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
QuantumAlgoProtocolvia the algo parameter.Methods
Initialize an IBMClient.
Call the solver service to solve the given optimization problem.
Return the IBM Quantum backend version.
Attributes
Polynomial degrees accepted by the algorithm for the objective and constraints.
The algorithm class used by this client.
IBM Quantum channel type (e.g.,
"ibm_quantum_platform"), orNone.Name of the target IBM Quantum backend, or
Noneto select automatically.Proxy server URL used for network requests, or
Nonefor no proxy.Qiskit transpilation pass manager.
IBM Quantum API token used to authenticate, or
Noneif not set.IBM Quantum service URL, or
Noneto use the default endpoint.Whether to verify SSL certificates, or
Noneto use the system default.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,
Initialize an IBMClient.
- パラメータ:
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"). IfNone, 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. PassNoneto 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.
- パラメータ:
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.
- 戻り値:
The algorithm result, or
Noneif dry_run isTrue.- 戻り値の型:
CustomClientResultProtocol | None
- version() str¶
Return the IBM Quantum backend version.
- 例外:
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 channel: Literal['ibm_quantum_platform', 'ibm_cloud', 'local'] | None¶
IBM Quantum channel type (e.g.,
"ibm_quantum_platform"), orNone.
- property device: str | None¶
Name of the target IBM Quantum backend, or
Noneto select automatically.
- parameters¶
Algorithm parameters instance. The concrete type depends on the algorithm; for
QAOAthis isQAOA.Parameters. Modify this to configure the algorithm before callingsolve().