Skip to main content

LatticeFit

Deterministic engine for discovering discrete multiplicative structure in positive real data.

Given measurements x_1, x_2, ..., x_n, LatticeFit tests whether they cluster near a geometric lattice:

x_i ~ A * r^(k_i/d),   k_i in Z

and quantifies whether the alignment is statistically non-accidental.

Installation

pip install latticefit            # core only
pip install "latticefit[plots]"   # with matplotlib

Quick start

import latticefit
import numpy as np

# Standard Model fermion masses (GeV)
masses = [5.11e-4, 0.1057, 1.777, 0.00216, 1.275, 172.76,
          0.00467, 0.0934, 4.18]
names  = ["e", "mu", "tau", "u", "c", "t", "d", "s", "b"]

result = latticefit.fit(masses, anchor=5.11e-4,
                        base=latticefit.PHI, denom=4, names=names)
print(result.summary())

Features

  • Deterministic scan -- no random initialization, reproducible results
  • Anchor-shift invariance -- fits relative ratios, not absolute scale
  • Structure-preserving null hypothesis -- permutation test that preserves the multiplicative spread of the data
  • Auto-discovery -- scans over base r and denominator d automatically
  • CLI -- latticefit data.csv --base phi --denom 4
  • Publication-quality plots -- ladder diagrams, residual histograms

Background

LatticeFit was developed as the core fitting engine for the Hyperbolic Flavour Geometry programme, which derives Standard Model flavor parameters from the arithmetic geometry of compact hyperbolic 3-manifolds.

The golden ratio base r = phi = (1+sqrt(5))/2 is motivated by the Lucas trace identity: closed geodesics of length 4m*log(phi) in hyperbolic 3-manifolds have integer holonomy traces equal to Lucas numbers.

Lucas mode

# Scan with golden ratio base (motivated by hyperbolic geometry)
result = latticefit.fit(masses, base=latticefit.PHI, lucas=True)

Citation

If you use LatticeFit in your research, please cite:

Gentry, M.L. (2026). LatticeFit v0.3.0.
GitHub: https://github.com/drmlgentry/latticefit
PyPI: https://pypi.org/project/latticefit/

License

MIT

Metadata

Release files for latticefit 0.3.1

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

Source distribution (sdist)

Source distribution for latticefit 0.3.1
File Size Uploaded
latticefit-0.3.1.tar.gz 47.3 kB Details

Built distribution (wheel)

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

Total release size: 112.1 kB

Release files / latticefit-0.3.1.tar.gz

Download URL latticefit-0.3.1.tar.gz
Size 47.3 kB
Tags Source
SHA-256 checksum
How to use checksums
78a1e87851485c3e1fd6d277c33592d4677da47226e2307e6393b87ea6ff758e
BLAKE2b-256 checksum
How to use checksums
24657faab7f5000dba2905be9f3e7e01ccd5ccb0f6b8efe0d400afc5afee2934
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release files / latticefit-0.3.1-py3-none-any.whl

Download URL latticefit-0.3.1-py3-none-any.whl
Size 64.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8722a11cee6a568bac9034763d0d75f8bbd710d32d22632b1812956873607367
BLAKE2b-256 checksum
How to use checksums
79102d62ac1c0d0285546334df1b6dbd9676291bc0bbfc23b8f192d027943fda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.0

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