Skip to main content

PennyLane device plugin for Quantum API

Project description

Quantum API PennyLane Plugin

Package-ready PennyLane device plugin for executing circuits through Quantum API /v1/qasm/run.

Install

pip install quantum-api-pennylane

For local development in this repo:

python3 -m pip install -e sdk/pennylane

Usage

import pennylane as qml

# The plugin is registered under the "quantum.api" PennyLane device name.
dev = qml.device(
    "quantum.api",
    wires=2,
    shots=1000,
    base_url="https://davidjgrimsley.com/public-facing/api/quantum",
    api_key="your-runtime-api-key",
)

@qml.qnode(dev)
def bell():
    qml.Hadamard(0)
    qml.CNOT([0, 1])
    return qml.counts(wires=[0, 1])

print(bell())

Configuration

Constructor keyword arguments:

  • base_url: Quantum API base URL (with or without /v1)
  • api_key: runtime X-API-Key for protected routes
  • bearer_token: optional bearer token for advanced auth routing
  • timeout: client timeout in seconds
  • qasm_version: currently "auto", "2", or "3" (default "auto")
  • seed: optional simulator seed forwarded to /v1/qasm/run
  • client: optional preconfigured quantum_api_sdk.QuantumApiClient

Finite-shot QNodes are reconstructed from counts. Analytic QNodes (shots=None) use statevector post-processing.

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

quantum_api_pennylane-0.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

quantum_api_pennylane-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file quantum_api_pennylane-0.1.0.tar.gz.

File metadata

  • Download URL: quantum_api_pennylane-0.1.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quantum_api_pennylane-0.1.0.tar.gz
Algorithm Hash digest
SHA256 44a58db7e213e450b7a21e0869c6f52b38870a4ac96db775661da3894bb6dd61
MD5 158193b71e7d6317304ca11a3aa68a15
BLAKE2b-256 4163c25236cdd3bfe56b8a5184408f3ce3b917376a2949203367882a506c79df

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantum_api_pennylane-0.1.0.tar.gz:

Publisher: publish-sdk.yml on DavidJGrimsley/quantum-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quantum_api_pennylane-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for quantum_api_pennylane-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d5eb6be83d9e359dc9338d8a1bdfa9197c0d1bba964f58b0255a31baeec41f9e
MD5 32931d110068c5fb2af7e5274e9ec97b
BLAKE2b-256 555976a8d47ba7538e51e44e0c5a8e675025bda0d2fd6cccfede0b1955b027ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantum_api_pennylane-0.1.0-py3-none-any.whl:

Publisher: publish-sdk.yml on DavidJGrimsley/quantum-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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