Next: 18.5 Examples Up: 18.4 Density Functionals Previous: 18.4.1 Alias density functionals

18.4.2 Implementing new functionals

New functionals are implemented based upon the automatic code generation (ACG) program [6]. In order to work the program requires the maple mathematics program and an XSLT parser, defined by the variable XSLT in CONFIG.

The format of the input file is an XML file containing all of the information about the new functional. All density functional XML files are placed in the directory lib/df and are automatically activated on the next instance of the make command in the MOLPRO base directory.

The root element of the XML document is content. At the next level there are two allowed elements, functional and alias.

The functional element has an id attribute which is used as the keyword for the functional in MOLPRO. The allowed elements are defined in table 8.

Table 8: Elements allowed for defining functionals
title Text to appear as a heading for the functional documentation
tex Text to document the functional
ref@id Alias for reference contained in doc/references.xml
alias@id alternative keywords for the functional


Multiple instances of ref and alias are allowed. The final element is maple for which multiple cases are also allowed. A typical maple expression such as
A:=1.2:
is written as
<maple lhs="A">1.2</maple>.
To input a Maple procedure such as
add_together:=proc(a,b) a+b end:
one should write
<maple lhs="add_together" proc="a,b">a+b</maple>.
As an example the Perdew-Wang 1991 GGA exchange functional is given below:
<?xml version="1.0" encoding="ISO-8859-1"?>
<content>
 <functional id="PW91X">
  <title>Perdew-Wang 1991 GGA Exchange Functional</title>
  <ref>PW91APPS</ref>
  <maple lhs="g">1/2*E(2*rho(s))</maple>
  <maple lhs="G">1/2*E(2*rho(s))</maple>
  <maple lhs="E" proc="n"> -3/(4*Pi)*(3*Pi^2)^(1/3)*n^(4/3)*F(S)</maple>
  <maple lhs="S">chi(s)/(2*(6*Pi^2)^(1/3))</maple>
  <maple lhs="F" proc="S">
   (1+0.19645*S*arcsinh(7.7956*S) + (0.2743-0.1508*exp(-100*S^2))*S^2)/
   (1+0.19645*S*arcsinh(7.7956*S)+0.004*S^4)
  </maple>
 </functional>
</content>

Hybrid functionals are defined through the alias element defined just after the content level. The elements key, functional and ref are defined. For example, the B3LYP functional is defined as:

<?xml version="1.0" encoding="ISO-8859-1"?>
<content>
 <alias>
  <key id="B3LYP"/>
  <key id="B3LYP5"/>
  <functional id="EXACT" factor="0.2d0"/>
  <functional id="B88" factor="0.72d0"/>
  <functional id="DIRAC" factor="0.08d0"/>
  <functional id="LYP" factor="0.81d0"/>
  <functional id="VWN5" factor="0.19d0"/>
 </alias>
</content>



Next: 18.5 Examples Up: 18.4 Density Functionals Previous: 18.4.1 Alias density functionals

molpro@molpro.net
Sep 24, 2008