Skip to main content

Requirements

  • Python 3.10, 3.12 or 3.13 (these run in CI)
  • NumPy (installed automatically)
  • A C compiler such as cc or gcc, only if you want the generated-C kernel backend (Stage 3)
  • PyTorch, only for sf.torch (Stage 2)

Install

1

Clone the repository

2

Install in a virtual environment

Add [test] to also get pytest and hypothesis, or [torch] for the PyTorch integration:
3

Check it works

Run the tests

The quick run skips the exhaustive sf9 and sf10 sweeps. Both runs compare every result against the exact-fraction oracle; see how sf is tested.

Run the tours

Each stage ships a script that walks through its features and prints what it does:
Everything in this documentation was produced by running the code shown. If an output on these pages differs from what you see, that is a bug in one or the other; please report it.