Constructor for the Forces object.
Configuration with a calculator that supports forces calculations
Type: A MoleculeConfiguration and BulkConfiguration
Default:
None
A Forces object provides the following methods:
evaluate(): For a system consisting of N atoms, return an N by 3 matrix where the i'th row
corresponds to the forces on i'th atom. Each matrix entry is a physical quantity object.
nlprint(stream): Print a formatted string with the forces.
stress(): For a system consisting of N atoms, return an N by 3 matrix where the i'th row
corresponds to the forces on i'th atom. Each matrix entry is a physical quantity object.
Calculate and print the forces on a water molecule
# 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 a calculator
molecule_configuration.setCalculator(LCAOCalculator())
# calculate and print the forces
forces = Forces(molecule_configuration)
forces.nlprint()