GPU-accelerated PennyLane simulator for Apple silicon, built on Metal 4
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pennylane_metal-0.2.1.tar.gz.
File metadata
- Download URL: pennylane_metal-0.2.1.tar.gz
- Upload date:
- Size: 120.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4312706760d13c68cf0997340185f5de2bc2e699b608c6b0bdaef8df07c4861d
|
|
| MD5 |
2659756986f0de7c81f718fafc461d09
|
|
| BLAKE2b-256 |
c2fb2489eb6fc8370097977276de495e36b24f9f21771f313ff7407d44398c76
|
Provenance
The following attestation bundles were made for pennylane_metal-0.2.1.tar.gz:
Publisher:
wheels.yml on dereklei12/pennylane-metal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pennylane_metal-0.2.1.tar.gz -
Subject digest:
4312706760d13c68cf0997340185f5de2bc2e699b608c6b0bdaef8df07c4861d - Sigstore transparency entry: 2168134326
- Sigstore integration time:
-
Permalink:
dereklei12/pennylane-metal@89467b524d1bafd17ab59ffb01e5ed9fad1d02ca -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/dereklei12
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@89467b524d1bafd17ab59ffb01e5ed9fad1d02ca -
Trigger Event:
push
-
Statement type:
File details
Details for the file pennylane_metal-0.2.1-cp314-cp314-macosx_26_0_arm64.whl.
File metadata
- Download URL: pennylane_metal-0.2.1-cp314-cp314-macosx_26_0_arm64.whl
- Upload date:
- Size: 411.1 kB
- Tags: CPython 3.14, macOS 26.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e6e983103d31f20af9d074c576ac8e1afad8c1e1c4f4dabccb4edad0653ebb3
|
|
| MD5 |
73b443909aa9bc58c833482cf38e66e2
|
|
| BLAKE2b-256 |
924219b25dd1ad4988d484abae52d9b80281a219eb402d6b8bc6228fa4ed0564
|
Provenance
The following attestation bundles were made for pennylane_metal-0.2.1-cp314-cp314-macosx_26_0_arm64.whl:
Publisher:
wheels.yml on dereklei12/pennylane-metal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pennylane_metal-0.2.1-cp314-cp314-macosx_26_0_arm64.whl -
Subject digest:
5e6e983103d31f20af9d074c576ac8e1afad8c1e1c4f4dabccb4edad0653ebb3 - Sigstore transparency entry: 2168134375
- Sigstore integration time:
-
Permalink:
dereklei12/pennylane-metal@89467b524d1bafd17ab59ffb01e5ed9fad1d02ca -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/dereklei12
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@89467b524d1bafd17ab59ffb01e5ed9fad1d02ca -
Trigger Event:
push
-
Statement type:
File details
Details for the file pennylane_metal-0.2.1-cp313-cp313-macosx_26_0_arm64.whl.
File metadata
- Download URL: pennylane_metal-0.2.1-cp313-cp313-macosx_26_0_arm64.whl
- Upload date:
- Size: 410.6 kB
- Tags: CPython 3.13, macOS 26.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9203cf4e36725c4b353808a622d6af30422ad09fb5752bcf5d12307148d0beab
|
|
| MD5 |
d8dff112071d82aa45deb473fe5d9c66
|
|
| BLAKE2b-256 |
0656a23288b07bda628c5c0106136aafa865b51649ad9b619fe7464298d5682f
|
Provenance
The following attestation bundles were made for pennylane_metal-0.2.1-cp313-cp313-macosx_26_0_arm64.whl:
Publisher:
wheels.yml on dereklei12/pennylane-metal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pennylane_metal-0.2.1-cp313-cp313-macosx_26_0_arm64.whl -
Subject digest:
9203cf4e36725c4b353808a622d6af30422ad09fb5752bcf5d12307148d0beab - Sigstore transparency entry: 2168134344
- Sigstore integration time:
-
Permalink:
dereklei12/pennylane-metal@89467b524d1bafd17ab59ffb01e5ed9fad1d02ca -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/dereklei12
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@89467b524d1bafd17ab59ffb01e5ed9fad1d02ca -
Trigger Event:
push
-
Statement type:
File details
Details for the file pennylane_metal-0.2.1-cp312-cp312-macosx_26_0_arm64.whl.
File metadata
- Download URL: pennylane_metal-0.2.1-cp312-cp312-macosx_26_0_arm64.whl
- Upload date:
- Size: 410.6 kB
- Tags: CPython 3.12, macOS 26.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a1ecc7428ab753eb3a1ef078a6259a5c4dad4bb0e46af98374d3fcf9d5bc58b
|
|
| MD5 |
ffbe4dff97f92ea4475f86f2901af605
|
|
| BLAKE2b-256 |
ab61834d9b4c4904683e7ebe7b307148050ece8bb97401970ab3242a3cb585ee
|
Provenance
The following attestation bundles were made for pennylane_metal-0.2.1-cp312-cp312-macosx_26_0_arm64.whl:
Publisher:
wheels.yml on dereklei12/pennylane-metal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pennylane_metal-0.2.1-cp312-cp312-macosx_26_0_arm64.whl -
Subject digest:
5a1ecc7428ab753eb3a1ef078a6259a5c4dad4bb0e46af98374d3fcf9d5bc58b - Sigstore transparency entry: 2168134356
- Sigstore integration time:
-
Permalink:
dereklei12/pennylane-metal@89467b524d1bafd17ab59ffb01e5ed9fad1d02ca -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/dereklei12
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@89467b524d1bafd17ab59ffb01e5ed9fad1d02ca -
Trigger Event:
push
-
Statement type:
File details
Details for the file pennylane_metal-0.2.1-cp311-cp311-macosx_26_0_arm64.whl.
File metadata
- Download URL: pennylane_metal-0.2.1-cp311-cp311-macosx_26_0_arm64.whl
- Upload date:
- Size: 408.4 kB
- Tags: CPython 3.11, macOS 26.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
893251cb6044ef902bd513d7a1e263c285b3f5bbfdc2427f5922be627ad0c4d3
|
|
| MD5 |
2f8c77758988d732905ece294dec65f6
|
|
| BLAKE2b-256 |
de43c526b621c99bd02fc5b0f7e22de5ae1e25d1fc8b80f1b8c72390855e48bc
|
Provenance
The following attestation bundles were made for pennylane_metal-0.2.1-cp311-cp311-macosx_26_0_arm64.whl:
Publisher:
wheels.yml on dereklei12/pennylane-metal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pennylane_metal-0.2.1-cp311-cp311-macosx_26_0_arm64.whl -
Subject digest:
893251cb6044ef902bd513d7a1e263c285b3f5bbfdc2427f5922be627ad0c4d3 - Sigstore transparency entry: 2168134419
- Sigstore integration time:
-
Permalink:
dereklei12/pennylane-metal@89467b524d1bafd17ab59ffb01e5ed9fad1d02ca -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/dereklei12
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@89467b524d1bafd17ab59ffb01e5ed9fad1d02ca -
Trigger Event:
push
-
Statement type:
File details
Details for the file pennylane_metal-0.2.1-cp310-cp310-macosx_26_0_arm64.whl.
File metadata
- Download URL: pennylane_metal-0.2.1-cp310-cp310-macosx_26_0_arm64.whl
- Upload date:
- Size: 406.7 kB
- Tags: CPython 3.10, macOS 26.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
786ec749ba227366f39e6603a417acc66a1bfb35cbd96406ea279de3e37146f8
|
|
| MD5 |
2992166481d54ea89fd923fa9411db27
|
|
| BLAKE2b-256 |
c64d8c03f081924c3211af844737c0c09fa028c552051fe3d4bbfdbdc76a0cc6
|
Provenance
The following attestation bundles were made for pennylane_metal-0.2.1-cp310-cp310-macosx_26_0_arm64.whl:
Publisher:
wheels.yml on dereklei12/pennylane-metal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pennylane_metal-0.2.1-cp310-cp310-macosx_26_0_arm64.whl -
Subject digest:
786ec749ba227366f39e6603a417acc66a1bfb35cbd96406ea279de3e37146f8 - Sigstore transparency entry: 2168134401
- Sigstore integration time:
-
Permalink:
dereklei12/pennylane-metal@89467b524d1bafd17ab59ffb01e5ed9fad1d02ca -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/dereklei12
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@89467b524d1bafd17ab59ffb01e5ed9fad1d02ca -
Trigger Event:
push
-
Statement type: