7.56. Compound Methods

7.56.1. Commands

Below is a list of all available commands available in Compound

——————————— Dataset Related ——————————–

—————————— File Handling Related —————————–

——————————- For Loop Related ——————————-

——————————– Geometry Related ——————————-

——————————– GΟΑΤ Related ——————————-

—————————— If block Related ——————————

—————————- Linear Algebra Related —————————-

————————— ORCA calculation Related —————————

—————————– Program flow Related —————————–

————————— Property File Related —————————-

————————– String Handling Related ————————–

——————————— Step Related ———————————

—————————– Timer Related ————————————

————————— Variables Related ———————————-

7.56.1.1. &

The & symbol has a special meaning in the compound block. Using this symbol inside the New_Step - Step_End block the user can use variables that are defined outside the block. Both string and numerical variables are allowed.

Syntax:

&{variable}

Example

# --------------------------------------------
# This script checks the options for the 
#             '&' symbol
# --------------------------------------------
%Compound 

  Variable method   = "BP86";              #string variable'
  Variable basis    = "def2-TZVP def2/J";
  Variable name     = "base";
  Variable number   = 0;                   #integer variable
  Variable distance = 0.8;                 #double variable
  New_step
    ! &{method} &{basis} TightSCF
    %base "&{name}_&{number}"              #combination of variables
    *xyz 0 1
      H 0.0 0.0 0.0
      H 0.0 0.0 &{distance} 
    *
  Step_End
  # ------------------------------------------
  # Add some printing
  # ------------------------------------------
  print("SUMMARY OF VARIABLES\n");
  print("Method:   %s\n",    method);
  print("Basis:    %s\n",    basis);
  print("Name:     %s\n",    name);
  print("Number:   %d\n",    number);
  print("Distance: %.2lf\n", distance);
End

7.56.1.2. Abort

Abort is used when the user wants to exit the program instantly. Syntax:
Abort;
or alternatively:
Abort

Example:

%Compound
for i from 0 to 4 do
  print("i: %d\n", i);
  if (i=2) then 
    abort;
  endif
endfor
End

7.56.1.3. Alias

Alias is used to replace an integer number with a more representative string. It is useful when one performs more than one calculations and the step numbers become too complicated to evaluate. In this case using Alias_Step after the Step_End command will connect the preceeding calculation step number with the provided name.

Syntax:
Alias \(name\);
or alternatively:
Alias \(name\)
Example:

# ----------------------------------
# This script checks 'alias' keyword
# ----------------------------------
Variable numOfSteps = 20;
Variable Range      = 4.0;
Variable distStart  = 0.4;
Variable Step       = Range/numOfSteps;
Variable distance;
Variable Energies[numOfSteps];
Variable simpleInput  = "BP86 def2-SVP def2/J";

For index from 0 to numOfSteps-1 Do
  Distance =  distStart+ index*Step;
  New_Step
    !&{simpleInput} 
    *xyz 0 1
      H 0.0 0.0 0.0
      H 0.0 0.0 &{Distance}
    *
  Step_End
  Alias currStep;
  print("Current step: %d\n", currStep);
  Read Energies[index] = JOB_INFO_TOTAL_EN[currStep];
EndFor

print("--------------------------------------\n");
print("       Compound Printing              \n");
print("%s  %12s  %16s \n","Step",  "Distance", "Energy");
print("--------------------------------------\n");
For index from 0 to numOfSteps - 1 Do
  Distance = distStart + index*Step;
  print("%4d  %12.4lf   %16.8lf \n", index, Distance, Energies[index]);
EndFor

End

NOTE for the Alias command the final ‘;’ is optional.

7.56.1.4. Basenames

Basenames in a variable that is automatically created in Compound everytime a New_Step is used and it holds the name of this step. It can be used to recover this name during running of a calculation. It practically is a vector were value zero corresponds to the main calculation before any new_step command.

Example:

*xyz 0 1
  H 0.0 0.0 0.0
  H 0.0 0.0 0.8
*
%Compound
  new_step
    !BP86
  step_end
  alias lala;
  print("Basaenames[0]: %s\n", basenames[0]);
  print("Basaenames[1]: %s\n", basenames[lala]);
End

7.56.1.5. Break

Break can be used inside a For loop (see (see For)) when one needs to break the loop under certain conditions. The syntax is the following:

Syntax:
For variable From Start value To End value Do
commands
break ;
commands
EndFor;

NOTE both versions break and break; are legal.

What break actually does is to set the running index of the loop to the last allowed value and then jump to the EndFor (see EndFor)).

Example:

#
# This a script to check Compound 'break' command
#
%Compound
print(" Test for 'break'\n");
print(" It should print 0, 1 and 2\n");
for i from 0 to 6 Do
  if (2*i > 4) then
    break
  endIF
  print("index: %d\n", i);
EndFor

print("Continued outside the 'for' loop\n");

End

7.56.1.6. CloseFile

When a file is opened in Compound using the openFile command (see OpenFile), then it must be closed using the closeFile command.

Syntax:
closeFile(file);

file is the file pointer created from the openFile command. For an example see paragraph OpenFile.

7.56.1.7. Continue

Continue can be used inside a For loop (see (see For)) when one needs to skip the current step of the loop and proceed to the next one. The syntax is the following:

Syntax:
For variable From Start value To End value Do
commands
continue ;
commands
EndFor;

NOTE both versions continue and continue; are legal.

What continue actually does is to jump to the EndFor (see EndFor)).

Example:

# -----------------------------------------------------
# This is a script to check Compound 'continue' command
# ----------------------------------------------------
%Compound
print(" Test for 'continue'\n");
print(" It should print 0, 1, 2 and 4\n");
for i from 0 to 4 Do
  if ( i=3) then
    continue;
  endIf
  print("index: %d\n", i);
EndFor
End

7.56.1.8. Dataset

In Compound we have Dataset objects. These objects can be treated like normal variables of type ‘compDataset’. An important difference between normal variables and Dataset variables is the declaration. Instead of the normal:

Variable x;

we excplicitly have to declare that this is a dataset. So the syntax for a dataset declaration is:

Syntax:

Dataset mySet;

NOTE in the case of datasets we do not allow multiple dataset declarations per line.

Below is a list of functions that work on Dataset.

Example:

# ----------------------------------------------------
# This is an example script for dataset definition
# -----------------------------------------------------
%Compound
  dataset mySet;
  mySet.Print();
End

7.56.1.9. D.MakeReferenceFromDir

MakeReferenceFromDir command acts on a dataset object (see Dataset). It creates a json reference file based on the *xyz files of the current folder. NOTE By default all charges and multplicities will be set to 0 and 1 respectively.

Syntax:
mySet.MakeReferenceFromDir(dirName);

Where:

  • mySet is a dataset object that is already declared

  • dirName The name of a directory that should contain some xyz files.

Example:

%Compound
  # ------------------------------------
  #   This is a compound script that will 
  #   check dataset.MakeReferenceFromDir 
  #   function
  #   NOTE: The script assumes that some
  #         xyz files rest in the current
  #         directory
  # ------------------------------------

  # First some definitions
  Variable name = "mySet";
  Variable numOfMolecules = 0;
  dataset mySet;
  Variable myDir="./";
  mySet.MakeReferenceFromDir(myDir);
  mySet.ReadReferenceFile();
  mySet.Print();
End

7.56.1.10. D.Print

Print command acts on a dataset object (see Dataset). It prints all details of the specific dataset object.

Syntax:
mySet.Print();

Where:

  • mySet is a dataset object that is already declared

Example:

# ----------------------------------------------------
# This is an example script for dataset definition
# -----------------------------------------------------
%Compound
  dataset mySet;
  mySet.Print();
End

7.56.1.11. Diagonalize

Compound can peform matrix algebraic operations, one of the available algebraic operation is matrix diagonalization. Be carefull that the matrix, that is to be diagonalized, must be a square symmetric matrix. It is also important to remember that only the upper triangle part of the matrix will be used for the diagonalization. If everything proceeds smoothly then the function will return the eigenvectors and eigenvalues of the matrix.

Syntax:
A.Diagonalize(eigenValues, eigenVectors);

Where:

  • A: The matrix to be diagonalized.

  • eigenValues: The vector with the eigenvalues

  • eigenVectors: The square matrix with the eigenvectros of the initial matrix.

Example:

# ----------------------------------------------------
# This is an example script for diagonalization
# -----------------------------------------------------
%Compound
  Variable Dim=3;
  Variable A[Dim][Dim];
  Variable eigenVal;
  Variable eigenVec;
  for i from 0 to Dim-1 Do
    for j from 0 to Dim-1 Do
      if (i<=j) then
        A[i][j] = i+j+1;
      else
        A[i][j] =  A[j][i];
      EndIf
    EndFor
  EndFor
  A.Diagonalize(eigenVal, eigenVec);
  A.PrintMatrix(); 
  eigenVal.PrintMatrix();
  eigenVec.PrintMatrix();
End

7.56.1.12. End

End is the final command each compound script must have (unless there is an EndRun command (see EndRun)). After Compound executes what is written in the script then it passes control again to normal ORCA input reading. ORCA will continue analyze the input that rests after the Compound part but it will not run any calculation.

7.56.1.13. EndRun

#EndRun* is an alternative to the End command (see EndRun) for ending the execution of a Compound script. The difference between end and EndRun is that EndRun ignores everything after the Compound block. This makes it even easier to use Compound as a full workflow run.

7.56.1.14. EndFor

All For loops (see For) must finish with EndFor. The syntax and an example is shown in the For section (see For).

NOTE For EndFor both EndFor and EndFor; are possible.

7.56.1.15. For

For loops are used to perform repetitive tasks. The syntax is the following:

Syntax:

For variable From Start value To End value Do

commands

EndFor or EndFor;

Variable should be a variable name not previously defined. Start value and End value should be integers defining the start and end value of the variable. Start value and End value can be numbers, predefined variables or functions of previously defined variables. The only requirement is that they should be integers. Keep in mind that the loop will be performed from the first value to the End value, including the End value.

Example:

# ---------------------------------------
# This is a script to check 'for' loops
# ---------------------------------------

# ---------------------------------
# Some necessary initial definitions
# ----------------------------------
Variable x = {0.0, 1.0, 2.0, 3.0, 4.0};
Variable f;
Variable loopStart;
Variable upLimit;

# -----------------------------------
# Case 1. 
# Constant Start / Constant End
# -----------------------------------
print(" --------------  Case 1 --------------\n");
print("     Constant Start / Constant End    \n");
print("          f = index*x[index]          \n");
print( "      for index from 0 to 4 Do     \n");
print(" -------------------------------------\n");
for index from 0 to 4 Do
  f = index*x[index];
  print("Index: %3d    x[index]:  %.2lf   f:   %.2lf\n", index, x[index], f); 
EndFor

loopStart = 0;
upLimit   = 4;
print(" --------------  Case 2 --------------\n");
print("     Variable Start / Variable End    \n");
print("          f = index*x[index]          \n");
print( "   for index from loopStart to upLimit Do\n");
print(" -------------------------------------\n");
for index from loopStart to upLimit Do
  f = index*x[index];
  print("Index: %3d    x[index]:  %.2lf   f:   %.2lf\n", index, x[index], f); 
EndFor


loopStart  = 1;
upLimit    = 3;
print(" --------------  Case 3 --------------    \n");
print("     function Start / function End        \n");
print("          f = index*x[index]              \n");
print( "   for index from start-1 to upLimit+1 Do\n");
print(" -------------------------------------    \n");
for index from loopStart-1 to upLimit+1 Do
  f = index*x[index];
  print("Index: %3d    x[index]:  %.2lf   f:   %.2lf\n", index, x[index], f);
EndFor

End

7.56.1.16. Geometry

In Compound we have Geometry objects. These objects can be treated like normal variables of type ‘compGeometry’. An important difference between normal variables and Geometry variables is the declaration. Instead of the normal:

Variable myGeom;

we excplicitly have to declare that this is a geometry. So the syntax for a geometry declaration is:

Syntax:

Geometry myGeom;

Geometry myGeom1, myGeom2;

Using the second definition one can define two geometry objects in the same line.

Below is a list of functions that work on Geometry objects.

7.56.1.17. G.BohrToAngs

BohrToAngs command acts on a geometry object (see see Geometry). It will transform the geometry of the loaded geometry object from Bohr to Angstroms. Practically it will just multiply the coordinates with the factor 0.529177249.

Syntax:
myGeom.BohrToAngs();

Where:

  • myGeom is a geometry object that already contains a geometry

Example:

# ----------------------------------------------------
# This is a script to check the BohrToAngs function
# -----------------------------------------------------
*xyz 0 1
  O      -1.69296787   -0.05579265    0.00556629
  H      -2.01296504    0.84704339   -0.01586469
  H      -0.73325076    0.04238910    0.00084302
*

%Compound
  Geometry myGeom;
  Variable CC;
  New_Step
    !BP86
  Step_End
  myGeom.Read();
  myGeom.BohrToAngs();
  CC = myGeom.GetCartesians();
  CC.PrintMatrix();
End

7.56.1.18. G.CreateBSSE

CreateBSSE command acts on a geometry object (see see Geometry). In the case that the geometry object contains ghost atoms then CreateBSSE will create five new files:

  • myFilename_FragmentA.xyz

  • myFilename_MonomerA.xyz

  • myFilename_FragmentB.xyz

  • myFilename_MonomerB.xyz

  • myFilename_Total.xyz

Syntax:
myGeom.CreateBSSE(filename=myFilename);

Where:

  • myGeom is a geometry object that already contains a geometry

  • filename is a base filename for the created files.

Example:

# --------------------------------------------------------
# This is a scrtipt to check the geom.CreateBSSE command
# -------------------------------------------------------

*xyz 0 1
o:      -1.69296787   -0.05579265    0.00556629
h:      -2.01296504    0.84704339   -0.01586469
h:      -0.73325076    0.04238910    0.00084302
o        1.23009925    0.02698440   -0.00375550
h        1.60672086   -0.41139567    0.76236888
h        1.60236356   -0.44922858   -0.74915800
*

%Compound
  Geometry monomerA;
  variable myFilename     = "BSSE";
  Variable method         = "BP86";

  # --------------------------------------
  # Calculation for Fragment A
  # --------------------------------------
  New_Step
    !&{method} 
  Step_End

  # -------------------------------------
  # Read the geometry of Fragment A
  # -------------------------------------
  monomerA.Read();

  # -------------------------------------
  # Create the missing xyz files
  # -------------------------------------
  monomerA.CreateBSSE(filename=myFilename);

End

NOTE The files will contain XYZ geometries in BOHRS.

