Molecule

Molecule is a class that defines a number of attributes of a molecule.

Class Function List

class Molecule
Molecule(key1, value1, key2, value2, ...)

Constructor for Molecule using (key, value) pairs. Each key is a string, is followed by a constant (integer, float, string) In most cases, the values of the following keys need to be set supercell, atoms, alist, xyzlist, ecutwfc. We recommend setting the value of the name key also. A typical example of the constructor can be found in Setup Molecule.

set(mol, key1, value1, key2, value2, ...)

Setting the attributes of a Molecule object :attr:mol using (key,value) pairs specified in the arguments.

get(mol, key, value)

Retrive an attribute of a Molecule object :attr:mol associated with a key.

finalize(mol)

Reset all attributes of a Molecule object when some of the attributes have been reset.

Examples

The following commands construct a hydrogen molecule

>> a = Atom('H');

>> atomlist = [a a]; % atoms in the molecule

>> C = 10*eye(3); % the supercell that contains the molecule

>> xyzlist = [1.5 0.0 0.0; 0.0 0.0 0.0]; % atom positions

>> mol = Molecule('supercell',C, 'atomlist',atomlist, 'xyzlist' ,xyzlist, ...
        'ecutwfc',100.0, 'name','h2' )

Class Attribute List

class Molecule
name

A string that specifies the name of a molecule.

supercell

A 3x3 array that contains the Bravais lattice vectors used to specify a supercell containing the Molecule.

alist

An array that contains a list of atoms (object)

xyzlist

An array that contains the x,y,z coordinates for each atom in the alist.

ecutwfc

A floating point number that specifies the kinetic energy cutoff used in the planewave expansion.

ecutrho

A floating point number that specifies the energy cutoff used in the computation of the Hartree potential. If this attribute is not set, it is set to 4*ecutwfc by default.

n1

The number of grid points in the x direction. This is calculated by treating Ecut as the Nyquist sampling frequency.

\[n_1 = \frac{2E_{cut}}{2\pi/L_1}=\frac{E_{cut}\times L_1}{\pi},\]

where \(L_1\) is the unit cell size along the x direction.

n2

The number of grid points in the y direction. This is calculated by treating Ecut as the Nyquist sampling frequency.

\[n_2 = \frac{2E_{cut}}{2\pi/L_2}=\frac{E_{cut}\times L_2}{\pi}\]

where \(L_2\) is the unit cell size along the y direction.

n3

The number of grid points in the z direction. This is calculated by treating Ecut as the Nyquist sampling frequency.

\[n_3 = \frac{2E_{cut}}{2\pi/L_3}=\frac{E_{cut}\times L_3}{\pi}\]

where \(L_3\) is the unit cell size along the z direction.

gridwfc
gridrho
vext
nspin

An integer that specifies spin type ( 1 = spin unpolarized, 2 = spin polarized)

temperature

A floating point number that specifies the temperature (in Calvin) used in a finite temperature SCF calculation.

natoms

An integer that gives the number of atoms.

vol

A floating point number that gives the volume of the supercell

nel

An integer that gives the number of electrons (spin polarized) or electron pairs (spin unpolarized)