pymatgen.io.lammps.topology module

class Topology(atoms, bonds, angles, charges=None, dihedrals=None, imdihedrals=None)[source]

Bases: object

Parameters:
  • atoms (list) – map atom names to force field(ff) atom name, [[‘c’, ‘c1’],...]
  • bonds (list) – List of bonds, [[i,j, bond_type], ... ] where i, j are integer(starts from 1) atom ids in the molecules and bond_type = (ff atomname_i, ff atomname_j)
  • angles (list) – List of angles, [[i,j,k, angle_type], ... ], angle_type = (ff atomname_i, ff atomname_j, ff atomname_k)
  • charges (list) – List of charges, [0.4, 0.7, ... ]
  • dihedrals (list) – List of dihedrals, [[i,j,k,l, dihedral_type], ... ] dihedral_type = (ff atomname_i, ff atomname_j, ff atomname_k, ff atomname_l)
  • imdihedrals (list) – List of improper dihedrals, [[‘i,j,k,l, dihedral_type], ... ]
static from_molecule(molecule, tol=0.1, ff_map='ff_map')[source]

Return Topology object from molecule. Charges are also set if the molecule has ‘charge’ site property.

Parameters:
  • molecule (Molecule) –
  • tol (float) – Relative tolerance to test in determining the bonds in the molecule. Basically, the code checks if the distance between the sites is less than (1 + tol) * typical bond distances. Defaults to 0.1, i.e., 10% longer.
  • ff_map (string) – Ensure this site property is set for each site if atoms need to be mapped to its forcefield name. eg: Carbon atom, ‘C’, on different sites can be mapped to either ‘Ce’ or ‘Cm’ depending on how the forcefield parameters are set.
Returns:

Topology object