AerClient¶
- class AerClient¶
Bases:
QuantumBaseClient[AlgoType,QiskitJobMeta,QiskitCircuit]Client that executes quantum circuits using the Qiskit Aer simulator.
Runs circuits locally on CPU or GPU via Aer, or can noise-model a specific QPU by providing its name. Accepts any algorithm conforming to
QuantumAlgoProtocolvia the algo parameter.Methods
Initialize an AerClient.
Current AerSimulator options, including
deviceandmethod.Set AerSimulator options.
Call the solver service to solve the given optimization problem.
Return the qiskit-aer package 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.Simulation device.
Aer simulation method (e.g.,
"automatic","statevector").Name of the target backend to simulate, or
Nonefor an ideal simulator.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,
- noise_model: str | None = None,
- channel: ChannelType | None = None,
- qiskit_pass_manager: PassManager | EllipsisType | None = Ellipsis,
- device: AerDeviceType = 'CPU',
- method: str = 'automatic',
- **options,
Initialize an AerClient.
- Parameters:
algo (type[AlgoType]) – The algorithm class to use (e.g.,
QAOA).token (str | None) – IBM Quantum API token. Required when noise_model refers to a real IBM backend (used to fetch the noise model).
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.noise_model (str | None) – Name of the backend to simulate. Accepts
"fake_*"names for built-in fake backends,"ibm_*"names to noise-model a real IBM device, or any other name which is converted automatically. IfNone, an ideal simulator is used.channel (ChannelType | None) – IBM Quantum channel type (e.g.,
"ibm_quantum_platform"). Only relevant when noise_model refers to a real IBM backend.qiskit_pass_manager (PassManager | EllipsisType | None) – Custom Qiskit transpilation pass manager. If
...(default), a preset pass manager is generated automatically. PassNoneto skip transpilation.device (AerDeviceType) – Simulation device. One of
"CPU","GPU", or"Thrust". Defaults to"CPU".method (str) – Aer simulation method (e.g.,
"automatic","statevector","density_matrix"). Defaults to"automatic".**options – Additional options forwarded to
qiskit_aer.AerSimulator.set_options().
- set_options(**options) None¶
Set AerSimulator options.
- Parameters:
**options – Options forwarded to
qiskit_aer.AerSimulator.set_options().deviceandmethodare handled specially and update the corresponding properties.
- 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 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.
- property channel: ChannelType | None¶
IBM Quantum channel type (e.g.,
"ibm_quantum_platform"), orNone.
- property device: Literal['CPU', 'GPU', 'Thrust']¶
Simulation device. One of
"CPU","GPU", or"Thrust".
- property noise_model: str | None¶
Name of the target backend to simulate, or
Nonefor an ideal simulator.
- parameters¶
Algorithm parameters instance. The concrete type depends on the algorithm; for
QAOAthis isQAOA.Parameters. Modify this to configure the algorithm before callingsolve().