Skip to content

Rust API ​

Errors (2.0): the root-level functions in this page return Result<_, SciFormError>. The String in the legacy signatures below is kept only for module-level helpers that have not migrated yet; at the crate boundary they convert with From<String>. Match on the enum instead of substrings:

rust
use sci_form::{parse, SciFormError};

match parse(smiles) {
    Ok(mol) => { /* ... */ }
    Err(error) if error.is_parse() => eprintln!("bad SMILES: {error}"),
    Err(error) => eprintln!("engine failure: {error}"),
}

Variants: Parse, Validation, Geometry, Numerical, Unsupported, Other. See sci_form::error and tests/typed_errors.rs.

Crate: sci-form ​

toml
[dependencies]
sci-form = "1.0"
# For parallel batch processing:
sci-form = { version = "2.0", features = ["parallel"] }
# GPU acceleration:
sci-form = { version = "2.0", features = ["experimental-gpu"] }

Units ​

Units are not uniform across the crate, so check the doc of the specific function:

QuantityUnit
Geometry (coordinates, bond lengths, cell parameters)Å (cell angles in degrees)
UFF / MMFF94 energieskcal/mol
UFF / MMFF94 gradientskcal/mol/Å
EHT, PM3, xTB orbital energies and HOMO–LUMO gapseV
PM3 / xTB total, electronic, repulsive, dispersion energieseV
PM3 heat of formationkcal/mol
HF-3c energy, HF energy, nuclear repulsion, D3/gCP/SRB correctionsHartree
HF-3c orbital energies, HOMO/LUMO, gapHartree
ANI energy and per-atom energiesHartree (forces Hartree/Å)
CISD excitation energy, correlation_energyHartree (energy_ev is eV)
EHT gradients, optimize_geometry_eht energyeV, eV/Å
optimize_framework energy and forceseV, eV/Å
Vibrational frequencies, IR wavenumberscm⁻¹
NMR chemical shifts and shieldingsppm
NMR J-couplingsHz
Dipole momentDebye
Partial chargeselementary charge (e)
Electrostatic potentialHartree/e
DOS / PDOS1/eV
Surface areaŲ
MD energieskcal/mol; times in fs; temperatures in K
Pressurebar

Energies are always total system energies, not per-atom normalised, unless the field name says otherwise. Gradients are dE/dR with R in Å, so they carry the sign convention "force = −gradient".


Naming ​

The canonical name of a capability is the name of the Rust root function, and it is the same on all four surfaces (Rust, Python, WASM/TypeScript, CLI).

Three crate-root helpers keep a deprecated get_ prefix and are scheduled for removal in sci-form 2.0 — use the idiomatic spelling instead:

DeprecatedUse instead
sci_form::get_eht_supportsci_form::eht_support
sci_form::get_system_capabilitiessci_form::system_capabilities
sci_form::get_system_method_plansci_form::system_method_plan

The Rust core does not grow aliases: the old bare-noun Python names are handled in the Python bindings only.


Top-Level Types ​

ConformerResult ​

rust
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ConformerResult {
    pub smiles: String,
    pub num_atoms: usize,
    pub coords: Vec<f64>,                    // [x₀, y₀, z₀, x₁, y₁, z₁, ...]
    pub elements: Vec<u8>,                   // atomic numbers
    pub bonds: Vec<(usize, usize, String)>,  // (atom_a, atom_b, order)
    pub error: Option<String>,
    pub time_ms: f64,
}
FieldDescription
smilesInput SMILES string
num_atomsTotal atoms including implicit H
coordsFlat 3D coordinates, length = num_atoms × 3
elementsAtomic numbers: 1=H, 6=C, 7=N, 8=O, 9=F, …
bonds(start, end, order) where order ∈
errorNone on success, Some(msg) on failure
time_msGeneration time in milliseconds

ConformerConfig ​

rust
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ConformerConfig {
    pub seed: u64,         // default: 42
    pub num_threads: usize, // default: 0 = auto-detect
}

Conformer Generation ​

embed ​

rust
pub fn embed(smiles: &str, seed: u64) -> ConformerResult

Generate a 3D conformer from a SMILES string using ETKDGv2. Always returns a ConformerResult — check error field for failures.

Example:

rust
let result = sci_form::embed("CCO", 42);
assert!(result.error.is_none());
println!("{} atoms at ({:.2}, {:.2}, {:.2})",
    result.num_atoms, result.coords[0], result.coords[1], result.coords[2]);

embed_batch ​

rust
pub fn embed_batch(smiles_list: &[&str], config: &ConformerConfig) -> Result<Vec<ConformerResult>, SciFormError>

Batch-generate conformers. With parallel feature uses rayon; config.num_threads = 0 auto-detects CPU count.

Example:

rust
use sci_form::{embed_batch, ConformerConfig};

let smiles = vec!["CCO", "c1ccccc1", "CC(=O)O"];
let cfg = ConformerConfig { seed: 42, num_threads: 0 };
let results = embed_batch(&smiles, &cfg)?;
for r in &results {
    println!("{}: {} atoms", r.smiles, r.num_atoms);
}

parse ​

rust
pub fn parse(smiles: &str) -> Result<graph::Molecule, SciFormError>

Parse SMILES into a molecular graph without generating 3D coordinates. Returns Ok(Molecule) or Err(SciFormError); use error.is_parse() to distinguish malformed input.


Gasteiger Charges ​

compute_charges ​

rust
pub fn compute_charges(smiles: &str) -> Result<charges::gasteiger::ChargeResult, SciFormError>

Compute Gasteiger-Marsili partial charges using default settings (6 iterations).

Returns:

rust
pub struct ChargeResult {
    pub charges: Vec<f64>,   // per-atom partial charges
    pub total_charge: f64,   // sum (should be ~0 for neutral)
}

Example:

rust
let result = sci_form::compute_charges("CCO").unwrap();
println!("O charge: {:.4}", result.charges[2]); // ~-0.38

compute_charges_configured ​

rust
pub fn compute_charges_configured(
    smiles: &str,
    config: &charges::gasteiger::GasteigerConfig,
) -> Result<charges::gasteiger::ChargeResult, SciFormError>

Compute Gasteiger-Marsili charges with fine-grained control.

rust
pub struct GasteigerConfig {
    pub max_iter: usize,               // default: 6
    pub initial_damping: f64,          // default: 1.0
    pub convergence_threshold: f64,    // default: 1e-8
}

Supports all main-group elements up to period 4 (Li, Be, Na, Mg, Al, Si, …) and formal-charge-aware initialization for charged species.

Example:

rust
use sci_form::charges::gasteiger::GasteigerConfig;

let config = GasteigerConfig {
    max_iter: 12,
    initial_damping: 0.9,
    convergence_threshold: 1e-10,
};
let result = sci_form::compute_charges_configured("[NH4+]", &config).unwrap();
println!("Total charge: {:.2}", result.total_charge); // ~+1.0

Solvent-Accessible Surface Area ​

compute_sasa ​

rust
pub fn compute_sasa(
    elements: &[u8],
    coords_flat: &[f64],
    probe_radius: Option<f64>,
) -> Result<surface::sasa::SasaResult, SciFormError>

Shrake-Rupley SASA computation using a Fibonacci sphere (DEFAULT_NUM_POINTS = 960 points per atom sphere), Bondi radii, and an optional probe radius (None selects the default 1.4 Å for water).

Returns:

rust
pub struct SasaResult {
    pub total_sasa: f64,      // Ų
    pub atom_sasa: Vec<f64>,  // per-atom SASA in Ų
    pub probe_radius: f64,    // Å
    pub num_points: usize,    // test points per atom sphere
}

Example:

rust
let conf = sci_form::embed("CCO", 42);
let sasa = sci_form::compute_sasa(&conf.elements, &conf.coords, Some(1.4)).unwrap();
println!("SASA: {:.2} Ų", sasa.total_sasa);

EHT & Population Analysis ​

compute_population ​

rust
pub fn compute_population(
    elements: &[u8],
    positions: &[[f64; 3]],
) -> Result<population::PopulationResult, SciFormError>

Runs EHT then computes Mulliken and Löwdin population analysis.

Returns:

