QuantumBaseClient

class QuantumBaseClient

ベースクラス: _QuantumBaseClient[AlgoType], Generic[AlgoType, SamplingMeta_co, CircType_co]

Abstract base class for clients that target a specific backend sampler.

Instantiate a concrete subclass such as QulacsClient or IBMClient rather than using this class directly.

Methods

__init__

Initialize a QuantumBaseClient.

solve

Call the solver service to solve the given optimization problem.

version

Return the version string of the amplify-quantum package.

Attributes

acceptable_degrees

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

algo

The algorithm class used by this client.

parameters

Algorithm parameters instance.

__init__(algo: type[AlgoType]) None

Initialize a QuantumBaseClient.

パラメータ:

algo (type[AlgoType]) -- The algorithm class to use. Must conform to the QuantumAlgoProtocol protocol.

solve(
objective: Poly | Matrix,
constraints: ConstraintList | None,
dry_run: bool = False,
) Result[SamplingMeta_co] | None
solve(
objective: Poly | Matrix,
constraints: ConstraintList | None,
dry_run: bool = False,
) Result[SamplingMeta_co] | None
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 return None.

戻り値:

The algorithm result, or None if dry_run is True.

戻り値の型:

CustomClientResultProtocol | None

version() str

Return the version string of the amplify-quantum package.

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.

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