Skip to main content

A Python package for exploring cyclic structures in polynomial rings

Project description

Plumial: Collatz Conjecture Analysis

Documentation Status PyPI version Python 3.8+ License: MIT

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

Plumial Animation

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 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

🛠 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.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes with tests
  4. Run the test suite (pytest)
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plumial-0.1.0.tar.gz (50.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plumial-0.1.0-py3-none-any.whl (34.6 kB view details)

Uploaded Python 3

File details

Details for the file plumial-0.1.0.tar.gz.

File metadata

  • Download URL: plumial-0.1.0.tar.gz
  • Upload date:
  • Size: 50.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for plumial-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7ae7cc04303d5baedd8373be28b0792028c41c4ae8310a970e4168de871929a0
MD5 ce48964c2631b55cbc1661aad8ea1b06
BLAKE2b-256 44d26c37696feafc5f40002951f0f0ddc6da7dfd3ddeedce4356a9c3014e038d

See more details on using hashes here.

File details

Details for the file plumial-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: plumial-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 34.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for plumial-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b350ff3f3439c369f50bc767708e35e01846dd7753426b6c917567dda9ae4202
MD5 40e733adcb0f86bb21c946095cca15f5
BLAKE2b-256 568edc83bee7f5b8d44516c43784c1d8e95e810365aaaf67dac39c90b0867533

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page