7.56.1.19. G.FollowNormalMode

FollowNormalMode command acts on a geometry object (see see Geometry). It will displace the loaded geometry following a chosen normal mode of vibtation

Syntax:
myGeom.FollowNormalMode(vibrationSN=myVibration, [ScalingFactor=myScalingFactor]);

Where:

  • myGeom is a geometry object that already contains a geometry

  • vibrationSN is the serial number of the vibration. NOTE Please remember that counting starts with 1.

  • scalingFactor is the scaling of the normal mode of vibration. This argument is optional.

Example:

# ----------------------------------------------------
# This is a script to check the followNormalMode function
# -----------------------------------------------------
*xyz 0 1
  O      -1.69296787   -0.05579265    0.00556629
  H      -2.01296504    0.84704339   -0.01586469
  H      -0.73325076    0.04238910    0.00084302
*

%Compound
  Geometry myGeom;
  Variable CC, normalModes;
  Variable res = -1;
  New_Step
    !BP86 Freq
  Step_End
  myGeom.Read();
  myGeom.FollowNormalMode(vibrationSN=7, scalingFactor=0.8);
  CC = myGeom.GetCartesians();
  CC.PrintMatrix();
End

7.56.1.20. G.GetAtomicNumbers

Function GetAtomicNumbers acts on geometry objects and returns and array with the atomic numbers of the elements in the working geometry.

Syntax: atomNumbers = geom.GetAtomicNumbers()

atomNumbers A variable that will be filled with the values of the atomic numbers

geom A geometry object that should already be loaded.

Example:

*xyz 0 1
  O      -1.69296787   -0.05579265    0.00556629
  H      -2.01296504    0.84704339   -0.01586469
  H      -0.73325076    0.04238910    0.00084302
*

%Compound
  Geometry myGeom;
  Variable atomicNumbers;

  New_Step
    !BP86
  Step_End
  myGeom.Read();
  atomicNumbers = myGeom.GetAtomicNumbers();
  print("\nCompound \n");
  for i from 0 to atomicNumbers.GetSize()-1 Do
    print("Atom '%d': atomic number: %d\n", i, atomicNumbers[i]);
  EndFor
End

7.56.1.21. G.GetBondDistance

Function GetBondDistance acts on geometry objects and returns the distance between two atoms in Bohrs.

Syntax:

res = geom.GetBondDistance(atomA, atomB)

Where:

res The distance between atoms atomA and atomB.

geom A geometry object previously loaded.

atomA The index of atomA in the geometry.

atomB The index of atomB in the geometry.

NOTE indices start counting from 0

Example:

# ------------------------------------
# This is to test Geometry function
#    GetBondDistance
# ------------------------------------
%Compound
  Variable dist;
  Geometry myGeom;
  New_Step
    !BP86
    *xyz 0 1
      H 0.0 0.0 0.0
      H 0.0 0.0 0.8
    * 
  Step_End
  myGeom.Read();  #Reads teh geometry of the previous step
  print( " -------------------------------------------------------\n");
  print( "  Compound Geometry functions test (GetBondDistance) \n");
  print( "  It should print 1.5118\n");
  print( " -------------------------------------------------------\n");
  print( " The distance between atom %d and atom %d  is: %.4lf Bohr\n", 
           0, 1, myGeom.GetBondDistance(0,1));

End

7.56.1.22. G.GetCartesians

Function GetCartesians acts on geometry objects (see Geometry) and returns the distance xyz cartesian coordinates. Please remember that it alsways returns the cooridnates in BOHRS.

Syntax:

coords = geom.GetCartesians()

Where:

coords: A (nAtoms,3) array with the cartesian coordinates in BOHRS.

geom: A geometry object previously loaded.

Example:

# ----------------------------------------------------
# This is a script to check the GetCartesians function
# NOTE: It always return it in Bohrs!
# -----------------------------------------------------
*xyz 0 1
  O      -1.69296787   -0.05579265    0.00556629
  H      -2.01296504    0.84704339   -0.01586469
  H      -0.73325076    0.04238910    0.00084302
*

%Compound
  Geometry myGeom;
  Variable CC;
  New_Step
    !BP86
  Step_End
  myGeom.Read();
  CC = myGeom.GetCartesians();
  for i from 0 to CC.GetDim1()-1 Do
    print("%12.9lf  %12.9lf  %12.9lf\n", 
    CC[i][0], CC[i][1], CC[i][2]);
  endFor
End

7.56.1.23. G.GetGhostAtoms

Function GetGhostAtoms acts on geometry objects (see Geometry). It returns a vector of size nAtoms where for each atom the value will be -1 if it is a ghost atom, otherwise the atomic number of the element

Syntax:

ghostAtoms = geom.GetGhostAtoms()

Where:

ghostAtoms: A (nAtoms,1) integer vector with values -1 or the atomic number of the atom, in case it is not a ghost atom.

geom: A geometry object previously loaded.

Example:

# ----------------------------------------------------
# This is a script to check the getGhostAtoms function
# -----------------------------------------------------
*xyz 0 1
o:      -1.69296787   -0.05579265    0.00556629
h:      -2.01296504    0.84704339   -0.01586469
h:      -0.73325076    0.04238910    0.00084302
o        1.23009925    0.02698440   -0.00375550
h        1.60672086   -0.41139567    0.76236888
h        1.60236356   -0.44922858   -0.74915800
*

%Compound
  Geometry myGeom;
  Variable ghostAtoms;
  New_Step
    !BP86 
  Step_End
  myGeom.Read();
  ghostAtoms = myGeom.GetGhostAtoms();
  ghostAtoms.PrintMatrix();
End

7.56.1.24. G.GetNumOfAtoms

GetNumOfAtoms returns an integer with the number of atoms of the working geometry.

Syntax:

res = geom.GetNumOfAtoms();

Where:

res is the resulting number of atoms

geom is the name of a geometry variable (see Geometry) we are using.

Example:

*xyz 0 1
  O      -1.69296787   -0.05579265    0.00556629
  H      -2.01296504    0.84704339   -0.01586469
  H      -0.73325076    0.04238910    0.00084302
*

%Compound
  Geometry myGeom;
  Variable numOfAtoms = 0;

  New_Step
    !BP86
  Step_End
  Alias currStep;
  myGeom.Read(currStep);
  numOfAtoms = myGeom.GetNumOfAtoms();
  print("\nCompound \n");
  print("Number of atoms: %d (it should print 3)\n", numOfAtoms);

End

7.56.1.25. G.MoveAtomToCenter

Function MoveAtomToCenter acts on geometry objects (see Geometry). It will adjust the cartesian coordinates so that the chosen atom will rest at (0.0 0.0 0.0).

Syntax:

geom.MoveAtomToCenter(atom serial nubmer);

Where:

geom: A geometry object previously loaded.

atom serial number: The serial number of the atom in the geometry.

Example:

# ----------------------------------------------------
# This is a script to check the moveAtomToCenter function
# -----------------------------------------------------
*xyz 0 1
  O      -1.69296787   -0.05579265    0.00556629
  H      -2.01296504    0.84704339   -0.01586469
  H      -0.73325076    0.04238910    0.00084302
*

%Compound
  Geometry myGeom;
  Variable CC;
  New_Step
    !BP86
  Step_End
  myGeom.Read();
  myGeom.MoveAtomToCenter(0);
  myGeom.BohrToAngs();
  CC = myGeom.GetCartesians();
  CC.PrintMatrix();
End

NOTE Please remember that counting starts with 0, meaning that the first atom is 0 and not 1!

7.56.1.26. G.Read

Function Read acts on geometry objects (see Geometry) and reads a geometry from a property file related to a previous step.

Syntax:

geom.Read([stepID=myStepID], propertySN=myPropertySN)

Where:

geom: A geometry object that will be updated.

stepID: The step from which we are going to read the geometry. If not given the previous step will be used.

propertySN: The serial number the geometry in the property file. If not given the last available geometry will be used.

Example:

# ----------------------------------------------------
# This is a script to check the Read function for 
#   geometries
# -----------------------------------------------------
*xyz 0 1
  O      -1.69296787   -0.05579265    0.00556629
  H      -2.01296504    0.84704339   -0.01586469
  H      -0.73325076    0.04238910    0.00084302
*

%Compound
  Geometry myGeom;
  Variable CC;
  New_Step
    !BP86 opt
  Step_End
  myGeom.Read(propertySN=2);
End

7.56.1.27. G.RemoveAtoms

Function RemoveAtoms acts on geometry objects (see Geometry). It accepts a list of atoms and removes them from the loaded geometry. In the end the geometry object will be updated.

Syntax:

geom.RemoveAtoms(atom1, atom2, …);

Where:

geom: A geometry object previously loaded.

atom1, atom2, …: The serial number of the atoms in the geometry.

Example:

# ----------------------------------------------------
# This is a script to check the RemoveAtoms function
# -----------------------------------------------------
*xyz 0 1
  O      -1.69296787   -0.05579265    0.00556629
  H      -2.01296504    0.84704339   -0.01586469
  H      -0.73325076    0.04238910    0.00084302
*

%Compound
  Geometry myGeom;
  Variable numOfAtoms;
  New_Step
    !BP86
  Step_End
  myGeom.Read();
  numOfAtoms = myGeom.GetNumOfAtoms();
  print("Number of atoms before: %d (It should print 3)\n", numOfAtoms);
  myGeom.RemoveAtoms(0);  #Remove the first atom
  numOfAtoms = myGeom.GetNumOfAtoms();
  print("Number of atoms after : %d (It should print 2)\n", numOfAtoms);
End

NOTE Please remember that counting starts with 0, meaning that the first atom is 0 and not 1!

7.56.1.28. G.RemoveElements

Function RemoveElements acts on geometry objects (see Geometry). It will remove from the loaded geometry all atoms with an atomic number given in the list.

Syntax:

geom.RemoveElements(atomNumber1, atomicNumber2, …);

Where:

geom: A geometry object previously loaded.

atomicNumber1, atomicNumber2, …: The atomic number of elements to be removed from the current geometry.

Example:

# ----------------------------------------------------
# This is a script to check the RemoveElements function
# -----------------------------------------------------
*xyz 0 1
  O      -1.69296787   -0.05579265    0.00556629
  H      -2.01296504    0.84704339   -0.01586469
  H      -0.73325076    0.04238910    0.00084302
*

%Compound
  Geometry myGeom;
  Variable numOfAtoms;
  Variable CC;
  New_Step
    !BP86
  Step_End
  myGeom.Read();
  numOfAtoms = myGeom.GetNumOfAtoms();
  CC = myGeom.GetCartesians();
  CC.PrintMatrix();
  print("Number of atoms before: %d (It should print 3)\n", numOfAtoms);
  myGeom.RemoveElements(8);  #Remove the oxygen
  numOfAtoms = myGeom.GetNumOfAtoms();
  print("Number of atoms after : %d (It should print 2)\n", numOfAtoms);
  CC = myGeom.GetCartesians();
  CC.PrintMatrix();
End

7.56.1.29. G.WriteXYZFile

Function WriteXYZFile acts on geometry objects (see Geometry) and writes on disc an xyz file with the coordinates of the current goemetry object. Please remember that it alsways writes the coordinates in BOHRS.

Syntax:

res = geom.WriteXYZFile(filename=myFilename)

Where:

res: An integer that returns ‘0’ if everything worked smoothly.

myFilename The name of the file that will contain the coordinates.

geom: A geometry object previously loaded.

Example:

# ----------------------------------------------------
# This is a script to check the WriteXYZ function
# NOTE: It always write the coordinates in Bohrs!
# -----------------------------------------------------
*xyz 0 1
  O      -1.69296787   -0.05579265    0.00556629
  H      -2.01296504    0.84704339   -0.01586469
  H      -0.73325076    0.04238910    0.00084302
*

%Compound
  Geometry myGeom;
  Variable res=-1;
  New_Step
    !BP86
  Step_End
  myGeom.Read();
  res = myGeom.WriteXYZFile(filename="myGeom.xyz");
End

7.56.1.30. GOAT

In Compound we have GOAT objects. These objects can be treated like normal variables of type ‘compGOAT’. An important difference between normal variables and GOAT variables is the declaration. Instead of the normal:

Variable myGoat;

we excplicitly have to declare that this is a GOAT object. So the syntax for a goat declaration is:

Syntax:

GOAT myGoat;

Below is a list of functions that work on Geometry objects.

Example:

# Example for the usage of GOAT objects in compound
#  
# NOTE:  The file 'test.finalensemble.xyz'
#        should be availablie in the directory
%Compound
  goat myGoat;
  variable myFilename;
  myGoat.Set_Basename("test");
  myGoat.Parse_Ensemble_file();
  for myGeomID from 1 to myGoat.Get_Num_of_Geometries() Do
    write2String(myFilename, "goatGeom_%d.xyz", myGeomID);
    myGoat.WriteXYZFile(geomID=myGeomID, filename=myFilename);
    print("geomID: %d Energy: %lf\n", myGeomID, myGoat.Get_Energy(geomID=myGeomID));
  EndFor
  myGoat.Print();
EndRun

7.56.1.31. Goat.Get_Energy

Function Get_Energy acts on goat objects (see GOAT) and returns a double with the energy of the requested structure.

Syntax:

res = myGoat.Get_Energy(geomID=myGeomID)

Where:

res: A double with the energy of the requested structure.

