mis.pipeline.backends
source module mis.pipeline.backends
Executing a register and a sequence on a quantum device (including emulators).
Classes
-
BaseBackend — Low-level abstraction to execute a Register and a Pulse on a Quantum Device.
-
QutipBackend — Execute a Register and a Pulse on the Qutip Emulator.
-
BaseRemoteExecution — Execution on a remote device.
-
BaseRemoteBackend — Base hierarch for remote backends.
-
RemoteQPUBackend — Execute on a remote QPU.
-
RemoteEmuMPSBackend — A backend that uses a remote high-performance emulator (EmuMPS) published on Pasqal Cloud.
-
EmuMPSBackend — Execute a Register and a Pulse on the high-performance emu-mps Emulator.
Functions
-
make_sequence — Build a Pulser sequence for a device from a pulse and a register.
source make_sequence(device: Device, pulse: targets.Pulse, register: targets.Register) → pulser.Sequence
Build a Pulser sequence for a device from a pulse and a register.
This function is mostly intended for internal use and will likely move to qool-layer in time.
Parameters
-
device : Device — The quantum device for which the sequence is built. Used to detect if a pulse + register is not compatible with a device.
-
pulse : targets.Pulse — The laser pulse to apply. It will be added as a Rydberg global channel.
-
register : targets.Register — The geometry for the sequence. If the device expects an automatic layout, this must already have been normalized with
with_automatic_layout
.
Raises
-
CompilationError if the pulse + register are not compatible with the device.
source class BaseBackend(device: Device)
Bases : abc.ABC
Low-level abstraction to execute a Register and a Pulse on a Quantum Device.
For higher-level abstractions, see BaseExtractor
and its subclasses.
The sole role of these abstractions is to provide the same API for all backends. They might be removed in a future version, once Pulser has gained a similar API.
Methods
source method BaseBackend.device() → Device
source method BaseBackend.run(register: targets.Register, pulse: targets.Pulse) → Execution[Counter[str]]
Raises
-
NotImplementedError
source class QutipBackend(device: Device | None = None)
Bases : BaseBackend
Execute a Register and a Pulse on the Qutip Emulator.
Please consider using EmuMPSBackend, which generally works much better with higher number of qubits.
Performance warning
Executing anything quantum related on an emulator takes an amount of resources polynomial in 2^N, where N is the number of qubits. This can easily go beyond the limit of the computer on which you're executing it.
Methods
-
run — Execute a register and a pulse.
source method QutipBackend.run(register: targets.Register, pulse: targets.Pulse) → Execution[Counter[str]]
Execute a register and a pulse.
Parameters
Returns
-
Execution[Counter[str]] — A bitstring Counter, i.e. a data structure counting for each bitstring the number of instances of this bitstring observed at the end of runs.
source class BaseRemoteExecution(sleep_sec: int, batch: Batch)
Bases : WaitingExecution[Any]
Execution on a remote device.
Unless you're implementing a new backend, you probably want to use one of the subclasses.
Methods
source method BaseRemoteExecution.status() → Status
source method BaseRemoteExecution.result() → Any
Raises
source class BaseRemoteBackend(project_id: str, username: str, device_name: str | None = None, password: str | None = None)
Bases : BaseBackend
Base hierarch for remote backends.
Create a remote backend
Performance warning
As of this writing, using remote Backends to access a remote QPU or remote emulator is slower than using a RemoteExtractor, as the RemoteExtractor optimizes the number of connections used to communicate with the cloud server.
Parameters
-
project_id : str — The ID of the project on the Pasqal Cloud API.
-
username : str — Your username on the Pasqal Cloud API.
-
password : str | None — Your password on the Pasqal Cloud API. If you leave this to None, you will need to enter your password manually.
-
device_name : str | None — The name of the device to use. As of this writing, the default value of "FRESNEL" represents the latest QPU available through the Pasqal Cloud API.
source class RemoteQPUBackend(project_id: str, username: str, device_name: str | None = None, password: str | None = None)
Bases : BaseRemoteBackend
Execute on a remote QPU.
Create a remote backend
Performance note
As of this writing, the waiting lines for a QPU may be very long. You may use this Extractor to resume your workflow with a computation that has been previously started.
Parameters
-
project_id : str — The ID of the project on the Pasqal Cloud API.
-
username : str — Your username on the Pasqal Cloud API.
-
password : str | None — Your password on the Pasqal Cloud API. If you leave this to None, you will need to enter your password manually.
-
device_name : str | None — The name of the device to use. As of this writing, the default value of "FRESNEL" represents the latest QPU available through the Pasqal Cloud API.
Methods
source method RemoteQPUBackend.run(register: targets.Register, pulse: targets.Pulse) → Execution[Counter[str]]
source class RemoteEmuMPSBackend(project_id: str, username: str, device_name: str | None = None, password: str | None = None)
Bases : BaseRemoteBackend
A backend that uses a remote high-performance emulator (EmuMPS) published on Pasqal Cloud.
Create a remote backend
Parameters
-
project_id : str — The ID of the project on the Pasqal Cloud API.
-
username : str — Your username on the Pasqal Cloud API.
-
password : str | None — Your password on the Pasqal Cloud API. If you leave this to None, you will need to enter your password manually.
-
device_name : str | None — The name of the device to use. As of this writing, the default value of "FRESNEL" represents the latest QPU available through the Pasqal Cloud API.
Methods
source method RemoteEmuMPSBackend.run(register: targets.Register, pulse: targets.Pulse, dt: int = 10) → Execution[Counter[str]]
source class EmuMPSBackend(device: Device)
Bases : BaseBackend
Execute a Register and a Pulse on the high-performance emu-mps Emulator.
As of this writing, this local emulator is only available under Unix. However, the RemoteEmuMPSBackend is available on all platforms.
Performance warning
Executing anything quantum related on an emulator takes an amount of resources polynomial in 2^N, where N is the number of qubits. This can easily go beyond the limit of the computer on which you're executing it.
Methods
source method EmuMPSBackend.run(register: targets.Register, pulse: targets.Pulse, dt: int = 10) → Execution[Counter[str]]