Skip to content

Latest commit

 

History

History

ppvm-python

Folders and files

README.md

CI

ppvm (Python)

ppvm (Pauli Propagation and Virtual Machine) is a fast quantum circuit simulator with Python bindings backed by a high-performance Rust core.

Installation

We recommend using uv to manage your Python environment. Install directly from git:

uv add git+https://github.com/QuEraComputing/ppvm.git#subdirectory=ppvm-python

Or clone and install locally:

git clone https://github.com/QuEraComputing/ppvm
cd ppvm
uv sync --project ppvm-python

Quick examples

Pauli Propagation

from ppvm import PauliSum

state = PauliSum.new(n_qubits=2, terms=["ZZ"])

# Backwards-propagate through a GHZ circuit
state.cnot(0, 1)
state.h(0)

print(state)  # 1.000 * IZ
print(state.overlap_with_zero())

Generalized Stabilizer Tableau

from ppvm import GeneralizedTableau

tab = GeneralizedTableau(n_qubits=2)
tab.h(0)
tab.cnot(0, 1)

r0 = tab.measure(0)
r1 = tab.measure(1)
print(f"Qubit 0: {r0}, Qubit 1: {r1}")  # always correlated

Documentation

Full documentation is available at the ppvm docs site.

Examples