Menu

OrcaExamples

TimN

Use of JANPA with ORCA

(tested in Orca versions 3.0.0 and 3.0.2)

Some introductory notes

By default for SCF methods (Hartree-Fock or DFT) ORCA saves molecular orbital
coefficients into its .gbw (binary) file. This information can be extracted from
.gbw file with orca_2mkl program included in ORCA distribution.

If MP2 is used, the user can force ORCA to create a .mp2nos file which is essentially
the same as .gbw file but contains natural orbital coefficients obtained from
MP2 wavefunction. An important note should be made here however.

For all non-variational the post-SCF methods (MP2, Coupled Cluster, etc.) two types
of electron density (and one-particle reduced density matrix (1-RDM) used to generate
natural orbitals) can be defined:

  • unrelaxed, or 'expectation value' density (and 'unrelaxed' 1-RDM) which can be calculated by direct integration of approximate wavefunction,

  • relaxed, or 'response-type' density (and 'relaxed' 1-RDM) which is a functional derivative of the energy with respect to an external one-particle potential.

A nice discussion by A. Granovskii can be found at Firefly's page
Note that construction of relaxed densities requires the solution of so-called 'Z vector equations',
but these densities are generally considered to be more appropriate in calculation
molecular properties.

ORCA is capable of solving Z vector equations, but the relaxed densities formed from their
solutions are mainly used internally and some tricks should be made in order to 'extract'
them to an external file valid for conversion to MOLDEN-compatible format.

One way to accomplish this is to use ORCA's command to perform NAO/NBO analysis in the
absence of true NBO program in its directories. In this case ORCA will create a file
with extension .47 which contains an information about system geometry, the basis set
used in calculation (partial data!), the overlap and (the most important) the density
matrices. This file can be read in by molden2molden program in order to suppress
molecular orbital coefficients from input MOLDEN file by those obtained by diagonalization
of the density matrix from ORCA's .47 file.
Clearly, appropriate calculation option in the ORCA input file must be used in order to
specify which densities (relaxed or unrelaxed) should be exported to .47 file (see examples
below).

So, ORCA package is among the most universal freeware packages for obtaining density matrices
at variety of levels of theory. It should be kept in mind however that by construction
it uses only the basis sets defined with 'pure' spherical harmonics while still popular
Pople's basis sets (6-31G etc) were defined in with 'Cartesian' spherical harmonics.


Note that there was -ignorefock option in JANPA versions prior to 2.02. Using this option was highly recommended for analyzing the orbitals obtained from a correlated wavefunction, since in this case no 'energies' of the orbitals are available. For the same reason the default behaviour has been changed in JANPA v. 2.02, so that the Fock matrix is ignored by default. In case if for some reason the Fock matrix analysis is still needed, the option -doFock should be used.

Hartree-Fock/DFT methods

(to be written - but the general idea is still to convert an ORCA's .gbw file
into a MOLDEN-semi-compatible file using orca_2mkl program from the ORCA package,
and then to use our molden2molden program with -fromorca3bf and -orca3signs options
to fix MO coefficients and basis function normalization in the obtained MOLDEN-semi-compatible
file)


MP2

(to be written - bu the general idea remains the same as for Hartree-Fock/DFT methods with
the only difference that .mp2nos file created by ORCA should to be used instead of a its .gbw file)

    %mp2 
      Density relaxed # relaxed density
              # other possible values are: none (no density will be computed)
              # and unrelaxed (unrelaxed density will be computed)
      NatOrbs true # Natural orbital construction on or off
    end

Note that no Fock matrix is available for MP2 method.

General notes for non-variational post-SCF methods (Configuration Interaction, Coupled Cluster)

We begin with a quote from ORCA documentation:

    ORCA features the calculation of the unrelaxed coupled cluster density on the basis 
    of the Z vector equations for closed- and open-shell systems. 
    If a fully relaxed coupled cluster density is desired then ORCA still features the
    orbital-optimized coupled-cluster doubles method (OOCCD). 
    This is not exactly equivalent to the fully relaxed CCSD density matrix because of the operator
    \kappa instead of T_1. However, results are very close and orbital optimized coupled
    cluster doubles is the method of choice if orbital relaxation effects are presumed to be large.

In ORCA both CI and CC are performed by MDCI module. Therefore, the settings of this module
should be used for specifying the way of density formation.

    %mdci 
            density orbopt
                # other possible values are: none, linearized, unrelaxed
    end

