Skip to content

hcsn-theory/hcsn-sim

Repository files navigation

πŸŒ€ HCSN β€” Hierarchical Causal Structure Network (Legacy Implementation)

Caution

πŸ›οΈ Legacy / Reference Implementation

This Python-based engine is now LEGACY. Due to Python execution bottlenecks in high-density causal graphs (Phase 10+), core development has migrated to the high-performance hcsn-rust engine.

Note: Features are only backported to this repository if specifically required for cross-validation. For active research and the latest Phase 12 results, please use the Rust Core.

DOI License ORCID


HCSN explores the hypothesis that the universe is fundamentally computational β€” built from discrete events and directed causal relations, with no assumed background space, time, or quantum framework.

πŸ“Ί Watch the overview on YouTube β†’ πŸ“„ Read the paper on ResearchHub β†’


✨ Highlights

  • πŸ” Local rewrite rules drive the evolution of a causal hypergraph
  • πŸ“ Geometry, time, and dimensionality emerge β€” they are not assumed
  • 🧲 Particles appear as persistent topological defects in the network
  • πŸ”¬ Reproducible experiments test emergence of Lorentz invariance, mass, and interaction
  • πŸŽ₯ Built-in visualizer and Blender importer for 3D cinematic rendering

πŸ“‹ Table of Contents


Overview

HCSN proposes a discrete, causal, and computational substrate for physics:

  • Events are vertices in a hypergraph; causal relations are directed hyperedges
  • Dynamics are local probabilistic rewrite rules β€” no global clock, no background metric
  • Time is the count of irreversible rewrites (rewrite depth)
  • Geometry, dimension, and particles emerge from what statistically persists

The long-term goal is to identify the minimal rule set that produces universes consistent with:

  • Lorentz invariance (emergent attractor)
  • 4D spacetime-like structure
  • Holographic scaling of information
  • Quantum probabilistic behavior (Born rule from causal ignorance)

The companion theory repository is at hcsn-theory.


Repository Structure

hcsn-sim/
β”œβ”€β”€ engine/                     # Core simulation engine
β”‚   β”œβ”€β”€ hypergraph.py           # Vertices, hyperedges, causal ordering
β”‚   β”œβ”€β”€ rules.py                # Rewrite rules
β”‚   β”œβ”€β”€ rewrite_engine.py       # Acceptance dynamics and rewrite scheduling
β”‚   β”œβ”€β”€ observables.py          # Physical diagnostic measurements
β”‚   └── physics_params.py       # Shared physics parameters
β”‚
β”œβ”€β”€ sim-exp/                    # Reproducible experiments
β”‚   β”œβ”€β”€ run_simulation.py       # Main simulation runner
β”‚   β”œβ”€β”€ exp_critical_scan.py    # Phase transition scan
β”‚   β”œβ”€β”€ exp_phase_diagram.py    # Omega phase diagram
β”‚   β”œβ”€β”€ exp_long_critical_run.py
β”‚   β”œβ”€β”€ exp_worldline_interactions.py
β”‚   β”œβ”€β”€ scattering_experiment.py
β”‚   β”œβ”€β”€ measure/                # Measurement scripts
β”‚   β”œβ”€β”€ plot/                   # Plotting scripts
β”‚   β”œβ”€β”€ tests/                  # Test suite
β”‚   └── json/                   # Experiment output data
β”‚
β”œβ”€β”€ multiverse/                 # Multi-variant universe runs (universality tests)
β”‚   β”œβ”€β”€ baseline/
β”‚   β”œβ”€β”€ variant_1/ … variant_4/
β”‚
β”œβ”€β”€ analysis/                   # Legacy analysis scripts
β”œβ”€β”€ visualizer.html             # Interactive browser-based visualizer
β”œβ”€β”€ visualizer_server.py        # Local server for the visualizer
β”œβ”€β”€ blender_importer.py         # Import cinematic frames into Blender
β”œβ”€β”€ export_cinematic.py         # Export simulation to cinematic frame format
β”œβ”€β”€ export_csv.py               # Export simulation data to CSV
β”œβ”€β”€ cinematic_frames.json       # Pre-exported cinematic data
β”œβ”€β”€ hcsn_sample.csv             # Sample simulation output
β”œβ”€β”€ simulation.log              # Latest simulation log
└── requirements.txt            # Python dependencies

