Constant Potential Method
Module: sci_form::cpm (core since 2026-10-13; beta::cpm re-export) Feature flag: none (core); beta-cpm/experimental-cpm kept as no-op aliases
Validation and limits
| Question | Answer |
|---|---|
| Compared with | LAMMPS fix electrode/conp |
| Measured separation | plate charge scale 1.76×; per-atom cosine similarity 0.44 |
| Confidence region | graphene bilayer, 3×3 cells, V = ±0.5/1/2 V, η = 1.979 |
| Main limitation | point-charge hardness 5 eV vs ~22 eV Gaussian self-energy; over-polarizes dense conductors |
The raw rows and the exact tolerances are in the full validation matrix.
Overview
Extends charge and electronic property calculations by coupling the molecule to a "virtual electrode" at electrochemical potential
Theory
Grand Potential
The grand potential functional couples electronic energy with the electrode potential:
Minimizing with respect to charges
Charge Equilibration at Fixed
The CPM equations are linear:
with Coulomb interaction:
The solver inverts electrode/conp likewise inverts the elastance matrix (mat_inv).
Multi-Electrode Setups
CpmConfig::mu_per_atom (optional, None = uniform mu_ev) assigns one applied potential per atom — e.g. plate A at fix electrode/conp ... couple. The grand potential generalizes to
Electrochemical Energy Surface
Scanning
computed via finite differences over the
API
use sci_form::cpm::*;
// CPM charges at a given potential
let config = CpmConfig {
mu_ev: -4.44, // SHE reference (eV)
dielectric: 78.5, // water
max_iter: 100,
charge_tol: 1e-6,
mu_per_atom: None, // Some(vec) for multi-electrode setups
};
let result = compute_cpm_charges(&elements, &positions, &config);
// result.charges: Vec<f64>
// result.total_charge: f64
// result.grand_potential: f64
// result.converged: bool
// result.iterations: usize
// Electrochemical surface scan
let surface = compute_cpm_surface(&elements, &positions, mu_min, mu_max, n_points, dielectric);
// surface.mu_values: Vec<f64>
// surface.total_charge: Vec<f64>
// surface.free_energy: Vec<f64>
// surface.capacitance: Vec<f64>Potential Scale
| Reference | |
|---|---|
| SHE (Standard Hydrogen Electrode) | |
| +1 V vs SHE | |
| -1 V vs SHE | |
| Typical scan range |
Applications
- Quantum capacitance of molecular electrodes
- Redox potential estimation:
- Conformer ranking under electrochemical bias
- Charge response analysis for molecular electronics
Tests
cargo test --features beta-cpm --test experimental_gates -- test_cpm9 integration tests (tests/experimental/test_cpm.rs) covering: charge equilibration convergence, total charge response to potential, monotonic charge-potential relationship, grand potential computation, capacitance positivity, electrochemical surface scanning, solvent dielectric effects, multi-element systems, and the LAMMPS bilayer comparison.
These tests live in the experimental_gates target — see Overview for the full command matrix.
Validation vs LAMMPS (F95, 2026-10-13)
Oracle scripts/validation/oracle_cpm_lammps.py + fixture tests/fixtures/validation/cpm_lammps.json + gate test_cpm_bilayer_matches_lammps: graphene bilayer capacitor (two 3×3-cell flakes, AB @ 3.35 Å) at V = ±0.5/1/2 V vs LAMMPS fix electrode/conp (
Model gap (documented): our point-charge hardness (
LAMMPS recipe notes: atom_modify map yes, kspace_modify gewald for uncharged starts, pair_coeff after read_data, two plates with couple (a lone electrode group stays neutral), charges solve while stepping (run 1), dump per-atom q.