An open API service indexing awesome lists of open source software.

https://github.com/fullscreen-triangle/nebuchadnezzar

Hierarchical Probabilistic Electric Circuit System for Biological Simulation
https://github.com/fullscreen-triangle/nebuchadnezzar

cell-simulation systems-biology

Last synced: 12 months ago
JSON representation

Hierarchical Probabilistic Electric Circuit System for Biological Simulation

Awesome Lists containing this project

README

          

# Nebuchadnezzar: Intracellular Dynamics Engine

[![Rust](https://img.shields.io/badge/rust-1.70+-blue.svg)](https://www.rust-lang.org)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

> **A comprehensive framework for modeling intracellular processes using ATP as the fundamental rate unit. Designed as the foundational intracellular dynamics package for constructing biologically authentic neurons.**

## ๐Ÿง  Overview

Nebuchadnezzar serves as the **intracellular dynamics foundation** for the neurobiological simulation ecosystem:

- **๐Ÿ—๏ธ Nebuchadnezzar**: Intracellular dynamics engine (this package)
- **๐Ÿ›ฃ๏ธ Autobahn**: RAG system integration for knowledge processing
- **๐Ÿงฌ Bene Gesserit**: Membrane dynamics and quantum transport
- **โšก Imhotep**: Neural interface and consciousness emergence

## โœจ Core Features

### ๐Ÿ”‹ ATP-Constrained Dynamics
- Uses `dx/dATP` equations instead of `dx/dt` for metabolically realistic computation
- Energy charge-dependent processing rates
- Physiological ATP pool management with synthesis/consumption balance

### ๐ŸŽฏ Biological Maxwell's Demons (BMDs)
- Information catalysts for selective pattern recognition
- Prisoner parable implementation (minimal input โ†’ massive thermodynamic consequences)
- Five BMD categories: Molecular, Cellular, Neural, Metabolic, Membrane
- Thermodynamic consistency and metastability tracking

### ๐ŸŒŠ Quantum Membrane Transport
- Environment-assisted quantum coherence at biological temperatures
- Ion channel modeling with quantum tunneling effects
- Decoherence mitigation through environmental coupling

### ๐Ÿ“Š Multi-Scale Oscillatory Dynamics
- Hierarchical oscillator networks from molecular to cellular scales
- Neural frequency band support (Delta, Theta, Alpha, Beta, Gamma)
- Hardware oscillation harvesting for zero-overhead rhythm generation

### ๐Ÿ–ฅ๏ธ Hardware Integration
- Direct coupling with system oscillations (CPU, GPU, network)
- Environmental noise harvesting for biological realism
- Screen backlight PWM integration for visual processing

## ๐Ÿš€ Quick Start

### Basic Integration API

```rust
use nebuchadnezzar::prelude::*;

// Create intracellular environment for neuron construction
let intracellular = IntracellularEnvironment::builder()
.with_atp_pool(AtpPool::new_physiological())
.with_oscillatory_dynamics(OscillatoryConfig::biological())
.with_membrane_quantum_transport(true)
.with_maxwell_demons(BMDConfig::neural_optimized())
.with_hardware_integration(true)
.build()?;

// Ready for integration with Autobahn, Bene Gesserit, and Imhotep
println!("Integration ready: {}", intracellular.integration_ready());
```

### Neuron Construction Kit

```rust
// Create neuron construction kit with integration interfaces
let neuron_kit = NeuronConstructionKit::new(intracellular)
.with_autobahn(AutobahnInterface {
knowledge_processing_rate: 1000.0, // bits/s
retrieval_efficiency: 0.85,
generation_quality: 0.90,
})
.with_bene_gesserit(BeneGesseritInterface {
membrane_dynamics_coupling: 0.8,
hardware_oscillation_harvesting: true,
pixel_noise_optimization: true,
})
.with_imhotep(ImhotepInterface {
consciousness_emergence_threshold: 0.7,
neural_interface_active: true,
bmd_neural_processing: true,
});

// Check if ready for complete neuron construction
if neuron_kit.integration_complete() {
println!("๐Ÿš€ Ready for Imhotep neuron construction!");
}
```

### ATP-Constrained Differential Equations

```rust
let mut solver = AtpDifferentialSolver::new(5.0); // 5 mM initial ATP

// Define enzymatic reaction: S + ATP -> P + ADP
let enzymatic_reaction = |substrate: f64, atp: f64| -> f64 {
let km = 2.0; // mM
let vmax = 5.0; // mM/s per mM ATP
vmax * atp * substrate / (km + substrate)
};

let result = solver.solve_atp_differential(
10.0, // Initial substrate concentration
enzymatic_reaction,
0.5 // ATP consumption per reaction
);
```

### Biological Maxwell's Demons

```rust
// Create information catalyst for neural signal processing
let pattern_selector = PatternSelector::new()
.with_recognition_threshold(0.7)
.with_specificity_for("neural_signal");

let target_channel = TargetChannel::new()
.with_target("action_potential")
.with_efficiency(0.85);

let catalyst = InformationCatalyst::new(
pattern_selector,
target_channel,
1000.0 // Amplification factor
);
```

## ๐Ÿ“š Examples

Run the comprehensive integration demo:

```bash
cargo run --example neuron_integration_demo
```

Other examples:
- `simple_bmd_test` - Basic BMD functionality
- `glycolysis_circuit` - Metabolic pathway modeling
- `comprehensive_simulation` - Full system demonstration
- `quantum_biological_computer_demo` - Quantum processing
- `atp_oscillatory_membrane_complete_demo` - Membrane dynamics

## ๐Ÿ—๏ธ Architecture

### Integration-Focused Design

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Imhotep (Neural Interface) โ”‚
โ”‚ Consciousness Emergence โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ โ”‚ Neuron Construction โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ Autobahn โ”‚โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”‚Nebuchadnezzarโ”‚โ”€โ”€โ”€โ”‚Bene Gesseritโ”‚ โ”‚
โ”‚ โ”‚ (RAG) โ”‚ โ”‚ โ”‚(Intracellular)โ”‚ โ”‚ (Membrane) โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Hardware Layer โ”‚
โ”‚ (Oscillations, โ”‚
โ”‚ Noise, Pixels) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

### Core Components

- **`IntracellularEnvironment`**: Main integration interface
- **`AtpSystem`**: Energy management and ATP kinetics
- **`BMDSystem`**: Information processing and pattern recognition
- **`OscillatorySystem`**: Multi-scale temporal dynamics
- **`MembraneSystem`**: Quantum transport and ion channels
- **`HardwareSystem`**: Environmental coupling and harvesting
- **`CircuitSystem`**: Hierarchical probabilistic circuits

## ๐Ÿ”ฌ Scientific Foundation

### ATP as Rate Unit
Instead of traditional time-based differential equations (`dx/dt`), Nebuchadnezzar uses ATP consumption as the fundamental rate unit (`dx/dATP`). This provides:

- **Metabolic Realism**: Computation directly tied to cellular energy availability
- **Natural Rate Limiting**: Processes automatically slow when ATP is depleted
- **Biological Accuracy**: Reflects actual cellular energy constraints

### Biological Maxwell's Demons
Based on Eduardo Mizraji's 2021 theoretical framework:

- **Information Catalysts**: `iCat = โ„‘_input โ—ฆ โ„‘_output`
- **Pattern Recognition**: Selective amplification of biologically relevant signals
- **Thermodynamic Consistency**: Energy conservation with entropy considerations
- **Fire-Light Optimization**: Enhanced performance at 600-700nm wavelengths

### Quantum Coherence at Biological Temperatures
- **Environment-Assisted Coherence**: Noise as a resource rather than detriment
- **Decoherence Mitigation**: Strategic environmental coupling
- **Ion Channel Quantum Effects**: Tunneling and superposition in transport

## ๐Ÿ› ๏ธ Development

### Prerequisites
- Rust 1.70+
- Standard scientific computing dependencies (see `Cargo.toml`)

### Building
```bash
# Standard build
cargo build

# Release build with optimizations
cargo build --release

# With all features
cargo build --features full
```

### Testing
```bash
# Run tests
cargo test

# Run benchmarks
cargo bench

# Run examples
cargo run --example neuron_integration_demo
```

### Features
- `default`: Core functionality
- `visualization`: Plotting and visualization tools
- `graph_analysis`: Advanced graph algorithms
- `full`: All features enabled

## ๐Ÿ“– Documentation

- **API Documentation**: `cargo doc --open`
- **Examples**: See `examples/` directory
- **Theoretical Background**: See `docs/` directory

## ๐Ÿค Integration with Other Packages

### For Autobahn Integration
```rust
use nebuchadnezzar::prelude::*;

let intracellular = IntracellularEnvironment::builder()
.with_maxwell_demons(BMDConfig::neural_optimized())
.build()?;

// Connect to Autobahn RAG system
let autobahn_interface = AutobahnInterface {
knowledge_processing_rate: intracellular.state.information_processing_rate,
retrieval_efficiency: 0.85,
generation_quality: 0.90,
};
```

### For Bene Gesserit Integration
```rust
let bene_gesserit_interface = BeneGesseritInterface {
membrane_dynamics_coupling: intracellular.state.quantum_coherence,
hardware_oscillation_harvesting: true,
pixel_noise_optimization: true,
};
```

### For Imhotep Integration
```rust
let imhotep_interface = ImhotepInterface {
consciousness_emergence_threshold: 0.7,
neural_interface_active: intracellular.integration_ready(),
bmd_neural_processing: true,
};
```

## ๐Ÿ“Š Performance

- **Zero-overhead oscillations**: Hardware harvesting eliminates computational cost
- **ATP-constrained computation**: Natural rate limiting prevents runaway processes
- **Quantum coherence**: Enhanced processing efficiency at biological temperatures
- **Parallel processing**: Multi-core BMD information catalysis

## ๐Ÿ”ฎ Future Directions

- **Enhanced BMD Categories**: Expand beyond the current five types
- **Advanced Quantum Effects**: Incorporate more sophisticated quantum phenomena
- **Hardware Integration**: Deeper coupling with specialized hardware
- **Consciousness Emergence**: Better integration with Imhotep consciousness models

## ๐Ÿ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## ๐Ÿ™ Acknowledgments

- Eduardo Mizraji for the Biological Maxwell's Demons theoretical framework
- The quantum biology community for environment-assisted coherence insights
- The systems biology community for ATP-centric modeling approaches

---

**Ready to build biologically authentic neurons with quantum processing capabilities? Start with Nebuchadnezzar as your intracellular dynamics foundation!** ๐Ÿง โšก