Skip to content

fused_chaos_index.tier2

Tier-2 advanced analyses for multi-artifact comparisons and discoveries.

Overview

Tier-2 commands provide sophisticated analysis workflows:

  • universality_sweep - Compare quantum-mass distributions across multiple runs
  • fingerprint - Cosmic vs. Collatz distribution fingerprinting with correlation analysis
  • collatz_summary - Comprehensive statistics for Collatz runs (manuscript-ready)
  • stopping_time - Investigate stopping time vs. quantum mass correlations
  • plot_16m_discovery - Visualize 16M Collatz discovery (optional PNG if matplotlib available)

Use Cases

Universality Analysis

Compare multiple quantum-mass distributions to test universality hypothesis:

from fused_chaos_index.tier2 import run_universality_sweep

# Compare multiple runs
result = run_universality_sweep(
    inputs=["run1.npz", "run2.npz", "run3.npz"],
    output_dir="./results",
    threshold=5e-7,
    seed=42,
)

print(f"Mean quantum mass: {result['mean_quantum_mass']:.6e}")
print(f"Std dev: {result['std_quantum_mass']:.6e}")

Cosmic vs. Collatz Fingerprinting

Compare distribution fingerprints between cosmic data and Collatz sequences:

from fused_chaos_index.tier2 import run_cosmic_vs_collatz_fingerprint

# Fingerprint comparison
result = run_cosmic_vs_collatz_fingerprint(
    collatz_npz="collatz_run.npz",
    smacs_npz="smacs_catalog.npz",
    output_dir="./results",
    k=10,
    n_modes=10,
    seed=42,
)

print(f"Mass correlation: {result['mass_kappa_correlation']:.3f}")

Collatz Run Summary

Generate comprehensive statistics for Collatz runs:

from fused_chaos_index.tier2 import run_collatz_run_summary

# Manuscript-ready summary
result = run_collatz_run_summary(
    collatz_npz="collatz_run.npz",
    baseline_npz="baseline_run.npz",
    output_dir="./results",
    runtime_seconds=136.5,
)

print(f"Mean quantum mass: {result['mass_mean']:.6e}")
print(f"Spectral gap ratio: {result['gap_ratio']:.3f}")

Stopping Time Analysis

Test for correlations between Collatz stopping time and quantum mass:

from fused_chaos_index.tier2 import run_stopping_time_vs_mass

# Association test
result = run_stopping_time_vs_mass(
    input_npz="collatz_run.npz",
    output_dir="./results",
    sample_size=200000,
    max_steps=5000,
    seed=42,
)

print(f"Correlation: {result['correlation']:.3f}")
print(f"P-value: {result['p_value']:.6f}")

Data Requirements

Tier-2 commands expect NPZ files with specific fields:

  • quantum_mass (preferred) or mass or M - Mass/eigenvalue array
  • positions (N×D) or ra+dec - Spatial coordinates
  • kappa (optional) - Convergence field for lensing catalogs
  • eigenvalues (optional) - For spectral gap analysis

See NPZ contracts for detailed specifications.

API Reference

fused_chaos_index.tier2

collatz_stopping_time_uint64(n0, *, max_steps)

Compute Collatz stopping time for many starting values.

Returns (stop_time, status): - stop_time: int32, 0..max_steps, max_steps means censored, -1 means overflow - status: int8 codes: 0=reached 1, 1=censored, 2=overflow

run_collatz_run_summary(*, output_dir, collatz_npz, baseline_npz=None, threshold=5e-07, cosmic_target=68.0, runtime_seconds=None)

Summarize a Collatz run artifact (NPZ) into manuscript-ready stats.

Offline-first: consumes local NPZ files only and writes a JSON manifest + NPZ results.

Required inputs: - collatz_npz: must contain quantum_mass (or mass/M)

Optional inputs: - baseline_npz: second NPZ for comparison (e.g., 10M baseline)

Notes: - If dark_percent exists in NPZ, it is recorded. - If not, dark% is computed from the mass vector and threshold. - If eigenvalues exists, the spectral gap and gap ratio are computed. - Output NPZ uses flattened dict format (e.g., mass_stats__n) to avoid dtype=object, allowing secure loading with allow_pickle=False.

run_cosmic_vs_collatz_fingerprint(*, output_dir, collatz_npz, smacs_npz, flamingo_npz=None, threshold=5e-07, k=10, n_modes=10)

Tier-2 Path 2: cross-domain fingerprint comparison.

Inputs are purely local artifacts (NPZ files). This runner computes: - distribution fingerprints of quantum_mass and (for SMACS) kappa - correlations between SMACS quantum mass and kappa - optional Collatz low-energy spectrum summaries (if eigenvalues included)

It does not claim physical causality; it only writes descriptive statistics.

Output NPZ uses flattened dict format (e.g., collatz_fingerprint__n) to avoid dtype=object, allowing secure loading with allow_pickle=False.

run_plot_16m_discovery(*, output_dir, collatz_npz, threshold=5e-07, cosmic_target=68.0)

Generate a lightweight plot for the 16M-style Collatz discovery artifact.

Offline-first and skip-safe: - reads one local NPZ - attempts to write a PNG if matplotlib is available - always writes a results NPZ + JSON manifest

This is intentionally minimal (no seaborn) to keep base installs light.

Output NPZ avoids dtype=object (issues saved as JSON string) to allow secure loading with allow_pickle=False.

run_stopping_time_vs_mass(*, output_dir, input_npz, sample_size=200000, max_steps=5000, seed=42, bootstrap=False, bootstrap_iters=200)

Tier-2 Path 3: stopping time vs quantum-mass association test.

Offline-first: reads one local NPZ, writes results NPZ + JSON manifest.

run_universality_sweep(*, output_dir, inputs, threshold=5e-07, plot=False)

Tier-2 Path 1: compare multiple quantum-mass artifacts under a shared threshold.

This is offline-first: it only reads local NPZ inputs and writes local outputs.

Each input NPZ must contain one of the keys: - quantum_mass (preferred) - mass - M

Optional keys used if present: - dark_percent (original run's reported percentage) - k_modes or eigenvalues (used to infer k)