IonQClient

class IonQClient

ベースクラス: QuantumBaseClient[AlgoType, BraketJobMeta | IonQJobMeta, QiskitCircuit]

Client that executes quantum circuits on IonQ hardware via Amazon Braket.

Connects to IonQ trapped-ion devices either via directly through the IonQ API or through the Amazon Braket service and runs circuits on the specified device. Accepts any algorithm conforming to QuantumAlgoProtocol via the algo parameter.

Methods

__init__

Initialize an IonQClient.

get_options

Get the current sampler options.

set_options

Set sampler options.

solve

Call the solver service to solve the given optimization problem.

version

Return the backend version string.

Attributes

acceptable_degrees

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

algo

The algorithm class used by this client.

device

Name of the target IonQ device.

provider

Provider used to connect to the IonQ device.

token

url

parameters

Algorithm parameters instance.

__init__(
algo: type[AlgoType],
device: str = 'Forte-1',
provider: AwsSession | None = None,
token: str | None = None,
url: str | None = None,
error_mitigation: Literal['debias'] | None = None,
**options,
) None

Initialize an IonQClient.

パラメータ:
  • algo (type[AlgoType]) -- The algorithm class to use (e.g., QAOA).

  • device (str) -- Name or ARN of the IonQ device. Defaults to "Forte-1".

  • provider (AwsSession | None) -- Provider used to connect to the IonQ device. Currently only Braket connection is supported; set to an braket.aws.AwsSession to configure credentials.

  • token (str | None) -- IonQ API token for authentication.

  • url (str | None) -- URL for the IonQ API endpoint.

  • error_mitigation (Literal["debias"] | None) -- Error mitigation strategy. Pass "debias" to enable debiasing. None to disable error mitigation. Defaults to None.

  • **options -- Additional options to configure the sampler.

get_options() dict[str, Any]

Get the current sampler options.

set_options(**options) None

Set sampler options.

Options will be cleared when the provider is switched. Values passed here take precedence over the error_mitigation attribute.

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 backend version string.

__static_attributes__ = ('_current_provider_type', '_device', '_options', '_provider', '_sampler', '_token', '_url', 'device', 'error_mitigation', 'provider')
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 device: str

Name of the target IonQ device.

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 provider: AwsSession | None

Provider used to connect to the IonQ device.

Set to a braket.aws.AwsSession to connect via Amazon Braket. Set to None to use the IonQ API directly with url and token.

property token: str | None
property url: str | None