Skip to content

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 in alpha-v2).

Equations ​

In Fourier space, for a one-component solvent,

h(k)=c(k)1−χ(k)c(k),

where h is the total correlation function, c the direct correlation function and χ the solvent susceptibility.

The Kovalenko–Hirata closure is

g(r)={exp⁡[d(r)],d≤0,1+d(r),d>0,d(r)=−βu(r)+h(r)−c(r),

and, with the indirect correlation t=h−c,

c(r)=g(r)−1−t(r).

The branch is chosen on the full exponent d, so attractive regions (−βu>0) are linearised; F107 checks the exact ideal-solvent limit χ=0⇒h=c, t=0, g=KH(−βu).

The solver iterates t (closure, then the Fourier-space OZ equation, then t=h−c) with Picard mixing. The inverse FFT is normalized by 1/(nx·ny·nz).

API ​

rust
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 ​

InputMeaning
solute_beta_potentialβu(r) on an nx × ny × nz grid
solvent_susceptibility_kχ(k) on the same grid
RismConfigGrid, 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)
IdealGasconstant ρ
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.

rust
use sci_form::rism::{RismSolventModel, solvent_susceptibility_k};

let chi = solvent_susceptibility_k(&config, RismSolventModel::Gaussian {
    correlation_length_angstrom: 3.0,
})?;

Output ​

FieldMeaning
g, h, cPair distribution, total and direct correlation arrays
residualMaximum `
iterationsPicard iterations
convergedTolerance reached
mean_g, max_gMean and contact-peak density
mean_interaction_energy_kcal_molMean solute–solvent interaction energy
shapeGrid dimensions

Validation ​

GateObservableResult
Ideal gasMean g1.0 ± 1e-8
Attractive soluteContact peakmax_g > 1
Non-cubic grid4 × 6 × 8 ideal gasruns
Ideal-gas χConstant densityconstant
Gaussian χDecay with kdecreasing
Interaction energyFinite for a test potentialfinite
Wrong array lengthGrid size mismatchrejected

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 ​

SurfaceEntry point
CLIsci-form rism '<beta-u-json>' '<susceptibility-json>' '<RismConfig-json>'
WASMsolve_3d_rism(beta_u, susceptibility, config_json)
Pythonsolve_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_mol is 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 ​

  1. Add a real solvent model (SPC/E, TIP3P) that generates χ(k).
  2. Add the excess chemical potential and hydration free energy.
  3. Add Ewald splitting for charged solutes.
  4. Add HNC and other closures.
  5. Add grid convergence and box-size tests.
  6. Benchmark against Amber/Placevent or a reference 3D-RISM code.

Released under the MIT License.