3D-RISM solver core
The v2.x solvation prototype implements the numerical core of the three-dimensional reference interaction site model (3D-RISM): a periodic-grid Ornstein–Zernike solver with the Kovalenko–Hirata closure and a 3D FFT. The solute–solvent potential and the solvent susceptibility are caller-supplied.
Status. The solver core, two simple susceptibility models and the mean interaction energy are implemented and exposed on the Rust, Python, WASM and CLI surfaces. A real solvent parameterisation, the excess chemical potential and a hydration-free-energy benchmark are follow-ups. See the v2.x roadmap.
Feature.
alpha-rism(included inalpha-v2).
Equations
In Fourier space, for a one-component solvent,
where h is the total correlation function, c the direct correlation function and χ the solvent susceptibility.
The Kovalenko–Hirata closure is
and, with the indirect correlation
The branch is chosen on the full exponent
The solver iterates 1/(nx·ny·nz).
API
use sci_form::rism::{RismConfig, solve_3d_rism};
let config = RismConfig::default();
let n = config.nx * config.ny * config.nz;
let beta_u = vec![0.0; n]; // solute-solvent potential
let chi_k = vec![config.bulk_density_angstrom3; n]; // ideal-gas susceptibility
let result = solve_3d_rism(&beta_u, &chi_k, &config)?;
println!("converged={} mean_g={:.4} max_g={:.4}",
result.converged, result.mean_g, result.max_g);Inputs
| Input | Meaning |
|---|---|
solute_beta_potential | βu(r) on an nx × ny × nz grid |
solvent_susceptibility_k | χ(k) on the same grid |
RismConfig | Grid, box, temperature, density, mixing, tolerance |
For an ideal-gas solvent, use a constant χ = ρ_bulk on every k point. A real solvent model must supply the Fourier-space susceptibility from its solvent correlation functions.
Solvent models
solvent_susceptibility_k provides two test models:
| Model | χ(k) |
|---|---|
IdealGas | constant ρ |
Gaussian { correlation_length_angstrom } | ρ exp(-k²ξ²/2) |
The Gaussian model is a numerical response for tests, not a parameterisation of water. A real SPC/E/TIP3P model must compute χ(k) from its solvent correlation functions.
use sci_form::rism::{RismSolventModel, solvent_susceptibility_k};
let chi = solvent_susceptibility_k(&config, RismSolventModel::Gaussian {
correlation_length_angstrom: 3.0,
})?;Output
| Field | Meaning |
|---|---|
g, h, c | Pair distribution, total and direct correlation arrays |
residual | Maximum ` |
iterations | Picard iterations |
converged | Tolerance reached |
mean_g, max_g | Mean and contact-peak density |
mean_interaction_energy_kcal_mol | Mean solute–solvent interaction energy |
shape | Grid dimensions |
Validation
| Gate | Observable | Result |
|---|---|---|
| Ideal gas | Mean g | 1.0 ± 1e-8 |
| Attractive solute | Contact peak | max_g > 1 |
| Non-cubic grid | 4 × 6 × 8 ideal gas | runs |
| Ideal-gas χ | Constant density | constant |
| Gaussian χ | Decay with k | decreasing |
| Interaction energy | Finite for a test potential | finite |
| Wrong array length | Grid size mismatch | rejected |
Invalid input is reported as an input error: Python raises ValueError for grid dimensions below 2, non-positive box/temperature/max iterations/tolerance, mixing outside (0,1], negative density, non-finite arrays and nx*ny*nz size mismatches. WASM returns {"error": "..."}.
These are solver-core tests. A solvent-model test and a hydration free-energy comparison are still required.
Bindings
| Surface | Entry point |
|---|---|
| CLI | sci-form rism '<beta-u-json>' '<susceptibility-json>' '<RismConfig-json>' |
| WASM | solve_3d_rism(beta_u, susceptibility, config_json) |
| Python | solve_3d_rism(beta_u, susceptibility, config_json) |
The grid arrays are row-major nx × ny × nz JSON arrays.
Limitations
- No real solvent force field is bundled; the ideal-gas and Gaussian models are test responses, not water.
mean_interaction_energy_kcal_molis an interaction energy, not the excess chemical potential or a solvation free energy.- No excess chemical potential or hydration free energy yet.
- No long-range charge treatment or Ewald split; the solver assumes a supplied periodic susceptibility.
- The FFT is a simple pure-Rust 3D transform; grid sizes are not optimized for large boxes.
- The KH closure only; HNC and other closures are follow-ups.
- No solute-site decomposition or spatial distribution output beyond
g. - No experimental or reference-code benchmark.
Next steps
- Add a real solvent model (SPC/E, TIP3P) that generates
χ(k). - Add the excess chemical potential and hydration free energy.
- Add Ewald splitting for charged solutes.
- Add HNC and other closures.
- Add grid convergence and box-size tests.
- Benchmark against Amber/Placevent or a reference 3D-RISM code.