Change Log#
Version 0.4.0#
Added#
Full Torch Ewald/PME APIs support energy-derived forces, charge gradients, and strain-first virials, including second-order force/stress losses.
Full JAX Ewald/PME energy-only calls support first-order gradients for positions, charges, and row-vector displacement virials. JAX PME reciprocal higher-order support is limited to tested position and charge scalar losses; PME cell/stress/strain higher-order derivatives remain unsupported.
2D slab correction is exposed through
compute_slab_correctionand the high-level Ewald/PMEslab_correction=keyword in Torch and JAX.Higher-order multipole electrostatics for charges, dipoles, and quadrupoles (
l = 0, 1, 2) are available through Torch/Warp direct-k Ewald, PME, feature extraction, and SCF cache/step APIs.Differentiable segment operations are available through
nvalchemiops.torch.segment_opsandnvalchemiops.jax.segment_ops.Neighbor-list APIs now include inline
pair_fnpotentials, optional per-pair vectors/distances, a cluster-pair tile strategy, partial rebuild flags, and public strategy cost/suggestion helpers.compute_bspline_moduli_1dis exported from the top-level Torch and JAX electrostatics namespaces for PME precompute workflows.
Changed#
Direct-output flags on full Ewald/PME APIs remain functional but are deprecated for differentiable training. Use energy-only calls plus framework autograd for forces, charge gradients, and virials in training workflows.
neighbor_list(method=None)now uses a geometry cost model and can select fine-grained strategies such asnaive_tile,cell_list_pair_centric, andcluster_tilewhen eligible.The
nvalchemiops.neighborspackage was restructured into per-strategy subpackages (naive/,cell_list/,cluster_tile/,rebuild/). Flat compatibility modules continue to re-export withDeprecationWarning.DFT-D3 dispersion kernels were optimized for improved performance.
PyTorch version requirements were loosened and CUDA backend extras were updated for CUDA 12/13 install workflows.
The minimum
warp-langrequirement is now>= 1.13.
Fixed#
Fixed an issue with JAX
naivePBC pair-output paths that dropped non-zero periodic images. The JAXnaive_neighbor_listpair-output path (return_distances/return_vectors, and nowpair_fn) launched its periodic kernel with the shift axis pinned to 1, so whencutoffexceeded half the cell width (R>1) every non-zero periodic image was silently dropped — yielding too few neighbors and incorrect per-pair distances/vectors/forces relative to the PyTorch binding. The launch now enumerates all shifts (max_shifts), matching PyTorch and the analytic neighbor set in the multi-image regime. The single-cutoffcutoff < half-cell(R==1) case is unchanged.Fixed an issue with JAX per-pair distance/vector higher-order gradients. The JAX neighbor-list autograd returned the detached Warp-kernel distances/vectors and re-attached only a first-order gradient via a
custom_vjp, so the Hessian / Hessian-vector-product was incorrect (~45% off) whenever the downstream loss was nonlinear in the returned distances (e.g.(distances**2).sum()); first-order gradients (forces) were unaffected. The geometry is now reconstructed as a live, differentiable pure-JAX function of positions/cell, so gradients of all orders are exact (matching PyTorch and the analytic Hessian). Affects all JAXreturn_distances/return_vectorsbindings (naive,cell_list,cluster_tile, batched).Fixed DFT-D3 forces and virials with S5 smoothing. When smoothing was active, the CN-chain
dE/dCNused the unswitched pair energy, so CN-chain forces and virials did not exactly match the gradient of the switched energy. Only runs with S5 smoothing enabled were affected; the default (smoothing disabled) was already correct and is unchanged.Naive PBC neighbor wrapping now leaves non-periodic axes unwrapped when per-axis
pbcflags are supplied.Fixed Torch Ewald gradients for non-uniform per-atom energy cotangents.
JAX electrostatics no longer imports the removed
jax.custom_transpose; transpose rules use stablejax.custom_vjppaths.FIRE2 variable-cell updates now advance positions and cell degrees of freedom consistently during constrained/variable-cell relaxation.
Neighbor-list launchers now reject unbatched methods when batch metadata is supplied.
MTK NPT/NPH cell propagation, velocity half-step coupling, and barostat half-step thermostat coupling now match the intended strain-rate formulation.
JAX
naivePBC pair-output paths enumerate all periodic images in the multi-image regime.JAX per-pair distance/vector outputs are reconstructed as live differentiable geometry, fixing higher-order gradients for nonlinear distance losses.
Deprecated and Removed#
compute_forces,compute_virial,compute_charge_gradients, andhybrid_forcesdirect-output flags on full Ewald/PME APIs are deprecated for differentiable training.nvalchemiops.neighbors.zero_arrayis deprecated; callarray.zero_()directly.cells_invandvolumesdynamics arguments listed inCHANGELOG.mdare deprecated.cell_velocitiesnow stores the strain rateε̇ = p_g/W, notḣ = dh/dt.npt_barostat_half_step{,_aniso,_triclinic}drop theeta_dotsargument.The internal
make_outer_neigh_offsetshelper was removed.
Version 0.3.0#
Breaking Changes#
PyTorch is now an optional dependency: Core codebase consists of framework-agnostic
warp-langkernels with PyTorch bindings in separate namespace (nvalchemiops.torch.*). You can install the minimum supported version of PyTorch viauv pip install nvalchemiops[torch].Naive PBC cached metadata changed: public Torch and JAX naive neighbor-list workflows now cache
shift_range_per_dimension,num_shifts_per_system, andmax_shifts_per_system.shift_offsetandtotal_shiftsare no longer part of the public API for cached naive-PBC inputs.
Migration Guide#
Tip
If PyTorch is detected in the environment, existing imports will continue to work for the next few minor version increments, but will emit warnings to remind users to update import paths (shown below).
Core modules comprise the pure
warp-langkernels and launchers.PyTorch neighbor lists: Change
nvalchemiops.neighborlist.neighbor_listtonvalchemiops.torch.neighbors.neighbor_listDFT-D3: Change
from nvalchemiops.interactions.dispersion import dftd3tofrom nvalchemiops.torch.interactions.dispersion import dftd3Coulomb: Change
from nvalchemiops.interactions.electrostatics import coulomb_energytofrom nvalchemiops.torch.interactions.electrostatics import coulomb_energyEwald: Change
from nvalchemiops.interactions.electrostatics import ewald_summationtofrom nvalchemiops.torch.interactions.electrostatics import ewald_summationPME: Change
from nvalchemiops.interactions.electrostatics import particle_mesh_ewaldtofrom nvalchemiops.torch.interactions.electrostatics import particle_mesh_ewaldUtility functions:
estimate_cell_list_sizesandestimate_batch_cell_list_sizesare now imported directly fromnvalchemiops.torch.neighbors(previouslynvalchemiops.neighborlist.neighbor_utils)
Version 0.2.0#
Bug fixes associated with neighbor list computation.
Added electrostatics interface.
Version 0.1.0#
Initial public beta release of
nvalchemiops.