rust
pub struct PopulationResult {
    pub mulliken_charges: Vec<f64>,      // per-atom Mulliken charge (e)
    pub lowdin_charges: Vec<f64>,        // per-atom Löwdin charge (e)
    pub mulliken_populations: Vec<f64>,  // gross orbital populations
    pub num_atoms: usize,
    pub total_charge_mulliken: f64,      // e
    pub total_charge_lowdin: f64,        // e
    pub charge_conservation_error: f64,  // |Σq - q_expected|
    pub homo_energy: Option<f64>,        // eV
    pub lumo_energy: Option<f64>,        // eV
    pub gap: Option<f64>,                // eV
    pub warnings: Vec<String>,
}

Example:

rust
let conf = sci_form::embed("CCO", 42);
let pos: Vec<[f64; 3]> = conf.coords.chunks(3)
    .map(|c| [c[0], c[1], c[2]])
    .collect();
let pop = sci_form::compute_population(&conf.elements, &pos).unwrap();
println!("HOMO: {:?} eV, Gap: {:?} eV", pop.homo_energy, pop.gap);

compute_dipole ​

rust
pub fn compute_dipole(
    elements: &[u8],
    positions: &[[f64; 3]],
) -> Result<dipole::DipoleResult, SciFormError>

Runs EHT then computes the molecular dipole moment. The geometry must be non-empty, have one finite triplet per atom, and use atomic numbers 1..=118; elements without EHT parameters return an unsupported-element error.

Returns:

rust
pub struct DipoleResult {
    pub vector: [f64; 3],   // Debye, [x, y, z]
    pub magnitude: f64,     // Debye
}

Electrostatic Potential ​

compute_esp_grid ​

rust
pub fn compute_esp_grid(
    elements: &[u8],
    positions: &[[f64; 3]],
    spacing: f64,
    padding: f64,
) -> Result<esp::EspGrid, SciFormError>

compute_esp is the historical alias of this function.

Compute an ESP grid using Mulliken charges from EHT. Grid extends padding Å beyond the molecular bounding box.

Returns:

rust
pub struct EspGrid {
    pub origin: [f64; 3],       // Å
    pub spacing: f64,           // Å
    pub dims: [usize; 3],       // [nx, ny, nz]
    pub values: Vec<f64>,       // Hartree/e, row-major (z-innermost)
}

Validated metadata only (no EHT solve):

rust
use sci_form::esp::{esp_grid_metadata, EspGridConfig};

let (origin, dims) = esp_grid_metadata(
    &positions,
    EspGridConfig { spacing: 0.5, padding: 2.0, ..Default::default() },
)?;

This rejects empty/non-finite geometries, invalid spacing/padding and grids above 2^30 points, and is the shared source of truth for the evaluator and the WASM metadata probe.

Advanced (parallel, color mapping):

rust
use sci_form::esp::{compute_esp_grid_parallel, esp_grid_to_colors, esp_color_map};

// Parallel grid (requires "parallel" feature)
let grid = compute_esp_grid_parallel(&elements, &pos, &mulliken_charges, 0.5, 3.0);

// Color-map the whole grid to RGB
let colors: Vec<u8> = esp_grid_to_colors(&grid, 0.05);  // range = ±0.05 a.u.

// Color-map a single value
let rgb: [u8; 3] = esp_color_map(0.03, 0.05);  // returns [r, g, b]

// Export to .cube file
use sci_form::esp::export_cube;
export_cube(&grid, &elements, &pos, "molecule.cube").unwrap();

Density of States ​

compute_dos ​

rust
pub fn compute_dos(
    elements: &[u8],
    positions: &[[f64; 3]],
    sigma: f64,
    e_min: f64,
    e_max: f64,
    n_points: usize,
) -> Result<dos::DosResult, SciFormError>

Runs EHT to get orbital energies, then computes DOS and per-atom PDOS with Gaussian smearing σ.

Returns:

rust
pub struct DosResult {
    pub energies: Vec<f64>,   // eV, n_points values from e_min to e_max
    pub total_dos: Vec<f64>,  // states/eV
    pub pdos: Vec<Vec<f64>>,  // per-atom PDOS: pdos[atom_idx][grid_idx]
    pub sigma: f64,           // eV
}

Advanced:

rust
use sci_form::dos::{compute_pdos, dos_mse, export_dos_json};

let dos = compute_pdos(&elements, &coords_flat, &orbital_energies, &coefficients,
                       n_electrons, 0.2, -20.0, 5.0, 200);

// Mean squared error between two DOS curves
let mse = dos_mse(&dos.dos, &reference_dos);

// Export to JSON string
let json = export_dos_json(&dos);

Molecular Alignment ​

compute_rmsd ​

rust
pub fn compute_rmsd(coords: &[f64], reference: &[f64]) -> f64

RMSD after optimal Kabsch alignment (SVD-based). Both arrays are flat [x0,y0,z0,…].

Advanced:

rust
use sci_form::alignment::{align_coordinates, align_quaternion, compute_rmsd};

// Kabsch SVD alignment
let result = align_coordinates(&mobile, &reference).unwrap();
// result.rotation: [[f64;3];3], result.translation: [f64;3], result.rmsd: f64

// Quaternion alignment (Coutsias 2004, faster for large N)
let result = align_quaternion(&mobile, &reference).unwrap();

Force Field Energy ​

compute_uff_energy ​

rust
pub fn compute_uff_energy(smiles: &str, coords: &[f64]) -> Result<f64, SciFormError>

Evaluate the UFF force field energy (kcal/mol) for a molecule at the given coordinates.

MMFF94 (complete energy):

rust
use sci_form::forcefield::mmff94::{Mmff94Builder, Mmff94Variant};

let mol = sci_form::parse("CCO").unwrap();
let terms = Mmff94Builder::build_typed(&mol, Mmff94Variant::Mmff94);
let (energy, gradient) = Mmff94Builder::total_energy(&terms, &coords);

The MMFF94 implementation includes stretch, bend, stretch-bend, out-of-plane, torsion, buffered 14-7 van der Waals and buffered Coulomb electrostatics with PBCI/BCI partial charges. It matches RDKit's full MMFF energy to <3e-11 kcal/mol on the validation corpus.


Materials ​

create_unit_cell ​

rust
pub fn create_unit_cell(
    a: f64, b: f64, c: f64,
    alpha: f64, beta: f64, gamma: f64,
) -> materials::UnitCell

pub fn create_unit_cell_checked(
    a: f64, b: f64, c: f64,
    alpha: f64, beta: f64, gamma: f64,
) -> Result<materials::UnitCell, SciFormError>

Create a periodic unit cell from lattice parameters (a, b, c in Å; α, β, γ in degrees). create_unit_cell is the historical unchecked constructor: it returns a degenerate cell when a length is non-positive, an angle is outside (0°, 180°), or the angles produce a non-positive volume. Use create_unit_cell_checked for untrusted input; it rejects those cases with a validation error. Python, WASM and the CLI validate before constructing.

write_cif ​

rust
pub fn write_cif(structure: &materials::CifStructure) -> String
pub fn write_cif_checked(structure: &materials::CifStructure) -> Result<String, SciFormError>

write_cif is the historical unchecked writer and serializes the structure verbatim. write_cif_checked calls CifStructure::validate first and rejects an empty data block, empty/duplicate labels, symbol/atomic-number mismatches, invalid cell parameters, non-finite coordinates and occupancies outside (0, 1]. The CLI, Python and WASM wrappers already validate.

assemble_framework ​

rust
pub fn assemble_framework(
    node: &materials::Sbu,
    linker: &materials::Sbu,
    topology: &materials::Topology,
    cell: &materials::UnitCell,
) -> materials::CrystalStructure

Assemble a MOF-type framework crystal structure from node/linker SBUs on a topology.

Example:

rust
use sci_form::materials::{CoordinationGeometry, Sbu, Topology, UnitCell};

let cell = UnitCell::cubic(26.3);
let node = Sbu::metal_node(30, 2.0, CoordinationGeometry::Octahedral);
let linker = Sbu::linear_linker(&[6, 6], 1.4, "carboxylate");
let topology = Topology::pcu();
let crystal = sci_form::assemble_framework(&node, &linker, &topology, &cell);

assemble_framework_with_linkers ​

rust
pub fn assemble_framework_with_linkers(
    node: &materials::Sbu,
    linkers: &[materials::Sbu],
    topology: &materials::Topology,
    cell: &materials::UnitCell,
) -> materials::CrystalStructure

