A Python package for exploring cyclic structures in polynomial rings
Project description
Plumial: Collatz Conjecture Analysis
Plumial is a powerful Python library for mathematical analysis of the Collatz conjecture using polynomial representations. It transforms the discrete dynamics of Collatz sequences into algebraic operations on polynomial spaces, enabling systematic analysis of cycle structures and their properties.
✨ Key Features
- Path Objects (P class): Hydrated path identifiers that encode Collatz sequence paths
- Polynomial Representations: UV polynomials and k polynomials for algebraic analysis
- Cycle Analysis: Complete cycle navigation, detection, and mathematical properties
- Symbolic Mathematics: Full SymPy integration with comprehensive mathematical operations
- Performance Optimized: LRU caching and efficient algorithms for large-scale analysis
- Type Safe: Comprehensive type hints and modern Python practices
🌀 The Mystery Revealed
Witness the hypnotic σ₂₈₁(u,v) polynomial visualization - a glimpse into the hidden mathematical beauty of "glitched" Collatz cycles
This mesmerizing animation reveals something remarkable: p=281 represents a glitched Collatz cycle that challenges our understanding of the 3x+1 conjecture. The visualization shows σ₂₈₁(u,v) = u² + uv² + v⁴ evaluated with complex roots of unity, transforming discrete binary patterns into continuous geometric flows.
🔗 Mathematical Foundations
📖 Read the Complete Mathematical Foundations
Dive deep into the theoretical framework that powers Plumial:
- UV-Polynomial Theory: Bijection between natural numbers and algebraic forms
- Cycle Element Identity: The fundamental relationship x·d = a·k for cycle elements
- Binary Decomposition: How p = 2^(n_p) + Σb_{p,i}2^i encodes path structure
- Successor Operations: Bit rotation operations that preserve polynomial structure
- Advanced Topics: Cyclotomic connections, forced vs unforced cycles, and more
🚀 Quick Start
Installation
pip install plumial
Basic Usage
from plumial import P
from plumial.core import B
from plumial.utils import S, I, F
# Create a polynomial for p-value 133
p = P(133)
# Get bit counts and binary representation
print(f"n={p.n()}, o={p.o()}, e={p.e()}") # n=7, o=2, e=5
print(f"Binary: {p.b()}") # Binary: 10000101
# Work with polynomial representations
print(p.d()) # h**5 - g**2 (d-polynomial)
print(p.k()) # k polynomial (symbolic)
print(p.uv()) # UV polynomial representation
# Evaluate numerically using basis encoding
print(p.encode(B.Collatz).d()) # Evaluates with g=3, h=2: 23
# Cycle operations with functional style
collatz_p293 = P(293).encode(B.Collatz)
odd_k_values = list(collatz_p293.cycle(map=F.k(), filter=F.isodd))
# Binary string constructor
assert P(133) == P("10000101") # Equivalent results
Advanced Analysis
# Explore the famous glitched cycle
p281 = P(281)
cycle = list(p281.cycle())
print(f"Cycle length: {len(cycle)}")
print(f"Sigma polynomial: {p281.uv()}") # u**2 + u*v**2 + v**4
# Mathematical verification
for p in cycle:
print(f"{p.p():3d}: forced={p.isforced()}")
# Symbolic mathematics
import sympy as sy
a, x = p.ax() # Get reduced cycle polynomials
assert sy.expand(x * p.d()) == sy.expand(a * p.k()) # Verify identity
📚 Documentation
- Mathematical Foundations - Complete theoretical framework
- API Reference - Comprehensive function documentation
- Tutorial - Step-by-step learning guide
- Examples - Interactive Jupyter notebooks
🧮 Mathematical Capabilities
Polynomial Representations
- σ-polynomials: Binary path encoding as σₚ(u,v) polynomials
- k-polynomials: Transformation polynomials for cycle analysis
- d-polynomials: d-polynomials - d(g,h) = h^e - g^o an important term in the cycle element identity
Cycle Analysis
- Complete cycle enumeration with efficient navigation
- Forced vs unforced cycle classification
- Cycle element identity verification: x·d = a·k relationships
- Multiple Collatz variants: (3x+1,x/2), (5x+1,x/2), (7x+1,x/2), etc.
Advanced Mathematics
- Cyclotomic polynomial factorization for d-polynomials
- Matrix representations for polynomial manipulation
- GCD analysis and solution theory for cycle constraints
- Binary operations with complete bit-level analysis
🔬 Research Applications
Plumial enables systematic investigation of:
- Cycle existence theorems through polynomial constraint analysis
- Uniqueness proofs using GH-form canonical representations
- Statistical analysis of cycle length distributions
- Visualization of polynomial surfaces and cycle behavior
Changelog
0.1.1
- Basis and encoding architecture: New
B(basis) and encoding system for P and D classes, replacing legacyg,hparameter patterns with a cleanerencode(B.Collatz)API - D class constructor refactored to use
(o, e)parameters instead of previous constructor pattern - New methods:
c()andr()methods on D and P classes;G()for matrix operations;H()for k polynomial coefficient matrix analysis - Comprehensive SymPy integration for the D class
- New utility symbol:
dadded to the indexed set of symbols inutils - API modernization: Removed legacy methods and obsolete
COLLATZ_substitution symbols from the D class - Documentation: Published docs to GitHub Pages, corrected bit order documentation, updated all examples and API references to modern encoding API
- Build system: Migrated from Makefile to Taskfile.yml for documentation builds
- Fix: Corrected maintainer email typo in package metadata
0.1.0
- Initial release with P and D class polynomial representations
- UV polynomials, k polynomials, and cycle analysis
- SymPy-based symbolic mathematics
- Comprehensive test suite
🛠 Development Installation
git clone https://github.com/yourusername/plumial.git
cd plumial
pip install -e ".[dev]"
Running Tests
pytest # Run all tests
pytest tests/test_p_class.py # Run specific test file
Building Documentation
cd docs
make html # HTML documentation
make latexpdf # PDF documentation
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes with tests
- Run the test suite (
pytest) - Submit a pull request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Built with SymPy for symbolic mathematics
- Documentation powered by Sphinx
- Inspired by decades of Collatz conjecture research
"The polynomial framework transforms Collatz analysis from computational iteration to algebraic constraint solving, revealing deep mathematical structures while maintaining computational accessibility."
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 plumial-0.1.1.tar.gz.
File metadata
- Download URL: plumial-0.1.1.tar.gz
- Upload date:
- Size: 51.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
755328e74793a6d5942ba64c11967b091abada0ed0d073948555ffe5604347bf
|
|
| MD5 |
44c87a542e3fc94c5c8211a58ce185bc
|
|
| BLAKE2b-256 |
f89bd53882b7f0554f55cdefa364aec1cb0254d664cc6e0847872797096d6bdb
|
File details
Details for the file plumial-0.1.1-py3-none-any.whl.
File metadata
- Download URL: plumial-0.1.1-py3-none-any.whl
- Upload date:
- Size: 35.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40c900358d1b6d633da9d59fe15c56c88ab845f67bb3d5cb3a1db23934671560
|
|
| MD5 |
b2cb5af04a41f89263e5d871c558e6b7
|
|
| BLAKE2b-256 |
a8ada96b45046bd53109a86da5d0a38d82d6d04d4ac78295da9f24b02a2769f1
|