Molecule and atom types#

These APIs describe the basic molecular data structures used throughout GauXC. The GauXC::Molecule type is a lightweight container of GauXC::Atom instances, providing methods for handling a collection of atoms.

class Molecule : public std::vector<Atom>#

A class to represent a collection of atoms in a molecule.

Public Functions

template<typename ...Args, typename = std::enable_if_t<can_construct_base_v<Args...>>>
inline Molecule(Args&&... args)#

Construct a molecule from any arguments accepted by std::vector<Atom>.

Template Parameters:

Args – Arguments forwarded to the base vector constructor.

Molecule(const Molecule&) = default#

Default copy constructor.

Molecule(Molecule&&) noexcept = default#

Default move constructor.

Molecule &operator=(const Molecule &other) = default#

Default copy assignment.

inline size_t natoms() const#

Get the number of atoms in the molecule.

Returns:

The number of atoms stored in the molecule.

inline AtomicNumber maxZ() const#

Get the maximum atomic number / nuclear charge in the molecule.

Warning

Undefined behavior if the molecule is empty.

Returns:

The largest atomic number among all atoms in the molecule.

inline bool operator==(const Molecule &other)#

Compare two molecules for equality.

Checks if all atoms are equal in properties and order.

Parameters:

otherMolecule to compare against.

Returns:

True if all atoms are equal and in the same order.

struct Atom#

A struct to represent the state of an atom (charge and spacial location)

Public Functions

Atom() = default#

Construct an Atom object with default state.

inline Atom(AtomicNumber _Z, double _x, double _y, double _z)#

Construct an Atom object with a specified state.

Parameters:
  • _Z[in] Atomic number

  • _x[in] X coordinate (bohr)

  • _y[in] Y coordinate (bohr)

  • _z[in] Z coordinate (bohr)

Public Members

AtomicNumber Z#

Atomic number.

double x#

X coordinate (bohr)

double y#

Y coordinate (bohr)

double z#

Z coordinate (bohr)