Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,30 @@ jobs:
run: cargo build --target wasm32-unknown-unknown --workspace --exclude ppvm-python-native --exclude ppvm-cli --exclude ppvm-tui

python-tests:
name: Python tests
name: Python tests (${{ matrix.python-version }})
needs: pre-commit
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@1.98.0

- uses: Swatinem/rust-cache@v2

- uses: astral-sh/setup-uv@v5
- uses: astral-sh/setup-uv@v7

- name: Install Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Show test interpreter
run: uv run --project ppvm-python --python ${{ matrix.python-version }} python --version

- name: Run Python tests
run: uv run --project ppvm-python --group dev pytest ppvm-python/test/ docs/examples/
run: uv run --project ppvm-python --python ${{ matrix.python-version }} --group dev pytest ppvm-python/test/ docs/examples/

# The pure-Rust crates are platform-agnostic and fully verified on Linux by
# the jobs above. The PyO3 extension is the only OS-sensitive artifact (macOS
Expand Down
4 changes: 2 additions & 2 deletions crates/ppvm-python-native/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ ppvm-pauli-sum = { version = "0.3.0", path = "../ppvm-pauli-sum" }
ppvm-stim = { version = "0.3.0", path = "../ppvm-stim", features = ["rayon"] }
ppvm-tableau = { version = "0.3.0", path = "../ppvm-tableau" }
ppvm-tableau-sum = { version = "0.3.0", path = "../ppvm-tableau-sum", features = ["rayon"] }
# abi3-py310: build a single stable-ABI wheel that loads on CPython 3.10+,
# abi3-py311: build a single stable-ABI wheel that loads on CPython 3.11+,
# instead of one wheel per Python version.
pyo3 = { version = "0.29.0", features = [
"extension-module",
"multiple-pymethods",
"abi3-py310",
"abi3-py311",
] }
rand = "0.10.3"
2 changes: 1 addition & 1 deletion docs/src/pages/develop.astro
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ chore: restore lockfile consistency</code></pre>
ppvm</code>.
</p>
<ul>
<li>Python &ge; 3.10 required (<code>.python-version</code> pins 3.12 for dev). The wheel is built against PyO3's <code>abi3-py310</code> stable ABI, so one <code>cp310-abi3</code> wheel per platform loads on 3.10+.</li>
<li>Python &ge; 3.11 required (<code>.python-version</code> pins 3.12 for dev). The wheel is built against PyO3's <code>abi3-py311</code> stable ABI, so one <code>cp311-abi3</code> wheel per platform loads on 3.11+.</li>
<li><code>uv</code> manages the venv and deps and triggers the maturin build on <code>uv sync</code>.</li>
<li><code>ppvm-python/pyproject.toml</code> sets <code>build-backend = "maturin"</code> with <code>[tool.maturin]</code> <code>manifest-path</code> &rarr; the crate, <code>python-source = "src"</code>, and <code>module-name = "ppvm._core"</code>.</li>
<li>Plain <code>cargo build</code> also links the cdylib (a <code>build.rs</code> in <code>ppvm-python-native</code> adds the macOS <code>-undefined dynamic_lookup</code> flag), so the Rust-only workflows work without maturin.</li>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const tableauCode = stripDocstring(tableauGhz);
</p>
<div class="meta">
<span><strong>Rust</strong> 2024</span>
<span><strong>Python</strong> ≥ 3.10</span>
<span><strong>Python</strong> ≥ 3.11</span>
<span><strong>Source</strong> <a href="https://github.com/QuEraComputing/ppvm">github.com/QuEraComputing/ppvm</a></span>
</div>
<div class="hero-cta">
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/quickstart/python/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const toc = [
<section id="install">
<h2>Install ppvm</h2>
<p>
Requires Python ≥ 3.10. The native extension is compiled
Requires Python ≥ 3.11. The native extension is compiled
automatically from Rust during install. We recommend using
<a href="https://docs.astral.sh/uv/">uv</a> to manage your Python
environment.
Expand Down
8 changes: 6 additions & 2 deletions ppvm-python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@ license-files = ["LICENSE", "NOTICE", "AUTHORS"]
authors = [
{ name = "David Plankensteiner", email = "dplankensteiner@quera.com" }
]
requires-python = ">=3.10"
requires-python = ">=3.11"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Rust",
"Topic :: Scientific/Engineering :: Physics",
]
dependencies = [
"bloqade-circuit>=0.15.0",
"bloqade-circuit>=0.15.5",
"kirin-toolchain~=0.22.2",
"numpy>=2.2.6",
"typing-extensions>=4.0",
Expand Down
4 changes: 1 addition & 3 deletions ppvm-python/src/ppvm/paulisum.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
import re
from collections.abc import Sequence
from dataclasses import dataclass, field
from typing import Union

from typing_extensions import Self
from typing import Self, Union

from . import _core
from .mixins import (
Expand Down
2 changes: 1 addition & 1 deletion ppvm-python/src/ppvm/squin_interpreter/_interp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# SPDX-License-Identifier: Apache-2.0

from dataclasses import dataclass, field
from typing import Self

from kirin import interp
from typing_extensions import Self

from ..generalized_tableau import GeneralizedTableau

Expand Down
Loading
Loading