Skip to main content

qftppy

A native PyTorch implementation of the C++ qft++ library, providing the spinor and tensor objects needed to build covariant tensor amplitudes.

import qftppy

qft = qftppy.QFTNative()
gamma = qftppy.dirac_gamma()

Installation

pip install qftppy

To install from a checkout instead, run pip install . in this directory (or pip install -e . for an editable install if you expect to make changes to the package).

Developing

Development is managed with pixi, which sets up Python, PyTorch and the dev tools from conda-forge and installs the package in editable mode. Common tasks are

pixi run test   # run the test suite with pytest
pixi run lint   # check linting and formatting with ruff
pixi run fmt    # apply ruff fixes and formatting
pixi run build  # build the sdist and wheel into dist/

pixi shell -e dev gives a shell in the development environment.

Comparing against the original C++ qft++

The cpp environment builds the original qft++ from source (pinned commit) together with small pybind11 wrappers in cpp_reference/, and runs tests/cpp/, which checks qftppy against it numerically:

pixi run -e cpp test-cpp

After changing anything in cpp_reference/, rebuild it with pixi reinstall -e cpp cpp_reference.

The build applies one local patch to qft++ (cpp_reference/patches/tensorindex-permute.patch): upstream TensorIndex::Permute() never terminates for rank 4, which hangs Tensor::Symmetric() and therefore orbital tensors of rank 4 and above. Regenerate it with cpp_reference/patches/make_patch.py rather than editing it by hand.

Both test sets run in GitHub Actions on pushes to main and on pull requests.

To keep the code-base clean, enable pre-commit with

pixi run -e dev pre-commit install

This runs several checks plus ruff linting and formatting on each commit. The max line length is 120 characters.

Releasing

Releases are automated with release-please and published to PyPI with trusted publishing:

  1. Merge changes into main as squash-merged pull requests whose titles follow Conventional Commits (fix: ... for a patch release, feat: ... for a minor release, feat!: ... for a breaking change, which bumps the minor version while below 1.0; chore:, docs:, test:, ci: etc. do not trigger a release). A CI check enforces the title format.
  2. release-please keeps a release pull request open that bumps the version in pyproject.toml and updates CHANGELOG.md.
  3. Merging the release pull request tags the release, creates a GitHub release and publishes the package to PyPI.

Metadata

Release files for qftppy 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qftppy 0.1.0
File Size Uploaded
qftppy-0.1.0.tar.gz 30.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for qftppy 0.1.0
File Interpreter ABI Platform
qftppy-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 54.9 kB

Release files / qftppy-0.1.0.tar.gz

Download URL qftppy-0.1.0.tar.gz
Size 30.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c8fd457da19b3c4f0f59288c918dfae8baeb6e7895f4dfbc424c2d29bb98ba98
BLAKE2b-256 checksum
How to use checksums
9f5ba78fc2f372703d54eb38e3242d3036ac8422c487986a4eb77ae1d2126bb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Release files / qftppy-0.1.0-py3-none-any.whl

Download URL qftppy-0.1.0-py3-none-any.whl
Size 24.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29aa98ea8bf54922c73f3c236b49df493770276bf369cc47460eef30be6df8c6
BLAKE2b-256 checksum
How to use checksums
d45f0e848d74ce848369c9fc606dc24ce4ce3eb693cd74e29b1696ad3dfb80b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page