# Density fitting

Density fitting can be used to approximate the integrals in spin restricted Hartree-Fock (`HF`

), density functional theory (`KS`

), second-order Møller-Plesset perturbation theory (`MP2`

and `RMP2`

), explicitly correlated MP2 (MP2-F12), all levels of closed-shell local correlation methods (`LCC2`

, `LMP2`

-`LMP4`

, `LQCISD(T)`

, `LCCSD(T)`

), as well as for `CASSCF`

and `CASPT2`

methods. Density fitting is invoked by adding the prefix `DF-`

to the command name, e.g. `DF-HF`

, `DF-KS`

, `DF-MP2`

and so on. Gradients are available for `DF-HF`

, `DF-KS`

, `DF-MP2`

, `DF-LMP2`

, `DF-CASSCF`

, and `DF-CASPT2`

. Symmetry is implemented for energy calculations (without gradients) for `DF-RHF`

, `DF-RKS`

,`DF-UHF`

, `DF-UKS`

`DF-RMP2`

,`DF-RMP2-F12`

, `DF-CASSCF|DF-MULTI`

, `DF-CASPT2|DF-RS2`

, and `DF-RS2C`

,
but for `DF-MP2`

, `DF-CCSD`

(and variants) as well as for local methods symmetry is not implemented and automatically turned off.

By default, a fitting basis set will be chosen automatically that corresponds to the current orbital basis set and is appropriate for the method. For instance, if the orbital basis set is `VTZ`

, the default fitting basis is `VTZ/JKFIT`

for `DF-HF`

or `DF-KS`

, and `VTZ/MP2FIT`

for `DF-MP2`

. Other fitting basis sets from the library can be chosen using the `DF_BASIS`

option, e.g.

BASIS=VTZ !use VTZ orbital basis DF-HF,DF_BASIS=VQZ !use VQZ/JKFIT fitting basis DF-MP2,DF_BASIS=VQZ !use VQZ/MP2FIT fitting basis

The program then chooses automatically the set which is appropriate for the method. Optionally, the basis type can be appended to the basis name and then this supercedes the default, e.g.

DF-HF,DF_BASIS=VQZ/JKFIT !use VQZ/JKFIT fitting basis

Orbital basis sets can be chosen using type `ORBITAL`

(but this is not recommended normally!). Contraction/uncontraction can be forced appending (CONTRACT) or (UNCONTRACT) to the basis name, e.g.

`DF_BASIS=AVQZ(UNCONTRACT)/ORBITAL`

.

If other options are given in parenthesis, these can be separeted by commas, e.g.

`DF_BASIS=AVQZ(f/d,UNCONTRACT)/ORBITAL`

.

Alternative forms, which should work as well, are

`DF_BASIS=AVQZ(f/d)(UNCONTRACT)/ORBITAL`

or

`DF_BASIS=AVQZ(f/d)/ORBITAL(UNCONTRACT)`

.

Note that the CONTRACT/UNCONTRACT option cannot be used with basis set names previously defined in a basis block (see below).

Alternatively, fitting basis sets can be defined in a preceding basis block (see basis input), and then be refered to with their set names, e.g.,

`DF-HF, DF_BASIS=MYJKBASIS`

`DF-MP2, DF_BASIS=MYMP2BASIS`

where `MYJKBASIS`

and `MYMP2BASIS`

are sets defined in a basis block. In this case it is the responsibility of the user to ensure that the basis set is appropriate for the method.

Further options, as fully described in section options for density fitting, can be added on the command line. In this case they are valid only for the current command. Alternatively, the options can be specifed on a separate `DFIT`

directive. If this is given within a command block, the options are used only for the current program; this is entirely equivalent to the case that the options are specified on the command line. However, if a `DFIT`

(or `GDFIT`

) directive is given outside of a command block, the specified options are used globally in all subsequent density fitting calculations in the same run.

The options specified on a global `DFIT`

directive are also passed down to procedures. However, if a `DFIT`

is given within a procedure, the corresponding options are used only in the same procedure and procedures called from it. When the procedure terminates, the options from the previous level are recovered.

