Skip to main content

Lattice fitting engine

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

latticefit-0.3.1.tar.gz (47.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

latticefit-0.3.1-py3-none-any.whl (64.8 kB view details)

Uploaded Python 3

File details

Details for the file latticefit-0.3.1.tar.gz.

File metadata

  • Download URL: latticefit-0.3.1.tar.gz
  • Upload date:
  • Size: 47.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for latticefit-0.3.1.tar.gz
Algorithm Hash digest
SHA256 78a1e87851485c3e1fd6d277c33592d4677da47226e2307e6393b87ea6ff758e
MD5 cb18a73620c5d21b8501bdf115d5af42
BLAKE2b-256 24657faab7f5000dba2905be9f3e7e01ccd5ccb0f6b8efe0d400afc5afee2934

See more details on using hashes here.

File details

Details for the file latticefit-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: latticefit-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 64.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for latticefit-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8722a11cee6a568bac9034763d0d75f8bbd710d32d22632b1812956873607367
MD5 100f426a00239a08df3d7bc23dd30256
BLAKE2b-256 79102d62ac1c0d0285546334df1b6dbd9676291bc0bbfc23b8f192d027943fda

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page