metafalcon.interfaces package

Submodules

metafalcon.interfaces.dftbaby module

Contains a class for DFTB calculations using DFTBaby.

class metafalcon.interfaces.dftbaby.iface_dftbaby(symbols, coords, **kwargs)[source]

Bases: metafalcon.interfaces.iface.iface

Interface to DFTBaby for DFTB calculations, inherits from metafalcon.interfaces.iface.iface.

Parameters:
  • symbols (list of str) – atomic symbols of the molecule
  • coords (np.2darray (shape: (N, 3))) – atomic xyz-coordinates of the molecule (bohr)
  • **kwargs – See below
Keyword Arguments:
 

charge (int) – atomic charge

Variables:
  • symbols (list of str) – atomic symbols of the molecule
  • coords (np.2darray (shape: (N, 3))) – atomic xyz-coordinates of the molecule (bohr)
  • energy (float) – electronic energy of the molecule calculated most recently (hartrees)
  • gradient (np.2darray (shape: (N, 3))) – electronic energy gradient of the molecule with current coordinates (hartree/bohr)
  • charge (int) – atomic charge
  • dftbpes (DFTB.PES.PotentialEnergySurfaces) – DFTBaby PotentialEnergySurfaces object for the calculation of energies and gradients

See also

iface.set_symbols, iface.set_coords, iface.get_energy, iface.get_gradient

calculate()[source]

Calculate energies and gradients for the current set of coordinates.

metafalcon.interfaces.dftbplus module

Contains a class for semiempirical calculations using Mopac.

class metafalcon.interfaces.dftbplus.iface_dftbplus(symbols, coords, **kwargs)[source]

Bases: metafalcon.interfaces.iface.iface

Interface to DFTB+ for semiempirical tight-bindind DFT calculations, inherits from metafalcon.interfaces.iface.iface.

Parameters:
  • symbols (list of str) – atomic symbols of the molecule
  • coords (np.2darray (shape: (N, 3))) – atomic xyz-coordinates of the molecule (bohr)
  • **kwargs – See below
Variables:
  • symbols (list of str) – atomic symbols of the molecule
  • coords (np.2darray (shape: (N, 3))) – atomic xyz-coordinates of the molecule (bohr)
  • energy (float) – electronic energy of the molecule calculated most recently (hartrees)
  • gradient (np.2darray (shape: (N, 3))) – electronic energy gradient of the molecule with current coordinates (hartree/bohr)

See also

iface.set_symbols, iface.set_coords, iface.get_energy, iface.get_gradient

initialCalculation()[source]

Calulates everything the first time from the scratch to construct partial charges as an initial guess for the next steps

calculate()[source]

Calculate energies and gradients for the current set of coordinates.

metafalcon.interfaces.gaussian module

Contains a class for DFT, AM1 or CASSCF calculations using Gaussian09.

class metafalcon.interfaces.gaussian.iface_gaussian(symbols, coords, **kwargs)[source]

Bases: metafalcon.interfaces.iface.iface

Interface to Gaussian09 for DFT, AM1 or CASSCF calculations, inherits from metafalcon.interfaces.iface.iface.

Parameters:
  • symbols (list of str) – atomic symbols of the molecule
  • coords (np.2darray (shape: (N, 3))) – atomic xyz-coordinates of the molecule (bohr)
  • **kwargs – See below
Keyword Arguments:
 

none

Variables:
  • symbols (list of str) – atomic symbols of the molecule
  • coords (np.2darray (shape: (N, 3))) – atomic xyz-coordinates of the molecule (bohr)
  • energy (float) – electronic energy of the molecule calculated most recently (hartrees)
  • gradient (np.2darray (shape: (N, 3))) – electronic energy gradient of the molecule with current coordinates (hartree/bohr)
  • head (list of str) – lines to be used as head for the g09 inputfile
  • tail (list of str) – lines to be used as tail for the g09 inputfile
  • head1 (list of str) – lines to be used as head for the optional excited state g09 inputfile
  • tail1 (list of str) – lines to be used as tail for the optional excited state g09 inputfile
  • cas (bool) – whether to do CASSCF calculation

See also

iface.set_symbols, iface.set_coords, iface.get_energy, iface.get_gradient

append_to_head(task)[source]
calculate()[source]

Calculate energies and gradients for the current set of coordinates.

metafalcon.interfaces.gaussian.run_g09(path='.')[source]

Execute Gaussian09 in order to get outputfile out from inputfile inp.

Parameters:path (str) – path to the calculation directory to be used (default: .)

metafalcon.interfaces.iface module

Contains a general class for interfacing with quantum chemistry codes.

class metafalcon.interfaces.iface.iface(symbols, coords)[source]

Parent class for interfaces to quantum chemistry codes.

Parameters:
  • symbols (list of str) – atomic symbols of the molecule
  • coords (np.2darray (shape: (N, 3))) – atomic xyz-coordinates of the molecule (bohr)
Variables:
  • symbols (list of str) – atomic symbols of the molecule
  • coords (np.2darray (shape: (N, 3))) – atomic xyz-coordinates of the molecule (bohr)
  • energy (float) – electronic energy of the molecule calculated most recently (hartrees)
  • gradient (np.2darray (shape: (N, 3))) – electronic energy gradient of the molecule with current coordinates (hartree/bohr)
  • converged (bool) – whether the calculation has converged
set_symbols(symbols)[source]

Set symbols attribute of an iface object.

Parameters:symbols (list of str) – atomic symbols of the molecule
set_coords(coords)[source]

Set coordinates attribute of an iface object.

Parameters:coords (np.2darray (shape: (N, 3))) – atomic xyz-coordinates of the molecule (bohr)
get_energy()[source]

Return the energy calculated by the QM-code.

Returns:energy – electronic ground state energy of the molecule calculated most recently (hartrees)
Return type:float
get_gradient()[source]

Return the energy gradient calculated by the QM-code.

Returns:gradient – electronic energy gradient of the molecule calculated most recently (hartree/bohr)
Return type:np.2darray (shape: (N, 3))

metafalcon.interfaces.molpro module

Contains a class for QC-calculations using Molpro.

class metafalcon.interfaces.molpro.iface_molpro(symbols, coords, **kwargs)[source]

Bases: metafalcon.interfaces.iface.iface

Interface to Molpro for QC-calculations, inherits from metafalcon.interfaces.iface.iface.

Parameters:
  • symbols (list of str) – atomic symbols of the molecule
  • coords (np.2darray (shape: (N, 3))) – atomic xyz-coordinates of the molecule (bohr)
  • kwargs – See below
Keyword Arguments:
 
  • nproc (int) – number of processors to be used in parallel calculation
  • mem (int) – amount of memory to be used by molpro (in MB)
Variables:
  • symbols (list of str) – atomic symbols of the molecule
  • coords (np.2darray (shape: (N, 3))) – atomic xyz-coordinates of the molecule (bohr)
  • energy (float) – electronic energy of the molecule calculated most recently (hartrees)
  • gradient (np.2darray (shape: (N, 3))) – electronic energy gradient of the molecule with current coordinates (hartree/bohr)
  • nproc (int) – number of processors to be used in parallel calculation
  • head (list of str) – lines to be used as head for the molpro inputfile
  • tail (list of str) – lines to be used as tail for the molpro inputfile

See also

iface.set_symbols, iface.set_coords, iface.get_energy, iface.get_gradient

calculate()[source]

Calculate energies and gradients for the current set of coordinates.

metafalcon.interfaces.mopac module

Contains a class for semiempirical calculations using Mopac.

class metafalcon.interfaces.mopac.iface_mopac(symbols, coords, **kwargs)[source]

Bases: metafalcon.interfaces.iface.iface

Interface to Mopac for semiempirical calculations, inherits from metafalcon.interfaces.iface.iface.

Parameters:
  • symbols (list of str) – atomic symbols of the molecule
  • coords (np.2darray (shape: (N, 3))) – atomic xyz-coordinates of the molecule (bohr)
  • **kwargs – See below
Keyword Arguments:
 

keywords (str) – keywords to be written to the mopac inputfile additional to 1SCF GRAD

Variables:
  • symbols (list of str) – atomic symbols of the molecule
  • coords (np.2darray (shape: (N, 3))) – atomic xyz-coordinates of the molecule (bohr)
  • energy (float) – electronic energy of the molecule calculated most recently (hartrees)
  • gradient (np.2darray (shape: (N, 3))) – electronic energy gradient of the molecule with current coordinates (hartree/bohr)
  • keywords (str) – keywords to be written to the mopac inputfile additional to 1SCF GRAD

See also

iface.set_symbols, iface.set_coords, iface.get_energy, iface.get_gradient

calculate()[source]

Calculate energies and gradients for the current set of coordinates.

metafalcon.interfaces.turbomole module

Contains a class for DFT and RI-DFT calculations using Turbomole.

class metafalcon.interfaces.turbomole.iface_turbomole(symbols, coords, **kwargs)[source]

Bases: metafalcon.interfaces.iface.iface

Interface to Turbomole for DFT and RI-DFT calculations, inherits from metafalcon.interfaces.iface.iface.

Parameters:
  • symbols (list of str) – atomic symbols of the molecule
  • coords (np.2darray (shape: (N, 3))) – atomic xyz-coordinates of the molecule (bohr)
  • **kwargs – See below
Keyword Arguments:
 
  • directory (str) – path to the working directory of the turbomole calculation (default: tm)
  • take_lower (bool) – whether to choose the lower energy of the two calculations in directory and directory2 (default: False)
  • directory2 (str) – path to the second working directory, only required if take_lower is used
Variables:
  • symbols (list of str) – atomic symbols of the molecule
  • coords (np.2darray (shape: (N, 3))) – atomic xyz-coordinates of the molecule (bohr)
  • energy (float) – electronic energy of the molecule calculated most recently (hartrees)
  • gradient (np.2darray (shape: (N, 3))) – electronic energy gradient of the molecule with current coordinates (hartree/bohr)
  • ridft (bool) – True, if the ri-approximation is used

See also

iface.set_symbols, iface.set_coords, iface.get_energy, iface.get_gradient

calculate()[source]

Calculate energies and gradients for the current set of coordinates.

metafalcon.interfaces.types module

Definition of interfaces. For the registration of a new code, import it and append it to the dict.

Module contents

Subpackage of metafalcon that contains interfaces to several quantum chemistry codes.