backend
¶
Backend tools for Qurry. (qurry.tools.backend
)
backend_manager
¶
Backend Wrapper (qurry.tools.backend.backend_manager
)
- qurry.tools.backend.backend_manager.BackendCallSignDict¶
The dictionary of backend callsign.
alias of
dict
[Literal
[‘real’, ‘sim’, ‘fake’, ‘extra’] |str
,dict
[str
,str
]]
- qurry.tools.backend.backend_manager.BackendDict¶
The dictionary of backends.
alias of
dict
[Literal
[‘real’, ‘sim’, ‘fake’, ‘extra’] |str
,dict
[str
,Backend
]]
- class qurry.tools.backend.backend_manager.BackendWrapper[source]¶
A wrapper for
qiskit.providers.Backend
to provide more convenient way to use.- add_backend(name: str, backend: Backend, callsign: str | None = None) None [source]¶
Add a backend to backend wrapper.
- property available_backends: dict[Literal['real', 'sim', 'fake', 'extra'] | str, dict[str, Backend]]¶
The available backends.
- property available_backends_callsign: dict[Literal['real', 'sim', 'fake', 'extra'] | str, dict[str, str]]¶
The available backends callsign.
- make_callsign(sign: str = 'Galm 2', who: str = 'solo_wing_pixy') None [source]¶
Make a callsign for backend.
- Parameters:
- Raises:
ValueError – If the callsign already exists.
ValueError – If the backend is unknown.
- qurry.tools.backend.backend_manager.random() x in the interval [0, 1). ¶
env_check
¶
Backend Environment Check (qurry.tools.backend.env_check
)
For qiskit-aer has been divided into two packages since qiskit some version, So it needs to be imported differently by trying to import qiskit-aer first.
And qiskit-ibmq-provider has been deprecated, but for some user may still need to use it, so it needs to be imported also differently by trying to import qiskit-ibm-provider first.
So this file is used to unify the import point of AerProvider, IBMProvider/IBMQProvider. Avoiding the import error occurs on different parts of Qurry.
import_fake
¶
Import Fake (qurry.tools.backend.import_fake
)
This file is used to unify the import point of FakeProvider, FakeBackend/FakeBackendV2 from qiskit.providers.fake_provider and qiskit_ibm_runtime.fake_provider. Avoiding the import error occurs on different parts of Qurry.
import_simulator
¶
This module provides the default simulator for Qurry. For the simulator, the following sources are considered:
qiskit_aer
qiskit.providers.aer
qiskit.providers.basicaer
qiskit.providers.basic_provider
which are used in different qiskit, qiskit-aer version, and ordered by priority.
Import Simulator (qurry.tools.backend.import_simulator
)
This module provides the default simulator for Qurry. For the simulator, the following sources are considered:
qiskit_aer
qiskit.providers.aer
qiskit.providers.basicaer
qiskit.providers.basic_provider
which are used in different qiskit, qiskit-aer version, and ordered by priority.
- class qurry.tools.backend.import_simulator.GeneralBackend(configuration, properties=None, provider=None, target=None, backend_options=None)[source]¶
The abstract class of default simulator.
- class qurry.tools.backend.import_simulator.GeneralSimulator(configuration=None, properties=None, provider=None, target=None, **backend_options)[source]¶
Default simulator.
- qurry.tools.backend.import_simulator.get_default_sim_source() Literal['qiskit_aer', 'qiskit.providers.aer', 'qiskit.providers.basicaer', 'qiskit.providers.basic_provider'] [source]¶
Get the default source for the simulator.
- Returns:
The default source for the simulator.
- Return type:
ImportPointType
- Raises:
ImportError – If no available simulator source is found.
utils
¶
Backend Utils (qurry.tools.backend.utils
)
For qiskit-aer has been divided into two packages since qiskit some version, So it needs to be imported differently by trying to import qiskit-aer first.
And qiskit-ibmq-provider has been deprecated, but for some user may still need to use it, so it needs to be imported also differently by trying to import qiskit-ibm-provider first.
So this file is used to unify the import point of AerProvider, IBMProvider/IBMQProvider. Avoiding the import error occurs on different parts of Qurry.
- qurry.tools.backend.utils.backendName(back)¶
Get the name of backend.
- Parameters:
back (Union[BackendV2, Backend]) – The backend instance.
- Returns:
The name of backend.
- Return type:
- qurry.tools.backend.utils.backend_name_getter(back: BackendV2 | Backend | str) str [source]¶
Get the name of backend.