Exact geometric computation on Pythagorean constraint manifolds — snap, holonomy, and adaptive tolerance
Project description
constraint-theory
Exact geometric computation on Pythagorean constraint manifolds.
What is Constraint Theory?
Constraint theory replaces floating-point arithmetic with operations on discrete mathematical manifolds. Values are "snapped" to exact points (like Pythagorean triples) rather than approximated as floats.
Benefits:
- Zero drift — snap operations are exact by construction
- Provable correctness — snapped values satisfy a²+b²=c² exactly
- Deterministic — same input, same output, any hardware
Install
pip install constraint-theory
Quick Start
from constraint_theory import PythagoreanManifold, snap
# Generate a manifold of Pythagorean triples
m = PythagoreanManifold(max_c=10000)
print(f"Loaded {m.size} triples")
# Snap a float to the nearest triple
triple = snap(5.1)
print(triple) # (3, 4, 5)
Holonomy Measurement
from constraint_theory import holonomy_loop
result = holonomy_loop(steps=100, max_c=10000, seed=42)
print(f"Displacement: {result.final_displacement:.6f}")
print(f"Angle drift: {result.total_angle_drift:.6f} rad")
Adaptive Tolerance
from constraint_theory import AdaptiveTolerance, FixedTolerance
adaptive = AdaptiveTolerance(k=1.0)
print(adaptive.epsilon(10.0)) # 0.1
print(adaptive.epsilon(100.0)) # 0.01
fixed = FixedTolerance(epsilon=0.05)
print(fixed.epsilon(100.0)) # 0.05
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file constraint_theory-0.2.0.tar.gz.
File metadata
- Download URL: constraint_theory-0.2.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0066128417afd6015b042acacc250ca41d74213ce59990477cf6407a0d261a30
|
|
| MD5 |
358f41931cf00d1ead648cb63edc2315
|
|
| BLAKE2b-256 |
777e6b3217213b1cd910a733297a3e141e6b401410f0bf3b5d0ffab44d7b156b
|
File details
Details for the file constraint_theory-0.2.0-py3-none-any.whl.
File metadata
- Download URL: constraint_theory-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55d37726b5ba80481606ea62086a21e80dff5be797b1d21d799c3f8560a6c4a7
|
|
| MD5 |
a9689c8187458191cfd41de55f469e74
|
|
| BLAKE2b-256 |
070c0a142e9fd6d93f6518b75c748d8c46e27201e14c8cb76bf4abb32c84dba9
|