myGoat A GOAT object that is already loaded (meaning it has already parse an ensemble file, see (see Goat.Parse_Ensemble_File).

myGeomID: The geometry ID of the requested structure. Counting starts from 1.

Example:

see example in GOAT

7.56.1.32. Goat.Get_Num_Of_Geometries

Function Get_Num_Of_Geometries acts on goat objects (see GOAT) and returns an integer with the number of structures available in the current GOAT object.

Syntax:

res = myGoat.Get_Num_Of_Geometries()

Where:

res: An integer with the number of geometries in the current GOAT object.

myGoat A GOAT object that is already loaded (meaning it has already parse an ensemble file, see (see Goat.Parse_Ensemble_File).

Example:

see example in GOAT

7.56.1.33. Goat.Parse_Ensemble_File

Function Parse_Ensemble_File acts on goat objects (see GOAT). It will read an ensemble file created by a GOAT run and then update the object with the geometries and energies of each geometry available in the current GOAT object.

Syntax:

res = geom.Parse_Enesemble_File(filename=myFilename)

Where:

res: An integer that returns ‘0’ if everything worked smoothly.

myFilename The name of the file that will contain the coordinates.

myGoat: A GOAT object previously loaded.

Example:

see example in GOAT

7.56.1.34. Goat.Set_Basename

Function Set_Basename acts on goat objects (see GOAT). It set the basename of the ensemble file created by a GOAT run. It will automatically add the extension: '.finalensemble.xyz' in the end of the basename.

Syntax:

myGoat.Set_Basename(myFilename)

Where:

myFilename The basename of the GOAT ensemble file (without the extension ‘finalensemble.xyz’).

myGOAT: A GOAT object previously loaded.

Example:

see example in GOAT

7.56.1.35. Goat.Print

Function Print acts on goat objects (see GOAT). It will print in the output the geometries of current GOAT object.

Syntax:

myGoat.Print()

Where:

myGoat: A GOAT object previously loaded.

Example:

see example in GOAT

7.56.1.36. Goat.WriteXYZFile

Function WriteXYZFile acts on goat objects (see GOAT). It will write the requested geometry to an XYZ file on disk. It expects two arguments:

  1. The geometry ID of the geometry and

  2. The filename that it will use to store the geometry

Syntax:

myGoat.WriteXYZFile(geomID=myGeomID, filename=myFilename)

Where:

myFilename: The name that it will be used to store the geometry on the disk.

myGeomID: The geometry ID of the requested structure. Counting starts from 1.

Example:

see example in GOAT

7.56.1.37. GetNumOfInstances

The GetNumOfInstances returns the number of instances of a specific object in a propertyfile.

Syntax:

[res=] GetNumOfInstances(propertyName=myName, [step=myStep], [filename=myFilename], [baseProperty=true/false])

Where:

res: An integer that returns the number of instances of the required property in the property file.

propertyName: A string alias that defines the variable the user wants to read.

step: The step from which we want to read the property. If not given the property file from the last step will be read.

filename: A filename of a property file. If a filename and at the same time a step are provided the program will ignore the step and try to read the property file with the given filename.

NOTE please note that in the end of filename the extension .property.txt will be added.

baseProperty: A true/false boolean. The default value is set to false. If the value is set to true then a generic property of the type asked will be read. This means if dipole moment is asked, it will return the last dipole moment, irrelevant if and MP2 or SCF one wad defined.

Example

# ----------------------------------------------------
# This is an example script for readNumOfInstances
# -----------------------------------------------------
%Compound
  Variable res = 0;
  Variable myProperty="MP2_DIPOLE_TOTAL";
  Variable myBaseProperty="DIPOLE_MOMENT_TOTAL";
  New_Step
    !MP2
    #%mp2
    #  density relaxed
    #end
    *xyz 0 1
      H 0.0 0.0 0.0
      H 0.0 0.0 0.8
    *
  Step_End
  # First read the MP2 dipole moment
  res = GetNumOfInstances(propertyName=myProperty);
  print("Num of MP2 dipole moments   : %d\n", res);
  res = GetNumOfInstances(propertyName=myBaseProperty, Property_Base=true);
  print("Num of total dipole moments : %d\n", res);
End

7.56.1.38. GoTo

The GoTo command allows the ‘jump’ inside the normal flow of a compound script. The syntax of the command can be best presented through an example.

Example:

# ----------------------------------------------------
# This is an example script for GoTo
# (It should print only 0,1,2,3)
# -----------------------------------------------------
%Compound
  Variable TCut=3;
  Variable Done;
  for i from 0 to 6 Do
    print("Index: %d\n", i);
    if (i >= TCut) then
      GoTo Done;
    EndIf
  EndFor
  Done:
    print("Done\n");
End

Please note that the variable we use as a label for the GoTo command should be previously defined like a normal variable.

7.56.1.39. If

The if block allows the user to make decisions. The syntax in Compound is the following:
Syntax:

If (expression) Then

actions

Else if (expression) Then

actions

Else

actions

Endif

Below is an example of the usage of if block in compound.

# -------------------------------------------------------------
# This is to check all available ways of 'if blocks'
# -------------------------------------------------------------
Variable x1 = 10.0;
Variable y1 = 20.0; 
Variable b1 = False;
Variable b2 = True;
Variable s1 = "alpha";
Variable s2 = "beta";
Variable s3 = "alpha";
print( " --------------------------------------------------------- \n");
print( " ----------      SUMMARY OF IF CASES        -------------- \n");
print( " --------------------------------------------------------- \n");

print(" x1: %.1lf\n", x1);
print(" y1: %.1lf\n", y1);
print(" b1: %s\n", b1.GetString());
print(" b2: %s\n", b2.GetString());
print(" s1: %s\n", s1);
print(" s2: %s\n", s2);
print(" s3: %s\n", s3);
# ****************************************************************
#                           DOUBLES
# ****************************************************************
print(" -------------------     Doubles     ---------------------- \n");
print("      Variable/constant / One operator  / if (x1>5)         \n");
print("                    No else if/No else                      \n");
if (x1>5) then
  print(" %.2lf > 5 \n", x1);
endif    
# ----------------------------------------------------------------
print("      function / Variable / One operator  / if (3*x1>y1)    \n");
print("                   no else if /   else                      \n");
if (3*x1>y1) then
  print(" 3*%.1lf > %.1lf\n", x1, y1);
else
  print(" 3*%.1lf < %.1lf\n", x1, y1);  
endif
# ----------------------------------------------------------------
print("     function / function / One operator  / if (x1-y1>-10.0) \n");
print("                    else if/else                      \n");
if (x1-y1>-10.0) then
  print(" %.2lf - %.2lf > -10.0\n", x1, y1); 
else if (x1-y1 < -10.0) then
  print(" %.2lf - %.2lf < -10.0\n", x1, y1); 
else
  print(" %.2lf - %.2lf = -10.0\n", x1, y1);  
endif
# ****************************************************************
#                          BOOLEANS
# ****************************************************************
print(" ---------------      Booleans      ---------------------------\n");
print("       Variable  /  No operator  /  if (b1)                   \n");
if (b1) then
  print("b1 is True\n");
else
  print("b1 is False\n");
endIf
# --------------------------------------------------------------------
# ---------------------------------------------------------------------
print("       Constant  / No operator  / if (true)                   \n");
if (True) then
  print( "True\n");
else
  print( "False");
endIf
# ---------------------------------------------------------------------
# ---------------------------------------------------------------------
print("       Variable/Variable / AND operator / if (b1 and b2)                 \n");
if (b1 and b2) then
  print("(%s and %s) is true\n", b1.GetString(), b2.GetString());
else
  print("(%s and %s) is not true\n", b1.GetString(), b2.GetString());
endIf
# ---------------------------------------------------------------------
# ---------------------------------------------------------------------
print("       Variable/Variable / OR operator / if (b1 or b2)                 \n");
if (b1 OR b2) then
  print("(%s or %s) is true\n", b1.GetString(), b2.GetString());
else
  print("(%s or %s) is not true\n", b1.GetString(), b2.GetString());
endIf
# ---------------------------------------------------------------------
# ---------------------------------------------------------------------
print("       Bool /Doubles Function / AND operator / if (b1 and x1>y1 )\n");
if (b1 and y1>x1) then
  print("(%s and %.1lf>%.1lf) is True\n", b1.GetString(), x1, y1);
else
  print("(%s and %.1lf>%.1lf) is False\n", b1.GetString(), x1, y1);
endIf
# ---------------------------------------------------------------------
# ---------------------------------------------------------------------
print("       Nested if / if (b2) then if (y1>x1)\n");
if (b2) then
  if (y1 > x1) then
    print ( "(%s is True) and (%.1lf>%.1lf)\n", b2.GetString(), y1, x1);
  else
    print ( "(%s is True) and (%.1lf<%.1lf)\n", b2.GetString(), y1, x1);
  endIf
else
    print ( "%s is False\n", b2.GetString());
endIf
# ---------------------------------------------------------------------
# ---------------------------------------------------------------------
print(" ----------------      Strings     ---------------------------\n");
print(" -------------------------------------------------------------\n");
print(" -------------------------------------------------------------\n");
print("       Variable/Variable / if s1=s2\n");
if (s1=s2) then
  print("%s is same as %s \n", s1, s2);
else
  print("%s is not same as %s \n", s1, s2);
EndIf

# ---------------------------------------------------------------------
# ---------------------------------------------------------------------
print(" ----------------      Strings     ---------------------------\n");
print(" -------------------------------------------------------------\n");
print(" -------------------------------------------------------------\n");
print("       Variable/constant / if s1=\"alpha\"\n");
if (s1="alpha") then
  print("%s is same as %s \n", s1, "alpha");
else
  print("%s is not same as %s \n", s1, "alpha");
EndIf
End

Some comments about the syntax:

The Else if or Else blocks are not obligatory.

The numerical operators that can be used are: ‘>’, ‘<’, ‘>=’, ‘<=’, ‘=’.

The available logical operators are: ‘and’ and ‘or’.

Unfortunately in the current version multi-parentheses are not allowed.

There is now the possibility to compare strings.

7.56.1.40. InvertMatrix

Compound can peform matrix algebraic operations, one of the available algebraic operation is the inversion of a matrix. Be carefull that the matrix, whose the invert we are looking for, must be a real, square matrix.

Syntax:
AInvert = A.InvertMatrix();

Where:

  • A: The matrix to be inverted.

  • AInvert: The invert of A. It can be A itself and then A will just be updated.

Example:

# ----------------------------------------------------
# This is an example script for matrix inversion
# -----------------------------------------------------
%Compound
  Variable Dim=3;
  Variable A[Dim][Dim];
  Variable invertA, C;
  Variable res=-1;
  for i from 0 to Dim-1 Do
    for j from 0 to Dim-1 Do
      if (i=j) then
        A[i][j] = i+1;
      else
        A[i][j] =  0.0;
      EndIf
    EndFor
  EndFor
  invertA = A.invertMatrix();
  A.PrintMatrix(); 
  invertA.PrintMatrix();
  C = Mat_x_Mat(A,invertA,false, false, 1.0, 1.0);
  C.PrintMatrix();
End

7.56.1.41. Mat_p_Mat

Compound can peform matrix algebraic operations, one of the available algebraic operation is matrix addittion. In order to add two matrices they must have the same dimensions.

Syntax:
C=Mat_p_Mat(alpha, A, beta, B);

Where:

  • C: The resulting matrix.

  • alpha: The coefficient for matrix A.

  • A: The left matrix of the addition.

  • beta: The coefficient for matrix B.

  • B: The right matrix of the addition.

Example:

# ----------------------------------------------------
# This is an example script for matrix addition
# -----------------------------------------------------
%Compound
  Variable Dim=3;
  Variable A[Dim][Dim];
  Variable B[Dim][Dim];
  Variable C;
  Variable res=-1;
  for i from 0 to Dim-1 Do
    for j from 0 to Dim-1 Do
      A[i][j] = 1.0;
      B[i][j] = 2.0;
    EndFor
  EndFor
  A.PrintMatrix();
  B.PrintMatrix();
  C = Mat_p_Mat(2.0, A, 3.0, B);
  C.PrintMatrix();
End

7.56.1.42. Mat_x_Mat

Compound can peform matrix algebraic operations, one of the available algebraic operation is matrix multiplication. In general we can multiply each matrix with constants alpha and beta so that the general multiplication is:

C=(alphaA)(betaB)

In addition each of matrices A and B are allowed to be transposed.

Syntax:
C=Mat_x_Mat(A, B, [transposeA], [transposeB], [alpha], [beta]);

Where:

  • C: The resulting matrix.

  • A: The left matrix of the multiplication.

  • B: The right matrix of the multiplication.

  • transposeA: A boolean to state if matrix A should be transposed before the mutliplication (default: False).

  • transposeB: A boolean to state if matrix B should be transposed before the multiplication (default: False).

  • alpha: A scalar to multiply matrix A before the mutliplication (default 1.0).

  • beta: A scalar to mutliply matrix B before the multiplication (default 1.0).

Example:

# ----------------------------------------------------
# This is an example script for matrix multiplication
# -----------------------------------------------------
%Compound
  Variable Dim=3;
  Variable A[Dim][Dim];
  Variable invertA;
  Variable C;
  Variable D;
  Variable res=-1;
  for i from 0 to Dim-1 Do
    for j from 0 to Dim-1 Do
      if (i=j) then
        A[i][j] = i+1;
      else
        A[i][j] =  0.0;
      EndIf
    EndFor
  EndFor
  A.invertMatrix(invertA);
  A.PrintMatrix(); 
  invertA.PrintMatrix();
  C = Mat_x_Mat(A,invertA,false, false, 1.0, 1.0);
  C.PrintMatrix();
  C = Mat_x_Mat(A, invertA, true, true, 1.0, 1.0);
  C.PrintMatrix();
  C = Mat_x_Mat(A, invertA, false, false, 2.0);
  C.PrintMatrix();
  C = Mat_x_Mat(A, invertA, false, false, 2.0, 3.0);
  C.PrintMatrix();
End

7.56.1.43. Mat_x_Scal

Compound can peform matrix algebraic operations, one of the available algebraic operation is multiplication of the elements of a matrix with a scalar. The function returns the multiplied matrix that can be the one that we use as an argument in the parenthesis, meaning it is updated, or a different one.

Syntax:
C=Mat_x_Scal(alpha, A);

Where:

  • C: The resulting matrix.

  • alpha: A scalar to multiply the elements of matrix A.

  • A: The matrix to be mutliplied.

Example:

# ----------------------------------------------------
# This is an example script for matrix times scalar 
# -----------------------------------------------------
%Compound
  Variable Dim=3;
  Variable A[Dim][Dim];
  Variable alpha=2.0;
  Variable C;
  for i from 0 to Dim-1 Do
    for j from 0 to Dim-1 Do
        A[i][j] = i+j;
    EndFor
  EndFor
  A.PrintMatrix();
  C = Mat_x_Scal(alpha,A);
  A = Mat_x_Scal(alpha,A);
  A.PrintMatrix();
  C.PrintMatrix();
End

7.56.1.44. New_Geom

New_Geom is a platform for geometry manipulation. The basic idea is to have functions that can read a geometry and then produce one or more new geometries with some characteristics that we need. For the moment under the umbrella of New_Geom fall 4 different functions, and these are: Displace, Remove_Atom, Remove_Element.

7.56.1.44.1. Displace

The idea behind “Displace’” is to have a structure, perform an analytical frequncy calculation on it (currently we do not store numerical frequencies in the property file) and then read the Hessian from this calculation to adjust the geometry based on a normal mode of vibration that we choose. The syntax of this command is:

syntax: New_Geom = (Displace, step, hessian, frequency, scaling)

where:
step is the step from which we choose the original geometry
hessian is the hessian read from a property file
frequency defines which normal mode we will use and
scaling is a factor of how severe we want the displacement to be.

We should note that Displace is the only command of the new_geom family of commands that will not store a geometry on disk but only internally pass the new geometry to the next calculation. An example of the usage of this command can be found in the script ‘iterativeOptimization’ that is given with ORCA. The relevant part is as follows: example:

# Define variables
		Variable MaxNTries    =  25; 
		Variable CutOff       = -50;
		Variable displacement = 0.6;
		Variable NNegative =   0;  
		Variable freqs[];
		Variable modes[];
		Variable NFreq;
		Variable limit;
		Variable done;
		Variable FinalEnergy; 
		
		# ===========================================================
		# Start a for loop over number of tries
		# ===========================================================
		For itry From 1 To maxNTries Do
		
		# ----------------------------------
		# Run a geometry optimization
		# ----------------------------------
		New_Step
		! tightopt freq verytightscf nopop def2-TZVP xyzfile
		Step_End
		Read freqs  = THERMO_FREQS[itry];
		Read modes  = HESSIAN_MODES[itry];
		Read NFreq  = THERMO_NUM_OF_FREQS[itry];
		limit = NFreq - 1;
		# ----------------------------------
		#  check for sufficeintly negative 
		#  frequencies
		# ----------------------------------
		NNegative = 0;
		For ifreq From 0 to limit Do
		if ( freqs[ifreq] < CutOff )  then
		New_Geom = (Displace, itry,  modes,  ifreq, displacement);

7.56.1.45. OpenFile

Compound can write text files on disk. In order to write to a file a filepointer must be created. For this in Compound exists the command OpenFile.

Syntax:
filePtr = OpenFile(Filename, “open mode”);

filePtr is a variable previously declared.

Filename can be a string or a variable of string type and represents the name of the file on disk.

There are two available opening modes:

  • ‘w’. In this mode a new file will be created and the user can write on it. If an old file with the same name exists, it’s contents will be deleted.

  • ‘a’. In this mode if a file already exists, the user will append to what already exists in the file.

Example:

%Compound 

# -------------------------------------------------------------
#      This is to check all available open and close 
#                file options 
# -------------------------------------------------------------
Variable myFilename    = "myFile.txt";
Variable file;

# ---------------------------
# First open for writing
# ---------------------------
file = openFile(myFilename, "w");
write2File(file, "This is the first time we write.\n");
closeFile(file);

# ---------------------------
# Re-open to append
# ---------------------------
file = openFile(myFilename, "a");
write2File(file, "This is the second time we write.\n");
closeFile(file);

End

7.56.1.45.1. Remove_Atom

Remove_atom removes an atom from a geometry given its index. We should point out that counting of atoms in ORCA starts with 0. After this command is executed it will store on a disk a new geomety in a xyz format where only the atom with the given index will be missing.

Syntax:

New_Geom = ( Remove_atom, atomIndex, “filename”, stepIndex, [geometry Index]);

where:
atom Index is the number of the atom we want to remove. It can be an integer number or a variable.
filename is the name of the file that we want to use for the new xyz file. It can be a string in quotation marks or a variable already defined before. In the name the xyz extension will be automatically appended. step Index the number of the step from which we will get the initial geometry. It has to be an integer number. geometry Index In case there are more than one geometries in the corresponding property file we can choose one. If no number is given but default the program will use the last one.

example:

if we use the normal ORCA input file:

*xyz 0 1 
O	 2.220871067	 0.026716792	 0.000620476
H	 2.597492682	-0.411663274	 0.766744858
H	 2.593135384	-0.449496183	-0.744782026
*

%Compound "removeAtom.cmp"

together with the compound file “removeAtom.cmp” :

Variable filename  = "newGeom";
Variable atomIndex = 0;

New_Step
  !BP86
Step_End

New_Geom = ( Remove_atom, atomIndex, filename, 1);

end

then the xyz file ‘newGeom.xyz’ will be created that should look like:

2

   H         2.5974927       -0.4116633        0.7667449
   H         2.5931354       -0.4494962       -0.7447820

where the atom with atomIndex = 0 meaning the first atom, meaning the oxygen is removed.

7.56.1.45.2. Remove_Element

Remove_element is similar to the Remove_atom but instead of using the index of the atom we use its atomic number. Thus the syntax is:

Syntax: New_Geom = ( Remove_Element, atomic number, “filename”, stepIndex, [geometry Index]);

where:
atomic number is the atomic number of the atom we want to remove. It can be an integer number or a variable.
filename is the name of the file that we want to use for the new xyz file. It can be a string in quotation marks or a variable already defined before. In the name the xyz extension will be automatically appended. step Index the number of the step from which we will get the initial geometry. It has to be an integer number. geometry Index In case there are more than one geometries in the corresponding property file we can choose one. If no number is given but default the program will use the last one.

example:

if we use again the input from paragraph 1.1.7.2 but instead of asking the compound file “removeAtom.cmp” we ask for the compound file “removeElement.cmp” that looks like:

Variable filename  = "newGeom";

New_Step
  !BP86
Step_End

New_Geom = ( Remove_element, 8, filename, 1);

end

then we will get again the same xyz file that was crated in paragraph Remove_Atom since the atom with atomic number 8 (meaning the Oxygen) will be removed from the original geometry.

7.56.1.46. New_Step

New_Step signals the beginning of a new ORCA input.

Syntax:

New_Step
…Normal ORCA input commands
Step_End

There is no restriction in the input of ORCA, except of course that it should not include another Compound block. It is important to remember that a New_Step command should always end with a Step_End command. Below we show a simple example.

Example:

New_Step
! BP86 def2-SVP
Step_End

There is only a basic fundamental difference with a normal ORCA input. Inside the New_Step block it is not necessary to include a geometry. ORCA will automatically try to read the geometry from the previous calculation. Of course a geometry can be given and then ORCA will use it.

7.56.1.47. Print

Printing in the ORCA outpug can be customized using the print command. The syntax of the print command closely follows the corresponding printf command from C/C++. So the usage of the print command is:

Syntax:
print(format string, [variables]);

For each variable there can be specifiers and flags for the specifiers. Currently print command supports three datatypes namely integers, doubles and strings.

A format specifier follows this prototype: %[flags][width][.precision]specifier

where details for the specifiers and flags can be found in table Table 7.29

Table 7.29 compound print Specifiers

Specifier

s

strings

d

integers

lf

doubles

Flags

number

width

.number

number of decimal digits

-

left alignement (by default is right)

Example:

# -------------------------------------------------------------
# This is to check all available print defintions 
# -------------------------------------------------------------
Variable x1    = 2.0;                        
Variable x2    = {10.0, 20.0, 30.0, 40.0};
Variable x3    = {10,   20,   30,   40};
Variable x4    = {"ten", "twenty", "thirty", "fourty"};
Variable x5 = "test";
Variable index = 2;

print( " --------------------------------------------- \n");
print( " ------ SUMMARY OF PRINT DEFINITIONS --------- \n");
print( " --------------------------------------------- \n");
# ---------- No variables ------------
print( " No variables: \n" );
# ------------- Doubles --------------
print( " -------- Doubles --------------\n");
print( " constant double ( no format)             : %lf\n", 3.5);
print( " constant double (defined width)          : %16lf\n",3.5);
print( " constant double (defined width/accuracy) : %16.8lf\n", 3.5);
print( " variable double (x1)                     : %lf\n", x1);
print( " function double 2*x1*x1                  : %lf\n", 2*x1*x1);
print( " array element double                     : %lf\n", x2[2]);
print( " array element double with var index      : %lf\n", x2[index]);
#print( " array element double with function index : %lf\n", x2[index + 1];
# ------------ Integers --------------
print( " -------- Integers --------------\n");
print( " constant integer ( no format)            : %d\n", 3);
print( " constant integeer (defined width)        : %8d\n",3);
print( " variable integer (index)                 : %d\n", index);
print( " function integer 2*index*index           : %d\n", 2*index*index);
print( " array element                            : %d\n", x3[2]);
print( " array element intteger with var index    : %lf\n",x3[index]);
# ------------  Strings --------------
print( " -------- Strings --------------\n");
print( " constant string ( no format)             : %s\n", "test");
print( " constant string (defined width)          : %8s\n","test");
print( " variable string                          : %s\n", x5);
print( " array element                            : %s\n", x4[2]);
print( " array element intteger with var index    : %s\n",x4[index]);
print(" ----------------------------------------------\n");
print(" ----------------------------------------------\n"); 
End

7.56.1.48. Read

The Read command reads a property from the property file.

NOTE This is the old syntax to read the property file and it will be deprecated in the next version of ORCA. For the new syntax please use the ReadProperty command (see ReadProperty)

Syntax

Read myVar = propertyName[stepID]

Where:

myVar: The variable that will be updated

propertyName: The alias for the property we need to read

stepID: The step to which we refer.

Example

# ----------------------------------------------------
# This is an example script for readProperty
# -----------------------------------------------------
%Compound
  Variable enDirect=0.0;
  New_Step
    !BP86
    *xyz 0 1
      H 0.0 0.0 0.0
      H 0.0 0.0 0.8
    *
  Step_End
  alias currStep;
  # First read the energy directly
  Read enDirect = DFT_Total_en[currStep];
  print("DFT Energy : %.12lf\n", enDirect);
End

7.56.1.49. ReadProperty

One of the fundamental features of Compound is the ability to easily read ORCA calculated values from the property file.

Syntax:

[res=] readProperty(propertyName=myName, [step=myStep], [filename=myFilename], [baseProperty=true/false])

Where: res: An integer that returns the index of the found property if the property was found in the property file, -1 if the property does not exist. This is not obligatory.

propertyName: A string alias that defines the variable the user wants to read.

step: The step from which we want to read the property. If not given the property file from the last step will be read.

filename: A filename of a property file. If a filename and at the same time a step are provided the program will ignore the step and try to read the property file with the given filename.

NOTE please note that in the end of filename the extension .property.txt will be added.

baseProperty: A true/false boolean. The default value is set to false. If the value is set to true then a generic property of the type asked will be read. This means if dipole moment is asked, it will return the last dipole moment, irrelevant if and MP2 or SCF one wad defined.

Example

# ----------------------------------------------------
# This is an example script for readProperty
# -----------------------------------------------------
%Compound
  Variable enDirect=0.0;
  Variable enFilename=0.0;
  Variable myProperty="DFT_Total_en";
  Variable basename="compound_example_properertFile_readProperty";
  Variable newBasename ="newFilename";
  Variable res = -1;
  New_Step
    !BP86
    *xyz 0 1
      H 0.0 0.0 0.0
      H 0.0 0.0 0.8
    *
  Step_End
  # First read the energy directly (returning res)
  res = enDirect.ReadProperty(propertyName=myProperty);
  print("res : %d\n", res);
  # Now read the same energy through filename (not returning res)
  sys_cmd("cp %s_Compound_1.property.txt %s.property.txt", basename, newBasename);
  enFilename.ReadProperty(propertyName=myProperty, filename=newBasename);
  print("Difference between 2 energies : %.12lf\n", enDirect-enFilename);
End

7.56.1.50. Read_Geom

Read_Geom will read the geometry from a previous step.

Syntax:
Read_Geom \(number\)

Here number is the number of the job that we want to read the geometry from. The directive should be positioned before a New_Step - Step_End block.

Example:

#Compound Job 1
New_Step
!BP86 def2-SVP
Step_End

#Compound Job 2
New_Step
!BP86 def2-SVP opt
Step_End

#Compound Job 3
Read_Geom 1
New_Step
!CCSD  def2-SVP
Step_End

End  #Final End

In this case the third calculation, through the Read_MGeom 1 command, will read the geometry from the first calculation.

7.56.1.51. ReadMOs

ReadMOs reads the molecular orbitals from a previous step.

Syntax:
ReadMOs(stepNumber);

Where:

  • stepNumber: is the number of the step from which we want to read the orbitals.

Example:

# ----------------------------------------------------
# This is an example script for ReadMOs
# -----------------------------------------------------
%Compound
  Variable step = 1;
  New_Step
    !BP86
    *xyzfile 0 1 h2o.xyz
  Step_End

  ReadMOs(step);
  New_Step
    !BP86
  Step_End
End

7.56.1.52. S.GetBasename

In Compound strings have all the functionality of a normal variable. In addition they have some additional functions that act only on strings. On of these functions is the function GetBasename. This function searches the string and if it contains a dot it will return the part of the string before the dot.

Syntax:

result = source.GetBasename();

Where:

result is the returned string.

source is the original string.

NOTE If the original string contains no dot then the result string will be a copy of the source one.

Example:

# ------------------------------------------------------
# This is an example script for string related functions:
#    - GetBasename
#    - GetSuffix
#    - GetChar
# ------------------------------------------------------
%Compound
  Variable original = "lala.xyz";
  Variable basename, suffix;
  Variable constructed = "";
  basename = original.GetBasename();
  suffix   = original.GetSuffix();
  for i from 0 to original.stringlength()-1 Do
    write2String(constructed,"%s%s", constructed, original.GetChar(i));
  endfor
  print("Original    : %s\n", original);
  print("Basename    : %s\n", basename);
  print("Sufix       : %s\n", suffix);
  print("Constructed : %s\n", constructed);
End

7.56.1.53. S.GetChar

In Compound strings have all the functionality of a normal variable. In addition they have some additional functions that act only on strings. On of these functions is the function GetChar. This function searches the string and if it contains a dot it will return the part of the string after the dot.

Syntax:

result = source.GetChar(index);

Where:

result is the returned string.

index is the index of the curracter in the string. Keep in mind that counting starts with 0 and not 1.

source is the original string.

NOTE If the index is larger than the size of the string or negative then the program will exit.

Example:

# ------------------------------------------------------
# This is an example script for string related functions:
#    - GetBasename
#    - GetSuffix
#    - GetChar
# ------------------------------------------------------
%Compound
  Variable original = "lala.xyz";
  Variable basename, suffix;
  Variable constructed = "";
  basename = original.GetBasename();
  suffix   = original.GetSuffix();
  for i from 0 to original.stringlength()-1 Do
    write2String(constructed,"%s%s", constructed, original.GetChar(i));
  endfor
  print("Original    : %s\n", original);
  print("Basename    : %s\n", basename);
  print("Sufix       : %s\n", suffix);
  print("Constructed : %s\n", constructed);
End

7.56.1.54. S.GetSuffix

In Compound strings have all the functionality of a normal variable. In addition they have some additional functions that act only on strings. On of these functions is the function GetSuffix. This function searches the string and if it contains a dot it will return the part of the string after the dot.

Syntax:

result = source.GetSuffix();

Where:

result is the returned string.

source is the original string.

NOTE If the original string contains no dot then the result string will be an empty string.

Example:

# ------------------------------------------------------
# This is an example script for string related functions:
#    - GetBasename
#    - GetSuffix
#    - GetChar
# ------------------------------------------------------
%Compound
  Variable original = "lala.xyz";
  Variable basename, suffix;
  Variable constructed = "";
  basename = original.GetBasename();
  suffix   = original.GetSuffix();
  for i from 0 to original.stringlength()-1 Do
    write2String(constructed,"%s%s", constructed, original.GetChar(i));
  endfor
  print("Original    : %s\n", original);
  print("Basename    : %s\n", basename);
  print("Sufix       : %s\n", suffix);
  print("Constructed : %s\n", constructed);
End

7.56.1.55. Step_End

Step_End signals the end of an ORCA Input. It should always be the last directive of an ORCA input inside the compound block that starts with New_Step (see paragraph New_Step)

7.56.1.56. Sys_cmd

Sys_cmd will read a system command and execute it.

Syntax:
Sys_cmd command

Example:

SYS_CMD "orca_mapspc test.out SOCABS -x0700 -x1900 -w0.5 -eV -n10000 "

7.56.1.57. Timer

A timer is an object that can keep time for tasks in compound. Before a timer object is used it has to be declared. The declaration of a timer is slightly different that the rest of variables, because it has to explicitly declare it’s type.

Syntax

timer myTimer;

where

timer is used instead of the normal variable command to explicitly set the variable type to compTimer.

myTimer is a normal instance of the object.

Example:

# -----------------------------------------------
# This is to test timer functions.  
# --------------------------------
timer tm;
Variable x = 0.0;
tm.start();
for index from 0 to 100000 Do
  x = x + 0.1;
EndFor
tm.stop();
x = tm.Total();
print( "------------------------------\n");
print( "   Compound - Timer Results   \n");
print( "------------------------------\n");
print( " First total time:   %.2lf\n", x); 

x = tm.total();
tm.Reset();
tm.Start();
for index from 0 to 200000 Do
  x = x + 0.1;
EndFor
tm.Stop();
x = tm.total();

print( " Second total time:   %.2lf\n", x); 
End

Below is a lit of functions that work exclusively on Timer objects.

7.56.1.58. T.Last

Last is a function that works on a timer object. It returns, as a real number, the last value of the timer.

Syntax

myTimer.Last();

Where:

myTimer: is the timer object initialized before.

Example:

# -----------------------------------------------
# This is to test timer functions.  
# --------------------------------
timer tm;
Variable x = 0.0;
tm.start();
for index from 0 to 100000 Do
  x = x + 0.1;
EndFor
tm.stop();
x = tm.Total();
print( "------------------------------\n");
print( "   Compound - Timer Results   \n");
print( "------------------------------\n");
print( " First total time:   %.2lf\n", x); 

x = tm.total();
tm.Reset();
tm.Start();
for index from 0 to 200000 Do
  x = x + 0.1;
EndFor
tm.Stop();
x = tm.total();

print( " Second total time:   %.2lf\n", x); 
End

NOTE Before using last the timer object must, beside defined, be also initializee, using Start (see T.Start)

7.56.1.59. T.Reset

Reset is a function that works on a timer object. It resets the timer object to its initial state.

Syntax

myTimer.Reset();

Where:

myTimer: is the timer object initialized before.

Example:

# -----------------------------------------------
# This is to test timer functions.  
# --------------------------------
timer tm;
Variable x = 0.0;
tm.start();
for index from 0 to 100000 Do
  x = x + 0.1;
EndFor
tm.stop();
x = tm.Total();
print( "------------------------------\n");
print( "   Compound - Timer Results   \n");
print( "------------------------------\n");
print( " First total time:   %.2lf\n", x); 

x = tm.total();
tm.Reset();
tm.Start();
for index from 0 to 200000 Do
  x = x + 0.1;
EndFor
tm.Stop();
x = tm.total();

print( " Second total time:   %.2lf\n", x); 
End

7.56.1.60. T.Start

Start is a function that works on a timer object. It retunrs the timer object to its initial state.

Syntax

myTimer.Start();

Where:

myTimer: is the timer object initialized before.

Example:

# -----------------------------------------------
# This is to test timer functions.  
# --------------------------------
timer tm;
Variable x = 0.0;
tm.start();
for index from 0 to 100000 Do
  x = x + 0.1;
EndFor
tm.stop();
x = tm.Total();
print( "------------------------------\n");
print( "   Compound - Timer Results   \n");
print( "------------------------------\n");
print( " First total time:   %.2lf\n", x); 

x = tm.total();
tm.Reset();
tm.Start();
for index from 0 to 200000 Do
  x = x + 0.1;
EndFor
tm.Stop();
x = tm.total();

print( " Second total time:   %.2lf\n", x); 
End

7.56.1.61. T.Stop

Stop is a function that works on a timer object. It stops the timer from counting.

Syntax

myTimer.Stop();

Where:

myTimer: is the timer object initialized before.

Example:

# -----------------------------------------------
# This is to test timer functions.  
# --------------------------------
timer tm;
Variable x = 0.0;
tm.start();
for index from 0 to 100000 Do
  x = x + 0.1;
EndFor
tm.stop();
x = tm.Total();
print( "------------------------------\n");
print( "   Compound - Timer Results   \n");
print( "------------------------------\n");
print( " First total time:   %.2lf\n", x); 

x = tm.total();
tm.Reset();
tm.Start();
for index from 0 to 200000 Do
  x = x + 0.1;
EndFor
tm.Stop();
x = tm.total();

print( " Second total time:   %.2lf\n", x); 
End

7.56.1.62. T.Total

Total is a function that works on a timer object. It returns a real number with the total time.

Syntax

myTimer.Total();

Where:

myTimer: is the timer object initialized before.

Example:

# -----------------------------------------------
# This is to test timer functions.  
# --------------------------------
timer tm;
Variable x = 0.0;
tm.start();
for index from 0 to 100000 Do
  x = x + 0.1;
EndFor
tm.stop();
x = tm.Total();
print( "------------------------------\n");
print( "   Compound - Timer Results   \n");
print( "------------------------------\n");
print( " First total time:   %.2lf\n", x); 

x = tm.total();
tm.Reset();
tm.Start();
for index from 0 to 200000 Do
  x = x + 0.1;
EndFor
tm.Stop();
x = tm.total();

print( " Second total time:   %.2lf\n", x); 
End

7.56.1.63. Variables - General

Everything in the Compound language is based on variables. Their meaning and usage are similar to those in any programming language: you need to declare a variable and then assign a value to it. Notably, in Compound, a variable must be declared before it is assigned a value, following the syntax rules of languages like C. This differs from languages like Python, where you can assign a value to a variable without prior declaration. The only exception to this rule in Compound is the index in a for loop, which does not require prior declaration.

In Compound we support the following data types for variables:

  • Integer

  • Double

  • String

  • Boolean

  • File pointer

In addition to these data types Compound supports also variables of type Geometry and Timer but these are treated separately (see Geometry and Timer).

For each variable in Compound there are 3 major categories of usage:

7.56.1.64. Variables - Declaration

There are currently 6 different ways to declare a variable in Compound. Their syntax is the following:

Syntax:

A. Variable name;

B. Variable name1, name2;

C. Variable name=value;

D. Variable name[\(n\)];

E. Variable name[\(n1\)][\(n2\)];

F. Variable name={value1, value2, …};

NOTE In previous versions of Compound for variables that were matrices but the size was not known one had to declare the variable using the following syntax:

Variable name = [];

This is now changed and the empty brackets are no longer needed, so that this variable can be defined like a normal variable as in case A.

Example

# -------------------------------------------------------------
# This is to check all available ways of 
#   Variable declaration in Compound
# -------------------------------------------------------------
Variable size = 5;
Variable x1;                              #caseA
Variable x2,x3;                           #caseB
Variable x4 = 1.0;                        #caseC
Variable x5 = 0;                          #caseC
Variable x6 = "Test";                     #caseC
Variable x7 = True;                       #caseC
Variable x8 = 2*x4;                       #caseC
Variable x9 = x6;                         #caseC
Variable x10 = x7;                        #caseC
Variable x11;                             #caseA
Variable x12[3];                          #caseD
Variable x12b[size-2];                    #caseD
Variable x12c[size][size-1];              #caseE
x12b[1] = 4.0;
x12c[2][2] = 7.0;
Variable x13[3][3];                       #caseE
Variable x14 = {2.0, 4*x4, 2, "lala"};    #caseF
Variable x15 = {0, 1, 2, 3, 4};
Variable x15b = {0, 1, 2, 3, 4};
Variable x15c[x15[x15b[2]-1]+2]; 
Variable x16, x17=x10, x18;
Variable x19=2.0, x20, x21[2], x23[size][size];
print( " --------------------------------------------- \n");
print( " ---------- SUMMARY OF DEFINITIONS ----------- \n");
print( " --------------------------------------------- \n");
print( " x4 (1.0)          :  %.2lf\n", x4);
print( " x5 (0)            :  %.2d\n",  x5);
print( " x6 (\"Test\")       :  %s\n",    x6);
if (x7) then 
  print(" x7 (True)         :  TRUE\n");
else
  print(" x7 (True)         :  FALSE\n");
endIf
print(" x8 (2*x4)         :  %.2lf\n", x8);
print(" x9 (x6)           :  %s\n", x9);
print(" x12b[1] (4.0)     :  %lf\n", x12b[1]);
print(" x12c[2][2] (7.0)  :  %lf\n", x12c[2][2]);
print(" Variable x14 = {2.0, 4*x4, 2, \"lala\"};\n");
print(" x14[0]            :  %lf\n", x14[0]);
print(" x14[1]            :  %lf\n", x14[1]);
print(" x14[2]            :  %d\n",  x14[2]);
print(" x14[3]            :  %s\n",  x14[3]);
print(" Variable x15  = {0, 1, 2, 3, 4};\n");
print(" Variable x15b = {0, 1, 2, 3, 4};\n");
print(" Variable x15c[x15[x15b[2]-1]+2];\n"); 
print(" x15c.GetSize()    :  %d\n",  x15c.GetSize());
print(" ----------------------------------------------\n");
print(" ----------------------------------------------\n"); 
End

Some comments for the different cases of variable declaration.
Case A is the simplest one were we just declare the name of a variable.

Case B is similar to Case A but here more than one variables are declared simultaneously.

In Case C we combine the variable declaration with the assignment of a value to the variable. It worth noting that in this case Compound automatically deducts the type of the variable based on the given value.

Case D declares a 1-Dimensional array of a defined size.

Case E declares a 2-Dimensional array of defined size. For this case, and also accordingly for Case E, one can use previously defined integer variables instead of numbers.

Case F defines an array based on a list of given values. The array will automatically define it’s size based on the size of the list. The values in the list do not have to be all of the same type.

NOTE In the past for Case F empty brackets were needed after the name of the variable. This is no longer necessary.

NOTE It is important not to forget the final ; symbol in the end of each declaration because the result of omitting it is undefined.

7.56.1.65. Variables - Assignment

Assigning a value to a variable has a rather straightforward syntax.

Syntax:
VariableName = CustomFunction;

Where:

VariableName is a variable already declared.

CustomFunction a mathematical expression.

Example:

# -------------------------------------------------------------
# This is to check all available ways of variable assignement
#   (It does not take care of 'with' we will have a separate
#         file for this)
# -------------------------------------------------------------

# -----------------------------------
# Some necessary initial declarations
# -----------------------------------
Variable x1, x2, x3, x4;  
Variable y1, y2, y3, y4;
Variable x5[4]; 
Variable y5[4];                        
Variable x6[3][3];                      
Variable y6[3][3];

# -----------------------------------
# Now the assignements
# -----------------------------------
#Scalars doubles
x1 = 1.0;
y1 = 2*x1;
#Scalars integers
x2 = 1;
y2 = 2*x2;
#Scalars strings
x3 = "test";
y3 = x3;
#Scalars bools
x4 = True;
y4 = x4;
#1D Arrays
x5[0] = 2.0;
y5[0] = x5[0];
x5[1] = 1;
y5[1] = 2*x5[1];
x5[2] = "test";
y5[2] = x5[2];
x5[3] = True;
y5[3] = x5[3];
#2D Arrays
x6[0][0] = 1.0;
y6[0][0] = 2*x6[0][0];
print( " --------------------------------------------- \n");
print( " ---------- SUMMARY OF ASSIGNMENTS ---------- \n");
print( " --------------------------------------------- \n");
print( " ---------------- Scalars -------------------- \n");
print( " x1         :  %.2lf\n", x1);
print( " y1         :  %.2lf\n", y1);
print( " x2         :  %d\n", x2);
print( " y2         :  %d\n", y2);
print( " x3         :  %s\n", x3);
print( " y3         :  %s\n", y3);
print( " ---------------- 1D - Arrays----------------- \n");
print( " x5[0]      :  %.2lf\n", x5[0]);
print( " y5[0]      :  %.2lf\n", y5[0]);
print( " x5[1]      :  %d\n", x5[1]);
print( " y5[1]      :  %d\n", y5[1]);
print( " x5[2]      :  %s\n", x5[2]);
print( " y5[2]      :  %s\n", y5[2]);
print( " ---------------- 2D - Arrays----------------- \n");
print( " x6[0][0]   :  %lf\n", x6[0][0]);
print( " y6[0][0]   :  %lf\n", y6[0][0]);
print(" ----------------------------------------------\n");
print(" ----------------------------------------------\n"); 
End

NOTE It is important to remember to finish the variable assignment using the ‘;’ symbol.

7.56.1.66. Variables - Functions

Variables in Compound have a small number of functions that can help exctract information about them. In the current version of Compound these functions are the following:

Syntax:
VariableName.Function();

where VariableName is a variable that is already declared. Then the function will return a value that depends on the Function that we used.

Currenlty Compound supports the following functions:

Example:

# -------------------------------------------------------------
# This is to check all available ways of variable assignement
#   (It does not take care of 'with' we will have a separate
#         file for this)
# -------------------------------------------------------------

# -----------------------------------
# Some necessary initial declarations
# -----------------------------------
Variable x1, x2, x3, x4;  
Variable y1, y2, y3, y4;
Variable x5[4]; 
Variable y5[4];                        
Variable x6[3][3];                      
Variable y6[3][3];

# -----------------------------------
# Now the assignements
# -----------------------------------
#Scalars doubles
x1 = 1.0;
y1 = 2*x1;
#Scalars integers
x2 = 1;
y2 = 2*x2;
#Scalars strings
x3 = "test";
y3 = x3;
#Scalars bools
x4 = True;
y4 = x4;
#1D Arrays
x5[0] = 2.0;
y5[0] = x5[0];
x5[1] = 1;
y5[1] = 2*x5[1];
x5[2] = "test";
y5[2] = x5[2];
x5[3] = True;
y5[3] = x5[3];
#2D Arrays
x6[0][0] = 1.0;
y6[0][0] = 2*x6[0][0];
print( " --------------------------------------------- \n");
print( " ---------- SUMMARY OF ASSIGNMENTS ---------- \n");
print( " --------------------------------------------- \n");
print( " ---------------- Scalars -------------------- \n");
print( " x1         :  %.2lf\n", x1);
print( " y1         :  %.2lf\n", y1);
print( " x2         :  %d\n", x2);
print( " y2         :  %d\n", y2);
print( " x3         :  %s\n", x3);
print( " y3         :  %s\n", y3);
print( " ---------------- 1D - Arrays----------------- \n");
print( " x5[0]      :  %.2lf\n", x5[0]);
print( " y5[0]      :  %.2lf\n", y5[0]);
print( " x5[1]      :  %d\n", x5[1]);
print( " y5[1]      :  %d\n", y5[1]);
print( " x5[2]      :  %s\n", x5[2]);
print( " y5[2]      :  %s\n", y5[2]);
print( " ---------------- 2D - Arrays----------------- \n");
print( " x6[0][0]   :  %lf\n", x6[0][0]);
print( " y6[0][0]   :  %lf\n", y6[0][0]);
print(" ----------------------------------------------\n");
print(" ----------------------------------------------\n"); 
End

7.56.1.67. V.GetBool()

This function will return a boolean value in case the variable is boolean or integer. For integers it will return false for 0 and true for all other integer values. In all other cases the program will crash providing a relevant message.

Syntax:

myVar.GetBool();

where:

myVar is an already initialized variable.

Example

# ----------------------------------------------------
# This is an example script for 
#  Variable functions
# -----------------------------------------------------
%Compound
  Variable double=1.0;
  Variable integer=2;
  Variable iToBool = integer.GetBool();
  Variable boolean=false;

  print("----------------------------------------\n");
  print("     Results for translation functions \n");
  print("Double  to integer : %d    (it should print 1)\n", double.GetInteger());
  print("Integer to double  : %.2lf (it should print 2.00)\n", integer.GetDouble());
  print("Boolean to string  : %s    (it should print FALSE)\n", boolean.GetString());
  print("Integer to boolean : %s    (it should print TRUE)\n", iToBool.GetString());
  print("Double  to string  : %s    (it should print 1.00000000000000000000e+00)\n", double.GetString());
  print("Integer to string  : %s    (it should print 2)\n", integer.GetString());
End

7.56.1.68. V.GetDim1()

This function works on a variable. It will return the size of the first dimension of an array. If the variable is a scalar it will return 1.

Syntax:

myVar.GetDim1();

where:

myVar is an already initialized variable.

Example

# ----------------------------------------------------
# This is an example script for 
#  Variable functions
# -----------------------------------------------------
%Compound
  Variable dim1, dim2, size;
  Variable A;
  Variable B[3];
  Variable C[3][2];

  print("----------------------------------------\n");
  print("          Results for scalar  \n");
  print("Dim1 : %d (it should print 1)\n", A.GetDim1());
  print("Dim2 : %d (it should print 1)\n", A.GetDim2());
  print("Size : %d (it should print 1)\n", A.GetSize());
  print("----------------------------------------\n");
  print("          Results for 1D-Array  \n");
  print("Dim1 : %d (it should print 3)\n", B.GetDim1());
  print("Dim2 : %d (it should print 1)\n", B.GetDim2());
  print("Size : %d (it should print 3)\n", B.GetSize());
  print("----------------------------------------\n");
  print("          Results for 2D-Array  \n");
  print("Dim1 : %d (it should print 3)\n", C.GetDim1());
  print("Dim2 : %d (it should print 2)\n", C.GetDim2());
  print("Size : %d (it should print 6)\n", C.GetSize());
End

7.56.1.69. V.GetDim2()

This function works on a variable. It will return the size of the second dimension of an array. If the variable is a scalar or a 1-Dimensional array it will return 1.

Syntax:

myVar.GetDim2();

where:

myVar is an already initialized variable.

Example

# ----------------------------------------------------
# This is an example script for 
#  Variable functions
# -----------------------------------------------------
%Compound
  Variable dim1, dim2, size;
  Variable A;
  Variable B[3];
  Variable C[3][2];

  print("----------------------------------------\n");
  print("          Results for scalar  \n");
  print("Dim1 : %d (it should print 1)\n", A.GetDim1());
  print("Dim2 : %d (it should print 1)\n", A.GetDim2());
  print("Size : %d (it should print 1)\n", A.GetSize());
  print("----------------------------------------\n");
  print("          Results for 1D-Array  \n");
  print("Dim1 : %d (it should print 3)\n", B.GetDim1());
  print("Dim2 : %d (it should print 1)\n", B.GetDim2());
  print("Size : %d (it should print 3)\n", B.GetSize());
  print("----------------------------------------\n");
  print("          Results for 2D-Array  \n");
  print("Dim1 : %d (it should print 3)\n", C.GetDim1());
  print("Dim2 : %d (it should print 2)\n", C.GetDim2());
  print("Size : %d (it should print 6)\n", C.GetSize());
End

7.56.1.70. V.GetDouble()

This function works on a variable. It will return a double value in case the variable is integer or double. In all other cases the program will crash providing a relevant message.

Syntax:

myVar.GetDouble();

where:

myVar is an already initialized variable.

Example

# ----------------------------------------------------
# This is an example script for 
#  Variable functions
# -----------------------------------------------------
%Compound
  Variable double=1.0;
  Variable integer=2;
  Variable iToBool = integer.GetBool();
  Variable boolean=false;

  print("----------------------------------------\n");
  print("     Results for translation functions \n");
  print("Double  to integer : %d    (it should print 1)\n", double.GetInteger());
  print("Integer to double  : %.2lf (it should print 2.00)\n", integer.GetDouble());
  print("Boolean to string  : %s    (it should print FALSE)\n", boolean.GetString());
  print("Integer to boolean : %s    (it should print TRUE)\n", iToBool.GetString());
  print("Double  to string  : %s    (it should print 1.00000000000000000000e+00)\n", double.GetString());
  print("Integer to string  : %s    (it should print 2)\n", integer.GetString());
End

7.56.1.71. V.GetInteger()

This function works on a variable. It will return an integer value in case the variable is integer or double. In all other cases the program will crash providing a relevant message.

Syntax:

myVar.GetInteger();

where:

myVar is an already initialized variable.

Example

# ----------------------------------------------------
# This is an example script for 
#  Variable functions
# -----------------------------------------------------
%Compound
  Variable double=1.0;
  Variable integer=2;
  Variable iToBool = integer.GetBool();
  Variable boolean=false;

  print("----------------------------------------\n");
  print("     Results for translation functions \n");
  print("Double  to integer : %d    (it should print 1)\n", double.GetInteger());
  print("Integer to double  : %.2lf (it should print 2.00)\n", integer.GetDouble());
  print("Boolean to string  : %s    (it should print FALSE)\n", boolean.GetString());
  print("Integer to boolean : %s    (it should print TRUE)\n", iToBool.GetString());
  print("Double  to string  : %s    (it should print 1.00000000000000000000e+00)\n", double.GetString());
  print("Integer to string  : %s    (it should print 2)\n", integer.GetString());
End

7.56.1.72. V.GetSize()

This function works on a variable. If the variable is a scalar it will return 1. If the variable is a 1-Dimensional array it will return the size of the array which is the same with the GetDim1() . If the variable is a 2-Dimensional array it will return the results Dim1*Dim2.

Syntax:

myVar.GetSize();

where:

myVar is an already initialized variable.

Example

# ----------------------------------------------------
# This is an example script for 
#  Variable functions
# -----------------------------------------------------
%Compound
  Variable dim1, dim2, size;
  Variable A;
  Variable B[3];
  Variable C[3][2];

  print("----------------------------------------\n");
  print("          Results for scalar  \n");
  print("Dim1 : %d (it should print 1)\n", A.GetDim1());
  print("Dim2 : %d (it should print 1)\n", A.GetDim2());
  print("Size : %d (it should print 1)\n", A.GetSize());
  print("----------------------------------------\n");
  print("          Results for 1D-Array  \n");
  print("Dim1 : %d (it should print 3)\n", B.GetDim1());
  print("Dim2 : %d (it should print 1)\n", B.GetDim2());
  print("Size : %d (it should print 3)\n", B.GetSize());
  print("----------------------------------------\n");
  print("          Results for 2D-Array  \n");
  print("Dim1 : %d (it should print 3)\n", C.GetDim1());
  print("Dim2 : %d (it should print 2)\n", C.GetDim2());
  print("Size : %d (it should print 6)\n", C.GetSize());
End

7.56.1.73. V.GetString()

This function works on a variable. It will return a string of the value of the variable. It works for doubles, integers and booleans.

Syntax:

myVar.GetString();

where:

myVar is an already initialized variable.

Example

# ----------------------------------------------------
# This is an example script for 
#  Variable functions
# -----------------------------------------------------
%Compound
  Variable double=1.0;
  Variable integer=2;
  Variable iToBool = integer.GetBool();
  Variable boolean=false;

  print("----------------------------------------\n");
  print("     Results for translation functions \n");
  print("Double  to integer : %d    (it should print 1)\n", double.GetInteger());
  print("Integer to double  : %.2lf (it should print 2.00)\n", integer.GetDouble());
  print("Boolean to string  : %s    (it should print FALSE)\n", boolean.GetString());
  print("Integer to boolean : %s    (it should print TRUE)\n", iToBool.GetString());
  print("Double  to string  : %s    (it should print 1.00000000000000000000e+00)\n", double.GetString());
  print("Integer to string  : %s    (it should print 2)\n", integer.GetString());
End

7.56.1.74. V.PrintMatrix()

This function works on variables. It will print print an array on a format with 8 columns.

Syntax: myVar.PrintMatrix([NCols=numOfColumns]);

where:

myVar is an already initialized variable.

numOfColumns is the desired number of columns for the printing. This is not obligatory and if not used then by default ORCA will print using 4 columns.

Example

Example:

# ----------------------------------------------
#  A script to check PrintMatrix
# ----------------------------------------------
%Compound
  Variable Dim1 = 5;
  Variable Dim2 = 16;
  Variable x[Dim1][Dim2];
  for i from 0 to Dim1-1 Do
    for j from 0 to Dim2-1 Do
      x[i][j] = i+j;
    EndFor;
  EndFor;

  x.PrintMatrix();        # This should print with 4 columns
  x.PrintMatrix(NCols=8); # This should print with 8 columns
EndRun

NOTE In case of scalars it will only print the header without any values.

NOTE It only works for arrays of type ‘double’ or type ‘integer’. With all variables of other types the program will exit providing an error message.

7.56.1.75. With

The purpose of the “with” command is to add the ability to call compound while adjusting some of the variables that are already defined in the compound file. This means that if there is a variable defined in the compound file and a value is assigned to it, we can during the call change the assigned value of this variable.

One can pass numbers, string or boolean variables.

It should be noted that it is not possible to call array variables this way. Beside this restriction, the syntax of the variable assignment in the case of with is the same with the variable assignment in a normal Compound script.

An important note here is that in case we use the With command the %Compound block should end with an ‘End’ even if we call a Compound script file.
Syntax:
% compound “filename”
With
var1 = val1;
var2 = val2;
End
Example:

# -------------------------------------------------------------
# This is to check all available ways of variable assignement
#   in combination with the 'with' calls.
# -------------------------------------------------------------

# ---------------------------------
# Some necessary initial definitions
# ----------------------------------
Variable x1, x2, x3, x4;  

# -----------------------------------
# Now the assignments
# -----------------------------------
#Scalars doubles
x1 = 1.0;
#Scalars integers
x2 = 1;
#Scalars strings
x3 = "test";
#Scalars bools
x4 = True;
print( " --------------------------------------------- \n");
print( " ------- SUMMARY OF WITH ASSIGNMENTS --------- \n");
print( " --------------------------------------------- \n");
print( " The calling input:\n");
print("%Compound \"0975.cmp\"\n");
print("  with\n"); 
print("    x1       = 3.0;\n");
print("    x2       = 2;\n");
print("    x3       = \"with\";\n");
print("    x4       = False;\n");
print("end\n");
print( " ---------------- Scalars -------------------- \n");
print( " x1 (1.0)      :  %.2lf\n", x1);
print( " x2 (1)        :  %d\n", x2);
print( " x3 (\"test\")   :  %s\n", x3);
print( " x4 (True)     :  %s\n", x4.GetString());
#print( " x6      :  %s\n",    x6);
#if (x4) then 
#  print(" x4      : TRUE\n");
#else
#  print(" x4   : FALSE\n");
#endIfo
End

7.56.1.76. Write2File

With the Print command (see Print) one can write in the ORCA output. Nevertheless it might be that one would prefer to write to a different file. In Compound one can achieve this using the write2File command. The syntax follows closely the syntax of ‘fprintf’ command of the programming language C. The arguments definition and the syntax is identical with the syntax of the Compound ‘Print’ command with the addition that one should define a file object to send the printing.

Syntax:
Write2File(file variable, format string, [variables]);

Where:

file variable: is a predefined variable corresponding to an already open, through the OpenFile command, file.

format string and variables follow exactly the syntax of the Print command, so for more details please refere to section Print.

NOTE Please remember once everything is writen to the file to close the file, using the CloseFile command (see CloseFile).

Example:

%Compound
  # -------------------------------------------------------------
  #      This is to check all available write2String and 
  #                 write2File options 
  # -------------------------------------------------------------
  Variable xS    = "test_";
  Variable xI    = 1;
  Variable final;
  Variable fp;            
  Variable myFilename = "0955.txt";
  
  
  #Create also a file object
  fp = OpenFile(myFilename, "w");
  write2String(final, "   ----- Test ----- \n");
  write2File(fp, "%s", final);
  CloseFile(fp);
  
  print( " --------------------------------------------- \n");
  print( " ------ SUMMARY OF WRITE2STRING AND  --------- \n");
  print( " ------          WRITE2FILE          --------- \n");
  print( " --------------------------------------------- \n");
  write2String(final, "%s", "constant" );
  print( " Final      : %s\n", final);
  write2String(final,"%s", "constant" );      #No space before the quotation marks
  print( " Final      : %s\n", final);
  write2String(final,  "%s", "constant" );    #More than one spaces before
  print( " Final      : %s\n", final);
  write2String(final,"    %s", "constant" );  #No spaces before but  more afterwards
  print( " Final      : %s\n", final);
  write2String(final,   "  %s", "constant" ); #More spaces before and more afterwards
  print( " Final      : %s\n", final);
  write2String(final, "%s", xS);
  print( " Final      : %s\n", final);
  write2String(final, "%s_%d", xS, xI);
  print( " Final      : %s_%d\n", final, xI);
  write2String(final, "%s_%d", xS,2*xI+1);
  print( " Final      : %s\n", final);
End

7.56.1.77. Write2String

In case one needs to construct a string using some variables, Compound provides the Write2String command. The syntax of the command is identical with the Write2File (see Write2File) command with the only exception that instead of a file we should provide the name of a variable that is already declared in the file. The syntax of the format and the variables used is identical with the Print command (please refer to Print. )

Syntax:

Write2String(variable, format string, [variables]);

where:

variable: is the name of a variable that should already be declared.

format string and variables follow exactly the syntax of the Print command, so for more details please refer to section Print.

Example:

%Compound
  # -------------------------------------------------------------
  #      This is to check all available write2String and 
  #                 write2File options 
  # -------------------------------------------------------------
  Variable xS    = "test_";
  Variable xI    = 1;
  Variable final;
  Variable fp;            
  Variable myFilename = "0955.txt";
  
  
  #Create also a file object
  fp = OpenFile(myFilename, "w");
  write2String(final, "   ----- Test ----- \n");
  write2File(fp, "%s", final);
  CloseFile(fp);
  
  print( " --------------------------------------------- \n");
  print( " ------ SUMMARY OF WRITE2STRING AND  --------- \n");
  print( " ------          WRITE2FILE          --------- \n");
  print( " --------------------------------------------- \n");
  write2String(final, "%s", "constant" );
  print( " Final      : %s\n", final);
  write2String(final,"%s", "constant" );      #No space before the quotation marks
  print( " Final      : %s\n", final);
  write2String(final,  "%s", "constant" );    #More than one spaces before
  print( " Final      : %s\n", final);
  write2String(final,"    %s", "constant" );  #No spaces before but  more afterwards
  print( " Final      : %s\n", final);
  write2String(final,   "  %s", "constant" ); #More spaces before and more afterwards
  print( " Final      : %s\n", final);
  write2String(final, "%s", xS);
  print( " Final      : %s\n", final);
  write2String(final, "%s_%d", xS, xI);
  print( " Final      : %s_%d\n", final, xI);
  write2String(final, "%s_%d", xS,2*xI+1);
  print( " Final      : %s\n", final);
End

7.56.2. List of known Properties

The name and a sort explanation of all the known variables that can be automatically recovered, from the property file, are given in the next table

Table 7.30 Variables, known to the compound block, with short explanation

======================================

=============================================================================================

=====

======================================

==========================================AUTOCI=============================================

=====

======================================

=============================================================================================

=====

++++++++++++++++++++++++++++++++++++++

++++++++++++++++++++++++++++++++++++++Energies+++++++++++++++++++++++++++++++++++++++++++++++

+++++

AUTOCI_REF_ENERGY

AutoCI Reference Energy

AUTOCI_CORR_ENERGY

AutoCI Correlatioin Energy

AUTOCI_TOTAL_ENERGY

AutoCI Total Energy

++++++++++++++++++++++++++++++++++++++

+++++++++++++++++++++++++++++++++++ ENERGY Gradient +++++++++++++++++++++++++++++++++++++++++

+++++

AUTOCI_NUCLEAR_GRADIENT

AutoCI Energy nuclear gradient

AUTOCI_NUCLEAR_GRADIENT_NORM

AutoCI Norm of the nuclear gradient

AUTOCI_NUCLEAR_GRADIENT_ATOM_NUMBERS

AutoCI The atomic numbers of the atoms in the gradient

++++++++++++++++++++++++++++++++++++++

+++++++++++++++++++++++++ Electric Properties (Dipole moment) +++++++++++++++++++++++++++++++

+++++

AUTOCI_DIPOLE_MAGNITUDE

AutoCI The value of the dipole moment

AUTOCI_DIPOLE_ELEC_CONTRIB

AutoCI The electronic contribution to the dipole moment

AUTOCI_DIPOLE_NUC_CONTRIB

AutoCI The nuclear contribution to the dipole moment

AUTOCI_DIPOLE_TOTAL

AutoCI The total dipole moment

SCF_ENERGY

SCF Energy

++++++++++++++++++++++++++++++++++++++

++++++++++++++++++++++++ Electric Properties (Polarizability) +++++++++++++++++++++++++++++++

+++++

AUTOCI_POLAR_ISOTROPIC

AutoCI The polarizability isotropic value

AUTOCI_POLAR_RAW

AutoCI The raw polarizability tensor

AUTOCI_POLAR_DIAG_TENSOR

AutoCI The polarizability diagonalized tensor

AUTOCI_POLAR_ORIENTATION

AutoCI The polarizability orientation (eigenvectors)

++++++++++++++++++++++++++++++++++++++

+++++++++++++++++++++ Electric Properties (Quadrupole moment) +++++++++++++++++++++++++++++++

+++++

AUTOCI_QUADRUPOLE_MOMENT_ISOTROPIC

AutoCI The quadrupole moment isotropic value

AUTOCI_QUADRUPOLE_MOMENT_DIAG_TENSOR

AutoCI The quadrupole moment diagonalized tensor

AUTOCI_QUADRUPOLE_MOMENT_ELEC_CONTRIB

AutoCI The elctronic contribution to the quadrupole moment tensor

AUTOCI_QUADRUPOLE_MOMENT_NUC_CONTRIB

AutoCI The nuclear contribution to the quadrupole moment tensor

AUTOCI_QUADRUPOLE_MOMENT_TOTAL

AutoCI The total quadrupole moment

++++++++++++++++++++++++++++++++++++++

++++++++++++++++++++++++++ Magnetic Properties (D Tensor) +++++++++++++++++++++++++++++++++++

+++++

AUTOCI_D_TENSOR_EIGENVALUES

AutoCI The D Tensor eigenvalues

AUTOCI_D_TENSOR_EIGENVECTORS

AutoCI The D Tensor eigenvectors

AUTOCI_D_TENSOR_RAW

AutoCI The Raw D Tensor

AUTOCI_D_TENSOR_D

AutoCI The final D value for the D Tensor

AUTOCI_D_TENSOR_E

AutoCI The final E value for the D Tensor

AUTOCI_D_TENSOR_MULTIPLICITY

AutoCI The spin-multiplicity used for the D Tensor calculation

++++++++++++++++++++++++++++++++++++++

++++++++++++++++++++++++++ Magnetic Properties (G Tensor) +++++++++++++++++++++++++++++++++++

+++++

AUTOCI_G_TENSOR_RAW

AutoCI The Raw G Tensor

AUTOCI_G_TENSOR_ELEC

AutoCI The Electronic part of the G Tensor

AUTOCI_G_TENSOR_TOT

AutoCI The Total G Tensor

AUTOCI_G_TENSOR_ISO

AutoCI The isotropic g value

AUTOCI_G_TENSOR_ORIENTATION

AutoCI The G Tensor orientation (eigenvectors)

SCF_ENERGY

SCF Energy

VDW_CORRECTION

van der Waals correction

SCF Electric properties

SCF_DIPOLE_MAGNITUDE_DEBYE

SCF dipole moment (debye)

SCF_DIPOLE_ELEC_CONTRIB

SCF Electronic contribution to dipole moment

SCF_DIPOLE_NUC_CONTRIB

SCF Nuclear contribution to dipole moment

SCF_DIPOLE_TOTAL

SCF Total dipole moment

SCF_QUADRUPOLE_ISOTROPIC

SCF isotropic quadrupole moment

SCF_QUADRUPOLE_DIAG_TENSOR

SCF quadrupole moment diagonalised tensor

SCF_QUADRUPOLE_ELEC_CONTRIB

SCF electronic contribution to the quadrupole moment

SCF_QUADRUPOLE_NUC_CONTRIB

SCF nuclear contribution to the quadrupole moment

SCF_QUADRUPOLE_TOTAL

SCF total quadrupole moment

SCF_POLAR_ISOTROPIC

SCF isotropic polarizability

SCF_POLAR_RAW

SCF polarizability raw tensor

SCF_POLAR_DIAG_TENSOR

SCF diagonaised polarizability tensor

DFT

DFT_NUM_OF_ALPHA_EL

Number of alpha electrons

DFT_NUM_OF_BETA_EL

Number of beta electrons

DFT_NUM_OF_TOTAL_EL

Total number of electrons

DFT_TOTAL_EN

DFT Total energy

DFT_EXCHANGE_EN

DFT Exchange energy

DFT_CORR_EN

DFT Correlation Energy

DFT_XC_EN

DFT Exchange-Correlation Energy

DFT_NON_LOC_EN

DFT Non-Local correlation

DFT_EMBED_CORR

DFT Embedding correction

MP2

MP2_REF_ENERGY

Reference SCF Energy

MP2_CORR_ENERGY

MP2 Correlation energy

MP2_TOTAL_ENERGY

Total Energy (SCF + MP2)

MP2 Electric properties

MP2_DIPOLE_MAGNITUDE_DEBYE

MP2 dipole moment (debye)

MP2_DIPOLE_ELEC_CONTRIB

MP2 Electronic contribution to dipole moment

MP2_DIPOLE_NUC_CONTRIB

MP2 Nuclear contribution to dipole moment

MP2_DIPOLE_TOTAL

MP2 Total dipole moment

MP2_QUADRUPOLE_ISOTROPIC

MP2 isotropic quadrupole moment

MP2_QUADRUPOLE_DIAG_TENSOR

MP2 quadrupole moment diagonalised tensor

MP2_QUADRUPOLE_ELEC_CONTRIB

MP2 electronic contribution to the quadrupole moment

MP2_QUADRUPOLE_NUC_CONTRIB

MP2 nuclear contribution to the quadrupole moment

MP2_QUADRUPOLE_TOTAL

MP2 total quadrupole moment

MP2_POLAR_ISOTROPIC

MP2 isotropic polarizability

MP2_POLAR_RAW

MP2 polarizability raw tensor

MP2_POLAR_DIAG_TENSOR

MP2 diagonaised polarizability tensor

MDCI

MDCI_REF_ENERGY

Reference SCF Energy

MDCI_CORR_ENERGY

Total Correlation Energy

MDCI_TOTAL_ENERGY

Total Energy (SCF + Correlation)

MDCI_ALPHA_ALPHA_CORR_ENERGY

Correlation energy from \(\alpha\alpha\) electron pairs

MDCI_BETA_BETA_CORR_ENERGY

Correlation energy from \(\beta\beta\) electron pairs

MDCI_ALPHA_BETA_CORR_ENERGY

Correlation energy from \(\alpha\beta\) electron pairs

MDCI_DSINGLET_CORR_ENERGY

Correlation energy from singlet electron pairs (only for closed-shell)(double excitations)

MDCI_DTRIPLET_CORR_ENERGY

Correlation energy from triplet electron pairs (only for closed-shell) (double excitations)

MDCI_SSINGLET_CORR_ENERGY

Correlation energy from singlet electron pairs (only for closed-shell) (single excitations)

MDCI_STRIPLET_CORR_ENERGY

Correlation energy from triplet electron pairs (only for closed-shell) (single excitations)

MDCI_TRIPLES_ENERGY

Perturbative triples correlation energy

MDCI_ALL_ELECTRONS

Total number of electrons

MDCI_CORR_ELECTRONS

Number of correlated electrons

MDCI_CORR_ALPHA_ELECTRONS

Number of correlated \(\alpha\) electrons

MDCI_CORR_BETA_ELECTRONS

Number of correlated \(\beta\) electrons

MDCI Electric properties

MDCI_DIPOLE_MAGNITUDE_DEBYE

MDCI dipole moment (debye)

MDCI_DIPOLE_ELEC_CONTRIB

MDCI Electronic contribution to dipole moment

MDCI_DIPOLE_NUC_CONTRIB

MDCI Nuclear contribution to dipole moment

MDCI_DIPOLE_TOTAL

MDCI Total dipole moment

MDCI_QUADRUPOLE_ISOTROPIC

MDCI isotropic quadrupole moment

MDCI_QUADRUPOLE_DIAG_TENSOR

MDCI quadrupole moment diagonalised tensor

MDCI_QUADRUPOLE_ELEC_CONTRIB

MDCI electronic contribution to the quadrupole moment

MDCI_QUADRUPOLE_NUC_CONTRIB

MDCI nuclear contribution to the quadrupole moment

MDCI_QUADRUPOLE_TOTAL

MDCI total quadrupole moment

MDCI_POLAR_ISOTROPIC

MDCI isotropic polarizability

MDCI_POLAR_RAW

MDCI polarizability raw tensor

MDCI_POLAR_DIAG_TENSOR

MDCI diagonaised polarizability tensor

CASSCF

CASSCF_NUM_OF_MULTS

The number of CASSCF spin multiplicities

CASSCF_NUM_OF_IRREPS

The number of CASSCF irreps

CASSCF_FINAL_ENERGY

The CASSCF final energy

PT2_NUM_OF_MULTS

The CASPT2 spin multiplicities

PT2_NUM_OF_IRREPS

The number of CASPT2 irreps

PT2_FINAL_ENERGY

The CASPT2 Energy

DCDCAS_NUM_OF_MULTS

The number of DCDCAS spin multiplicities

DCDCAS_NUM_OF_IRREPS

The number of DCDCAS irreps

DCDCAS_FINAL_ENERGY

The DCDCAS Energy

CASSCF_ABS_SPECTRUM

The CASSCF Absorption spectrum

CASSCF_ABS_SPECTRUM_INFO

Information about the excitations of the CASSCF spectrum

CASSCF_ABS_SPECTRUM_NROOTS

The number of Roots

CASSCF_CD_SPECTRUM

The CASSCF CD spectrum

CASSCF_CD_SPECTRUM_INFO

Information about the excitations of the CASSCF CD spectrum

CASSCF_CD_SPECTRUM_NROOTS

The number or roots

CASPT2_ABS_SPECTRUM

The CASPT2 Absorption spectrum

CASPT2_ABS_SPECTRUM_INFO

Information about the excitations of the CASPT2 spectrum

CASPT2_ABS_SPECTRUM_NROOTS

The number of roots

CASPT2_CD_SPECTRUM

The CASPT2 CD spectrum

CASPT2_CD_SPECTRUM_INFO

Information about the excitations of the CASPT2 CD spectrum

CASPT2_CD_SPECTRUM_NROOTS

The number of roots

CAS_CUSTOM_ABS_SPECTRUM

The Custom CASSCF Absorption spectrum

CAS_CUSTOM_ABS_SPECTRUM_INFO

Information about the excitations of the custom CASSCF absorption spectrum

CAS_CUSTOM_ABS_SPECTRUM_NROOTS

The number of roots

CAS_CUSTOM_CD_SPECTRUM

The Custom CASSCF CD spectrum

CAS_CUSTOM_CD_SPECTRUM_INFO

Information about the excitations of the custom CASSCF CD spectrum

CAS_CUSTOM_CD_SPECTRUM_NROOTS

The number of roots

DCDCAS_ABS_SPECTRUM

The DCDCAS Absorption spectrum

DCDCAS_ABS_SPECTRUM_INFO

Information about the excitations of the DCDCAS absorption spectrum

DCDCAS_ABS_SPECTRUM_NROOTS

The number of roots

CASSCF_DTENSOR_EIGENVALUES

CASSCF D Tensor eigenvalues

CASSCF_DTENSOR_RAW_EIGENVECTORS

CASSCF D Tensor Raw eigenvectors

CASSCF_DTENSOR_D

D value of CASSCF ZFS

CASSCF_DTENSOR_E

E value of CASSCF ZFS

CASSCF_DTENSOR_MULTIPLICITY

Spin multiplicity

CASPT2_DTENSOR_EIGENVALUES

CASPT2 D Tensor eigenvalues

CASPT2_DTENSOR_RAW_EIGENVECTORS

CASPT2 D Tensor raw eigenvectors

CASPT2_DTENSOR_D

D value of CASPT2 ZFS

CASPT2_DTENSOR_E

E value of CASPT2 ZFS

CASPT2_DTENSOR_MULTIPLICITY

Spin multiplicity

CAS_CUSTOM_DTENSOR_EIGENVALUES

custom CASSCF D Tensor eigenvalues

CAS_CUSTOM_DTENSOR_RAW_EIGENVECTORS

custom CASSCF D Tensor Raw eigenvectors

CAS_CUSTOM_DTENSOR_D

D value of custom CASSCF ZFS

CAS_CUSTOM_DTENSOR_E

E value of custom CASSCF ZFS

CAS_CUSTOM_DTENSOR_MULTIPLICITY

Spin multiplicity

CIPSI

CIPSI_SPIN_MULTIPLICITY

The CIPSI spin multiplicity

CIPSI_NUM_OF_ROOTS

The CIPSI number of roots

CIPSI_FINAL_ENERGY

The CIPSI Final energy

CIPSI_ENERGIES

The CIPSI Energies

CIS

CIS_FINAL_ENERGY

The final total energy

CIS_ESCF

The SCF Energy

CIS_E0

The Energy of the ground state

CIS_ENERGIES

The singlet energies

CIS_ENERGIESP1

The triplet energies

CIS_MODE

One of the CIS modes

CIS_NUM_OF_ROOTS

The number of roots

CIS_ROOT

State to be optimized

CIS_ABS_SPECTRUM_NROOTS

The number of roots

CIS_ABS_SPECTRUM

The CIS absorption spectrum

CIS_ABS_SPECTRUM_VELOCITY

The CIS absorptioin spectrum in velocity representation

CIS_ABS_SOC_SPECTRUM_NROOTS

The number or roots

CIS_ABS_SOC_SPECTRUM

The CIS absorption spectrum including SOC

CIS_CD_SPECTRUM_NROOTS

The number of roots

CIS_CD_SPECTRUM

The CIS CD spectrum

CIS_CD_SOC_SPECTRUM_NROOTS

The number of roots

CIS_CD_SOC_SPECTRUM

The CIS CD spectrum including SOC

ROCIS

ROCIS_STATE

ROCIS State

ROCIS_REF_ENERGY

ROCIS Reference energy

ROCIS_CORR_ENERGY

ROCIS correlation energy

ROCIS_TOTAL_ENERGY

ROCIS total energy

ROCIS_ABS_SPECTRUM_NROOTS

Number of roots

ROCIS_ABS_SPECTRUM

ROCIS Absorption spectrum

ROCIS_ABS_SOC_SPECTRUM_NROOTS

Number of roots

ROCIS_ABS_SOC_SPECTRUM

ROCIS absorption spectrum including SOC

ROCIS_CD_SPECTRUM_NROOTS

Number of roots

ROCIS_CD_SPECTRUM

ROCIS CD spectrum

ROCIS_CD_SOC_SPECTRUM_NROOTS

Number of roots

ROCIS_CD_SOC_SPECTRUM

ROCIS CD spectrum including SOC

MRCI

MRCI_ABS_SPECTRUM

The MRCI absorption spectrum

MRCI_ABS_SPECTRUM_INFO

Information about the absorption spectrum

MRCI_ABS_SPECTRUM_NROOTS

The number of roots

MRCI_CD_SPECTRUM

The MRCI CD spectrum

MRCI_CD_SPECTRUM_INFO

Information about the MRCI CD spectrum

MRCI_CD_SPECTRUM_NROOTS

The number of roots

MRCI_DIPOLE_MOMENTS

The MRCI dipole moments

MRCI_DIPOLE_MOMENTS_INFO

Information about the MRCI dipole moments

MRCI_DTENSOR_EIGENVECTORS

The eigenvectors of the MRCI D tensor

MRCI_DTENSOR_EIGENVALUES

The eigenvalues of the MRCI D tensor

MRCI_DTENSOR_RAW_EIGENVECTORS

The raw eigenvectors of the MRCI D tensor

MRCI_DTENSOR_D

The MRCI D value for the ZFS

MRCI_DTENSOR_E

The MRCI E value for the ZFS

MRCI_DTENSOR_MULTIPLICITY

The MRCI spin multiplicity

EXTRAPOLATION

EXTRAP_SCF_ENERGIES

The SCF energies with the different basis sets

EXTRAP_CBS_SCF

The extrapolated SCF energy

EXTRAP_CORR_ENERGIES

The correlation energies with the different basis sets

EXTRAP_CBS_CORR

The extrapolated correlatioin energy

EXTRAP_CBS_TOTAL

The extrapolated total energy

EXTRAP_CCSDT_X

The (T) contribution to the energy

EXTRAP_NUM_OF_ENERGIES

The number of energies (basis sets) used for the extrapolation

THERMOCHEMISTRY

THERMO_TEMPERATURE

Temperature (\(^oK\))

THERMO_PRESSURE

Pressure (Atm)

THERMO_TOTAL_MASS

Total Mass of the molecule (AMU)

THERMO_SPIN_DEGENERACY

Electronic degeneracy

THERMO_ELEC_ENERGY

Electronic energy (Eh)

THERMO_TRANS_ENERGY

Translational energy (Eh)

THERMO_ROT_ENERGY

Rotational energy (Eh)

THERMO_VIB_ENERGY

Vibrational energy (Eh)

THERMO_NUM_OF_FREQS

The number of vibrational frequencies

THERMO_FREQS

Frequencies

THERMO_ZPE

Zero point energy (Eh)

THERMO_INNER_ENERGY_U

Inner Energy (Eh)

THERMO_ENTHALPY_H

Enthalpy (Eh)

THERMO_ELEC_ENTROPY

(Electronic Entropy)*T (Eh)

THERMO_ROR_ENTROPY

(Rotational Entropy)*T (Eh)

THERMO_VIB_ENTROPY

(Vibrational Entropy)*T (Eh)

THERMO_TRANS_ENTROPY

(Translational Entropy)*T (Eh)

THERMO_ENTROPY_S

(Total Entropy)*T (Eh)

THERMO_FREE_ENERGY_G

Free Energy (Eh)

EPR-NPR Spin-Spin coupling

EPRNMR_SSC_NUM_OF_NUC_PAIRS

Number of nuclear pairs to calculate something

EPRNMR_SSC_NUM_OF_NUC_PAIRS_DSO

Number of nuclear pairs to calculate DSO terms

EPRNMR_SSC_NUM_OF_NUC_PAIRS_PSO

Number of nuclear pairs to calculate PSO terms

EPRNMR_SSC_NUM_OF_NUC_PAIRS_FC

Number of nuclear pairs to calculate FC terms

EPRNMR_SSC_NUM_OF_NUC_PAIRS_SD

Number of nuclear pairs to calculate SD terms

EPRNMR_SSC_NUM_OF_NUC_PAIRS_SD_FC

Number of nuclear pairs to calculate SD/FC terms

EPRNMR_SSC_NUM_OF_NUCLEI_PSO

Number of nuclei to calculate PSO perturbations

EPRNMR_SSC_NUM_OF_NUCLEI_FC

Number of nuclei to calculate SD/FC perturbations

Solvation

SOLVATION_EPSILON

Dielectric constant

SOLVATION_REFRAC

Refractive index

SOLVATION_RSOLV

Solvent probe radius

SOLVATION_SURFACE_TYPE

Cavity surface

SOLVATION_CPCM_DIEL_ENERGY

Total energy including the CPCM dielectric correction

SOLVATION_NPOINTS

Number of points for the Gaussian surface

SOLVATION_SURFACE_AREA

Surface area

General Job Information

JOB_INFO_MULT

Job Multiplicity

JOB_INFO_CHARGE

Job Charge

JOB_INFO_NUM_OF_ATOMS

Total number of atoms

JOB_INFO_NUM_OF_EL

Total number of electrons

JOB_INFO_NUM_OF_FC_EL

Number of frozen core electrons

JOB_INFO_NUM_OF_CORR_ELC

Number of correlated electrons

JOB_INFO_NUM_OF_BASIS_FUNCS

Number of basis functions

JOB_INFO_NUM_OF_AUXC_BASIS_FUNCS

Number of auxilliary C basis functions

JOB_INFO_NUM_OF_AUXJK_BASIS_FUNCS

Number of auxilliary J basis functions

JOB_INFO_NUM_OF_AUX_CABS_BASIS_FUNCS

Number of auxilliary JK basis functions

JOB_INFO_NUM_OF_AUX_CABS_BASIS_FUNCS

Number of auxilliary CABS basis functions

JOB_INFO_TOTAL_EN

Final energy

HESSIAN

HESSIAN_MODES

The hessian

Math Functions

ABS

Absolute value

COS

Cosine

SIN

Sine

TAN

Tangent

ACOS

Inverse cosine

ASIN

Inverse sine

ATAN

Inverse tangent

COSH

Hyperbolic cosine

SINH

Hyperbolic sine

TANH

Hyperbolic tangent

EXP

Exponential

LOG

Common logarithm

LN

Natural logarithm

SQRT

Square root

ROUND

Round down to nearest integer

7.56.3. List of known Simple input commands

The name and a sort explanation of all compound protocols that are know through the simple input line, are given in the next table. The syntax is always:

Syntax:
! compound[protocol name]

Table 7.31 Protocols, known to the simple input line, with short explanation

General Printing

PRINT-ALLMETHODS

Print all available know protocols

PRINT-ALLDESCRIPTIONS

Print only the description of all protocols without the actual protocols

Extrapolation Schemes

EXTRAPOLATE-EP1-MDCI

Direct two-point extrapolation scheme with MDCI energies

COMPOUND[EXTRAPOLATE-EP1-MP2

SCF isotropic quadrupole moment

EXTRAPOLATE-EP2-DLPNO

EP2 type extrapolation with DLPNO-CCSD(T) as secondary method

EXTRAPOLATE-EP2-MP2

EP2 type extrapolation with MP2 as secondary method

EXTRAPOLATE-EP3-DLPNO

EP3 type extrapolation with DLPNO-CCSD(T) as secondary method

EXTRAPOLATE-EP3-MP2

EP3 type extrapolation with MP2 as secondary method

EXTRAPOLATE-PETERSON

Extrapolation based on the scheme of Peterson

EXTRAPOLATE-XANTHEAS-FELLER

Extrapolation based on the scheme of Xantheas and Feller

Wn Protocols

W2-2

The W2-2 version of the Wn protocols

Gn Protocols

G2-MP2

The G2-MP2 protocol

G2-MP2-ATOM

The G2-MP2 protocol for atoms

G2-MP2-SV

The G2-MP2-SV protocol

G2-MP2-SV-ATOM

The G2-MP2-SV protocol for atoms

G2-MP2-SVP

The G2-MP2-SVP protocol

G2-MP2-SVP-ATOM

The G2-MP2-SVP protocol for atoms

ccCA Protocols

CCCA-DZ-QCISD-T

The CCCA-DZ-QCISD-T protocol

CCCA-DZ-QCISD-T-ATOM

The CCCA-DZ-QCISD-T protocol for atoms

CCCA-TZ-QCISD-T

The CCCA-TZ-QCISD-T protocol

CCCA-TZ-QCISD-T-ATOM

The CCCA-TZ-QCISD-T protocol for atoms

CCCA-ATZ-QCISD-T

The CCCA-ATZ-QCISD-T protocol

CCCA-ATZ-QCISD-T-ATOM

The CCCA-ATZ-QCISD-T protocol for atoms

CCCA-CBS-1

The CCCA-CBS-1 protocol

CCCA-CBS-1-ATOM

The CCCA-CBS-1 protocol for atoms

CCCA-CBS-2

The CCCA-CBS-2 protocol

CCCA-CBS-2-ATOM

The CCCA-CBS-2 protocol for atoms

Accurate Energies

EXTRAPOLATE-PNO

A custom PNO extrapolation scheme to reach the complete PNO space limit. See Ref. [31] and [26] for more information.

DLPNO-CC-ENERGY

A protocol for accurate energies

Ab Initio ligand field

AILFT_1SHELL

Ab-initio ligand field theory for 1 shell

AILFT_2SHELL

Ab-initio ligand field theory for 2 shells

X-Ray spectroscopy

MRCI-XAS

X-Ray absorption spectroscopy with MRCI

CASCI-NEVPT2-XAS-XMCD

X-Ray and XMCD spectroscopies with CASCI-NEVPT2

MREOM-XAS

X-Ray absorption spectroscopy with MREOM..

Solvation

DFT-SOLVATION-ENERGY

Calculation of solvation energy

COMPOUND[DFT-DIPOLE-MOMENT-SOLVENT-INDUCTION

Calculate the effect of solvent in the dipole moment

Geometry optimizations

ITERATIVE_OPTIMIZATION

Iterative Optimization protocol to find structure with no negative frequencies (e.g. real minima)