Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/scientific-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ jobs:
- name: Run selected ERI Criterion benchmarks
id: eri
continue-on-error: true
run: cargo bench --features bench-support --bench eri_timings
run: cargo bench --features bench --bench eri_timings

- name: Run selected MP2 Criterion benchmarks
id: mp2
continue-on-error: true
run: cargo bench --features bench-support --bench mp2_timings
run: cargo bench --features bench --bench mp2_timings

- name: Generate performance report
id: performance
Expand Down
36 changes: 24 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,22 @@ members = ["crates/rustiq-core"]
default-members = [".", "crates/rustiq-core"]
resolver = "2"

[workspace.package]
authors = ["Mickaël Véril"]
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/mveril/RustiQ"
homepage = "https://mveril.github.io/RustiQ/"
keywords = ["quantum-chemistry", "electronic-structure", "hartree-fock", "mp2", "chemistry"]

[workspace.lints.rust]
unsafe_code = "deny"

[workspace.lints.clippy]
# Individual lint settings and local, documented exceptions override these groups.
all = { level = "deny", priority = -1 }
pedantic = { level = "deny", priority = -1 }
cargo = { level = "deny", priority = -1 }
unwrap_used = "deny"
panic = "deny"
panic_in_result_fn = "deny"
Expand Down Expand Up @@ -56,14 +65,17 @@ tokio = { version = "1", default-features = false }

[package]
name = "rustiq-chem"
description = "The modern rust quantum chemistry software"
authors = ["Mickaël Véril"]
description = "A modern command-line application for quantum chemistry, written in Rust"
authors.workspace = true
version = "0.1.0-alpha.1.dev"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/mveril/RustiQ"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
edition.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
documentation = "https://mveril.github.io/RustiQ/"
readme = "README.md"
keywords.workspace = true
categories = ["science::computational-chemistry::electronic-structure", "command-line-utilities"]

[[bin]]
name = "rustiq"
Expand All @@ -72,7 +84,7 @@ path = "src/main.rs"
[features]
default = ["online", "manpages", "completions"]
online = ["rustiq-core/online", "dep:indicatif", "dep:tokio"]
bench-support = ["rustiq-core/bench-support"]
bench = ["rustiq-core/bench"]
manpages = ["dep:clap_mangen"]
completions = ["dep:clap_complete", "dep:clap_complete_nushell", "dep:sysinfo"]

Expand Down Expand Up @@ -123,22 +135,22 @@ temp-env.workspace = true
[[bench]]
name = "mp2_timings"
harness = false
required-features = ["bench-support"]
required-features = ["bench"]

[[bench]]
name = "eri_timings"
harness = false
required-features = ["bench-support"]
required-features = ["bench"]

[[bench]]
name = "eri_storage_allocation"
harness = false
required-features = ["bench-support"]
required-features = ["bench"]

[[bench]]
name = "eri_storage_memory"
harness = false
required-features = ["bench-support"]
required-features = ["bench"]

[build-dependencies]
bat = { workspace = true, features = ["build-assets"] }
Expand Down
2 changes: 1 addition & 1 deletion THIRD-PARTY-NOTICES.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1019e261ed817234736bc7b4dd0aacb41ffcbbc1c89e66bd974592b651dec752 THIRD-PARTY-NOTICES.txt
fd10896a1c4a5a5be0dfdcabb49197b9fb5dc80a93d9e0e8a917ff746ca3169e THIRD-PARTY-NOTICES.txt
2 changes: 1 addition & 1 deletion THIRD-PARTY-NOTICES.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 11 additions & 6 deletions crates/rustiq-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
[package]
name = "rustiq-chem-core"
description = "Reusable domain model and quantum chemistry implementation for RustiQ"
authors = ["Mickaël Véril"]
description = "A reusable Rust library for modern quantum chemistry software"
authors.workspace = true
version = "0.1.0-alpha.1.dev"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/mveril/RustiQ"
edition.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
documentation = "https://docs.rs/rustiq-chem-core"
readme = "README.md"
keywords.workspace = true
categories = ["science::computational-chemistry::electronic-structure"]

