openforcefield.topology.TopologyMolecule

class openforcefield.topology.TopologyMolecule(reference_molecule, topology, local_topology_to_reference_index=None)[source]

TopologyMolecules are built to be an efficient way to store large numbers of copies of the same molecule for parameterization and system preparation.

Warning

This API is experimental and subject to change.

Attributes
angles

Iterable of Tuple[TopologyAtom]: iterator over the angles in this Topology.

atom_start_topology_index

Get the topology index of the first atom in this TopologyMolecule

atoms

Return an iterator of all the TopologyAtoms in this TopologyMolecule

bond_start_topology_index

Get the topology index of the first bond in this TopologyMolecule

bonds

Return an iterator of all the TopologyBonds in this TopologyMolecule

impropers

Iterable of Tuple[TopologyAtom]: iterator over the improper torsions in this Topology.

n_angles

int: number of angles in this Topology.

n_atoms

The number of atoms in this topology.

n_bonds

Get the number of bonds in this TopologyMolecule

n_impropers

int: number of proper torsions in this Topology.

n_particles

Get the number of particles in this TopologyMolecule

n_propers

int: number of proper torsions in this Topology.

n_virtual_sites

Get the number of virtual sites in this TopologyMolecule

particles

Return an iterator of all the TopologyParticles in this TopologyMolecules

propers

Iterable of Tuple[TopologyAtom]: iterator over the proper torsions in this Topology.

reference_molecule

Get the reference molecule for this TopologyMolecule

topology

Get the topology that this TopologyMolecule belongs to

virtual_site_start_topology_index

Get the topology index of the first virtual site in this TopologyMolecule

virtual_sites

Return an iterator of all the TopologyVirtualSites in this TopologyMolecules

Methods

atom(index)

Get the TopologyAtom with a given topology atom index in this TopologyMolecule.

bond(index)

Get the TopologyBond with a given reference molecule index in this TopologyMolecule

from_dict(d)

Static constructor from dictionary representation.

particle(index)

Get the TopologyParticle with a given reference molecule index in this TopologyMolecule

to_dict()

Convert to dictionary representation.

virtual_site(index)

Get the TopologyVirtualSite with a given reference molecule index in this TopologyMolecule

__init__(reference_molecule, topology, local_topology_to_reference_index=None)[source]

Create a new TopologyMolecule.

Parameters
reference_moleculean openforcefield.topology.molecule.Molecule

The reference molecule, with details like formal charges, partial charges, bond orders, partial bond orders, and atomic symbols.

topologyan openforcefield.topology.Topology

The topology that this TopologyMolecule belongs to

local_topology_to_reference_indexdict, optional, default=None

Dictionary of {TopologyMolecule_atom_index : Molecule_atom_index} for the TopologyMolecule that will be built

Methods

__init__(reference_molecule, topology[, …])

Create a new TopologyMolecule.

atom(index)

Get the TopologyAtom with a given topology atom index in this TopologyMolecule.

bond(index)

Get the TopologyBond with a given reference molecule index in this TopologyMolecule

from_dict(d)

Static constructor from dictionary representation.

particle(index)

Get the TopologyParticle with a given reference molecule index in this TopologyMolecule

to_dict()

Convert to dictionary representation.

virtual_site(index)

Get the TopologyVirtualSite with a given reference molecule index in this TopologyMolecule

Attributes

angles

Iterable of Tuple[TopologyAtom]: iterator over the angles in this Topology.

atom_start_topology_index

Get the topology index of the first atom in this TopologyMolecule

atoms

Return an iterator of all the TopologyAtoms in this TopologyMolecule

bond_start_topology_index

Get the topology index of the first bond in this TopologyMolecule

bonds

Return an iterator of all the TopologyBonds in this TopologyMolecule

impropers

Iterable of Tuple[TopologyAtom]: iterator over the improper torsions in this Topology.

n_angles

int: number of angles in this Topology.

n_atoms

The number of atoms in this topology.

n_bonds

Get the number of bonds in this TopologyMolecule

n_impropers

int: number of proper torsions in this Topology.

n_particles

Get the number of particles in this TopologyMolecule

n_propers

int: number of proper torsions in this Topology.

n_virtual_sites

Get the number of virtual sites in this TopologyMolecule

particles

Return an iterator of all the TopologyParticles in this TopologyMolecules

propers

Iterable of Tuple[TopologyAtom]: iterator over the proper torsions in this Topology.

reference_molecule

Get the reference molecule for this TopologyMolecule

topology

Get the topology that this TopologyMolecule belongs to

virtual_site_start_topology_index

Get the topology index of the first virtual site in this TopologyMolecule

virtual_sites

Return an iterator of all the TopologyVirtualSites in this TopologyMolecules