Skip to main content

A Pulser-compatible package to connect to Azure Pasqal Cloud Services

Project description

Azure quantum provider for Pulser

Azure quantum provider implementation to use neutral atoms based quantum computers.

Pulser Azure is a Python package to run quantum sequence on Azure Quantum infrastructure, providing access to Pasqal neutral atom quantum computers.

Installation

pip install pulser-azure

Getting started

To instantiate the AzureConnection, you need to provide a resource_id

from pulser_azure import AzureConnection

connection = AzureConnection(
    resource_id="/subscriptions/<your-subscription-id>/resourceGroups/<your-resource-group-name>/providers/Microsoft.Quantum/Workspaces/<your-workspace-name>",
)

Alternatively, the AzureConnection can discover your resource from environment variables:

export PULSER_AZURE_RESOURCE_ID="/subscriptions/<your-subscription-id>/resourceGroups/<your-resource-group-name>/providers/Microsoft.Quantum/Workspaces/<your-workspace-name>"

Then you can instantiate the provider without any arguments:

from pulser_azure import AzureConnection

connection = AzureConnection()

Now you have access to the supported backends and can design your pulse sequence. See the technical documentation on how to write a sequence.

from pulser_azure import AzureConnection
from pulser.pulse import Pulse
from pulser import QPUBackend, Sequence, Register

connection = AzureConnection()

# Retrieve all QPU devices
devices = connection.fetch_available_devices()
device = devices["pasqal.qpu.fresnel-can1"]

# Create a register of trapped atoms before performing operation on them
register = Register.square(5, 5).with_automatic_layout(device)

# Declare the sequence of pulses to perform on the register
sequence = Sequence(register, device)
sequence.declare_channel("rydberg", "rydberg_global")
omega_max = sequence.declare_variable("omega_max")

# Add a pulse to that channel with the amplitude omega_max
generic_pulse = Pulse.ConstantPulse(100, omega_max, 2, 0.0)
sequence.add(generic_pulse, "rydberg")

# Declare a backend based on the sequence and remote connection
backend = QPUBackend(sequence=sequence, connection=connection)

# Run jobs with different arguments over the same sequence and register
results = backend.run(
    job_params=[
        {"runs": 5, "variables": {"omega_max": 12}},
        {"runs": 10, "variables": {"omega_max": 6}},
    ],
    wait=True,
)

Contributing

Prerequisites

This project uses uv for dependency and environment management.

Setting up your environment

Clone the repository and sync the dev environment (this installs the project plus all dev dependencies into a local .venv):

git clone https://github.com/pasqal-io/pulser-azure.git
cd pulser-azure
uv sync

Running the test suite

uv run pytest

Linting and formatting

This project uses ruff for both linting and formatting:

uv run ruff check .          # lint
uv run ruff check . --fix    # lint and auto-fix
uv run ruff format .         # format

Pre-commit hooks

To automatically run ruff (and other checks) before each commit, install the pre-commit hooks:

uv run pre-commit install

You can run all hooks manually against the whole repo with:

uv run pre-commit run --all-files

Releasing

git tag -a v1.2.3 -m "Release 1.2.3"
git push origin v1.2.3

License

License Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pulser_azure-0.1.dev15.tar.gz (168.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pulser_azure-0.1.dev15-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file pulser_azure-0.1.dev15.tar.gz.

File metadata

  • Download URL: pulser_azure-0.1.dev15.tar.gz
  • Upload date:
  • Size: 168.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pulser_azure-0.1.dev15.tar.gz
Algorithm Hash digest
SHA256 e67c8b5455e34fcef275c109c226b33e92286320702952d45b7d3f56ff2b379b
MD5 5c8197daa59cffc65d39e3ce06695451
BLAKE2b-256 ed1b2223f40b94c90667f0b120ea5fc851f687ac77ae05a87f5fc9c66dba306f

See more details on using hashes here.

File details

Details for the file pulser_azure-0.1.dev15-py3-none-any.whl.

File metadata

  • Download URL: pulser_azure-0.1.dev15-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pulser_azure-0.1.dev15-py3-none-any.whl
Algorithm Hash digest
SHA256 d0fdffd91fc86a77543734c40c02a29720ac80ad5f536994186162dfcc1e145c
MD5 c33254e1e456292aa4a83b305c3e6bd4
BLAKE2b-256 2eeb2e128630c315b133747840476bf7555caef139301626a477f2b5350414ba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page