# SciForge
A comprehensive scientific computing library written in pure Rust.
[](LICENSE)
[]()
[]()
## Overview
SciForge provides a wide range of scientific computing tools spanning mathematics, physics, chemistry, biology, geology, astronomy, and meteorology — all in a single, dependency-free Rust crate.
- **Zero external dependencies**
- **629 Rust source files** across library code, tests, and tooling
- **Expanded test coverage** across benchmark, parser, scientific domains, Hub, and validation suites
- **118 elements** — full periodic table dataset (IUPAC 2024)
SciForge currently targets crate version `0.0.2`.
## Cosmology Highlights
The astronomy cosmology stack now includes:
- Direct `E(z)` parameterizations: general, flat LCDM, LCDM with radiation, wCDM, and CPL (`w0-wa`)
- Hubble parameter evaluation at redshift: `H(z) = H0 * E(z)` (general and LCDM helpers)
- Comoving, luminosity, and angular-diameter distances from redshift (LCDM, general curved models, wCDM/CPL variants)
- LCDM analytical shortcuts where applicable (for example, analytical age of the universe in flat LCDM)
- Direct Hub dispatch wiring for all these cosmology functions via `DomainType::Astronomy`
This enables running cosmology workflows through the unified Hub execution path without bypassing domain dispatch.
## Modules
| **Constants** | 5 | Fundamental, astrophysical, atomic constants, unit conversions, element data |
| **Mathematics** | 17 | Complex numbers, tensors, linear algebra, FFT, ODE/PDE solvers, statistics, optimization |
| **Physics** | 11 | Relativity, quantum mechanics, thermodynamics, electrodynamics, optics, acoustics |
| **Chemistry** | 26 | Kinetics, electrochemistry, organic/inorganic, spectroscopy, polymers, quantum chemistry |
| **Biology** | 44 | Genetics, neuroscience, ecology, evolution, pharmacology, genomics, proteomics |
| **Geology** | 4 | Seismology, radiometric dating, petrology, plate tectonics |
| **Astronomy** | 4 | Orbital mechanics, stellar astrophysics, cosmology, celestial mechanics |
| **Meteorology** | 4 | Atmospheric modeling, radiation transfer, dynamics, precipitation |
| **Hub** | 5 | Central dispatch API, domain engine, tools, prelude |
| **Benchmark** | 6 | Benchmark engine, binary encode/decode, simulation, reporting, multi-format export |
| **Parser** | 5 | CSV, JSON, YAML, Markdown, HTML parsing and validation |
## Quick Start
Add SciForge to your `Cargo.toml`:
```toml
[dependencies]
sciforge = "0.0.2"
```
### Example
```rust
use sciforge::hub::prelude::*;
let experiment = Experiment::new(DomainType::Astronomy, "hubble_at_z_lcdm")
.param("h0", ParameterValue::Scalar(67.4))
.param("omega_m", ParameterValue::Scalar(0.315))
.param("z", ParameterValue::Scalar(1.0));
let result = ExperimentRunner::new().run(&experiment)?;
```
## Documentation
SciForge documentation is split into two complementary layers:
- `docs/modules/` — scientific explanations, assumptions, and equations
- `docs/code/` — source layout, API surfaces, and execution flow
- `docs/Summary.md` — entry point mapping each module guide to its matching code guide
Use `docs/modules/` first for scientific context, then `docs/code/` for implementation-level details.
## Benchmark Export
The benchmark module generates a complete interactive HTML dashboard featuring:
- IUPAC 2024 periodic table grid with category-colored gradient cells
- Click-to-detail element cards with full metrics
- SVG chart visualizations (category distribution, timing analysis, top 10 fastest/slowest)
- Tabbed file browser for CSV, JSON, YAML, TOML exports
- Markdown summary report
## Periodic Table Data
118 element data files organized by IUPAC category under `tableau-periodique/`:
```
tableau-periodique/
├── actinides/
├── elements-superlourds/
├── gaz-nobles/
├── halogenes/
├── lanthanides/
├── metalloides/
├── metaux-alcalino-terreux/
├── metaux-alcalins/
├── metaux-de-transition/
├── metaux-post-transition/
└── non-metaux/
```
## Building
```bash
cargo build
```
## Testing
```bash
cargo test
```
Dedicated integration targets include `benchmark`, `parser`, `constants`, `maths`, `physics`, `chemistry`, `biology`, `geology`, `astronomy`, `meteorology`, `hub`, `scientific_validation`, and `scientific_properties`.
This layout separates domain-level coverage, orchestration tests, and scientific validation suites.
## Linting
```bash
cargo clippy
```
The project targets zero warnings and zero `#[allow]` directives.
For consistent quality checks, run `cargo fmt`, `cargo clippy`, and `cargo test` before publishing changes.
## Project Structure
```
src/
├── lib.rs
├── constants/ # Physical constants and element data
├── maths/ # Mathematical computing (17 submodules)
├── physics/ # Physics simulations (11 submodules)
├── chemistry/ # Chemical modeling (26 submodules)
├── biology/ # Biological computing (44 submodules)
├── geology/ # Earth sciences (4 submodules)
├── astronomy/ # Astrophysics (4 submodules)
├── meteorology/ # Atmospheric sciences (4 submodules)
├── hub/ # Central dispatch API
├── benchmark/ # Benchmarking and export pipeline
└── parser/ # Multi-format file parsing
tests/
├── benchmark.rs # benchmark integration target
├── parser.rs # parser integration target
├── scientific_validation.rs # scientific reference validation suite
├── scientific_properties.rs # property/invariant validation suite
├── hub/ # Hub orchestration and cross-domain tests
├── constants/ # constants integration suites
├── maths/ # maths integration suites
├── physics/ # physics integration suites
├── chemistry/ # chemistry integration suites
├── biology/ # biology integration suites
├── geology/ # geology integration suites
├── astronomy/ # astronomy integration suites
└── meteorology/ # meteorology integration suites
tableau-periodique/ # 118 element data files
```
## Contributing
See [Contributing.md](Contributing.md) for guidelines.
## Roadmap
See [ComingSoon.md](ComingSoon.md) for the 0.0.1 roadmap baseline.
## Changelog
See [ChangeLog.md](ChangeLog.md) for version history.
## License
[MIT](LICENSE)