Skip to content
Pasqal Documentation

Matrix Product States (MPS)

EMU-MPS is a Pulser backend, designed to EMUlate the dynamics of programmable arrays of neutral atoms, with matrix product states (MPS). MPSs are a way of encoding quantum states such that the memory required to represent the wavefunction depends on its entanglement, roughly, how much quantum information is stored in it. For product states, an MPS only takes d*N numbers to store the state for N d-level qudits, while for maximally entangled states, it’ll take a multiple of the memory in a state vector. For systems of interest, MPSs are expected to be more efficient than state-vectors, allowing the user to simulate more qubits. For more information, see the official documentation on EMU-MPS (external) . EMU-MPS is built on PyTorch, and in the future we intend to make it differentiable. Follow the links for more details about our emulator (external)

Specs

  • GPU acceleration
  • Supports all Pulser sequences that use only the rydberg channel.
  • Customisable output
    • Bitstrings
    • The quantum state in MPS format
    • The fidelity with respect to a given state
    • The expectation of a given operator
    • The qubit density (magnetization)
    • The correlation matrix
    • The mean, second moment and variance of the energy
  • Currently supported noise types
    • Custom noise types
    • SPAM
    • Monte Carlo Quantum jumps
    • A Gaussian laser waist for the global pulse channels.
  • Unlike some of our other emulation offerings on our Cloud service, MPS doesn’t support a custom configuration argument yet. But it will be available in a later release.

Example

This example assumes you have created a Pulser sequence using the Pasqal Pulser library and that you are using the Pasqal Cloud SDK version 0.12.7 or higher. See our SDK CHANGELOG (external) here.

Terminal window
pip install pulser

More information in Pulser can be found in the official Github repo (external) .

Then using the EmulatorType property from pasqal_clod.device, we can select EMU_MPS as our desired emulator.

from pasqal_cloud import SDK
from pasqal_cloud.device import EmulatorType
sdk = SDK(
username="your username", password="your password", project_id="your project id"
)
# Two jobs providing alternate shot/run count and omega_max values
first = {"runs": 20, "variables": {"omega_max": 6}}
second = {"runs": 50, "variables": {"omega_max": 10.5}}
batch = sdk.create_batch(
serialized_sequence=serialized_sequence,
jobs=[first, second],
emulator=EmulatorType.EMU_MPS,
)

Then using our batch object we can wait for our results to return and populate our object

We can do this one of two ways:

You can pass the wait argument to create_batch which will poll Pasqal’s cloud service on a loop until your results are calculated

batch = sdk.create_batch(
serialized_sequence=serialized_sequence,
jobs=[first, second],
emulator=EmulatorType.EMU_MPS,
wait=True
)

or

You can use an alternate method in our SDK to call at your own leisure

batch = sdk.get_batch("your-batch-id-here")

To retrieve the results of your MPS emulation, you can currently read the bitstrings from each job inside the batch.

If you iterate over the ordered_jobs property of your batch, you can call full_results to access a dictionary containing a bitstrings field.

for job in batch.ordered_jobs:
print(job.full_result)

The output

Terminal window
{'raw': None, 'counter': None, 'bitstring': {'100': {'0100': 3, '0000': 12, '0001': 2, '1000': 2, '0010': 1}}}
{'raw': None, 'counter': None, 'bitstring': {'100': {'1000': 17, '0010': 9, '0001': 3, '0100': 7, '1001': 1, '0000': 12, '0110': 1}}}

Currently MPS results are only accessible via the full_results property of a job, unlike EMU_TN/EMU_FREE which can be retrieved via results.