Zilver is a quantum circuit simulator built natively for Apple Silicon. It runs entirely on the Apple GPU through MLX, with hand-written Metal compute kernels for the universal gates.
It is designed for QML researchers and engineers who want to develop, train, and benchmark variational quantum algorithms locally on their own Mac. No cloud dependency. No virtualisation. No platform cost.
pip install zilverApple Silicon Mac, macOS 13 or later, Python 3.10 or later.
New to Zilver? The Quickstart goes from install to a trained circuit in a few minutes.
import numpy as np
from zilver.circuit import hardware_efficient
circuit = hardware_efficient(n_qubits=10, depth=3)
params = np.random.default_rng(0).uniform(-np.pi, np.pi, circuit.n_params)
sv = circuit.statevector(params)
print(sv.numpy().shape, sv.dtype)That is the entire setup. No accounts, no API keys, no registration.
For the multithreaded CPU path and double-precision simulation, install the optional extra:
pip install "zilver[accel]"Zilver ships the primitives QML practitioners use daily.
Variational algorithms. Parameter-shift gradients, batched over a parameter vector or a parameter grid, fused into a single MLX dispatch.
import mlx.core as mx
from zilver.gradients import param_shift_gradient, param_shift_gradient_batched
f = circuit.compile(observable="sum_z")
g = param_shift_gradient(f, mx.array(params.astype(np.float32)))Quantum kernel methods. A fidelity kernel |<psi_i|psi_j>|^2 for an N-sample batch is one call, computed on-device.
K = circuit.fidelity_kernel(batch_params) # (N, N) numpy float32Loss-landscape and barren-plateau analysis. A 2D parameter sweep at fixed depth is one vmap dispatch.
from zilver.landscape import LossLandscape
land = LossLandscape(circuit, sweep_params=(0, 1), resolution=32).compute()
print(land.trainability_score(), land.plateau_coverage())Noisy simulation. NoisyCircuit runs on the density-matrix backend, and a NoiseModel applies Kraus channels automatically after every gate — depolarizing, or thermal relaxation built straight from device T1/T2 and gate times.
import mlx.core as mx
from zilver import NoisyCircuit, NoiseModel
nc = NoisyCircuit(4)
nc.h(0); nc.cnot(0, 1); nc.ry(1, param_idx=0)
# coherence times and gate durations share a unit (e.g. ns)
noise = NoiseModel.thermal_relaxation(t1=250_000, t2=170_000,
gate_time_1q=32, gate_time_2q=70)
f = nc.compile(observable="sum_z", noise_model=noise)
exp = f(mx.array([0.7]))Circuit.statevector(params, method=..., precision=...) selects how the circuit executes.
method="metal" runs hand-written Metal compute kernels for RY, RZ, RX, H, X, CNOT, CZ, RZZ, and U3, fused into a single graph by mx.compile. Single precision (complex64). The default for single-statevector evaluation.
method="accel" runs a multithreaded CPU path on Numba and Accelerate. It auto-routes between strided NumPy (small circuits), tape-lowered JIT dispatch, and k=2 fused blocks based on qubit count. Supports complex64 and complex128. Requires the accel extra.
method="mlx" is the generic MLX path. Use it for batched workloads such as parameter sweeps, gradient batches, and fidelity kernels where mx.vmap over the parameter axis is the dominant compute pattern.
method="auto" (the default) picks metal when the circuit uses only supported gate kinds and precision="single", otherwise accel.
The wider simulation surface (density-matrix and tensor-network backends) is selected at job-submission time via the backend flag.
| Backend | Flag | Approximate ceiling on a 16 GB M-series |
|---|---|---|
| Statevector | sv | 30 qubits |
| Density matrix | dm | 15 qubits |
| Tensor network | tn | 50+ qubits, circuit-dependent |
Single statevector, hardware-efficient ansatz at depth 2, on Apple M1 Pro with 16 GB unified memory. Wall time in milliseconds, minimum of four trials; lower is better.
| Qubits | Zilver (Metal) | Qiskit Aer |
|---|---|---|
| 12 | 1.45 | 1.50 |
| 16 | 1.76 | 4.84 |
| 20 | 19.93 | 40.84 |
| 22 | 70.31 | 148.44 |
| 24 | 334.63 | 588.61 |
Two-qubit process fidelity against the ideal unitary: CNOT and CZ are bit-exact on every backend. RZZ on the Metal path is within 3.4e-08 of ideal, the float32 floor. The Accel path with precision="double" reproduces ideal to numerical zero.
Everything above runs standalone on your Mac/Mini. If you want to contribute compute or run jobs across a distributed pool of Apple Silicon nodes, the Zilver network adds that as a separate, opt-in layer.
The 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.
Node registration is invite-only during the current phase. Open an issue with your chip model and intended uptime; on approval you will receive a registry API key.
pip install "zilver[network]"
zilver-node start \
--registry https://registry.siriusquantum.com \
--public-url https://your-public-url.example.comSee NODES.md for setup requirements, public URL options, and identity management.
Client API access is also by invitation. Open an issue describing your use case and institution; on approval 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))Zilver is under active development. Public APIs and wire formats may change between minor releases.
Open an issue on GitHub or write to info@siriusquantum.com.
Apache 2.0. See LICENSE.