# openforcefield.topology.TopologyMolecule

class `openforcefield.topology.``TopologyMolecule`(reference_molecule, topology, local_topology_to_reference_index=None)

  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

    `particle_start_topology_index`

      Get the topology index of the first particle 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`(self, index) | Get the TopologyAtom with a given topology atom index in this TopologyMolecule.
  `bond`(self, index) | Get the TopologyBond with a given reference molecule index in this TopologyMolecule
  `from_dict`(d) | Static constructor from dictionary representation.
  `particle`(self, index) | Get the TopologyParticle with a given reference molecule index in this TopologyMolecule
  `to_dict`(self) | Convert to dictionary representation.
  `virtual_site`(self, index) | Get the TopologyVirtualSite with a given reference molecule index in this TopologyMolecule

  `__init__`(self, reference_molecule, topology, local_topology_to_reference_index=None)

    Create a new TopologyMolecule.

    Parameters
      reference_molecule an openforcefield.topology.molecule.Molecule

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

      topology an openforcefield.topology.Topology

        The topology that this TopologyMolecule belongs to

      local_topology_to_reference_index dict, optional, default=None

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

  Methods

  `__init__`(self, reference_molecule, topology) | Create a new TopologyMolecule.
  `atom`(self, index) | Get the TopologyAtom with a given topology atom index in this TopologyMolecule.
  `bond`(self, index) | Get the TopologyBond with a given reference molecule index in this TopologyMolecule
  `from_dict`(d) | Static constructor from dictionary representation.
  `particle`(self, index) | Get the TopologyParticle with a given reference molecule index in this TopologyMolecule
  `to_dict`(self) | Convert to dictionary representation.
  `virtual_site`(self, 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
  `particle_start_topology_index` | Get the topology index of the first particle 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

  property `topology`

    Get the topology that this TopologyMolecule belongs to

    Returns
      an openforcefield.topology.Topology
  property `reference_molecule`

    Get the reference molecule for this TopologyMolecule

    Returns
      an openforcefield.topology.molecule.Molecule
  property `n_atoms`

    The number of atoms in this topology.

    Returns
      int
  `atom`(self, index)

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

    Parameters
      index int

        Index of the TopologyAtom within this TopologyMolecule to retrieve

    Returns
      an openforcefield.topology.TopologyAtom
  property `atoms`

    Return an iterator of all the TopologyAtoms in this TopologyMolecule

    Returns
      an iterator of openforcefield.topology.TopologyAtoms
  property `atom_start_topology_index`

    Get the topology index of the first atom in this TopologyMolecule

  `bond`(self, index)

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

    Parameters
      index int

        Index of the TopologyBond within this TopologyMolecule to retrieve

    Returns
      an openforcefield.topology.TopologyBond
  property `bonds`

    Return an iterator of all the TopologyBonds in this TopologyMolecule

    Returns
      an iterator of openforcefield.topology.TopologyBonds
  property `n_bonds`

    Get the number of bonds in this TopologyMolecule

    Returns
      int number of bonds
  property `bond_start_topology_index`

    Get the topology index of the first bond in this TopologyMolecule

  `particle`(self, index)

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

    Parameters
      index int

        Index of the TopologyParticle within this TopologyMolecule to retrieve

    Returns
      an openforcefield.topology.TopologyParticle
  property `particles`

    Return an iterator of all the TopologyParticles in this TopologyMolecules

    Returns
      an iterator of openforcefield.topology.TopologyParticle
  property `n_particles`

    Get the number of particles in this TopologyMolecule

    Returns
      int The number of particles
  property `particle_start_topology_index`

    Get the topology index of the first particle in this TopologyMolecule.

  `virtual_site`(self, index)

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

    Parameters
      index int

        Index of the TopologyVirtualSite within this TopologyMolecule to retrieve

    Returns
      an openforcefield.topology.TopologyVirtualSite
  property `virtual_sites`

    Return an iterator of all the TopologyVirtualSites in this TopologyMolecules

    Returns
      an iterator of openforcefield.topology.TopologyVirtualSite
  property `n_virtual_sites`

    Get the number of virtual sites in this TopologyMolecule

    Returns
      int
  property `angles`

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

  property `n_angles`

    int: number of angles in this Topology.

  property `propers`

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

  property `n_propers`

    int: number of proper torsions in this Topology.

  property `impropers`

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

  property `n_impropers`

    int: number of proper torsions in this Topology.

  property `virtual_site_start_topology_index`

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

  `to_dict`(self)

    Convert to dictionary representation.

  classmethod `from_dict`(d)

    Static constructor from dictionary representation.