NVEVelocityVerlet

class NVEVelocityVerlet(initial_velocity=None, time_step=None)

Constructor for the NVE Velocity-Verlet integrator class.

Parameters:
kineticEnergy(configuration)
Parameters:configuration (DistributedConfiguration) – The current configuration to calculate the kinetic energy of.
Returns:The kinetic energy of the current configuration.
Return type:PhysicalQuantity of type energy
timeStep()
Returns:The time step.
Return type:PhysicalQuantity of type time

Usage Examples

Perform a micro-canonical molecular dynamics run of 10 steps on a water molecule, using the NVE Verlet Velocity MD method:

# Define elements
elements = [Oxygen, Hydrogen, Hydrogen]

# Define coordinates
cartesian_coordinates = [[0.0,  -1.70000000e-05,   1.20198000e-01],
                         [0.0,   7.59572000e-01,  -4.86714000e-01],
                         [0.0,  -7.59606000e-01,  -4.86721000e-01]]*Angstrom

# Set up configuration
molecule_configuration = MoleculeConfiguration(
    elements=elements,
    cartesian_coordinates=cartesian_coordinates
    )

# Define a calculator
molecule_configuration.setCalculator(LCAOCalculator())

# Perform MD
md_configuration = MolecularDynamics(molecule_configuration,
                                     method=NVEVelocityVerlet(),
                                     steps=10)

# Save the final configuration
nlsave('velocityverlet.nc', md_configuration)

nvevelocityverlet.py

Notes

Uses the Verlet algorithm to perform a micro-canonical, classical molecular-dynamics simulation, i.e. the energy of the system is constant during the simulation.