Assemble a framework using one linker per inequivalent edge type. Edge i uses linkers[topology.edge_types[i]]; a shorter slice reuses the last linker, and an empty slice places no linker atoms. Topology::from_name accepts the data-driven RCSR nets (afw, xah, tfy, …) whose edge_types distinguish inequivalent edges.

rust
let topology = Topology::from_name("xah")?;
let linkers = [
    Sbu::linear_linker(&[6], 1.4, "short"),
    Sbu::linear_linker(&[7], 1.2, "long"),
];
let crystal =
    sci_form::assemble_framework_with_linkers(&node, &linkers, &topology, &cell);

For untrusted SBU/cell data use the checked variant, which rejects mismatched element/position arrays, non-finite positions, invalid atomic numbers, non-finite topology nodes and a singular cell before assembly:

rust
let crystal = sci_form::assemble_framework_with_linkers_checked(
    &node, &linkers, &topology, &cell,
)?;

Spectroscopy (Track D) ​

compute_stda_uvvis ​

rust
pub fn compute_stda_uvvis(
    elements: &[u8],
    positions: &[[f64; 3]],
    sigma: f64,
    e_min: f64,
    e_max: f64,
    n_points: usize,
    broadening: reactivity::BroadeningType,
) -> Result<reactivity::StdaUvVisSpectrum, SciFormError>

Compute a UV-Vis absorption spectrum via the simplified Tamm-Dancoff approximation (sTDA) on EHT MO transitions.

ParameterDescription
elementsAtomic numbers
positions3D Cartesian coordinates (Å)
sigmaBroadening width in eV (Gaussian σ or Lorentzian γ)
e_min / e_maxEnergy window in eV
n_pointsWavelength grid size
broadeningBroadeningType::Gaussian or BroadeningType::Lorentzian

Returns StdaUvVisSpectrum { energies_ev, wavelengths_nm, absorptivity, excitations, sigma, broadening, notes }; each excitation has energy_ev, wavelength_nm, oscillator_strength, from_mo, to_mo and transition_dipole.

rust
use sci_form::{embed, compute_stda_uvvis};
use sci_form::reactivity::BroadeningType;

let conf = embed("c1ccccc1", 42);
let pos: Vec<[f64;3]> = conf.coords.chunks(3).map(|c| [c[0],c[1],c[2]]).collect();
let spec = compute_stda_uvvis(&conf.elements, &pos, 0.3, 1.0, 8.0, 500, BroadeningType::Gaussian).unwrap();
println!("{} points, {} excitations", spec.energies_ev.len(), spec.excitations.len());

compute_vibrational_analysis ​

rust
pub fn compute_vibrational_analysis(
    elements: &[u8],
    positions: &[[f64; 3]],
    method: &str,
    step_size: Option<f64>,
) -> Result<ir::VibrationalAnalysis, SciFormError>

Compute a numerical Hessian (6N energy evaluations with mass-aware step size) and diagonalize to obtain vibrational frequencies, normal modes, IR intensities, ZPVE, and thermochemistry. Translation/rotation modes are projected out automatically.

method is "eht", "pm3" or "xtb"; step_size is the finite-difference step in Å (None selects the engine default).

Returns VibrationalAnalysis { n_atoms, elements, modes, n_real_modes, n_imaginary_modes, zpve_ev, thermochemistry, method, notes }.

Each VibrationalMode has frequency_cm1, ir_intensity (km/mol), displacement (3N) and is_real.

Thermochemistry (RRHO, 298.15 K): temperature_k, zpve_kcal, thermal_energy_kcal, enthalpy_correction_kcal, entropy_vib_cal (cal/mol/K), gibbs_correction_kcal — all energies in kcal/mol.

WARNING

The EHT Hessian is a one-electron model with no electron-electron repulsion, so the potential-energy surface has no minimum and its second derivative does not define force constants: imaginary (negative) frequencies are expected. Use pm3 or xtb.

rust
let vib = sci_form::compute_vibrational_analysis(&conf.elements, &pos, "xtb", None).unwrap();
println!("ZPVE: {:.4} eV", vib.zpve_ev);
if let Some(t) = &vib.thermochemistry {
    println!("Gibbs correction: {:.3} kcal/mol", t.gibbs_correction_kcal);
}
let strongest = vib.modes.iter().filter(|m| m.is_real)
    .max_by(|a,b| a.ir_intensity.partial_cmp(&b.ir_intensity).unwrap());
println!("Strongest: {:.1} cm⁻¹  ({:.1} km/mol)",
    strongest.map(|m| m.frequency_cm1).unwrap_or(0.0),
    strongest.map(|m| m.ir_intensity).unwrap_or(0.0));

compute_vibrational_analysis_uff ​

rust
pub fn compute_vibrational_analysis_uff(
    smiles: &str,
    elements: &[u8],
    positions: &[[f64; 3]],
    step_size: Option<f64>,
) -> Result<ir::VibrationalAnalysis, SciFormError>

Fast UFF path: relaxes the geometry with UFF, builds the analytical Hessian by gradient differences, and falls back to a numerical UFF Hessian (recording a note) if significant imaginary modes remain. elements must match the SMILES atom order and positions must hold exactly 3N finite coordinates; otherwise the call fails before any Hessian work. Water at the regression geometry gives three real modes at 1757.4598999427346, 3706.0462968790475 and 3759.6865897106463 cm⁻¹.


compute_ir_spectrum ​

rust
pub fn compute_ir_spectrum(
    analysis: &ir::VibrationalAnalysis,
    gamma: f64,
    wn_min: f64,
    wn_max: f64,
    n_points: usize,
) -> ir::IrSpectrum

Applies default Lorentzian broadening to an existing VibrationalAnalysis.

Returns IrSpectrum { wavenumbers, intensities, peaks, gamma, notes } — wavenumbers in cm⁻¹ and intensities in km/mol.

rust
let vib = sci_form::compute_vibrational_analysis(&conf.elements, &pos, "xtb", None).unwrap();
let spec = sci_form::compute_ir_spectrum(&vib, 15.0, 400.0, 4000.0, 1000);
let max_i = spec.intensities.iter().cloned().fold(0.0_f64, f64::max);
let idx   = spec.intensities.iter().position(|&v| v == max_i).unwrap();
println!("Dominant band: {:.1} cm⁻¹", spec.wavenumbers[idx]);

compute_ir_spectrum_broadened ​

rust
pub fn compute_ir_spectrum_broadened(
    analysis: &ir::VibrationalAnalysis,
    gamma: f64,
    wn_min: f64,
    wn_max: f64,
    n_points: usize,
    broadening: &str,
) -> Result<ir::IrSpectrum, SciFormError>

Generate a broadened IR spectrum from an existing VibrationalAnalysis with full control over parameters.

ParameterDescription
gammaHalf-width (Lorentzian) or σ (Gaussian) in cm⁻¹
broadening"lorentzian" (default) or "gaussian"

Errors: an unknown line shape is an error. It used to fall back to the Lorentzian shape, so the typo gauassian silently changed the spectrum.

Returns IrSpectrum { wavenumbers, intensities, peaks, gamma, notes } — wavenumbers in cm⁻¹ and intensities in km/mol.

rust
// Gaussian broadening for publication-quality spectra
let spec = sci_form::compute_ir_spectrum_broadened(&vib, 10.0, 400.0, 4000.0, 2000, "gaussian");
println!("{} peaks labelled", spec.peaks.len());

predict_nmr_shifts ​

rust
pub fn predict_nmr_shifts(smiles: &str) -> Result<nmr::NmrShiftResult, SciFormError>

Predict ¹H and ¹³C chemical shifts from SMILES using HOSE code environment matching.

Returns representative shifts for the default nucleus of each element found in the molecule. Legacy fields such as h_shifts, c_shifts, f_shifts, and p_shifts are preserved, and additional nuclei are available under other_shifts.

Returns NmrShiftResult { h_shifts, c_shifts, ..., other_shifts, notes }. Each ChemicalShift has atom_index, element, shift_ppm, environment, confidence.

rust
let shifts = sci_form::predict_nmr_shifts("CCO").unwrap();
for h in &shifts.h_shifts {
    println!("H#{}: {:.2} ppm ({})", h.atom_index, h.shift_ppm, h.environment);
}

predict_nmr_shifts_for_nucleus ​

rust
pub fn predict_nmr_shifts_for_nucleus(
    smiles: &str,
    nucleus: &str,
) -> Result<Vec<nmr::ChemicalShift>, SciFormError>