This will work together with CCSD or QCISD (ORCA's documentation adds that QCISD and CCSD are identical in the case of OOCCD because of the absence of single excitations). Note also that an unrelaxed density for CCSD(T) is NOT available in ORCA.


A notes for ORCA post-3.0.0 (but not v.4.x) users

The following sections require creation of a .47 file with ORCA by using its built-in abilities
(using NPA keyword). However, if the version of ORCA is greater than 3.0.0 this ability will not
work by default due to the fact that ORCA will try to find an executable of an original NBO
program and will not proceed if this executable is not found. Here is a simple trick to overcome
this limitation.
Before running ORCA program simply set NBOEXE and GENEXE environment variables to some program
which can be run and which will finish without an error (returning a zero exit code) regardless of
the command line parameters passed to that program. A good candidate for such a program in Linux
is a standard executable file named pwd. Here is an example of a Linux script which does that

    #!/bin/bash
    export NBOEXE=pwd
    export GENEXE=pwd
    orca file.inp > file.out

(we assume that orca executable can be found in a system's PATH). Another variation of the same
script can be as follows

    #!/bin/bash
    export NBOEXE=`which pwd`
    export GENEXE=`which pwd`
    orca file.inp > file.out

so that NBOEXE and GENEXE environment variables receive a full path to pwd program.

QCISD example

Input file (say, bh_oo_oo.inp)

    %MaxCore 2800
    %pal nprocs 2
    end

    %mdci 
      citype QCISD
      density orbopt
      Denmat orbopt
    end

    ! QCISD cc-pvtz VeryTightSCF NPA

    *xyz 0 1
      B   -0.67451701207061      0.24271844000000      0.00000000000000
      H   0.56001869207061      0.24271844000000      0.00000000000000 
    *

With this input, ORCA will produce bh_oo_oo.gbw and bh_oo_oo.mdcip.47 files. Both of them are needed
for generation of MOLDEN file for JANPA.

  • Use orca_2mkl program to prepare MOLDEN-semi-compatible file with SCF molecular orbitals:

    ./orca_2mkl bh_oo_oo -molden
    

here bh_oo_oo is the name of .gbw file (without extension!). This command will produce MOLDEN-semi-
compatible file bh_oo_oo.molden.input with SCF molecular orbitals from the Hartree-Fock step of
QCISD calculation.

  • Use molden2molden to convert basis set data from bh_oo_oo.molden.input to a conventional
    MOLDEN format and to suppress SCF MO coefficient with QCISD natural orbitals:

    java -jar molden2molden.jar -i bh_oo_oo.molden.input -o bh_oo_oo.PURE -fromorca3bf -orca3signs -ds47 bh_oo_oo.mdcip.47  > M2M.log
    

where > M2M.log is optional, -fromorca3bf -orca3signs convert ORCA-style MOLDEN file to a
conventional MOLDEN file, while -ds47 bh_oo_oo.mdcip.47 instructs molden2molden program
to suppress molecular orbitals from bh_oo_oo.molden.input with those generated from
the density matrix from bh_oo_oo.mdcip.47 by its diagonalization (performed internally
by molden2molden).
This command will create bh_oo_oo.PURE file which is conventional MOLDEN file and can
be used for further analysis with Janpa as well as for orbital visualization (in MOLDEN, JMOL etc.).

  • Run janpa to perform analysis

    java -jar janpa.jar -i bh_oo_oo.PURE  > bh_oo_oo.JANPA
    

Note that no Fock matrix is available for QCISD method.

You can Download the files of this example.


CCSD example

A flowchart here is very similar to QCISD example.

Input file (say, HCl.inp)

    %MaxCore 2800
    %pal nprocs 2
    end

    %mdci
     citype CCSD
     Denmat orbopt
     density orbopt
    end

    ! CCSD cc-pvqz NPA
    *xyz 0 1 
        H            0.000000000000     0.000000000000    -1.237032722757
        CL           0.000000000000     0.000000000000     0.035652086010
    *

With this input, ORCA will produce HCl.gbw and HCl.mdcip.47 files. Both of them are needed
for generation of MOLDEN file for JANPA.

  • Use orca_2mkl program to prepare MOLDEN-semi-compatible file with SCF molecular orbitals:

    ./orca_2mkl HCl -molden
    

here HCl is the name of .gbw file (without extension!). This command will produce MOLDEN-semi-
compatible file HCl.molden.input with SCF molecular orbitals from the Hartree-Fock step of
CCSD calculation.

  • Use molden2molden to convert basis set data from HCl.molden.input to a conventional
    MOLDEN format and to suppress SCF MO coefficient with CCSD natural orbitals:

    java -jar molden2molden.jar -i HCl.molden.input -o HCl.PURE -fromorca3bf -orca3signs -ds47 HCl.mdcip.47  > M2M.log
    

This command will create HCl.PURE file which is conventional MOLDEN file and can
be used for further analysis with Janpa as well as for orbital visualization (in MOLDEN, JMOL etc.).

  • Run janpa to perform analysis

    java -jar janpa.jar -i HCl.PURE > HCl.JANPA
    

Note that no Fock matrix is available for CCSD method.

You can Download the files of this example.