# Preserve the Rust import name independently of the Cargo package name.
[lib]
Expand All @@ -20,7 +25,7 @@ workspace = true
[features]
default = []
online = ["dep:reqwest", "dep:tokio"]
bench-support = []
bench = []

[dependencies]
miette.workspace = true
Expand Down
21 changes: 21 additions & 0 deletions crates/rustiq-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# RustiQ Core

RustiQ Core is the reusable scientific library behind [RustiQ](https://github.com/mveril/RustiQ).
It explores how Rust's strong typing, memory safety, and modularity can support
quantum chemistry software, alongside numerical validation and performance.

The library provides molecular and basis data, scientific configuration,
calculation execution, and persistence. Runfile parsing and terminal output
belong to the RustiQ application. The Cargo package is `rustiq-chem-core`;
its Rust import name is `rustiq_core`.

RustiQ is experimental. Independently validate results against established
quantum chemistry packages before using them for research conclusions.

- [API documentation](https://docs.rs/rustiq-chem-core)
- [RustiQ manual](https://mveril.github.io/RustiQ/)
- [Source, examples, and scientific validation](https://github.com/mveril/RustiQ)

RustiQ-authored source is licensed under MIT OR Apache-2.0. See the
[distribution terms](https://github.com/mveril/RustiQ/blob/main/DISTRIBUTION.md)
for third-party licensing information.
4 changes: 2 additions & 2 deletions crates/rustiq-core/src/basis/basis_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ impl BasisStore {
}

/// Copies a basis file from another store into this store.
#[cfg(any(test, feature = "bench-support"))]
#[cfg(any(test, feature = "bench"))]
#[allow(
dead_code,
reason = "Retained scientific helpers and representations support tests, benchmarks, or future internal use"
Expand All @@ -174,7 +174,7 @@ impl BasisStore {
}

/// Returns the package-local fixture basis store used by tests and benches.
#[cfg(any(test, feature = "bench-support"))]
#[cfg(any(test, feature = "bench"))]
#[allow(
dead_code,
reason = "Retained scientific helpers and representations support tests, benchmarks, or future internal use"
Expand Down
32 changes: 16 additions & 16 deletions crates/rustiq-core/src/eri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#[cfg(test)]
use mendeleev::Element;
use std::f64::consts::PI;
#[cfg(feature = "bench-support")]
#[cfg(feature = "bench")]
use std::sync::atomic::{AtomicU64, AtomicUsize, Ordering};
#[cfg(feature = "bench-support")]
#[cfg(feature = "bench")]
use std::time::{Duration, Instant};
mod compact;
pub use compact::CompactEri;
Expand All @@ -27,16 +27,16 @@ use thiserror::Error;
const ERI_SELF_INTEGRAL_NEGATIVE_TOLERANCE: f64 = 1e-12;
const COULOMB_CACHE_SMALLVEC_CAPACITY: usize = 128;

#[cfg(feature = "bench-support")]
#[cfg(feature = "bench")]
const CACHE_SIZE_BUCKET_LIMITS: [usize; 8] = [16, 32, 64, 128, 256, 512, 1024, usize::MAX];

#[cfg(feature = "bench-support")]
#[cfg(feature = "bench")]
static COULOMB_CACHE_SIZE_COUNT: AtomicU64 = AtomicU64::new(0);
#[cfg(feature = "bench-support")]
#[cfg(feature = "bench")]
static COULOMB_CACHE_SIZE_SUM: AtomicU64 = AtomicU64::new(0);
#[cfg(feature = "bench-support")]
#[cfg(feature = "bench")]
static COULOMB_CACHE_SIZE_MAX: AtomicUsize = AtomicUsize::new(0);
#[cfg(feature = "bench-support")]
#[cfg(feature = "bench")]
static COULOMB_CACHE_SIZE_BUCKETS: [AtomicU64; 8] = [
AtomicU64::new(0),
AtomicU64::new(0),
Expand Down Expand Up @@ -220,7 +220,7 @@ pub(crate) fn electron_repulsion_ints_with_threshold(
))
}

#[cfg(feature = "bench-support")]
#[cfg(feature = "bench")]
#[allow(
dead_code,
reason = "Retained scientific helpers and representations support tests, benchmarks, or future internal use"
Expand All @@ -238,7 +238,7 @@ pub struct EriTimingBreakdown {
pub coulomb_cache_sizes: CacheSizeStats,
}

#[cfg(feature = "bench-support")]
#[cfg(feature = "bench")]
#[allow(
dead_code,
reason = "Retained scientific helpers and representations support tests, benchmarks, or future internal use"
Expand All @@ -252,7 +252,7 @@ pub struct CacheSizeStats {
pub buckets: [(usize, u64); 8],
}

#[cfg(feature = "bench-support")]
#[cfg(feature = "bench")]
#[allow(
dead_code,
reason = "Retained scientific helpers and representations support tests, benchmarks, or future internal use"
Expand Down Expand Up @@ -281,7 +281,7 @@ impl CacheSizeStats {
}
}

#[cfg(feature = "bench-support")]
#[cfg(feature = "bench")]
#[allow(
dead_code,
reason = "Retained scientific helpers and representations support tests, benchmarks, or future internal use"
Expand All @@ -292,7 +292,7 @@ pub fn electron_repulsion_ints_timed(
electron_repulsion_ints_timed_with_observer(basis, |_, _| {})
}

#[cfg(feature = "bench-support")]
#[cfg(feature = "bench")]
pub fn electron_repulsion_ints_timed_with_observer(
basis: &Basis,
mut observer: impl FnMut(&'static str, Duration),
Expand Down Expand Up @@ -498,7 +498,7 @@ fn compute_eri_pair_primitive(primitive_ab: &PairPrimitive, primitive_cd: &PairP
2.0 * PI.powf(2.5) / (p * q * (p + q).sqrt()) * eri
}

#[cfg(feature = "bench-support")]
#[cfg(feature = "bench")]
fn reset_coulomb_cache_size_stats() {
COULOMB_CACHE_SIZE_COUNT.store(0, Ordering::Relaxed);
COULOMB_CACHE_SIZE_SUM.store(0, Ordering::Relaxed);
Expand All @@ -508,7 +508,7 @@ fn reset_coulomb_cache_size_stats() {
}
}

#[cfg(feature = "bench-support")]
#[cfg(feature = "bench")]
fn record_coulomb_cache_size(len: usize) {
COULOMB_CACHE_SIZE_COUNT.fetch_add(1, Ordering::Relaxed);
COULOMB_CACHE_SIZE_SUM.fetch_add(len as u64, Ordering::Relaxed);
Expand All @@ -521,7 +521,7 @@ fn record_coulomb_cache_size(len: usize) {
COULOMB_CACHE_SIZE_BUCKETS[bucket_index].fetch_add(1, Ordering::Relaxed);
}

#[cfg(feature = "bench-support")]
#[cfg(feature = "bench")]
fn coulomb_cache_size_stats() -> CacheSizeStats {
let mut buckets = [(0, 0); 8];
for (index, limit) in CACHE_SIZE_BUCKET_LIMITS.iter().copied().enumerate() {
Expand Down Expand Up @@ -648,7 +648,7 @@ impl CoulombAuxiliaryCache {
* (u_max as usize + 1)
* (v_max as usize + 1)
* (n_max as usize + 1);
#[cfg(feature = "bench-support")]
#[cfg(feature = "bench")]
record_coulomb_cache_size(len);
let mut values = SmallVec::new();
values.resize(len, f64::NAN);
Expand Down
2 changes: 1 addition & 1 deletion crates/rustiq-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub(crate) mod resources;
#[deny(clippy::doc_markdown)]
pub(crate) mod test_utils;

#[cfg(feature = "bench-support")]
#[cfg(feature = "bench")]
#[deny(clippy::doc_markdown)]
pub mod bench_support {
pub use crate::basis::BasisStore;
Expand Down
Loading
Loading