Predict shifts for one specific nucleus. This is the direct entry point for the expanded registry, including nuclei such as 2H, 35Cl, 79Br, 195Pt, and 207Pb.

nucleus is case-insensitive and accepts either mass-number order (13C/C13), element names (carbon) and aliases (proton). An empty or malformed SMILES and an unknown nucleus return Err; a valid nucleus with no matching atom returns an empty vector. Isotope abundances are not modeled, so 2H returns a relative shift for every hydrogen position.

The fast path remains most accurate for ¹H and ¹³C. Other nuclei are screening-level relative estimates intended to show rough trend and neighborhood sensitivity.

rust
let cl35 = sci_form::predict_nmr_shifts_for_nucleus("[Cl]", "35Cl").unwrap();
for peak in &cl35 {
    println!("Cl#{}: {:.1} ppm ({})", peak.atom_index, peak.shift_ppm, peak.environment);
}

predict_nmr_shifts_with_hose_database ​

rust
pub fn predict_nmr_shifts_with_hose_database(
    smiles: &str,
    database: &nmr::HoseDatabase,
) -> Result<nmr::NmrShiftResult, SciFormError>

Runs the built-in additivity prediction and replaces matching ¹H/¹³C values with the longest-prefix HOSE entry. The result notes how many shifts were overridden; an empty database leaves every built-in value and adds a note.

HoseDatabase::from_json and from_csv reject empty HOSE codes, elements outside 1..=118, non-finite shifts, short CSV rows and invalid counts. HoseDatabase::validate checks a hand-built database, and lookup ignores malformed records pushed directly instead of applying a NaN shift.

rust
let db = sci_form::nmr::HoseDatabase::from_csv("C/H,H,H,1,0.9,10")?;
let shifts = sci_form::predict_nmr_shifts_with_hose_database("CCO", &db)?;
println!("{} H shifts", shifts.h_shifts.len());

compute_giao_nmr ​

rust
pub fn compute_giao_nmr(
    elements: &[u8],
    positions: &[[f64; 3]],
    nucleus: &str,
) -> Result<GiaoNmrResult, SciFormError>

Run the high-level public GIAO route for one requested nucleus. This path builds a MolecularSystem, runs the public RHF SCF loop, constructs the STO-3G basis mapping, and returns isotope-specific shieldings and chemical shifts.

Current public constraints: singlet closed-shell systems only. By default the API rejects elements that only have the hydrogen-like fallback basis in the SCF stack.

rust
let elements = [8, 1, 1];
let positions = [
    [0.0, 0.0, 0.1173],
    [0.0, 0.7572, -0.4692],
    [0.0, -0.7572, -0.4692],
];
let result = sci_form::compute_giao_nmr(&elements, &positions, "1H").unwrap();
println!("{} target atoms, converged={}", result.n_target_atoms, result.scf_converged);

compute_giao_nmr_configured ​

rust
pub fn compute_giao_nmr_configured(
    elements: &[u8],
    positions: &[[f64; 3]],
    nucleus: &str,
    config: &GiaoNmrConfig,
) -> Result<GiaoNmrResult, SciFormError>

Configured variant of the high-level GIAO API.

GiaoNmrConfig { charge, multiplicity, max_scf_iterations, use_parallel_eri, allow_basis_fallback }

Set allow_basis_fallback=true only for screening-level experiments on elements that do not yet have explicit STO-3G coverage in the public SCF path.


predict_nmr_couplings ​

rust
pub fn predict_nmr_couplings(
    smiles: &str,
    positions: &[[f64; 3]],
) -> Result<Vec<nmr::JCoupling>, SciFormError>

Predict 2J, 3J, and 4J H–H coupling constants. Pass 3D positions for Karplus dihedral-angle evaluation; pass &[] for topology-based free-rotation averages. An empty or malformed SMILES is an error, and a non-empty positions slice must contain exactly one finite triplet per atom.

Each JCoupling has h1_index, h2_index, j_hz, n_bonds, coupling_type.

Parameterized pathways: H-C-C-H (Altona-Sundaralingam), H-C-N-H (Bystrov), H-C-O-H, H-C-S-H.


compute_ensemble_j_couplings ​

rust
pub fn compute_ensemble_j_couplings(
    smiles: &str,
    conformer_coords: &[Vec<f64>],
    energies_kcal: &[f64],
    temperature_k: f64,
) -> Result<Vec<nmr::JCoupling>, SciFormError>

Boltzmann-average ³J couplings over a conformer ensemble.

ParameterDescription
conformer_coordsVec of flat coordinate arrays (one per conformer)
energies_kcalRelative energies in kcal/mol (UFF or xTB)
temperature_kTemperature for Boltzmann weighting (default: 298.15 K)
rust
let confs: Vec<Vec<f64>> = conf_results.iter().map(|r| r.coords.clone()).collect();
let energies: Vec<f64> = conf_results.iter().map(|r| r.uff_energy).collect();
let couplings = sci_form::compute_ensemble_j_couplings("CCCC", &confs, &energies, 298.15).unwrap();
for jc in &couplings {
    println!("H{}–H{}: {:.2} Hz", jc.h1_index, jc.h2_index, jc.j_hz);
}

compute_nmr_spectrum ​

rust
pub fn compute_nmr_spectrum(
    smiles: &str,
    nucleus: &str,     // e.g. "1H", "13C", "35Cl", "79Br", "195Pt"
    gamma: f64,
    ppm_min: f64,
    ppm_max: f64,
    n_points: usize,
) -> Result<nmr::NmrSpectrum, SciFormError>

Full NMR spectrum pipeline: SMILES → nucleus-specific shifts → couplings → multiplet splitting → Lorentzian broadening.

Only ¹H currently gets explicit vicinal J splitting by default. Other nuclei are rendered as fast screening spectra using the inferred shifts and nucleus-specific linewidth defaults.

Returns NmrSpectrum { ppm_axis, intensities, peaks, nucleus, gamma }.

rust
let spec = sci_form::compute_nmr_spectrum("CCO", "1H", 0.01, -2.0, 12.0, 2000).unwrap();
println!("{} ¹H multiplet lines in spectrum", spec.peaks.len());

compute_hose_codes ​

rust
pub fn compute_hose_codes(smiles: &str, max_radius: usize) -> Result<Vec<nmr::HoseCode>, SciFormError>

Generate HOSE code environment strings for all atoms in the molecule (breadth-first spherical atom environments).

rust
let codes = sci_form::compute_hose_codes("c1ccccc1", 4).unwrap();
for hose in &codes {
    println!("Atom {}: {}", hose.atom_index, hose.code_string);
}

Stereochemistry ​

analyze_stereo ​

rust
pub fn analyze_stereo(
    smiles: &str,
    coords: &[f64],
) -> Result<stereo::StereoAnalysis, SciFormError>

Assign CIP priorities and determine R/S configuration at stereocenters and E/Z geometry at double bonds using 3D coordinates.

rust
pub struct StereoAnalysis {
    pub stereocenters: Vec<Stereocenter>,
    pub double_bonds:  Vec<DoubleBondStereo>,
    pub n_stereocenters: usize,
    pub n_double_bonds:  usize,
}

pub struct Stereocenter {
    pub atom_index: usize,
    pub element: u8,
    pub substituent_indices: Vec<usize>,
    pub priorities: Vec<usize>,           // CIP priority rank (1 = highest)
    pub configuration: Option<String>,    // "R" or "S"
}

pub struct DoubleBondStereo {
    pub atom1: usize,
    pub atom2: usize,
    pub configuration: Option<String>,    // "E" or "Z"
    pub high_priority_sub1: Option<usize>,
    pub high_priority_sub2: Option<usize>,
}

CIP logic: DFS priority tree, duplicate-atom expansion for multiple bonds, recursive tie-breaking (up to depth 10), triple-product sign test for R/S, dihedral angle for E/Z.

Example:

rust
let conf = sci_form::embed("C(F)(Cl)(Br)I", 42);
let stereo = sci_form::analyze_stereo("C(F)(Cl)(Br)I", &conf.coords).unwrap();
println!("{} stereocenters", stereo.n_stereocenters);
for sc in &stereo.stereocenters {
    println!("Atom {}: {:?}", sc.atom_index, sc.configuration);
}

Implicit Solvation ​

compute_nonpolar_solvation ​

