bfgs_step

torch_sim.optimizers.bfgs.bfgs_step(state, model)[source]

Perform one BFGS optimization step.

Updates the Hessian estimate and moves atoms. If state is a CellBFGSState, forces are transformed using the deformation gradient to work in the same scaled coordinate space as ASE’s cell filters (matching FIRE’s approach).

For cell optimization, prev_positions are stored as fractional coordinates and prev_forces as scaled forces, exactly matching ASE’s pos0/forces0.

Shape notation:

N = total atoms across all systems (n_atoms) S = number of systems (n_systems) M = max atoms per system (max_atoms) D = 3*M (position DOFs) D_ext = 3*M + 9 (extended DOFs with cell)

Parameters:
Returns:

Updated state

Return type:

BFGSState | CellBFGSState