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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ body:
id: python_version
attributes:
label: Python version
placeholder: "e.g. 3.11.9 — run: python --version"
placeholder: "e.g. 3.12.0 — run: python --version"
validations:
required: true

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/performance_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ body:
id: python_version
attributes:
label: Python version
placeholder: "e.g. 3.11.9"
placeholder: "e.g. 3.12.0"
validations:
required: true

Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
python-version:
description: Python version handed to setup-uv.
required: false
default: "3.11"
default: "3.12"
cache-suffix:
description: >-
setup-uv cache key suffix. Must differ per build configuration, or a
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.14"]
python-version: ["3.12", "3.14"]
runner: [ubuntu-26.04, ubuntu-26.04-arm, macos-15]
compiler: [default, g++-14, clang++-18]
mpi: ["off"]
Expand All @@ -38,15 +38,15 @@ jobs:
- compiler: clang++-18
runner: macos-15
include:
- python-version: "3.11"
- python-version: "3.12"
runner: ubuntu-26.04
compiler: default
mpi: "on"
- python-version: "3.11"
- python-version: "3.12"
runner: ubuntu-26.04-arm
compiler: default
mpi: "on"
- python-version: "3.11"
- python-version: "3.12"
runner: macos-15
compiler: default
mpi: "on"
Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11
3.12
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ option(monoprop_ENABLE_CXX_UNIT_TESTS "Enable C++ unit test suite" ON)
set(Python_FIND_VIRTUALENV FIRST)
find_package(
Python
3.11
3.12
REQUIRED
COMPONENTS
Interpreter
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/building.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ without MPI, so a from-source build is required for multi-rank runs.

- a C++23-compliant compiler; on Linux the minimum supported versions are **GCC 14** and **Clang 18**
- CMake and Ninja
- Python 3.11 or newer and the `uv` package manager (for the bindings)
- Python 3.12 to 3.14 and the `uv` package manager (for the bindings)
- an MPI implementation such as Open MPI (only for MPI builds)
- `hwloc` (version 2.9+) and `pkg-config` (required so CMake can locate `hwloc`)

Expand Down
2 changes: 1 addition & 1 deletion packages/monoprop-bench-tools/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description = "Benchmark harness for monoprop: memory accounting, model builders
license = "Apache-2.0"
license-files = ["LICENSE"]
readme = "README.md"
requires-python = ">=3.11,<3.15"
requires-python = ">=3.12,<3.15"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
Expand Down
16 changes: 7 additions & 9 deletions packages/monoprop-bench-tools/src/monoprop_bench_tools/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from __future__ import annotations

from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, TypeVar
from typing import TYPE_CHECKING, Any

import numpy as np

Expand All @@ -45,12 +45,10 @@
if TYPE_CHECKING:
from collections.abc import Callable

_T = TypeVar("_T")

Built = tuple[MajoranaPropagator, Circuit]


def barriered(fn: Callable[..., _T], comm: Any | None) -> Callable[..., _T]:
def barriered[T](fn: Callable[..., T], comm: Any | None) -> Callable[..., T]:
"""Wrap ``fn`` in the timed *exit* barrier, making each measurement the makespan.

The entry barrier lives untimed in :func:`barrier_setup`. Serial runs return ``fn``.
Expand All @@ -62,22 +60,22 @@ def barriered(fn: Callable[..., _T], comm: Any | None) -> Callable[..., _T]:
if comm is None or comm.Get_size() == 1:
return fn

def wrapped(*args: object, **kwargs: object) -> _T:
def wrapped(*args: object, **kwargs: object) -> T:
result = fn(*args, **kwargs)
comm.Barrier()
return result

return wrapped


def barrier_setup(
comm: Any | None, setup: Callable[[], _T] | None = None
) -> Callable[[], _T] | None:
def barrier_setup[T](
comm: Any | None, setup: Callable[[], T] | None = None
) -> Callable[[], T] | None:
"""Untimed *entry* barrier for ``pedantic(setup=...)``; serial runs return ``setup``, ``None`` included."""
if comm is None or comm.Get_size() == 1:
return setup

def wrapped_setup() -> _T:
def wrapped_setup() -> T:
result = setup() if setup is not None else None
comm.Barrier()
return result # type: ignore[return-value]
Expand Down
11 changes: 5 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ description = "Quantum circuit simulation with monomial propagation. Both Pauli
license = "Apache-2.0"
license-files = ["LICENSE"]
readme = "README.md"
requires-python = ">=3.11,<3.15"
requires-python = ">=3.12,<3.15"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
Expand All @@ -26,7 +26,6 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
Expand Down Expand Up @@ -123,8 +122,8 @@ provider = "scikit_build_core.metadata.setuptools_scm"
minimum-version = "build-system.requires"
# setuptools-style build caching in a local directory
build-dir = "build/{state}/{build_type}"
# build stable ABI wheels for CPython 3.11
wheel.py-api = "cp311"
# build stable ABI wheels for CPython 3.12
wheel.py-api = "cp312"
logging.level = "INFO"
# read CMake version from CMakeLists.txt
cmake.version = "CMakeLists.txt"
Expand Down Expand Up @@ -239,7 +238,7 @@ exclude = [
".github/workflows/scripts/*.py",
]

target-version = "py311"
target-version = "py312"

[tool.ruff.format]
# enable auto-formatting of code examples in docstrings
Expand Down Expand Up @@ -366,7 +365,7 @@ required-imports = ["from __future__ import annotations"]


[tool.pyright]
pythonVersion = "3.11"
pythonVersion = "3.12"

include = ["src/monoprop/**/*.py"]

Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sonar.test.exclusions=tests/data/**
sonar.sourceEncoding=UTF-8
sonar.tests=tests
sonar.verbose=true
sonar.python.version=3.11,3.12,3.13,3.14
sonar.python.version=3.12,3.13,3.14
sonar.lang.patterns.c=**/*.c
sonar.lang.patterns.cpp=**/*.cpp,**/*.h,**/*.hpp,**/*.inl

Expand Down
6 changes: 2 additions & 4 deletions src/monoprop/monomial_propagator.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import logging
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Generic, TypeVar
from typing import TYPE_CHECKING

import numpy as np

Expand Down Expand Up @@ -57,10 +57,8 @@

logger = logging.getLogger(__name__)

T_op = TypeVar("T_op", MajoranaOperator, PauliOperator)


class MonomialPropagator(ABC, Generic[T_op]):
class MonomialPropagator[T_op: (MajoranaOperator, PauliOperator)](ABC):
"""Abstract base for the classical monomial-propagation simulators.

Subclasses implement ``__init__`` -- resolve their operator family to a
Expand Down
Loading
Loading