rust
pub fn compute_nonpolar_solvation(
    elements: &[u8],
    positions: &[[f64; 3]],
    probe_radius: Option<f64>,
) -> solvation::NonPolarSolvation

Non-polar solvation free energy: ΔGnp=∑iσi⋅Ai using per-element atomic solvation parameters (ASP) and Shrake-Rupley SASA.

rust
pub struct NonPolarSolvation {
    pub energy_kcal_mol: f64,
    pub atom_contributions: Vec<f64>,  // kcal/mol per atom
    pub atom_sasa: Vec<f64>,           // Ų per atom
    pub total_sasa: f64,               // Ų
}

compute_gb_solvation ​

rust
pub fn compute_gb_solvation(
    elements: &[u8],
    positions: &[[f64; 3]],
    charges: &[f64],
    solvent_dielectric: Option<f64>,   // default: 78.5 (water), must be >= 1.0
    solute_dielectric: Option<f64>,    // default: 1.0, must be >= 1.0
    probe_radius: Option<f64>,         // default: 1.4 Å, must be >= 0.0
) -> Result<solvation::GbSolvation, SciFormError>

Generalized Born + Surface Area (GB/SA) electrostatic solvation using the HCT pairwise descreening model for effective Born radii and the Still GB equation.

Errors (Err):

SituationMessage
positions does not have one triple per atompositions has N entries but M atoms require M
charges does not have one value per atomcharges has N values but M atoms require M
a charge is NaN or ±Infatom I has a non-finite partial charge
a dielectric constant is not finite or < 1.0solvent_dielectric must be >= 1.0 (1.0 = vacuum)
the probe radius is negative or not finiteprobe_radius must be >= 0.0 Å

ε = 1.0 is the vacuum limit and is accepted: the electrostatic term then vanishes and only the non-polar term remains.

rust
pub struct GbSolvation {
    pub electrostatic_energy_kcal_mol: f64,
    pub nonpolar_energy_kcal_mol: f64,
    pub total_energy_kcal_mol: f64,
    pub born_radii: Vec<f64>,
    pub charges: Vec<f64>,
    pub solvent_dielectric: f64,
    pub solute_dielectric: f64,
}

Example:

rust
let conf = sci_form::embed("CCO", 42);
let pos: Vec<[f64;3]> = conf.coords.chunks(3).map(|c| [c[0],c[1],c[2]]).collect();
let charges = sci_form::compute_charges("CCO").unwrap().charges;

let np = sci_form::compute_nonpolar_solvation(&conf.elements, &pos, None)?;
println!("Non-polar ΔG: {:.2} kcal/mol", np.energy_kcal_mol);

let gb = sci_form::compute_gb_solvation(&conf.elements, &pos, &charges, None, None, None)?;
println!("Total solvation: {:.2} kcal/mol", gb.total_energy_kcal_mol);

Ring Perception (SSSR) ​

compute_sssr ​

rust
pub fn compute_sssr(smiles: &str) -> Result<rings::sssr::SssrResult, SciFormError>

Smallest Set of Smallest Rings using Horton's shortest-path algorithm with Hückel aromaticity perception.

rust
pub struct SssrResult {
    pub rings: Vec<RingInfo>,
    pub atom_ring_count: Vec<usize>,              // rings containing each atom
    pub atom_ring_sizes: Vec<Vec<usize>>,         // ring sizes per atom
    pub ring_size_histogram: HashMap<usize, usize>, // size → count
}

pub struct RingInfo {
    pub atoms: Vec<usize>,   // atom indices (ring traversal order)
    pub size: usize,
    pub is_aromatic: bool,   // Hückel 4n+2 rule
}

Example:

rust
let r = sci_form::compute_sssr("c1ccc2ccccc2c1").unwrap();  // naphthalene
println!("{} rings, sizes: {:?}", r.rings.len(),
    r.rings.iter().map(|r| r.size).collect::<Vec<_>>());

Fingerprints (ECFP) ​

compute_ecfp ​

rust
pub fn compute_ecfp(
    smiles: &str,
    radius: usize,
    n_bits: usize,
) -> Result<rings::ecfp::ECFPFingerprint, SciFormError>

Extended-Connectivity Fingerprint (Morgan algorithm) with configurable radius and bit-vector size. radius must be in 0..=100 and n_bits in 64..=1,048,576; empty/whitespace SMILES and invalid controls return Err.

rust
pub struct ECFPFingerprint {
    pub n_bits: usize,
    pub on_bits: BTreeSet<usize>,
    pub radius: usize,
    pub raw_features: Vec<u64>,
}
impl ECFPFingerprint {
    pub fn density(&self) -> f64  // fraction of set bits
}

Atom invariants: element, degree, valence, ring membership, aromaticity, formal charge.

compute_tanimoto ​

rust
pub fn compute_tanimoto(
    fp1: &rings::ecfp::ECFPFingerprint,
    fp2: &rings::ecfp::ECFPFingerprint,
) -> f64

Jaccard-Tanimoto similarity: T=|A∩B|/|A∪B|. Returns 1.0 for identical fingerprints, 0.0 for disjoint. This legacy entry point does not check compatibility; use rings::ecfp::try_compute_tanimoto to reject fingerprints with different radii or n_bits (and malformed on-bits).

Example:

rust
let fp_benz = sci_form::compute_ecfp("c1ccccc1", 2, 2048).unwrap();
let fp_tol  = sci_form::compute_ecfp("Cc1ccccc1", 2, 2048).unwrap();
let t = sci_form::compute_tanimoto(&fp_benz, &fp_tol);
println!("Tanimoto benzene/toluene: {:.3}", t);  // 0.333

Conformer Clustering ​

butina_cluster ​

rust
pub fn butina_cluster(
    conformers: &[Vec<f64>],
    rmsd_cutoff: f64,
) -> clustering::ClusterResult

Taylor-Butina single-linkage RMSD clustering. Builds an O(N²) RMSD matrix with Kabsch alignment, then assigns conformers to cluster seeds greedily (largest first).

rust
pub struct ClusterResult {
    pub n_clusters: usize,
    pub assignments: Vec<usize>,       // cluster index per conformer
    pub centroid_indices: Vec<usize>,  // representative conformer per cluster
    pub cluster_sizes: Vec<usize>,
    pub rmsd_cutoff: f64,
}

compute_rmsd_matrix ​

rust
pub fn compute_rmsd_matrix(conformers: &[Vec<f64>]) -> Vec<Vec<f64>>

O(N²) pairwise RMSD matrix with Kabsch alignment. The bare function keeps its historical tolerant behaviour; use clustering::compute_rmsd_matrix_checked to reject ragged, empty or non-finite conformers explicitly.

filter_diverse_conformers ​

rust
pub fn filter_diverse_conformers(
    conformers: &[Vec<f64>],
    rmsd_cutoff: f64,
) -> Vec<usize>

Return indices of diverse representative conformers (one per cluster centroid).

Example:

rust
use sci_form::{embed_batch, ConformerConfig, butina_cluster};

let smiles = vec!["CCCC"; 20];
let cfg = ConformerConfig { seed: 42, num_threads: 0 };
let results = embed_batch(&smiles, &cfg);
let coords: Vec<Vec<f64>> = results.iter().map(|r| r.coords.clone()).collect();

let clusters = sci_form::butina_cluster(&coords, 1.0);
println!("{} clusters from {} conformers", clusters.n_clusters, results.len());

Capabilities added in this release ​

These functions are new in the v1.0 surface. Most of them were Rust-only before and are now mirrored on the Python, WASM and CLI surfaces.

compute_cisd ​

rust
// sci_form::hf::cisd::compute_cisd
pub fn compute_cisd(
    orbital_energies: &[f64],
    coefficients: &nalgebra::DMatrix<f64>,
    eris: &[f64],
    n_basis: usize,
    n_occupied: usize,
    n_states: usize,
) -> CisdResult

CISD excited states. correlation_energy is in Hartree; each excitation carries energy (Hartree) and energy_ev (eV).

The high-level geometry entry point is shared by the CLI, Python and WASM surfaces:

rust
// sci_form::hf::compute_cisd_from_geometry
pub fn compute_cisd_from_geometry(
    elements: &[u8],
    positions: &[[f64; 3]],
    n_states: usize,
) -> Result<CisdGeometryResult, String>

