Skip to main content

Open quantum simulation network for Apple Silicon

Project description

Zilver

PyPI version Python MLX License Apple Silicon

Distributed quantum simulation network for Apple Silicon.

Zilver is a quantum simulation framework built on MLX, Apple's unified memory compute framework. It runs natively on Apple Silicon — M1 through M4 — using Metal for GPU dispatch and the Neural Engine where applicable. There is no cloud dependency, no virtualisation layer, and no emulation.

The network is a distributed fabric of Apple Silicon nodes. Operators contribute their hardware. Researchers submit circuits. The registry coordinates matching, job dispatch, and result verification without acting as a compute intermediary.

v0.4 is under active development. APIs and wire formats may change between minor releases.

Requirements

  • Apple Silicon Mac (M1 or later)
  • macOS 13 Ventura or later
  • Python 3.10+

MLX does not run on Linux, Windows, or Intel Macs. This is a deliberate constraint — the architecture is built around Apple's unified memory model and Metal compute stack.

Local simulation

Install and run circuits immediately, no account or network required.

pip install zilver
from zilver.circuit import hardware_efficient
from zilver.gradients import param_shift_gradient
from zilver.landscape import LossLandscape
import mlx.core as mx

circuit = hardware_efficient(n_qubits=6, depth=3)

# Loss landscape analysis
result = LossLandscape(circuit, sweep_params=(0, 1), resolution=40).compute()
print(f"Trainability score: {result.trainability_score():.3f}")
print(f"Plateau coverage:   {result.plateau_coverage():.1%}")
print(f"Wall time:          {result.wall_time_seconds:.3f}s")

# Parameter-shift gradients, fully batched on Metal
f = circuit.compile(observable="sum_z")
params = mx.zeros([circuit.n_params])
grads = param_shift_gradient(f, params)

Three simulation backends ship in the base package:

Backend Flag Max qubits (M1 Pro, 16 GB)
Statevector sv 30
Density matrix dm 15
Tensor network tn 50+ (circuit-dependent)

Statevector dispatch methods

Circuit.statevector(params, method=..., precision=...) selects how the statevector backend executes a circuit on Apple Silicon:

Method Implementation Best for
"metal" Custom Metal compute kernels for RY/RZ/RX/H/X/CNOT/CZ/RZZ/U3, fused via mx.compile Single statevector simulation (complex64)
"accel" Multithreaded CPU path (numba + Accelerate), strided + tape-lowered + k=2 fused kernels Double-precision (precision="double"); CPU-only environments
"mlx" Generic MLX gate application (transpose + matmul per gate) Batched / vmap workloads (parameter sweeps, gradient batches, fidelity kernels)
"auto" Picks metal for single-precision supported circuits, accel otherwise Default

The accel path requires the optional extra: pip install "zilver[accel]".

import numpy as np
from zilver.circuit import hardware_efficient

circuit = hardware_efficient(n_qubits=16, depth=2)
params  = np.random.default_rng(0).uniform(-np.pi, np.pi, circuit.n_params)

sv = circuit.statevector(params, method="auto", precision="single")
print(sv.dtype, sv.numpy().shape)

Single-statevector performance on Apple M1 Pro (16 GB)

Hardware-efficient ansatz, depth 2. Lower is better.

Qubits zilver metal qiskit-aer (statevector) Speedup
12 1.45 ms 1.50 ms 1.03×
16 1.76 ms 4.84 ms 2.76×
20 19.93 ms 40.84 ms 2.05×
22 70.31 ms 148.44 ms 2.11×
24 334.63 ms 588.61 ms 1.76×

2-qubit gate process fidelity vs ideal unitary: CNOT and CZ are bit-exact on all paths; RZZ on metal (complex64) is within 3.4 × 10⁻⁸ of ideal; accel precision="double" and Aer match to numerical zero. Run benchmarks/bench_2q_fidelity.py and benchmarks/bench_apple_silicon_ceiling.py to reproduce.

Network

The Zilver network connects Apple Silicon nodes into a shared simulation fabric. Researchers submit jobs to the registry; the registry matches to a capable node; the node executes and returns a cryptographically signed result.

Join as a node operator

Node registration is invite-only during the current phase. If you have Apple Silicon hardware and want to contribute compute, open an issue with your chip model and intended uptime.

Once approved, you will receive a registry API key. Start your node:

pip install "zilver[network]"
zilver-node start \
  --registry https://registry.siriusquantum.com \
  --public-url https://your-public-url.example.com

See NODES.md for setup requirements, public URL options, and identity management.

Submit jobs as a researcher

API access is by invitation. To request access, open an issue describing your use case and institution. Once approved you will receive a client key.

from zilver.client import NetworkCoordinator
from zilver.node import SimJob

coord = NetworkCoordinator(
    "https://registry.siriusquantum.com",
    client_api_key="your-key",
)

job = SimJob(
    circuit_ops=[{"type": "ry", "qubits": [0], "param_idx": 0}],
    n_qubits=4, n_params=1, params=[1.57], backend="sv",
)

result = coord.submit(job)
print(result.expectation)
print(result.verify(job))  # cryptographic result verification

Feedback & contributions

Open an issue on GitHub or reach us at dev@siriusquantum.com.

License

Apache 2.0. See LICENSE.

Read the Sirius Quantum Manifesto

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

zilver-0.4.0.tar.gz (133.1 kB view details)

Uploaded Source

Built Distribution

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

zilver-0.4.0-py3-none-any.whl (109.1 kB view details)

Uploaded Python 3

File details

Details for the file zilver-0.4.0.tar.gz.

File metadata

  • Download URL: zilver-0.4.0.tar.gz
  • Upload date:
  • Size: 133.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.1

File hashes

Hashes for zilver-0.4.0.tar.gz
Algorithm Hash digest
SHA256 3087488701655a5f55d240dcdb6fe140bd7c564567786fd39f9e609df0a31aeb
MD5 8c77dfd87ccac396c095bb6da4b5a9b3
BLAKE2b-256 fd0ed46faa620c2067ffb4ea9e70139958e3b38e4c58d21efa2f01ddf690bd42

See more details on using hashes here.

File details

Details for the file zilver-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: zilver-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 109.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.1

File hashes

Hashes for zilver-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 62a7b14397dce6ce7122d4e309514684c3550578f2b48e84cdcb8df2da7526da
MD5 8d6e48f521fb910a4a9121f943b1686a
BLAKE2b-256 12853fe0b05c6d65e8486de05f55d9efe297c72ccccb54edf9ef9a6f55bbad30

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