| Crates.io | moma |
| lib.rs | moma |
| version | 0.3.8 |
| created_at | 2025-07-31 17:35:12.83926+00 |
| updated_at | 2025-11-15 17:17:17.32143+00 |
| description | Moving Origin Modular Arithmetic (MOMA), a library for modeling complex systems |
| homepage | |
| repository | https://github.com/neil-crago/moma |
| max_upload_size | |
| id | 1775400 |
| size | 58,548 |
MOMA is a Rust framework for exploring number theory, cryptography, and bioinformatics through the lens of Moving Origin Modular Arithmetic.
The crate is designed for researchers and developers who are interested in a novel, relational framework for analyzing complex sequences.
The inspiration for this crate comes from the concept of a barycenter in astrophysics. Just as the Earth and Moon orbit a common center of mass that is not the exact center of the Earth, MOMA treats modular arithmetic as a system where the "zero point" or "origin" is not fixed.
This origin shifts dynamically based on a contextual value—typically a prime number p—and the chosen OriginStrategy. This provides a novel relational framework for analyzing complex systems.
The original inspiration came from this NASA article: What Is a Barycenter?
The MOMA framework is built on a few simple but powerful concepts:
MomaRing: The primary object for all calculations. A ring is defined by a modulus and a chosen OriginStrategy.OriginStrategy: A trait that defines how the origin moves, making the framework highly extensible.Number Theory: MassField, OriginDrift, CompositeInfluence, CompositeDampener, GoldbachProjector, Entropy, and ResonanceFinder.
Bioinformatics: BioSigAnalyzer, CodonTable, and Mutation for mapping numeric signatures to biological events.
MomaRing and OriginStrategy trait.primes module for primality testing and prime generation.Add MOMA to your Cargo.toml:
[dependencies]
moma = "0.3.6" # Replace with the latest version
or rather just run cargo add moma from the terminal
MOMA is a toolkit for exploration across different domains.
Use the ResonanceFinder to find primes where the MOMA signature is a multiple of another property of the prime, such as its number of prime factors (prime_factor_mass).
use moma::resonance::ResonanceFinder;
use moma::strategy;
use moma::primes;
// Find primes where the signature (using CompositeMass strategy)
// is divisible by the prime's factor mass.
let finder = ResonanceFinder::new(
100,
strategy::CompositeMass,
primes::prime_factor_mass,
);
// Search for resonance events in the range 1 to 500.
let resonances = finder.find_in_range(1, 500);
println!("Found {} resonance events.", resonances.len());
for (prime, signature) in resonances {
println!(" - Resonance at p={} with signature {}", prime, signature);
}
Use the BioSigAnalyzer to map MOMA signatures to simulated genetic mutations.
use moma::biosig::BioSigAnalyzer;
use moma::strategy;
let analyzer = BioSigAnalyzer::new(60, strategy::CompositeMass);
let dna_sequence = "AGCTGCGATCGTACGATCGATCGTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCT";
// Analyze the mutational effect of the signature derived from prime 13.
if let Some((signature, mutation)) = analyzer.analyze(13, dna_sequence) {
println!("Signature for p=13 is {}", signature);
println!("Resulting mutation type: {:?}", mutation.mutation_type);
}
There are more examples in the GitHub repository including:-
Neil Crago — experimental mathematician
Contributions are welcome! If you have an idea for a new OriginStrategy, an analysis tool, or find a bug, please feel free to open an issue or submit a pull request.
This project is licensed under either of:
at your option
This crate is part of a collection of crates by the same author: These include:-