API Reference

This page provides the API documentation for the core components of synth-dynamics.

System

class synth_dynamics.System(pdb_path: str)[source]

Bases: object

property positions: ndarray

ForceField

class synth_dynamics.ANMForceField(equilibrium_coords: ndarray, cutoff: float = 15.0, spring_constant: float = 1.0)[source]

Bases: object

compute_forces(current_coords: ndarray) ndarray[source]

Computes the harmonic forces on each atom.

Parameters:

current_coords – (N, 3) array of current positions.

Returns:

(N, 3) array of forces.

Return type:

forces

Integrator

class synth_dynamics.LangevinIntegrator(dt: float = 0.1, temperature: float = 300.0, friction: float = 1.0)[source]

Bases: object

step(positions: ndarray, forces: ndarray) ndarray[source]

Performs a single integration step.

x(t+dt) = x(t) + (dt/gamma) * F + sqrt(2 * kb * T * dt / gamma) * R

Parameters:
  • positions – (N, 3) array of current positions.

  • forces – (N, 3) array of current forces.

Returns:

(N, 3) array of updated positions.

Return type:

new_positions

Simulation

class synth_dynamics.Simulation(system: System, forcefield: ANMForceField, integrator: LangevinIntegrator)[source]

Bases: object

run(n_steps: int, output_path: str, stride: int = 10) None[source]

Runs the simulation and saves the trajectory.

Parameters:
  • n_steps – Total number of integration steps.

  • output_path – Path to save the trajectory (e.g., .dcd or .pdb).

  • stride – Frequency of saving frames.