Skip to main content
← OpenMECP Documentation

drive_coordinate

Function drive_coordinate 

Source
pub fn drive_coordinate(
    initial_geom: &Geometry,
    drive_coord: &DriveCoordinate,
    start_value: f64,
    end_value: f64,
    num_steps: usize,
) -> Vec<Geometry>
Expand description

Generates a series of geometries by systematically driving a coordinate from start to end value.

This function implements the coordinate driving method, which is fundamental in computational chemistry for exploring reaction paths and potential energy surfaces. It creates a series of molecular geometries where a chosen reaction coordinate is systematically varied while all other degrees of freedom are optimized.

§Theoretical Background

Coordinate driving solves a series of constrained optimization problems:

For each target value t_i:
  minimize E(x) subject to g(x) = t_i

where:

  • E(x) is the molecular energy
  • g(x) is the reaction coordinate function
  • t_i are intermediate target values from start_value to end_value
  • x represents all atomic coordinates

§Algorithm Overview

  1. Discretization: Divide the coordinate range into num_steps equal intervals
  2. Sequential Optimization: For each target value:
    • Create a constraint with the current target value
    • Perform constrained optimization starting from the previous geometry
    • Store the optimized geometry
  3. Path Construction: Return the series of optimized geometries

§Mathematical Details

The step size is calculated as:

Δt = (end_value - start_value) / (num_steps - 1)

Target values are:

t_i = start_value + i × Δt  for i = 0, 1, ..., num_steps-1

§Arguments

  • initial_geom - Starting molecular geometry (reactant structure)
  • drive_coord - Specification of the coordinate to drive (bond, angle, or dihedral)
  • start_value - Initial value of the reaction coordinate
  • end_value - Final value of the reaction coordinate
  • num_steps - Number of intermediate points to generate (including endpoints)

§Returns

Returns a Vec<Geometry> containing num_steps optimized geometries representing the reaction path. The first geometry corresponds to start_value and the last to end_value.

§Applications

  • Reaction Path Generation: Create initial guess for transition state searches
  • Barrier Height Estimation: Calculate approximate activation energies
  • Mechanism Elucidation: Understand how molecular structure changes during reaction
  • Conformational Analysis: Explore conformational transitions

§Examples

use omecp::reaction_path::{drive_coordinate, DriveCoordinate, CoordinateType};

// Drive a C-H bond from 1.1 Angstrom to 3.0 Angstrom in 20 steps
let bond_coord = DriveCoordinate::new(
    CoordinateType::Bond,
    vec![0, 1],  // Carbon-Hydrogen bond
    3.0          // Final target (not used in this function)
);

let path = drive_coordinate(
    &initial_geometry,
    &bond_coord,
    1.1,    // Start: typical C-H bond length
    3.0,    // End: dissociated state
    20      // 20 intermediate geometries
);

println!("Generated {} geometries along the dissociation path", path.len());

§Performance Considerations

  • Convergence: Each constrained optimization may require 10-50 iterations
  • Step Size: Smaller steps (more points) give smoother paths but cost more
  • Starting Guess: Each optimization starts from the previous optimized geometry
  • Constraint Stiffness: Tight constraints may require more iterations

§Limitations

  • Single Coordinate: Only one coordinate can be driven at a time
  • Local Minima: May get trapped in local minima along the path
  • Constraint Satisfaction: Assumes constraints can be satisfied at all points
  • No Energy Information: Does not consider energy barriers during driving