A C++23/Python library for Majorana and Pauli propagation. MonomialPropagator<NumModes> is the
shared engine; Majorana against Pauli is a runtime Basis, and Python exposes MajoranaPropagator and
PauliPropagator. monoprop_MAX_NUM_MODES is the compile-time mode limit (default 1024).
- C++23 idioms, trailing return types, follow almost-always-
autostyle,clang-formatwith the repository configuration. - Use snake case for naming variables and functions, camel case for classes. E.g.,
kBitsis wrong for a integer variable, usenum_bitsinstead. - Only private member variables are suffixed with an underscore.
- Qt-style Doxygen on every header declaration, member docs after the member.
//for one-line C++ comments,/* */for blocks. - Comment invariants, contracts and non-obvious choices only. Never narrate the code.
- Google-style Python docstrings without type hints, accurate enough for
just gen-api. Type hints in the code. - In
docs/content/docs/**/*.mdxand docstrings, link API symbols as[Symbol][]or[Display][fully.qualified.path]-- never/api/...URLs, never backticks around a link. Seedocs/content/docs/documenting.mdx. - Run
prek run --all-filesand the relevant tests before pushing, and fix every finding.lint.ymlruns the same hooks over the PR's commit range, so a skipped lint is a red PR. - Changes to the API or user-facing behavior (including developers, e.g. test workflows) should be reflected in the docs and, if relevant, the
README.md.
- Commits and PR titles:
<type>(<optional scope>): <gitmoji> <description>. Types:feat(minor),fix(patch),docs,style,refactor,test,chore;!for breaking changes. - Agent commits carry
Assisted-by: <harness>:<model>and noCo-authored-by. - Follow
.github/PULL_REQUEST_TEMPLATE.md; prefix agent-authored descriptions and comments with:robot: _AI text below_ :robot:.
Public headers cpp/include/monoprop/, implementation cpp/monoprop/, Python API
src/monoprop/, binding template src/monoprop/bindings/binder.h, generators
tools/generate-*.py, sibling distributions packages/*. The repository root is the uv
workspace's monoprop package.
bindings.cpp and _dispatch.py are generated -- never edit them. To change the C++ API: edit
the header and implementation, then binder.h if Python needs it, then rebuild the project and run both C++ and Python tests.
We use uv for environment management.
We also use just for task automation. The recipes in the justfile show how to build and test in the supported configurations.
uv sync --all-groups --all-extras -v
uv run pytest
prek run --all-files
just build-docs- Python cases live in
tests/cases.py(load_problem()readstests/data/*.msgpack); C++ usestest_utils::load_case()fromcpp/tests/TestData.h. - Pytest's fd capture hides C++ stderr such as
COMMPROF; rerun with-s. uv syncdoes not relinkbin/monoprop_unit_tests.x-- compare mtimes and use the standalone recipe indocs/content/docs/building.mdx.- Slow CTest startup in MPI builds is
MPI_Initfabric probing; seemonoprop_TEST_EXCLUDE_MPI_FABRICincpp/tests/CMakeLists.txt. - Sanitizer rebuild and test: