Skip to main content

Professional fractal computation framework based on golden ratio (φ) and 7D geometric manifolds

Project description

🔬 CMFO: Fractal Universal Computation Engine

PyPI version Python License Tests

CMFO is a professional-grade Python framework for deterministic fractal computation based on the golden ratio (φ) and 7-dimensional geometric manifolds. Unlike probabilistic AI/ML or binary logic, CMFO provides analytically reversible, physics-consistent operations for computation, logic, and optimization.


✨ Key Features

🧮 Fractal Algebra

  • Fractal Product: x ⊗_φ y = x^(log_φ(y)) - Scale-based multiplication
  • Fractal Root: √_φ(x) = x^(1/φ) - Natural hierarchical scaling
  • Convergent, stable, and mathematically rigorous

🔀 Geometric Logic

  • Continuous logic with φ-scaling (not fuzzy logic)
  • Operations: f_and, f_or, f_not, f_xor
  • Compatible with analog hardware and NPUs
  • Reversible and deterministic

⚛️ Physics-Based Operations

  • Geometric mass: m = ħ/(c·L) (Compton relation)
  • Dimensionally correct and fundamental
  • Anchor for all CMFO predictions

🚀 High Performance

  • Pure Python with NumPy acceleration
  • Optional C++ native extension for 20x+ speedup
  • Batch processing for superposition simulations

📦 Installation

pip install cmfo

Requirements:

  • Python ≥ 3.9
  • NumPy ≥ 1.20

Optional (for native acceleration):

  • C++ compiler (Visual Studio on Windows, GCC/Clang on Linux/macOS)

🚀 Quick Start

1. Fractal Algebra

from cmfo import fractal_root, fractal_product, PHI

# Fractal root - natural scaling
x = fractal_root(100.0)
print(f"√_φ(100) = {x:.4f}")  # 24.8588

# Convergence to unity
from cmfo import iterated_fractal_root
result = iterated_fractal_root(1000.0, n=50)
print(f"After 50 iterations: {result:.6f}")  # ≈ 1.0

# Fractal product
result = fractal_product(2.0, PHI)
print(f"2 ⊗_φ φ = {result:.4f}")  # = 2.0 (identity)

2. Geometric Logic

from cmfo import f_and, f_or, f_not, TRUE, FALSE, NEUTRAL

# Continuous logic operations
print(f"TRUE ∧_φ TRUE = {f_and(TRUE, TRUE):.4f}")
print(f"FALSE ∨_φ TRUE = {f_or(FALSE, TRUE):.4f}")
print(f"¬_φ NEUTRAL = {f_not(NEUTRAL):.4f}")

# Intermediate values (not binary!)
a, b = 0.7, 0.3
result = f_and(a, b)
print(f"f_and(0.7, 0.3) = {result:.4f}")  # Geometric conjunction

3. Physics Operations

from cmfo import geometric_mass, compton_wavelength

# Electron Compton wavelength
L_e = 2.4263102367e-12  # meters
m_e = geometric_mass(L_e)
print(f"Electron mass: {m_e:.4e} kg")  # ≈ 9.109e-31 kg

# Inverse relation
lambda_c = compton_wavelength(m_e)
print(f"Compton wavelength: {lambda_c:.4e} m")  # Recovers L_e

4. Legacy 7D Tensor Operations

from cmfo import T7Tensor, T7Matrix

# Create 7D state
state = T7Tensor([1.0, 0.5, -0.5, 0.0, 0.0, 0.0, 0.0])

# Deterministic evolution
matrix = T7Matrix()
final_state = matrix.evolve_state(state.v, steps=100)
print(f"Final state norm: {np.linalg.norm(final_state):.4f}")

📚 Core Modules

Constants (cmfo.constants)

PHI = 1.618033988749895      # Golden ratio
PHI_INV = 0.618033988749895   # φ⁻¹
HBAR = 1.054571817e-34        # Reduced Planck constant [J·s]
C = 299792458.0               # Speed of light [m/s]
M_PLANCK                      # Planck mass [kg]

Algebra (cmfo.algebra)

  • fractal_product(x, y) - Fractal multiplication
  • fractal_root(x) - Fractal root (√_φ)
  • iterated_fractal_root(x, n) - n applications of √_φ

Logic (cmfo.logic)

  • f_and(a, b) - Geometric AND
  • f_or(a, b) - Geometric OR
  • f_not(x) - Geometric NOT
  • f_xor(a, b) - Geometric XOR
  • Constants: TRUE, FALSE, NEUTRAL

Physics (cmfo.physics)

  • geometric_mass(L) - Mass from length (Compton)
  • compton_wavelength(m) - Wavelength from mass

🎯 Use Cases

✅ What CMFO is Good For:

  • Hierarchical optimization - Natural multi-scale problems
  • Deterministic logic - When you need reproducibility
  • Geometric computation - Scale-invariant operations
  • Physics simulations - Compton-scale calculations
  • Analog/NPU hardware - Continuous operations

❌ What CMFO is NOT:

  • Not a replacement for NumPy/SciPy (it's complementary)
  • Not for standard ML/AI (use PyTorch/TensorFlow)
  • Not for cryptography (experimental, not audited)
  • Not for production-critical systems (v0.x = experimental)

📖 Documentation

Full documentation: https://github.com/1JONMONTERV/CMFO-COMPUTACION-FRACTAL-

Key resources:


🧪 Verified Claims

All claims are backed by executable proofs in the repository:

Physics: Particle masses derived from Planck mass with α⁵ correction
Logic: Reversible Boolean gates via unitary rotations
Mining: O(1) geometric inversion (vs brute force)
Superposition: 10k concurrent fractal timelines (20x speedup)

Run verification:

git clone https://github.com/1JONMONTERV/CMFO-COMPUTACION-FRACTAL-.git
cd CMFO-COMPUTACION-FRACTAL-
python experiments/run_all_proofs.py

🔬 Scientific Rigor

CMFO is NOT vaporware. Every operation is:

  • ✅ Mathematically defined
  • ✅ Dimensionally correct
  • ✅ Reproducibly tested
  • ✅ Performance benchmarked

Test coverage: 43 tests, 100% passing
CI/CD: Automated testing on Ubuntu/Windows/macOS, Python 3.9-3.12


🛠️ Development

Running Tests

pip install pytest
pytest tests/ -v

Building from Source

git clone https://github.com/1JONMONTERV/CMFO-COMPUTACION-FRACTAL-.git
cd CMFO-COMPUTACION-FRACTAL-/bindings/python
pip install -e .

📄 License

Apache 2.0 for academic and personal use.

For commercial, corporate, or governmental use, please contact:


🙏 Citation

If you use CMFO in your research, please cite:

@software{cmfo2024,
  title = {CMFO: Fractal Universal Computation Engine},
  author = {Montero Viquez, Jonathan},
  year = {2024},
  version = {0.1.4},
  url = {https://github.com/1JONMONTERV/CMFO-COMPUTACION-FRACTAL-}
}

🚀 Roadmap

  • v0.1.x - ✅ Core algebra, logic, physics (CURRENT)
  • v0.2.x - GPU/CUDA acceleration
  • v0.3.x - NPU/neuromorphic hardware support
  • v1.0.0 - Stable API, production-ready

Made with precision in San José, Costa Rica 🇨🇷

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

cmfo_fractal-0.1.4.tar.gz (29.6 kB view details)

Uploaded Source

File details

Details for the file cmfo_fractal-0.1.4.tar.gz.

File metadata

  • Download URL: cmfo_fractal-0.1.4.tar.gz
  • Upload date:
  • Size: 29.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cmfo_fractal-0.1.4.tar.gz
Algorithm Hash digest
SHA256 5832930882f3181429585be5ab8cecc9588940cd6db60e35858e83b022b8d4c4
MD5 d2d2e88648f6f4f5200c2e6e66fcdcb6
BLAKE2b-256 4ba381a78709b1e53184593315c23aa088620e5db5717c145459b99fb77cc55d

See more details on using hashes here.

Provenance

The following attestation bundles were made for cmfo_fractal-0.1.4.tar.gz:

Publisher: publish-pypi.yml on 1JONMONTERV/CMFO-COMPUTACION-FRACTAL-

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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