It validates the geometry, the STO-3G basis and the closed-shell electron count, runs the RHF reference, transforms the ERIs to the MO basis and returns the CISD result together with scf_energy, scf_converged, n_basis and n_occupied. An unsupported element, an odd electron count, n_states == 0 or a non-converged reference returns Err instead of panicking.

compute_dos_multimethod ​

rust
// sci_form::dos::multi_method::compute_dos_multimethod
pub fn compute_dos_multimethod(
    elements: &[u8],
    positions: &[[f64; 3]],
    method: DosMethod,
    sigma: f64,
    e_min: f64,
    e_max: f64,
    n_points: usize,
) -> Result<MultiMethodDosResult, String>

DOS built from the orbital energies of a chosen method (DosMethod::Eht, Pm3, Xtb, Gfn1, Gfn2, Hf3c). Energies in eV, DOS in 1/eV.

compute_eht_gradient and optimize_geometry_eht ​

rust
// sci_form::eht::gradients
pub fn compute_eht_gradient(
    elements: &[u8],
    positions: &[[f64; 3]],
) -> Result<EhtGradient, String>

pub fn optimize_geometry_eht(
    elements: &[u8],
    initial_positions: &[[f64; 3]],
    config: Option<EhtOptConfig>,
) -> Result<EhtOptResult, String>

Central-finite-difference gradients on the EHT surface (eV/Å) and a BFGS optimisation on that surface (energy in eV). The optimizer rejects empty/mismatched geometries, non-finite coordinates, non-finite energies or forces, and invalid max_steps/thresholds; the Python/WASM wrappers additionally require max_steps to be a finite non-negative integer and elements in 1..=118.

compute_aevs_tm ​

rust
// sci_form::ani::ani_tm::compute_aevs_tm
pub fn compute_aevs_tm(
    elements: &[u8],
    positions: &[[f64; 3]],
    params: &AevParams,
) -> Vec<Vec<f64>>

ANI-TM atomic environment vectors over the extended 24-element set. The checked entry point ani_tm::compute_aevs_tm_checked also validates the geometry, element set and AevParams (finite positive cutoffs and non-empty finite parameter lists); the checked default water call returns three rows of 176256 finite values.

compute_whim, compute_rdf, compute_getaway ​

rust
// sci_form::ml::whim
pub fn compute_whim(
    elements: &[u8],
    positions: &[[f64; 3]],
    weighting: WhimWeighting,
) -> WhimDescriptors

// sci_form::ml::rdf_descriptors
pub fn compute_rdf(
    elements: &[u8],
    positions: &[[f64; 3]],
    charges: &[f64],
    beta: f64,
    r_max: f64,
    n_points: usize,
) -> RdfDescriptors

// sci_form::ml::getaway
pub fn compute_getaway(
    elements: &[u8],
    positions: &[[f64; 3]],
    bonds: &[(usize, usize)],
    max_lag: usize,
) -> GetawayDescriptors

3D descriptor families. rdf radii are in Å and beta in Å⁻².

train_random_forest and train_gradient_boosting ​

rust
// sci_form::ml::advanced_models
pub fn train_random_forest(
    features: &[Vec<f64>],
    targets: &[f64],
    config: &RandomForestConfig,
) -> RandomForest

pub fn train_gradient_boosting(
    features: &[Vec<f64>],
    targets: &[f64],
    config: &GradientBoostingConfig,
) -> GradientBoosting

Regressors for descriptor-based property models.

assign_peaks ​

rust
// sci_form::ir::peak_assignment::assign_peaks
pub fn assign_peaks(
    frequencies: &[f64],
    intensities: &[f64],
    elements: &[u8],
    mode_displacements: Option<&[Vec<[f64; 3]>]>,
) -> AssignmentResult

Assign IR peaks (cm⁻¹) to functional groups using the standard group-frequency tables.

Space groups, periodic molecules and framework optimisation ​