## Options for density fitting

The options described in this section have sensible default values and usually do not have to be given. Many options described below have alias names. These can be obtained using

`HELP,CFIT,ALIASES`

.

### Options to select the fitting basis sets

Basis set for fitting (Default: set corresponding to the orbital basis)`BASIS`

Basis set for Coulomb fitting (default`BASIS_COUL`

`BASIS`

)Basis set for exchange fitting (default`BASIS_EXCH`

`BASIS`

)Fitting basis set for DF-MP2 (default`BASIS_MP2`

`BASIS`

)Fitting basis set for DF-LCCSD (default`BASIS_CCSD`

`BASIS`

)

### Screening thresholds

Threshold for neglecting contracted 3-index integrals in the AO basis (default 1.d-8).`THRAO`

Threshold for neglecting half-transformed 3-index integrals (default 1.d-8).`THRMO`

Threshold for Schwarz screening (default 1.d-5).`THRSW`

Threshold for neglecting 2-index integrals in the AO (default 1.d-10.`THROV`

Product screening threshold for first half transformation (default 1.d-8).`THRPROD`

Analogous thresholds for specfic programs can be set by appending the above keywords by the following specifications

Coulomb and exchange fitting in DF-HF/DF-KS`_SCF`

Coulomb fitting in DF-HF/DF-KS`_COUL`

Exchange fitting in DF-HF/DF-KS`_EXCH`

Coulomb and exchange fitting in CPHF`_CPHF`

Coulomb and exchange fitting in DF-HF/DF-KS gradients`_SCFGRD`

The default values are the same as for the general thresholds.

Further thresholds:

Threshold for second-half transformation in exchange fitting (default`THR2HLF`

`THRAO_SCF`

)Threshold for local assembly of exchange matrix (default`THRASM_SCF`

`THRAO_SCF`

)Threshold for Coulomb fitting in DF-KS`THRAO_FOCK`

(default `MIN(THRAO_SCF*1.d-2,1.d-12)`

)

### Parameters to enable local fitting

Local fitting as described in H.-J. Werner, F. R. Manby, and P. J. Knowles, J. Chem. Phys. **118**, 8149 (2003), Polly, H.-J. Werner, F. R. Manby, and Peter J. Knowles, Mol. Phys. **102**, 2311 (2004), and M. Schütz, H.-J. Werner, R. Lindh and F. R. Manby, J. Chem. Phys. **121**, 737 (2004) can be activated by setting `LOCFIT=1`

. By default, local fitting is disabled, because under certain circumstances it can lead to unacceptable errors. For instance, local fitting must not be used in counter-poise calculations, since the lack of fitting functions at the dummy atoms can lead to wrong results.

Local fitting can be restricted to certain programs, using the following options:

If positive, use local fitting in all programs in which it is available (default 0).`LOCFIT`

If positive, use local fitting in SCF (default`LOCFIT_SCF`

`LOCFIT`

)If positive, use local fitting in DF-LMP2; 1: use orbital domains; 2: use pair domains (default`LOCFIT_MP2`

`LOCFIT`

)If positive, use local fitting in DF-LMP2-F12 (default`LOCFIT_F12`

`LOCFIT`

)If positive, use local fitting in DF-LCCSD (default`LOCFIT_CCSD`

`LOCFIT`

)If positive, use local fitting in LCCSD 2ext transformation (default`LOCFIT_2EXT`

`LOCFIT_CCSD`

)If positive, use local fitting in LCCSD 3ext transformation (default`LOCFIT_3EXT`

`LOCFIT_CCSD`

)If positive, use local fitting in LCCSD 4ext transformation (default`LOCFIT_4EXT`

`LOCFIT_CCSD`

)If positive, use local fitting in CPHF (default`LOCFIT_CPHF`

`LOCFIT`

)If positive, use local fitting in gradient calculations (default`LOCFIT_SCFGRD`

`LOCFIT`

)If positive, use localized orbitals in DF-HF (default 1)`LOCORB`

If positive, use local screening in first half transformation (default`LOCTRA`

`LOCFIT`

).If positive, enable density screening in LMP2 (default 0)`DSCREEN`

If positive, enable fit-basis Schwarz screening in LMP2 (default depends on`KSCREEN`

`LOCTRA`

).

### Parameters for fitting domains

The following options can be used to modify the domains used in local fitting. These parameters only have an effect if `LOCFIT`

=1. The local fitting domains are determined in two steps: first *primary* orbital domains are determined. In the LMP2 and LCCSD programs, the primary orbital domains are the same as used for excitation domains and determined by the Boughton-Pulay procedure, as described in Sect. PAO-based local correlation treatments. Depending on the value of `FITDOM_MP2`

or `FITDOM_CCSD`

for LMP2 and LCCSD, respectively, either the orbital domains are used directly or united pair domains are generated. In DF-HF the primary orbital domains include all basis functions at atoms which have Löwdin charges greater or equal to `THRCHG_SCF`

. In the second step the primary fitting domains are extended using either distance criteria (`RDOMAUX`

, in bohr) or bond connectivity criteria (`IDOMAUX`

). `IDOMAUX`

=1 means to include all functions at atoms wich are at most one bond distant from the primary domains. By default, distance criteria are used. However, if `IDOMAUX`

.ge.0, the distance criteria are ignored and connectivity is used.

Parameter to select the primary orbital domains in local exchange fitting (default 0.1). All atoms are included which have Löwdin charges greater than this value. The primary domains are extended according to`THRCHG_SCF`

`RDOMAUX_SCF`

or`IDOMAUX_SCF`

.Parameter to select primary fitting domains in LMP2 transformation (default 3). 1: use orbital domains; 2: use united orbital domains of strong pairs; 3: use united orbital domains of strong and weak pairs (default 3). The primary domains are extended according to`FITDOM_MP2`

`RDOMAUX_MP2`

or`IDOMAUX_MP2`

Similar to`FITDOM_CCSD`

`FITDOM_MP2`

but used for LCCSD 2-ext transformation.Distance criterion for fitting domain extension in SCF (default 5.0)`RDOMAUX_SCF`

Connectivity criterion for fitting domain extension in SCF (default 0)`IDOMAUX_SCF`

Distance criterion for core orbital fitting domain extension in SCF (default`RDOMAUX_CORE`

`RDOMAUX_SCF`

).Connectivity criterion for core orbital fitting domain extension in SCF (default`IDOMAUX_CORE`

`IDOMAUX_SCF`

).Distance criterion for fitting domain extension in the initial SCF iterations (default 3.0).`RDOMSCF_START`

Connectivity criterion for fitting domain extension in the initial SCF iterations (default 1).`IDOMSCF_START`

Distance criterion for fitting domain extension in the final SCF iterations (default`RDOMSCF_FINAL`

`RDOMAUX_SCF`

).Connectivity criterion for fitting domain extension in the final SCF iterations (default`IDOMSCF_FINAL`

`IDOMAUX_SCF`

).Distance criterion for fitting domain extension in LMP2. The default value depends on`RDOMAUX_MP2`

`FITDOM_MP2`

Connectivity criterion for fitting domain extension in LMP2. The default value depends on`IDOMAUX_MP2`

`FITDOM_MP2`

Distance criterion for fitting domain extension in LCCSD. The default value depends on`RDOMAUX_CCSD`

`FITDOM_CCSD`

).Connectivity criterion for fitting domain extension in LCCSD. The default value depends on`IDOMAUX_CCSD`

`FITDOM_CCSD`

.Distance criterion for fitting domain extension in CPHF (default 3.0).`RDOMAUX_CPHF`

Distance criterion for fitting domain extension in gradients (default 5.0).`RDOMAUX_SCFGRD`

Switches the DF-LMP2 analytic gradient to Grimmes SCS scaled MP2 energy functional (default 0).`SCSGRD`

### Miscellaneous control options

There is a rather large number of parameters. Many of these should normally not be changed, and therefore only a subset is described here. A full list can be obtained using

`HELP,CFIT`