Quick Start

Requirements

  • Python 3.10 or later
  • Dependencies: pytest, websockets, asyncio
pip install -r requirements.txt

Clone and run:

git clone https://github.com/hcsn-theory/hcsn-sim.git
cd hcsn-sim
python3 sim-exp/run_simulation.py

This runs a toy universe and prints diagnostics periodically.


How to Run Experiments

The sim-exp/ directory contains all reproducible experiments:

Script Purpose
run_simulation.py Main simulation runner
exp_critical_scan.py Scan Ξ© values to locate phase transition
exp_phase_diagram.py Map defect rate across Ξ© regimes
exp_long_critical_run.py Extended run at critical Ξ©
exp_worldline_interactions.py Two-particle interaction experiment
scattering_experiment.py Scattering geometry test

Key printed diagnostics (periodic):

  • average coordination ⟨k⟩
  • causal depth (L)
  • interaction concentration (Ξ¦)
  • closure density (Ξ¨)
  • hierarchical stability (Ξ©)

Diagnostics Explained

Symbol Name Meaning Target Range
⟨k⟩ Avg coordination Controls effective dimensionality β‰ˆ 7.5–8.5 for spacetime-like geometry
L Causal depth Maximum causal chain length β€” emergent time Grows with rewrites
Ξ¦ Interaction concentration Hub dominance (lower = more uniform) Small Ξ¦ preferred
Ξ¨ Closure density Redundancy in causal closure Non-zero = error correction
Ξ© Hierarchical closure RG-like stability across scales > 1.0 for persistent structure

Phase interpretation:

Ξ© Regime Behavior
Ξ© < 1.0 (subcritical) Transient defects, no stable transport
Ξ© β‰ˆ 1.08–1.18 (critical) Phase transition, marginal stability
Ξ© > 1.2 (supercritical) Persistent worldlines, stable emergent structure

Visualization

HCSN includes a browser-based visualizer and a Blender pipeline for cinematic rendering:

Browser Visualizer:

python3 visualizer_server.py
# Open visualizer.html in your browser

Blender 3D Import:

  1. Run export_cinematic.py to generate cinematic_frames.json
  2. Import into Blender with blender_importer.py

CSV Export:

python3 export_csv.py

Current Research Focus

Active directions:

  • Prevent metric collapse under coarse-graining
  • Implement logarithmic information metrics (holographic scaling tests)
  • Enforce holographic bounds dynamically during evolution
  • Search for Lorentz-invariant fixed points of the rewrite dynamics
  • Derive quantum probabilistic behavior (Born rule) from causal ignorance

Contributing

We welcome contributions from physicists, mathematicians, and programmers.

Getting started:

  1. Fork the repo, create a feature branch
  2. Add reproducible experiments under sim-exp/
  3. Document new rules, diagnostics, and observed behaviors
  4. Open a PR with clear description, expected behavior, and reproducibility notes

Guidelines:

  • Seed all RNGs for reproducibility
  • New rules or observables belong in engine/
  • Keep experiments modular and self-contained

Citation

If you use HCSN in your research, please cite both the paper and the software:

Saif Mukhtar. HCSN: A Hierarchical Causal Structure Network Framework for Emergent Physics. ResearchHub, 2026. DOI: 10.55277/researchhub.fvahxvpt.1

BibTeX:

@article{mukhtar2026hcsn,
  author  = {Saif Mukhtar},
  title   = {HCSN: A Hierarchical Causal Structure Network Framework for Emergent Physics},
  year    = {2026},
  doi     = {10.55277/researchhub.fvahxvpt.1},
  url     = {https://doi.org/10.55277/researchhub.fvahxvpt.1}
}

License & Contact

Published under the Apache 2.0 licence.

For collaboration or questions, open an issue or contact via GitHub: hcsn-theory


πŸ›οΈ Governance

The HCSN Research Group is maintained by @hcsn.


"The universe may not be described by computation β€” it may be computation."

HCSN treats this as a testable hypothesis: build minimal computational rules and examine what emerges.

Enjoy exploring! 🧩

About

Hierarchial Closure Structure Network (HCSN): A framework for hypergraph rewriting.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors