Emulators Cloud Integration
EMU-SV (State Vector) and EMU-MPS (Matrix Product States) are two emulators for simulating quantum sequences, both are fully integrated into the Pasqal cloud platform with configurable noise models, observables, and simulation parameters.
EMU-SV performs exact state vector simulation, tracking the full quantum state throughout the computation. The memory required grows as 2^N for N qubits, which limits the system size but provides exact results without approximation. This makes it ideal for smaller systems where high precision is required.
EMU-MPS uses matrix product states to encode quantum states such that the memory required depends on the entanglement in the system. For product states, an MPS only takes d×N numbers to store the state for N d-level qudits, while maximally entangled states require memory similar to a full state vector. For many systems of interest, MPS is more efficient than state vectors, allowing simulation of more qubits.
This article covers how to use both emulators through the Pasqal cloud platform. For detailed documentation on the emulators themselves, see:
- EMU-SV documentation (external) or EMU-SV emulation tools doc (external) .
- EMU-MPS documentation (external) or EMU-MPS emulation tools doc (external) or arXiv Paper (external) .
Comparison between emulators
Section titled “Comparison between emulators”| Aspect | EMU-SV | EMU-MPS |
|---|---|---|
| Method | State Vector | Matrix Product States |
| Max qubits | ≤25 | ≤80 |
| GPU allocation | 0 or 1 GPU per job | 0 or 1 GPU per job |
| GPU allocation by default | 1 GPU per job | 1 GPU per job |
| Min SDK version | 0.20.7 | 0.12.7 |
| Observables | BitStrings, Fidelity, CorrelationMatrix, Occupation, Energy, EnergyVariance, EnergySecondMoment, Expectation | BitStrings, Fidelity, CorrelationMatrix, Occupation, Energy, EnergyVariance, EnergySecondMoment, Expectation |
Note:
StateResultis not supported on remote backends. Use a local backend if you need access to the full quantum state.
Basic usage with the PasqalCloudConnection
Section titled “Basic usage with the PasqalCloudConnection”This example demonstrates how to submit a job for execution on a cloud-hosted emulator. It assumes you have created a Pulser sequence using the Pasqal Pulser library (external) .
from pasqal_cloud import PasqalCloudConnection, RemoteSVBackend, RemoteMPSBackend
connection = PasqalCloudConnection( username="your username", password="your password", project_id="your project id")
# Define your jobsfirst = {"runs": 20}second = {"runs": 50}
# For EMU-SVRemoteSVBackend(sequence=seq, connection=connection).run( job_params=[first, second])
# For EMU-MPSRemoteMPSBackend(sequence=seq, connection=connection).run( job_params=[first, second])from pasqal_cloud import PasqalCloudConnection, RemoteSVBackend, RemoteMPSBackend
connection = PasqalCloudConnection( username="your username", password="your password", project_id="your project id", region="sa",)
# Define your jobsfirst = {"runs": 20}second = {"runs": 50}
# For EMU-SVresults = RemoteSVBackend(sequence=seq, connection=connection).run( job_params=[first, second])
# For EMU-MPSresults = RemoteMPSBackend(sequence=seq, connection=connection).run( job_params=[first, second])
for job_id, result in results.get_available_results().items(): print(result)You can pass the wait argument to run to poll Pasqal’s cloud service until your results are ready. See the batches documentation for more details.
Accessing results
Section titled “Accessing results”This is an output example of printed results, more detail can be found in dedicated Results pulser documentation.
Results-------Stored results: ['bitstrings']Evaluation times per result: {'bitstrings': [1.0]}Atom order in states and bitstrings: ('0', '1', '2', '3')Total sequence duration: 100 nsCustom configuration
Section titled “Custom configuration”Both emulators support custom configurations for noise models and observables.
For EMU-SV:
import pulserfrom pulser.backend import BitStrings, CorrelationMatrixfrom emu_sv import SVConfig
# Create noise modelnoise = pulser.NoiseModel(relaxation_rate=1, dephasing_rate=1.0)
# Set up observablesdt = 100bitstrings = BitStrings(evaluation_times=[0.8], num_shots=1000)correlation_matrix = CorrelationMatrix(evaluation_times=[0.8])
# Create config and use it on the backendconfig = SVConfig(noise_model=noise, dt=dt, observables=[bitstrings, correlation_matrix])
backend = RemoteSVBackend(..., config=config)For EMU-MPS:
import pulserfrom pulser.backend import BitStrings, CorrelationMatrixfrom emu_mps import MPSConfig
# Create noise modelnoise = pulser.NoiseModel(relaxation_rate=1, dephasing_rate=1.0)
# Set up observablesdt = 100bitstrings = BitStrings(evaluation_times=[0.8], num_shots=1000)correlation_matrix = CorrelationMatrix(evaluation_times=[0.8])
# Create config and use it on the backendconfig = MPSConfig(noise_model=noise, dt=dt, observables=[bitstrings, correlation_matrix])
backend = RemoteMPSBackend(..., config=config)