rust
// sci_form::materials::space_groups
pub fn space_group_by_number(number: u16) -> Option<SpaceGroup>
pub fn space_group_by_symbol(symbol: &str) -> Option<SpaceGroup>
pub fn all_space_groups() -> Vec<(u16, &'static str)>

// sci_form::periodic
pub fn build_periodic_molecule(
    elements: &[u8],
    frac_coords: &[[f64; 3]],
    cell: &UnitCell,
    bond_tolerance: Option<f64>,
) -> PeriodicMolecule

pub fn detect_hapticity(
    elements: &[u8],
    coords: &[[f64; 3]],
    bonds: &[(usize, usize)],
) -> HapticityAnalysis

// sci_form::materials::geometry_opt
pub fn optimize_framework<F>(
    elements: &[u8],
    initial_positions: &[[f64; 3]],
    energy_force_fn: &F,
    config: &FrameworkOptConfig,
) -> Result<FrameworkOptResult, String>
where
    F: Fn(&[u8], &[[f64; 3]]) -> Result<(f64, Vec<[f64; 3]>), String>,

optimize_framework reports its energy in eV and its forces in eV/Å. It rejects an empty geometry, a position/atom count mismatch, non-finite initial coordinates, and any callback result with a non-finite energy/force component or a force count different from the atom count.


Capabilities that used to be Rust-only ​

These capabilities are now available in every surface (Python, WASM and CLI).

rust
// Open-shell SCF.
let uhf = sci_form::compute_uhf(&elements, &positions, 0, 2)?;   // doublet
let rohf = sci_form::compute_rohf(&elements, &positions, 0, 2)?;

// Energy gradients (eV/Å per atom): PM3 uses the stationary-density (Pulay-free)
// form (fixed-density integral rebuilds, no SCF per displacement); xTB uses
// warm-started central differences (5e-4 Å) of the GFN2 energy.
let pm3_grad = sci_form::compute_pm3_gradient(&elements, &positions)?;
let xtb_grad = sci_form::compute_xtb_gradient(&elements, &positions)?;

// Force-field energy split by term type (kcal/mol).
let terms = sci_form::compute_uff_energy_breakdown("CCO", &coords)?;

// Topological properties straight from a SMILES.
let tpsa = sci_form::compute_tpsa_from_smiles("CCO")?;
let ensemble = sci_form::predict_ensemble_from_smiles("CCO")?;

// CIF import and export.
let structure = sci_form::parse_cif(&cif_text)?;
let cif_text = sci_form::write_cif(&structure);

UhfResult carries the dense matrices; UhfResult::summary() returns the scalar part of the result (the same payload the JSON bindings return).

compute_uhf_configured accepts an explicit scf::uhf::UhfConfig. UhfConfig::validate (called by run_uhf) requires max_iterations >= 1, finite positive energy/density thresholds, a finite level_shift, and damping in [0, 1]; invalid controls return a validation error before the basis or integrals are built. Python/WASM expose only the default-control compute_uhf/compute_rohf entry points.


Root function index ​

Every public root function in sci_form, with the first line of its Rust documentation. Module-level helpers are listed in the next section.

FunctionPurpose
sci_form::analyze_graph_featuresAnalyze aromaticity and graph-level stereocenters from a SMILES string.
sci_form::analyze_stereoAnalyze stereochemistry: detect chiral centers (R/S) and E/Z double bonds.
sci_form::assemble_frameworkAssemble a framework crystal structure from node/linker SBUs on a topology.
sci_form::assemble_framework_with_linkersAssemble a framework with one linker SBU per inequivalent edge type. The checked variant is assemble_framework_with_linkers_checked.
sci_form::assemble_framework_with_linkers_checkedValidated linker-per-edge framework assembly; rejects bad SBU arrays, elements, positions, topology nodes and singular cells.
sci_form::butina_clusterCluster conformers using Butina (Taylor-Butina) algorithm based on RMSD.
sci_form::compare_methodsCompare multiple supported methods on the same geometry/system.
sci_form::compute_alpb_solvationCompute ALPB (Analytical Linearized Poisson-Boltzmann) solvation energy.
sci_form::compute_aniCompute ANI neural-network potential energy (and optionally forces).
sci_form::compute_ani_with_modelsCompute ANI neural-network potential energy with custom config and pre-loaded models.
sci_form::compute_bond_ordersCompute Wiberg-like and Mayer-like bond orders from EHT.
sci_form::compute_chargesCompute Gasteiger-Marsili partial charges from a SMILES string.
sci_form::compute_charges_configuredCompute Gasteiger-Marsili charges with configurable parameters.
sci_form::compute_dipoleCompute molecular dipole moment (Debye) from atomic elements and positions.
sci_form::compute_dosCompute DOS/PDOS from EHT orbital energies.
sci_form::compute_ecfpCompute Extended-Connectivity Fingerprint (ECFP/Morgan).
sci_form::compute_ecfp_batchCompute ECFP fingerprints for a batch of SMILES (parallelized with rayon when enabled).
sci_form::compute_eht_or_uff_fallbackCompute electronic properties with automatic fallback to UFF energy.
sci_form::compute_empirical_pkaEstimate acidic/basic pKa sites from graph environments and Gasteiger-charge heuristics. See empirical pKa sites.
sci_form::compute_ensemble_j_couplingsPredict J-couplings averaged over a conformer ensemble using Boltzmann weighting.
sci_form::compute_epr_hyperfineCompute isotropic EPR hyperfine coupling from the UHF spin density.
sci_form::compute_espCompute ESP grid from atomic elements, positions and Mulliken charges.
sci_form::compute_esp_gridCompute ESP grid and return full result with values, origin, spacing and dimensions.
sci_form::compute_esp_with_configCompute the ESP grid with explicit evaluation settings
sci_form::compute_fluorescenceFluorescence spectrum from the same sTDA singlets as UV-Vis absorption.
sci_form::compute_frontier_descriptorsCompute atom-resolved HOMO/LUMO frontier descriptors from EHT.
sci_form::compute_fukui_descriptorsCompute Fukui-function workflows and condensed per-atom descriptors from EHT.
sci_form::compute_gb_solvationCompute Generalized Born (Still-HCT) electrostatic + non-polar solvation.
sci_form::compute_gcmc_isothermCompute a GCMC adsorption isotherm on a rigid periodic framework.
sci_form::compute_gfn1Compute a GFN1-xTB single point (electrical structure + total energy).
sci_form::compute_gfn2Compute a GFN2-xTB single point (electrical structure + total energy).
sci_form::compute_giao_nmrCompute isotope-specific GIAO NMR shieldings using the public SCF route.
sci_form::compute_giao_nmr_configuredCompute isotope-specific GIAO NMR shieldings using the public SCF route and explicit settings.
sci_form::compute_hf3cRun a complete HF-3c calculation (Hartree-Fock with D3, gCP, SRB corrections).
sci_form::compute_hose_codesGenerate HOSE codes for all atoms in a molecule.
sci_form::compute_ir_spectrumGenerate a Lorentzian-broadened IR spectrum from vibrational analysis.
sci_form::compute_ir_spectrum_broadenedCompute IR spectrum with configurable broadening type.
sci_form::compute_md_trajectoryRun short exploratory molecular dynamics with Velocity Verlet (NVE-like).
sci_form::compute_md_trajectory_nvtRun short exploratory molecular dynamics with Velocity Verlet + Berendsen NVT thermostat.
sci_form::compute_ml_descriptorsCompute molecular descriptors for ML property prediction.
sci_form::compute_mmff94_energyCompute MMFF94 force field energy for a molecule. See MMFF94.
sci_form::compute_mmff94_energy_breakdownPer-term-type MMFF94 energy breakdown (kcal/mol) for a molecule. See MMFF94.
sci_form::compute_mp2_energyCompute the conventional closed-shell MP2 correlation energy.
sci_form::compute_nmr_spectrumGenerate a complete NMR spectrum from SMILES.
sci_form::compute_nmr_spectrum_with_coordsGenerate a complete NMR spectrum from SMILES and optional 3D coordinates.
sci_form::compute_nonpolar_solvationCompute non-polar solvation energy from SASA and atomic solvation parameters.
sci_form::compute_orbital_meshCompute orbital isosurface mesh for visualization.
sci_form::compute_pkaCompute a solution pKa from an explicit acid/conjugate-base pair.
sci_form::compute_pm3Compute PM3 semi-empirical energy and orbital information.
sci_form::compute_pm3_gradientCompute PM3 energy gradients.
sci_form::compute_populationCompute Mulliken & Löwdin population analysis from atomic elements and positions.
sci_form::compute_qmmm_energyCompute a mechanical-embedding QM/MM energy.
sci_form::compute_raman_spectrumCompute a Raman stick spectrum from the UFF normal modes.
sci_form::compute_reaction_dynamicsCompute a full reaction dynamics path: embed one reactant/product molecule, map atoms by element/bond-order graph isomorphism, run simplified NEB and add approach/departure frames.
sci_form::compute_reactivity_rankingBuild empirical reactivity rankings using condensed Fukui descriptors and Mulliken charges.
sci_form::compute_redox_potentialCompute a redox potential from an explicit oxidised/reduced pair.
sci_form::compute_rmsdCompute RMSD between two coordinate sets after Kabsch alignment.
sci_form::compute_rmsd_matrixCompute all-pairs RMSD matrix for a set of conformers.
sci_form::compute_roa_spectrumCompute ROA screening intensities from Raman activities and the VCD magnetic term.
sci_form::compute_rohfRun a Restricted Open-shell Hartree-Fock (ROHF) calculation. HOMO is the SOMO and LUMO is the next spatial orbital.
sci_form::compute_sasaCompute solvent-accessible surface area from SMILES + 3D coordinates.
sci_form::compute_simplified_neb_pathBuild a simplified NEB path between two geometries.
sci_form::compute_simplified_neb_path_configurableBuild a simplified NEB path using a configurable energy backend.
sci_form::compute_sssrCompute the Smallest Set of Smallest Rings (SSSR).
sci_form::compute_stda_uvvisCompute an sTDA UV-Vis spectrum with proper oscillator strengths.
sci_form::compute_tanimotoCompute Tanimoto similarity between two ECFP fingerprints.
sci_form::compute_topologyCompute structured topology analysis for transition-metal coordination environments.
sci_form::compute_topology_checkedChecked topology analysis that rejects invalid geometry before classification.
sci_form::compute_tpsaCompute Topological Polar Surface Area (TPSA) in Ų. The raw helper is tolerant; compute_tpsa_checked validates the graph.
sci_form::compute_tpsa_checkedValidated TPSA from elements and bonds; rejects unknown elements, out-of-range/self bonds and invalid bond orders.
sci_form::compute_tpsa_from_smilesCompute the Topological Polar Surface Area (TPSA) in Ų, from a SMILES.
sci_form::compute_uff_energyCompute UFF force field energy for a molecule.
sci_form::compute_uff_energy_breakdownPer-term-type UFF energy breakdown (kcal/mol) for a molecule.
sci_form::compute_uff_energy_with_aromatic_heuristicsCompute UFF energy and apply an aromaticity-informed heuristic correction. See UFF energy and the aromatic heuristic.
sci_form::compute_uhfRun an Unrestricted Hartree-Fock (UHF) calculation for open-shell systems.
sci_form::compute_uhf_configuredRun UHF/ROHF with full configuration control.
sci_form::compute_uv_vis_spectrumBuild an exploratory UV-Vis-like spectrum from low-cost EHT transitions.
sci_form::compute_vcd_spectrumCompute VCD rotational strengths with a nuclear charge-current screening model.
sci_form::compute_vibrational_analysisPerform vibrational analysis via numerical Hessian.
sci_form::compute_vibrational_analysis_uffPerform vibrational analysis using UFF analytical Hessian.
sci_form::compute_xps_binding_energiesCompute Koopmans core-level XPS binding energies.
sci_form::compute_xtbCompute a generic xTB single point (electrical structure + total energy).
sci_form::compute_xtb_gradientCompute xTB (GFN2) energy gradients.
sci_form::create_unit_cellCreate a periodic unit cell from lattice parameters (a, b, c in Å; α, β, γ in degrees); unchecked, use create_unit_cell_checked for validation.
sci_form::create_unit_cell_checkedChecked unit-cell constructor; rejects non-positive/non-finite lengths, angles outside (0°, 180°) and non-positive volume.
sci_form::discover_reaction_networkDiscover a reaction network from explicit rules.
sci_form::discover_template_networkDiscover a reaction network from serialisable template rules.
sci_form::eht_supportReport EHT capability metadata for a given element list.
sci_form::embedGenerate a 3D conformer from a SMILES string.
sci_form::embed_batchBatch-embed multiple SMILES in parallel.
sci_form::embed_batchBatch-embed multiple SMILES sequentially (no rayon dependency).
sci_form::embed_diverseGenerate multiple conformers for a SMILES and filter by Butina RMSD clustering.
sci_form::embed_diverse_checkedValidated multi-conformer embedding; rejects non-positive/infinite cutoffs and non-finite conformers.
sci_form::evaluate_mlipEvaluate a user-supplied MLIP model through the documented contract; validates manifest, geometry, coverage and finite results.
sci_form::get_eht_support
sci_form::get_system_capabilities
sci_form::get_system_method_plan
sci_form::neb_backend_energy_and_gradientCompute energy (kcal/mol) and gradient (kcal/mol/Å) with any NEB-capable backend.
sci_form::neb_backend_energy_kcalCompute single-point energy (kcal/mol) with any NEB-capable backend.
sci_form::parseParse a SMILES string and return molecular structure (no 3D generation).
sci_form::parse_cifParse a CIF (Crystallographic Information File) string into a crystal structure.
sci_form::predict_ensemblePredict molecular properties using ensemble ML models.
sci_form::predict_ensemble_from_smilesPredict molecular properties using ensemble ML models, from a SMILES.
sci_form::predict_ml_propertiesPredict molecular properties using ML proxy models.
sci_form::predict_nmr_couplingsPredict J-coupling constants for a molecule.
sci_form::predict_nmr_shiftsPredict representative NMR chemical shifts from SMILES.
sci_form::predict_nmr_shifts_for_nucleusPredict chemical shifts for a specific NMR nucleus from SMILES.
sci_form::predict_nmr_shifts_with_hose_databasePredict NMR chemical shifts using an external HOSE database.
sci_form::refine_barrier_with_gsmRefine a reaction barrier with the existing GSM backend.
sci_form::run_kinetic_monte_carloRun a Gillespie kinetic Monte Carlo simulation on an elementary-step network.
sci_form::run_multi_opesRun two-dimensional OPES with self-consistent kernel weights.
sci_form::run_uff_metadynamicsRun well-tempered metadynamics on a UFF molecule.
sci_form::run_uff_opesRun OPES-style enhanced sampling on a UFF molecule.
sci_form::search_conformers_with_uffSearch conformers by sampling multiple embeddings, optimizing torsions, and ranking with UFF.
sci_form::solve_3d_rismSolve the 3D-RISM Ornstein–Zernike equations on a periodic grid.
sci_form::system_capabilitiesReport operation capability metadata for a given element list.
sci_form::system_method_planBuild a structured method plan with recommendations, fallback paths, and confidence scores.
sci_form::to_canonical_smilesGenerate a canonical SMILES string from an input SMILES.
sci_form::versionLibrary version string.
sci_form::write_cifWrite a crystal structure to CIF format string; unchecked, use write_cif_checked for validation.
sci_form::write_cif_checkedChecked CIF writer; validates the structure before serializing.

Internal Module Reference ​

ModuleKey Types / Functions
sci_form::graphMolecule, Atom, Bond, BondOrder, Hybridization
sci_form::smilesSMILES parser (60+ elements, implicit H inferral)
sci_form::smartsSMARTS pattern engine (846 CSD torsion patterns)
sci_form::conformergenerate_3d_conformer(), adaptive large-mol params
sci_form::distgeomBoundsMatrix, smooth_bounds(), compute_initial_coords_rdkit()
sci_form::distgeom::parallelcompute_bounds_parallel(), floyd_warshall_parallel() (requires parallel feature)
sci_form::etkdgTorsion FF, TorsionPattern, macrocycle detection
sci_form::forcefieldbuild_uff_force_field(), Mmff94Builder, UFF param tables
sci_form::optimizationL-BFGS minimizer
sci_form::ehtsolve_eht(), EhtResult, evaluate_orbital_on_grid_chunked(), marching_cubes()
sci_form::eht::band_structurecompute_band_structure(), BandStructure, BandStructureConfig
sci_form::eht::gradientscompute_eht_gradient(), optimize_geometry_eht(), EhtGradient, EhtOptResult
sci_form::espcompute_esp_grid(), compute_esp_grid_parallel(), esp_color_map(), export_cube(), read_cube()
sci_form::doscompute_dos(), compute_pdos(), dos_mse(), export_dos_json()
sci_form::dos::multi_methodcompute_dos_multimethod(), DosMethod, MultiMethodDosResult
sci_form::alignmentalign_coordinates(), align_quaternion(), compute_rmsd()
sci_form::charges::gasteigergasteiger_marsili_charges(), gasteiger_marsili_charges_configured(), ChargeResult, GasteigerConfig
sci_form::surface::sasacompute_sasa(), SasaResult
sci_form::populationcompute_population(), PopulationResult
sci_form::population::npacompute_npa(), compute_nbo(), NpaResult, NboResult, NboBond, NboLonePair
sci_form::dipolecompute_dipole_from_eht(), DipoleResult
sci_form::pm3compute_pm3(), Pm3Result (PM3 + PM3(tm) transition metals)
sci_form::xtbcompute_xtb(), XtbResult (GFN2), solve_gfn0 (faithful GFN0), solve_gfn1, solve_gfn2, compute_xtb_gradient()
sci_form::xtb::gfn1solve_gfn1(), Gfn1Result (shell charges, D3 dispersion)
sci_form::xtb::gfn2solve_gfn2(), Gfn2Result (multipole, D4 dispersion, halogen bonding)
sci_form::hfsolve_hf3c(), HfConfig, Hf3cResult (D3 + gCP + SRB corrections)
sci_form::hf::cisdcompute_cisd(), CisdResult, CisdExcitation (excited states)
sci_form::scf::extended_basisbuild_basis_set(), BasisSetType (STO-3G, 3-21G, 6-31G)
sci_form::anicompute_ani(), AniConfig, AniResult, FeedForwardNet
sci_form::ani::ani_tmcompute_aevs_tm(), species_index_tm() (24 elements incl. transition metals)
sci_form::materialsUnitCell, Sbu, Topology, CrystalStructure, assemble_framework()
sci_form::materials::space_groupsspace_group_by_number(), space_group_by_symbol(), all_space_groups(), crystal_system_for_number(), SpaceGroup (230 ITC groups)
sci_form::materials::geometry_optoptimize_framework(), FrameworkOptConfig, FrameworkOptResult, OptMethod
sci_form::transportpack_batch_arrow(), ChunkedIterator, WorkerTask, split_worker_tasks()
sci_form::reactivityStdaUvVisSpectrum, StdaExcitation, BroadeningType, compute_stda_uvvis_spectrum()
sci_form::irVibrationalAnalysis, VibrationalMode, IrSpectrum, IrPeak, compute_vibrational_analysis(), compute_ir_spectrum()
sci_form::ir::peak_assignmentassign_peaks(), AssignmentResult, PeakAssignment (functional group recognition)
sci_form::nmrNmrShiftResult, ChemicalShift, JCoupling, NmrSpectrum, NmrPeak, HoseCode, NmrNucleus
sci_form::stereoanalyze_stereo(), StereoAnalysis, Stereocenter, DoubleBondStereo, HelicalChirality
sci_form::solvationcompute_nonpolar_solvation(), compute_gb_solvation(), compute_born_radii(), NonPolarSolvation, GbSolvation
sci_form::rings::sssrcompute_sssr(), SssrResult, RingInfo
sci_form::rings::ecfpcompute_ecfp(), compute_tanimoto(), ECFPFingerprint
sci_form::clusteringbutina_cluster(), butina_cluster_checked(), compute_rmsd_matrix(), compute_rmsd_matrix_checked(), filter_diverse_conformers(), filter_diverse_conformers_checked(), ClusterResult
sci_form::mlcompute_ml_descriptors(), predict_ml_properties(), MolecularDescriptors, MlPropertyResult
sci_form::ml::whimcompute_whim(), WhimDescriptors, WhimWeighting (5 weighting schemes)
sci_form::ml::rdf_descriptorscompute_rdf(), RdfDescriptors (4 weighting types)
sci_form::ml::getawaycompute_getaway(), GetawayDescriptors
sci_form::ml::advanced_modelstrain_random_forest(), train_gradient_boosting(), RandomForest, GradientBoosting
sci_form::periodicbuild_periodic_molecule(), detect_hapticity(), PeriodicMolecule, HapticityAnalysis
sci_form::smirksparse_smirks(), apply_smirks(), SmirksTransform, SmirksResult
sci_form::gpu::mmff94_gpucompute_mmff94_nonbonded_gpu() (requires experimental-gpu feature)

Released under the MIT License.