ppflib 0.1.0

Advanced computational library for Physics-Prime Factorization (PPF): quantum mechanics through number theory, featuring Sign Prime (-1), state space collapse, topological analysis, and IOT geometric realizations
Documentation
//! # PPF (Physics-Prime Factorization) Library
//!
//! A comprehensive Rust library implementing the Physics-Prime Factorization (PPF) 
//! mathematical framework for exploring quantum mechanics through number theory.
//!
//! ## Overview
//!
//! The PPF framework extends classical number theory by treating -1 as a special 
//! "Sign Prime", creating multiple valid factorizations for integers and enabling
//! a number-theoretic model of quantum phenomena.
//!
//! ## Quick Start
//!
//! ```rust
//! use ppflib::prelude::*;
//!
//! // Create factorization state spaces
//! let state = FactorizationStateSpace::new(6)?;     // Classical state (positive)
//! let quantum = FactorizationStateSpace::new(-6)?;  // Quantum state (negative)
//!
//! println!("S(6) has {} factorizations", state.size());
//! println!("S(-6) has {} factorizations", quantum.size());
//!
//! // Demonstrate quantum collapse: (-2) × (-3) = 6
//! let s_neg2 = FactorizationStateSpace::new(-2)?;
//! let s_neg3 = FactorizationStateSpace::new(-3)?;
//! let result = s_neg2.multiply(&s_neg3)?;
//!
//! if result.collapse_info.collapsed {
//!     println!("Quantum collapse occurred!");
//! }
//! # Ok::<(), ppflib::core::FactorizationError>(())
//! ```
//!
//! ## Feature Overview
//!
//! ### Core Features
//! - **Factorization State Spaces**: Complete enumeration of valid P-factorizations
//! - **Quantum Collapse**: Modeling (-a) × (-b) = ab transitions
//! - **Sign Prime**: The unique negative prime (-1) enabling quantum behavior
//!
//! ### Advanced Features
//! - **Algebraic Structures**: State space ideals, P-prime spectrum, homology
//! - **Topological Analysis**: Simplicial complexes, Galois groups, Betti numbers
//! - **Geometric Realizations**: IOT metric, tautochrone operators, Hilbert spaces
//!
//! ## Module Organization
//!
//! - [`prelude`]: Common imports for most use cases
//! - [`core`]: Fundamental PPF primitives and operations
//! - [`algebra`]: Advanced algebraic structures
//! - [`topology`]: Topological properties of state spaces
//! - [`geometry`]: Geometric realizations and IOT framework

#![deny(missing_docs)]
#![warn(rust_2018_idioms)]
#![allow(clippy::module_name_repetitions)]

// Module structure - expose existing modules with better organization
pub mod core;
pub mod algebra;
pub mod topology;
pub mod geometry;

/// Prelude - common imports for convenience
pub mod prelude {
    //! Common imports for most PPF use cases
    
    // Core types
    pub use crate::core::{
        FactorizationStateSpace, PFactorization, PPrime, SignPrime,
        StateSpaceOperations, CollapseInfo,
        FactorizationError,
    };
    
    // Algebraic types
    pub use crate::algebra::{
        StateSpaceIdeal, PPrimeSpectrum, MultiplicationAlgebra,
        HomologyGroups,
    };
    
    // Topological types
    pub use crate::topology::{
        FactorizationSimplex, PPFGaloisGroup, BettiNumberComputer,
        Vertex, Edge, Face, TopologicalType,
    };
    
    // Geometric types
    pub use crate::geometry::{
        IOTMetric, TautochroneOperator, PPFHilbertSpace,
        QuantumState, QuantumOperator,
    };
    
    // Constants
    pub use crate::{VERSION, DESCRIPTION, CRITICAL_RATIO};
}

/// Core factorization functionality
pub use core::{
    FactorizationStateSpace as StateSpace,
    PFactorization as Factorization,
    FactorizationError as Error,
};

/// Library version information
pub const VERSION: &str = env!("CARGO_PKG_VERSION");

/// Library description
pub const DESCRIPTION: &str = env!("CARGO_PKG_DESCRIPTION");

/// The critical IOT ratio r/R = 1/30
pub const CRITICAL_RATIO: f64 = 1.0 / 30.0;