Localized Molecular Orbitals
****************************


Boys-Foster and Pipek-Mezey localization
========================================

With the LOCORB key ADF provides the Boys-Foster method and Pipek-
Mezey method for localization of molecular orbitals [1] [2] [3]. This
implies a unitary transformation of the occupied molecular orbitals as
computed in the SCF procedure, with the objective of obtaining a
(transformed) set of orbitals that represent exactly the same charge
density but with molecular orbitals that are more localized in space
than the original MOs.

These localization methods cannot be used in case of spin-orbit
coupling.

The goal of orbital localization lies in analysis: the localized
orbitals provide an easier-to-interpret picture. The localized
molecular orbitals can be visualized with the ADF-GUI.

Orbital localization procedures require a measure of the localization
of the orbitals which can then be optimized in the space of the
allowed unitary transformations. Methods advocated in the literature
differ in the definition of this measure. The Boys-Foster method
minimizes the mean extension of the occupied orbitals around their
center of gravity; see the literature for details. The Pipek-Mezey
localization maximizes the sum of orbital-dependent partial charges on
the nuclei, see the literature for details. Both Boys-Foster
localization method and Pipek-Mezey localization method have been
implemented in ADF, see Ref. [1].

Occasionally it is useful to apply the localization only to a subset
of the MOs, with the objective to expose certain features better. This
is accomplished by performing the localization in a number of distinct
steps, where at each step the localization is restricted by keeping a
subset of the MOs frozen. A case is worked out in the Examples
document.

The computation of localized orbitals is controlled with the block-
type key. By default (if the key is not supplied in input) no orbital
localization is carried out.

   LOCORB {nopop store}
     {Criterion <BOYS|PM>}
     Spintype FrozenMOs
     Spintype FrozenMOs
     ...
   End

"nopop"
   Specifies that no SFO population analysis is to be carried out on
   the localized MOs. By default this population analysis will be
   printed in the output file.

"store"
   Specifies that the transformation from MOs to localized MOs is
   stored on adf.rkf (TAPE21).

"Criterion <BOYS|PM>"
   By default the Boys-Foster localization method is used if Criterion
   is not specified and in case 'Criterion BOYS' is specified. If
   'Criterion PM' is specified, the Pipek-Mezey localization method is
   used.

"Spintype"
   Must be either alfa or beta (not case sensitive) and refers to
   spin-A and spin-B orbitals respectively. In a spin-restricted run
   beta records are meaningless and must not be used.

"FrozenMOs"
   A list (possibly empty) of integers, referring to a list of MOs
   from the SCF, and/or labels of irreducible representations. The
   integers and/or labels may be given in any order.

Each record Spintype FrozenMOs in the data block defines a
localization *cycle* in which the localization procedure is carried
out on all orbitals (of the indicated spin), except those indicated by
the FrozenMOs.

For either spin at least one localization cycle is carried out. If no
data record for that spin is found in the data block, a full
localization is performed, without any MOs excluded.

The data block may be completely empty (but the record end must be
supplied since the key is block-type) and would be equivalent with
specifying two records, one for either spin, without any FrozenMOs:

   LOCORB {nopop}
   End

is equivalent with

   LOCORB {nopop}
     alfa
     beta
   End

The integers in FrozenMOs refer to an overall list of SCF MOs
consisting of all valence MOs in each symmetry representation up to
and including the highest non-empty one. So, when for instance in the
first irrep MO #4 is the highest non-empty one and in the second irrep
mo #2 is the highest non-empty one, then in the overall list the first
4 are the orbitals of the first irrep, the no.s 5 and 6 are from the
second irrep, et cetera.

Each symmetry label in FrozenMOs collectively denotes in one stroke
all molecular orbitals of that representation up to and including the
highest occupied one (in that symmetry). The label may be the name of
an irreducible representation or of a subspecies. In the former case
all partner representations are denoted collectively. In an atom
symmetry for instance, specifying P would be equivalent to P:x P:y
P:z.

Note that if the final SCF has in any symmetry representation empty
orbitals *below* the highest non-empty orbital in that symmetry -
violating the Aufbau principle - then these empty orbitals are
included in the above-defined overall list and hence a FrozenMOs
specification is necessary, namely to avoid mixing MOs with different
occupation numbers in the localization.

Note:

  It is imperative that in a particular localization cycle only MOs
  from the SCF are combined that have identical occupation numbers. If
  this is violated the program will carry out the localization without
  error message, but the results are incorrect in the sense that the
  density defined by the localized orbitals is *not* the same anymore
  as the SCF density.So, if any of the MOs in the overall list defined
  above is not fully occupied (open shell, excited state, ...) you
  need to define precisely the localization cycles - localizing in
  each cycle only MOs with identical occupations and freezing all
  others - in order to obtain sensible results.

