quantum_executor.local_aer package¶
Submodules¶
quantum_executor.local_aer.device module¶
Local Qiskit Aer Backend Class compatible with qBraid.
This module provides a wrapper for the Qiskit AerSimulator backend, allowing for the execution of quantum circuits on a local simulator. It includes methods for transforming circuits, submitting jobs, and checking device status.
- class quantum_executor.local_aer.device.LocalAERBackend(profile: TargetProfile, backend: BackendV2 | None = None)[source]¶
Bases:
QuantumDeviceWrapper class for local AerSimulator backend objects.
This class adapts a Qiskit AerSimulator to the QuantumDevice interface, enabling circuit transformation and submission on a local simulation backend.
- Parameters:
profile (TargetProfile) – The target profile configuration.
backend (AerSimulator, optional) – An optional instance of an AerSimulator. If not provided, a new instance is created.
- status() DeviceStatus[source]¶
Get the current status of the device.
- Returns:
A status object representing the current state of the device. Local simulators are always considered online.
- Return type:
DeviceStatus
- submit(run_input: QuantumCircuit | list[QuantumCircuit], *_args: Any, **kwargs: Any) QiskitJob[source]¶
Submit one or more quantum circuits for execution on the backend.
This method runs the circuit(s) on the Qiskit backend via the SamplerV2.run method. It handles simulator options, including an optional seed to ensure reproducibility.
It also accepts additional keyword arguments for the number of shots and seed.
- Parameters:
run_input (QuantumCircuit or list[QuantumCircuit]) – A single quantum circuit or a list of quantum circuits to run on the device.
*_args (tuple) – Additional positional arguments, ignored in this implementation.
**kwargs (dict) – Additional keyword arguments to pass to the Sampler.run method. - shots (int): The number of shots for the simulation. - seed (int): The seed for the random number generator.
- Returns:
A job-like object representing the submitted task.
- Return type:
QiskitJob
- Raises:
ValueError – If the run_input is neither a Qiskit QuantumCircuit nor a list of QuantumCircuits.
quantum_executor.local_aer.provider module¶
Local Qiskit Aer Provider Class compatible with qBraid.
- class quantum_executor.local_aer.provider.LocalAERProvider[source]¶
Bases:
QuantumProviderProvider class for local AerSimulator backends.
This class provides methods for retrieving simulated quantum devices, including both noiseless and noisy simulators.
- get_device(device_id: str) LocalAERBackend[source]¶
Retrieve a specific quantum backend by its device identifier.
This method returns a LocalAERBackend instance corresponding to the specified device_id. It supports both the default noiseless simulator and a noisy simulator generated based on a noise strength encoded in the device_id.
- Parameters:
device_id (str) – The identifier of the desired quantum backend.
- Returns:
The corresponding quantum backend.
- Return type:
qbraid.runtime.ibm.QiskitBackend
- Raises:
ValueError – If the device is not found among local AerSimulator backends.
- get_devices() list[LocalAERBackend][source]¶
Retrieve a list of available quantum backends.
This method combines a noiseless AerSimulator with additional backends provided by a fake IBM provider, returning a list of LocalAERBackend objects.
- Returns:
A list of quantum backend instances.
- Return type:
list[qbraid.runtime.ibm.QiskitBackend]
Module contents¶
Local Qiskit Aer Provider and Backend Classes compatible with qBraid.
- class quantum_executor.local_aer.LocalAERBackend(profile: TargetProfile, backend: BackendV2 | None = None)[source]¶
Bases:
QuantumDeviceWrapper class for local AerSimulator backend objects.
This class adapts a Qiskit AerSimulator to the QuantumDevice interface, enabling circuit transformation and submission on a local simulation backend.
- Parameters:
profile (TargetProfile) – The target profile configuration.
backend (AerSimulator, optional) – An optional instance of an AerSimulator. If not provided, a new instance is created.
- status() DeviceStatus[source]¶
Get the current status of the device.
- Returns:
A status object representing the current state of the device. Local simulators are always considered online.
- Return type:
DeviceStatus
- submit(run_input: QuantumCircuit | list[QuantumCircuit], *_args: Any, **kwargs: Any) QiskitJob[source]¶
Submit one or more quantum circuits for execution on the backend.
This method runs the circuit(s) on the Qiskit backend via the SamplerV2.run method. It handles simulator options, including an optional seed to ensure reproducibility.
It also accepts additional keyword arguments for the number of shots and seed.
- Parameters:
run_input (QuantumCircuit or list[QuantumCircuit]) – A single quantum circuit or a list of quantum circuits to run on the device.
*_args (tuple) – Additional positional arguments, ignored in this implementation.
**kwargs (dict) – Additional keyword arguments to pass to the Sampler.run method. - shots (int): The number of shots for the simulation. - seed (int): The seed for the random number generator.
- Returns:
A job-like object representing the submitted task.
- Return type:
QiskitJob
- Raises:
ValueError – If the run_input is neither a Qiskit QuantumCircuit nor a list of QuantumCircuits.
- class quantum_executor.local_aer.LocalAERProvider[source]¶
Bases:
QuantumProviderProvider class for local AerSimulator backends.
This class provides methods for retrieving simulated quantum devices, including both noiseless and noisy simulators.
- get_device(device_id: str) LocalAERBackend[source]¶
Retrieve a specific quantum backend by its device identifier.
This method returns a LocalAERBackend instance corresponding to the specified device_id. It supports both the default noiseless simulator and a noisy simulator generated based on a noise strength encoded in the device_id.
- Parameters:
device_id (str) – The identifier of the desired quantum backend.
- Returns:
The corresponding quantum backend.
- Return type:
qbraid.runtime.ibm.QiskitBackend
- Raises:
ValueError – If the device is not found among local AerSimulator backends.
- get_devices() list[LocalAERBackend][source]¶
Retrieve a list of available quantum backends.
This method combines a noiseless AerSimulator with additional backends provided by a fake IBM provider, returning a list of LocalAERBackend objects.
- Returns:
A list of quantum backend instances.
- Return type:
list[qbraid.runtime.ibm.QiskitBackend]