PennyLane Metal
PennyLane Metal is a PennyLane quantum simulator for
Apple silicon, built exclusively on Metal 4. It provides the metal.qubit
device, where state evolution, noise channels, measurements, sampling, and
adjoint gradients all run on the GPU.
- Pure circuits use a state vector; noisy circuits use a density-matrix execution model, selected automatically.
- Native Metal adjoint Jacobians and VJPs for the parameterized gate set.
- Broad native gate, measurement, and noise-channel coverage — see supported operations.
- Device-aware memory admission with a queryable resource planner — see memory and resources.
Requirements
- macOS 26.0 or newer on Apple silicon
- A Metal 4-capable Apple GPU (M1 or newer)
- Python 3.10–3.14
Installation
pip install pennylane-metal
Binary wheels are published for macOS 26+ (arm64) and CPython 3.10–3.14.
Building from the sdist or a git checkout additionally requires Xcode 26 with
the Metal Toolchain component (xcodebuild -downloadComponent MetalToolchain)
and CMake 3.24+; then pip install .. See
docs/DEVELOPMENT.md for the full workflow.
Quickstart
import pennylane as qml
dev = qml.device("metal.qubit", wires=2)
@qml.qnode(dev)
def bell_state():
qml.H(0)
qml.CNOT([0, 1])
return qml.probs(wires=[0, 1])
print(bell_state()) # [0.5, 0.0, 0.0, 0.5]
Gradients use the native Metal adjoint method:
@qml.qnode(dev, diff_method="adjoint")
def expectation(angle):
qml.RX(angle, 0)
qml.CNOT([0, 1])
return qml.expval(qml.Z(0))
angle = qml.numpy.array(0.37, requires_grad=True)
print(qml.grad(expectation)(angle)) # -sin(0.37)
Performance
A 22-qubit, depth-10 RY/CNOT circuit with an analytic expectation value (Apple M1 Max, macOS 26, pennylane-metal 0.2.0):
| Device | Time per execution |
|---|---|
default.qubit |
5808 ms |
lightning.qubit |
973 ms |
metal.qubit |
98 ms |
Each execution carries a fixed ~1 ms GPU dispatch cost, so CPU simulators
remain faster for very small circuits; the GPU advantage grows with qubit
count and depth. Reproduce with benchmarks/benchmark_metal.py — see
docs/DEVELOPMENT.md.
Capabilities and limits
| Area | Summary |
|---|---|
| Gates | Native one/two/multi-qubit set incl. excitation families, arbitrary unitaries |
| Measurements | State, probs, expval, var, purity, entropies (analytic); shots via Metal sampling |
| Noise | Standard channels plus arbitrary multi-wire Kraus maps, all on GPU |
| Gradients | Native adjoint/VJP (pure states); parameter-shift for noisy circuits |
| Precision | complex64; capacity is device-memory-bound (2**n state vector, 4**n density matrix) |
| Not supported | Mid-circuit measurements, reset, postselection, classical conditionals |
Full details: docs/SUPPORTED_OPERATIONS.md and docs/RESOURCES.md.
Documentation
- Supported operations — gates, measurements, channels, differentiation, batching
- Memory and resources — memory budgets, capacity queries, resource estimation
- Architecture — layer ownership and data-flow rules
- Development — building, testing, benchmarks, releasing
Development
python -m venv .venv
.venv/bin/pip install -e '.[dev]'
.venv/bin/pytest
See docs/DEVELOPMENT.md for CMake iteration builds, Metal API validation runs, and the release process.
License
Metadata
Release files for pennylane-metal 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pennylane_metal-0.2.1.tar.gz | 120.5 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| pennylane_metal-0.2.1-cp314-cp314-macosx_26_0_arm64.whl | CPython 3.14 | CPython 3.14 | macOS 26.0+ ARM64 | Details |
| pennylane_metal-0.2.1-cp313-cp313-macosx_26_0_arm64.whl | CPython 3.13 | CPython 3.13 | macOS 26.0+ ARM64 | Details |
| pennylane_metal-0.2.1-cp312-cp312-macosx_26_0_arm64.whl | CPython 3.12 | CPython 3.12 | macOS 26.0+ ARM64 | Details |
| pennylane_metal-0.2.1-cp311-cp311-macosx_26_0_arm64.whl | CPython 3.11 | CPython 3.11 | macOS 26.0+ ARM64 | Details |
| pennylane_metal-0.2.1-cp310-cp310-macosx_26_0_arm64.whl | CPython 3.10 | CPython 3.10 | macOS 26.0+ ARM64 | Details |
Total release size: 2.2 MB
Release files / pennylane_metal-0.2.1.tar.gz
| Download URL | pennylane_metal-0.2.1.tar.gz |
|---|---|
| Size | 120.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4312706760d13c68cf0997340185f5de2bc2e699b608c6b0bdaef8df07c4861d
|
|
BLAKE2b-256 checksum How to use checksums |
c2fb2489eb6fc8370097977276de495e36b24f9f21771f313ff7407d44398c76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
Transparency logRelease files / pennylane_metal-0.2.1-cp314-cp314-macosx_26_0_arm64.whl
| Download URL | pennylane_metal-0.2.1-cp314-cp314-macosx_26_0_arm64.whl |
|---|---|
| Size | 411.1 kB |
| Tags | CPython 3.14 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5e6e983103d31f20af9d074c576ac8e1afad8c1e1c4f4dabccb4edad0653ebb3
|
|
BLAKE2b-256 checksum How to use checksums |
924219b25dd1ad4988d484abae52d9b80281a219eb402d6b8bc6228fa4ed0564
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
Transparency logRelease files / pennylane_metal-0.2.1-cp313-cp313-macosx_26_0_arm64.whl
| Download URL | pennylane_metal-0.2.1-cp313-cp313-macosx_26_0_arm64.whl |
|---|---|
| Size | 410.6 kB |
| Tags | CPython 3.13 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9203cf4e36725c4b353808a622d6af30422ad09fb5752bcf5d12307148d0beab
|
|
BLAKE2b-256 checksum How to use checksums |
0656a23288b07bda628c5c0106136aafa865b51649ad9b619fe7464298d5682f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
Transparency logRelease files / pennylane_metal-0.2.1-cp312-cp312-macosx_26_0_arm64.whl
| Download URL | pennylane_metal-0.2.1-cp312-cp312-macosx_26_0_arm64.whl |
|---|---|
| Size | 410.6 kB |
| Tags | CPython 3.12 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5a1ecc7428ab753eb3a1ef078a6259a5c4dad4bb0e46af98374d3fcf9d5bc58b
|
|
BLAKE2b-256 checksum How to use checksums |
ab61834d9b4c4904683e7ebe7b307148050ece8bb97401970ab3242a3cb585ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
Transparency logRelease files / pennylane_metal-0.2.1-cp311-cp311-macosx_26_0_arm64.whl
| Download URL | pennylane_metal-0.2.1-cp311-cp311-macosx_26_0_arm64.whl |
|---|---|
| Size | 408.4 kB |
| Tags | CPython 3.11 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
893251cb6044ef902bd513d7a1e263c285b3f5bbfdc2427f5922be627ad0c4d3
|
|
BLAKE2b-256 checksum How to use checksums |
de43c526b621c99bd02fc5b0f7e22de5ae1e25d1fc8b80f1b8c72390855e48bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
Transparency logRelease files / pennylane_metal-0.2.1-cp310-cp310-macosx_26_0_arm64.whl
| Download URL | pennylane_metal-0.2.1-cp310-cp310-macosx_26_0_arm64.whl |
|---|---|
| Size | 406.7 kB |
| Tags | CPython 3.10 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
786ec749ba227366f39e6603a417acc66a1bfb35cbd96406ea279de3e37146f8
|
|
BLAKE2b-256 checksum How to use checksums |
c64d8c03f081924c3211af844737c0c09fa028c552051fe3d4bbfdbdc76a0cc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
Transparency log