In the output file the localized MOs are printed as expansions in SFOs
and (optionally) a population analysis is given, again in terms of the
SFOs. Furthermore, each localized MO has associated with it an energy
value and an occupation number. The energy is the expectation value of
the Fock operator for the orbital. The occupation number is obtained
as a weighted sum from the SCF MOs that were combined into the
localized orbital. As mentioned before one should combine only SCF MOs
with identical occupations into a localized orbital, in which case its
occupation number will be the same. The printout of the occupation
number of the localized orbital allows therefore a verification that a
correct localization procedure has been carried out.


Perturbed Localized Molecular Orbitals
--------------------------------------

Perturbed localized molecular orbitals, correct to first order in an
applied field, can be calculated in case of AORESPONSE. Can be used if
the applied field changes the density in first order. Ref. [1]
describes this functionality and the implementation in ADF in detail,
and gives some examples. The perturbed localized molecular orbitals
can be visualized with the ADF-GUI. In addition to the AORESPONSE and
the LOCORB key one has to specify the PERTLOC key in order to
calculate these perturbed localized molecular orbitals. The optional
subkeywords of the block key PERTLOC are described below.

   LOCORB ..
     ..
   End
   AORESPONSE
     ..
   End
   PERTLOC
     efield
     bfield
     alfa
     gprime
     beta
     <static|dynamic>
     <diag|fulltens>
   End

"efield"
   The perturbation is an electric field (default).

"bfield"
   The perturbation is a magnetic field. Should be consistent with
   AORESPONSE.

"alfa"
   Analyze the static or dynamic polarizability.

"gprime"
   Analyze the G' (gyration) tensor, for optical rotation dispersion.
   Requires a frequency dependent perturbation field, with a frequency
   (omega) unequal to zero.

"beta"
   Analyze the optical rotation parameter beta. The relation to G' is
   beta = -G'/omega. The optical rotation parameter beta is calculated
   directly [4] and has a well-defined static limit, i.e. omega can be
   zero or non-zero.

"<static|dynamic>"
   The static or dynamic (frequency dependent) subkeyword should be
   consistent with what is used in AORESPONSE. Static is default,
   should be used for a static field. Dynamic should be used for a
   frequency dependent perturbation field.

"<diag|fulltens>"
   Diag is default, which will only analyze the diagonal of the
   response tensor. If fulltens is specified the full tensor is
   analyzed.


Reduction of Orbital Space Extent (ROSE)
========================================

ROSE (Reduction of Orbital Space Extent) aims at constructing
intrinsic fragment orbitals (IFOs), see Ref. [5], and recanonicalized
intrinsic localized molecular orbitals (RILMOs), see Ref. [6]. With
the external ROSE package (see https://gitlab.com/quantum_rose/rose,
this package is not distributed by SCM), one can calculate such
orbitals for different types of basis functions. In AMS2025 the ROSE
functionality relating to Slater-Type Orbitals has been made available
inside ADF.

The basic idea used in ROSE is to define an intrinsic minimal basis
set of polarized orbitals which span the occupied space exactly and
also covers the valence part of the unoccupied, or virtual, orbital
space. These intrinsic fragment orbitals are localized and not very
basis set dependent and therefore form a good starting point for
analysis. They are furthermore used as a reference in a localization
procedure in which the occupied orbitals are unitarily transformed
into RILMOs that typically resemble the occupied MOs of the reference
fragment calculations. The same localization procedure is also applied
to localize the valence virtuals that together with the occupied
RILMOs span the IFO space. As the thus generated virtual space is too
small to reach quantitative accuracy in TDDFT calculations, it is
necessary to also add the so-called 'hard' virtuals, see Ref. [6], to
the virtual space. This is done, slightly different from the procedure
reported in Ref. [6], by defining a set of reference virtuals on the
fragments. The generation of localized hard virtuals follows then in
mathematically exactly the same way as the construction of valence
intrinsic fragment orbitals. The difference is that an energy-
truncated space, complementary to the already localized valence space,
is now the target. This procedure combines energy localization and
spatial localization to allow for subsystem TDDFT treatments, see
section on exciton transfer integrals with ROSE and Ref. [6].

Next we only discuss the functionality of ROSE that is available
inside ADF. In this implementation spin-orbit coupling cannot be used,
spin-restricted orbitals should be used, and all-electron basis sets
should be used.

Starting point for ROSE calculations is always to divide the target
molecule or complex into 2 or more chemically relevant fragments. One
needs to calculate these fragments using SYMMETRY NOSYM, and the
fragment nuclear coordinates should match the corresponding
coordinates in the full molecule or complex. The subsequent ADF
calculation on the full molecule or complex should also use symmetry
NOSYM. It is convenient to use the same basis set as used in the
fragments to make sure that the reference virtual space is large
enough to cover the (energy-truncated) supermolecular virtual space.

