sankhya
sankhya (Sanskrit: सांख्य — enumeration/analysis) is an ancient mathematical systems library for the AGNOS project.
Faithful implementations of computational traditions from seven civilizations, plus cross-civilizational epoch correlation.
Modules
| Module | Civilization | Era | Highlights |
|---|---|---|---|
mayan |
Maya | 2000 BCE+ | Vigesimal (base-20), Long Count calendar, Tzolkin, Haab, Venus tables, Calendar Round search |
babylonian |
Babylon | 2000–300 BCE | Sexagesimal (base-60), Saros cycle, Plimpton 322 triples, Heron's sqrt, lunar calendar, cuneiform display |
egyptian |
Egypt | 2000–1000 BCE | Unit fractions (Rhind Papyrus), doubling multiplication, stellar decans, Sothic cycle, hieroglyphic display |
vedic |
India | 800 BCE+ | Nikhilam multiplication, Sulba Sutra geometry, Katapayadi, Meru Prastara, Devanagari display |
chinese |
China | 500 BCE+ | Rod numerals, Chinese Remainder Theorem (Sun Tzu), magic squares, Unicode rod display |
greek |
Greece | 600 BCE–300 CE | Golden ratio, Sieve of Eratosthenes, Euclidean GCD, Archimedes' pi, Antikythera, isopsephy |
roman |
Rome | 500 BCE+ | Roman numeral conversion (I–MMMCMXCIX), canonical validation, arithmetic |
islamic |
Islamic Golden Age | 750–1258 CE | Al-Khwarizmi algebra, Khayyam cubics, completion of the square, Hijri calendar |
epoch |
Cross-civilizational | — | Precession (25,920-year Great Year), precessional ages, Seven Sages traditions, cycle alignment, multi-calendar correlation |
Quick Start
use LongCount;
use babylonian;
use greek;
use roman;
// Convert days to Mayan Long Count
let lc = from_days.unwrap; // 13.0.0.0.0 (Dec 21, 2012)
assert_eq!;
// Babylonian square root (Heron's method, from YBC 7289 tablet)
let sqrt2 = babylonian_sqrt.unwrap;
assert!;
// Sieve of Eratosthenes
let primes = sieve;
assert_eq!;
// Roman numerals
assert_eq!;
assert_eq!;
Features
| Feature | Default | Description |
|---|---|---|
varna |
off | Script rendering: cuneiform, hieroglyphic, Devanagari, Greek alphabetic, CJK rod numerals |
logging |
off | Structured tracing via tracing-subscriber |
Building
Requirements
- Rust 1.89+ (MSRV)
- Dependencies: hisab, serde, thiserror, tracing
- Optional: varna (script rendering)
License
GPL-3.0-only. See LICENSE.