MOMA: Moving Origin Modular Arithmetic
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 Core Idea: A Barycenter for Numbers
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?
Core Concepts
The MOMA framework is built on a few simple but powerful concepts:
MomaRing: The primary object for all calculations. A ring is defined by amodulusand a chosenOriginStrategy.OriginStrategy: A trait that defines how the origin moves, making the framework highly extensible.- Analysis Tools: A suite of modular tools for deeper analysis:
- Number Theory:
MassField,OriginDrift,CompositeInfluence,CompositeDampener,GoldbachProjector,Entropy, andResonanceFinder. - Bioinformatics:
BioSigAnalyzer,CodonTable, andMutationfor mapping numeric signatures to biological events.
- Number Theory:
Features
- Flexible Core: A powerful and extensible system based on the
MomaRingandOriginStrategytrait. - Advanced Analysis Tools: A suite of high-level structs for statistical, number-theoretic, and bioinformatics analysis.
- Cryptographic Primitives: Demonstrates how MOMA can be used to build components like a Key Derivation Function.
- Prime Number Utilities: A helper
primesmodule for primality testing and prime generation. - Pure Rust: Built with safe, idiomatic Rust.
Installation
Add MOMA to your Cargo.toml:
[]
= "0.1.9" # Replace with the latest version
Exploring MOMA
MOMA is a toolkit for exploration across different domains.
Example 1: Finding "Resonance"
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 ResonanceFinder;
use strategy;
use primes;
// Find primes where the signature (using CompositeMass strategy)
// is divisible by the prime's factor mass.
let finder = new;
// Search for resonance events in the range 1 to 500.
let resonances = finder.find_in_range;
println!;
for in resonances
Example 2: Bioinformatics Signature Analysis
Use the BioSigAnalyzer to map MOMA signatures to simulated genetic mutations.
use BioSigAnalyzer;
use strategy;
let analyzer = new;
let dna_sequence = "AGCTGCGATCGTACGATCGATCGTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCT";
// Analyze the mutational effect of the signature derived from prime 13.
if let Some = analyzer.analyze
Contributing
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.
License
This project is licensed under either of:
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.