An input that calculates localized orbitals with the ROSE
implementation in ADF could look like

   AMS_JOBNAME=Frag1 $AMSBIN/ams <<eor
   System
     atoms
       coordinates Frag1
     end
   end
   Task SinglePoint
   Engine ADF
     basis
       ...
       core None
     end
     symmetry nosym
     ...
   EndEngine
   eor

   AMS_JOBNAME=Frag2 $AMSBIN/ams <<eor
   System
     atoms
       coordinates Frag2
     end
   end
   Task SinglePoint
   Engine ADF
     basis
       ...
       core None
     end
     symmetry nosym
     ...
   EndEngine
   eor

   $AMSBIN/ams <<eor
   System
     atoms
       coordinates Frag1
       coordinates Frag2
     end
   end
   Task SinglePoint
   Engine ADF
     basis
       ...
       core None
     end
     symmetry nosym
     ROSE
       fragmentfile Frag1.results/adf.rkf
       fragmentfile Frag2.results/adf.rkf
     End
     ...
   EndEngine
   eor

The calculated intrinsic orbitals can be visualized with the AMS-GUI.

The ROSE block key should contain the FragmentFile key. Other keys are
optional.

   ROSE
      Additional_virtuals_cutoff float
      Exponent integer
      Frag_bias float_list
      Frag_threshold float
      Frag_valence integer_list
      FragmentFile string
      Version [Stndrd_2013 | Simple_2013 | Simple_2014]
      nfragments integer
   End

"ROSE"
   Type:
      Block

   Description:
      Options for orbital localization

   "Additional_virtuals_cutoff"
      Type:
         Float

      Default value:
         2.0

      Unit:
         Hartree

      GUI name:
         Additional virtuals cutoff

      Description:
         Specifies the energy threshold to determine the number of
         additional hard virtuals to localize for the supermolecule.
         If not specified the default value is used.

   "Exponent"
      Type:
         Integer

      Description:
         The value of the exponent (for the default Pipek-Mezey type
         of localization, the exponent is equal to 2. A higher value
         of 3 or 4 is sometimes useful.).

   "Frag_bias"
      Type:
         Float List

      Description:
         Expert key. Specifies the bias applied to each fragment when
         assigning the localized orbitals to a particular fragment.
         Use a negative value for default behavior for a given
         fragment. If not specified, or if the number of items is
         unequal the number of fragments, a default bias is used.

   "Frag_threshold"
      Type:
         Float

      Default value:
         10.0

      Unit:
         Hartree

      GUI name:
         Frag threshold

      Description:
         Specifies energy threshold to determine number of reference
         hard virtuals to use for the fragments (needed to localize
         the additional hard virtuals). The total number of reference
         virtuals should be larger than the number of virtual MOs to
         localize (similar to having more reference valence orbitals
         than occupied valence orbitals to localize), so it is
         advisable to use a relatively high value for this parameter.
         If not specified the default value is used.

   "Frag_valence"
      Type:
         Integer List

      Description:
         Expert key. Specifies the number of valence orbitals for each
         fragment. Use a negative value for default behavior for a
         given fragment. If not specified, or if the number of items
         is unequal the number of fragments, by default the code
         generates the valence space for each fragment as the sum of
         valence orbitals of individual atoms within each fragment.

   "FragmentFile"
      Type:
         String

      Recurring:
         True

      Description:
         Path (either absolute or relative) of each fragment file. The
         number of fragments used to project on will be number of
         occurrences of this key.

   "Version"
      Type:
         Multiple Choice

      Options:
         [Stndrd_2013, Simple_2013, Simple_2014]

      Description:
         Expert key, specifies version of the IAO generation. If not
         specified a default value is used.

   "nfragments"
      Type:
         Integer

      Default value:
         2

      Description:
         Expert key, preferably use the FragmentFile key for each
         fragment instead, and do not use this key. If the
         FragmentFile key is not used, then with this key one can
         specify the number of fragments used to project on. If this
         key is used the fragment file names should be called
         frag1.rkf, frag2.rkf, etcetera, and should be present at the
         directory where ams is started.


Natural Bond Orbitals (NBO)
===========================

See the section on NBO analysis for localized orbitals that are
calculated in case of NBO.

[1] J. Autschbach and H.F. King, *Analyzing molecular static linear
    response properties with perturbed localized orbitals*, Journal of
    Chemical Physics 133, 044109 (2010)

[2] C. Edmiston and K. Rudenberg, *Localized Atomic and Molecular
    Orbitals*, Reviews of Modern Physics 35, 457 (1963)

[3] J.M Foster and S.F. Boys, *Canonical Configurational Interaction
    Procedure*, Reviews of Modern Physics 32, 300 (1960)

[4] S.J.A. van Gisbergen, J.G. Snijders and E.J. Baerends, *A Density
    Functional Theory study of frequency-dependent polarizabilities
    and van der Waals dispersion coefficients for polyatomic
    molecules*, Journal of Chemical Physics 103, 9347 (1995)

[5] B. Senjean, S. Sen, M. Repisky, G. Knizia, and L. Visscher,
    *Generalization of Intrinsic Orbitals to Kramers-Paired Quaternion
    Spinors, Molecular Fragments, and Valence Virtual Spinors*,
    Journal of Chemical Theory and Computation 17, 1337 (2021)

[6] S. Sen, B. Senjean, L. Visscher, *Characterization of excited
    states in time-dependent density functional theory using localized
    molecular orbitals*, Journal of Chemical Physics 158, 054115
    (2023)
