Building molecules

Molecules can be built either directly using the Molecule class or via a MoleculeBuilder convenience routine. The Molecule and MoleculeBuilder classes are not implemented in PyDFT but are obtained from the PyQInt module.

Molecule class

To manually build a molecule, one first need to construct a Molecule object after which one or more atoms can be assigned to the molecule. If no unit is specified, it is assumed that all coordinates are given in atomic units (i.e. Bohr units).

1from pyqint import Molecule
2
3mol = Molecule('co')
4mol.add_atom('C', 0.0, 0.0, 0.0, unit='angstrom')
5mol.add_atom('O', 0.0, 0.0, 1.2, unit='angstrom')

MoleculeBuilder class

Alternatively, a Molecule can be constructed from the MoleculeBuilder class which uses a name. For more information about the MoleculeBuilder class, please consult the PyQInt documentation on the MoleculeBuilder class.

1from pyqint import MoleculeBuilder
2
3co = MoleculeBuilder().from_name("CO")