% $ this file belongs to the Molcas repository $*/
\section{\program{averd}}
\label{UG:sec:averd}
\index{Program!Averd@\program{Averd}}\index{Averd@\program{Averd}}

\subsection{Description}
\label{UG:sec:averd_description}
%%%<MODULE NAME="AVERD">
%%Description:
%%%<HELP>
%%+Computes average densities and corresponding natural molecular orbitals
%%%</HELP>
\program{Averd} computes average densities and corresponding
natural molecular orbitals. Given a set of density
matrices in the same basis set, an average density matrix is
constructed and diagonalized to give average natural orbitals.
These orbitals have non-integer occupation numbers, although they
usually are fairly well clustered in one strongly occupied
part and one weakly occupied part. From basic mathematical
properties of natural orbitals, a truncated set of the orbitals
constructed this way constitutes the most compact basis of
one-electron functions of that given size. In other words, the smallest
set of functions to span the average space within a certain
accuracy has been obtained. \program{Averd}
is in essence very similar to \program{Genano}.

\subsection{Dependencies}
\label{UG:sec:averd_dependencies}
\program{Averd} needs a set of input densities. Any of the
programs, which  generate a density must precede.

\subsection{Files}
\label{UG:sec:averd_files}
Below is a list of the files that are used/created by
\program{Averd}.

\subsubsection{Input files}
\begin{filelist}
\item[RUNFILE]
File for communication of auxiliary information generated by the program
{\prgmfont SEWARD}.
\item[ONEINT]
File with one-electron integrals generated by {\prgmfont SEWARD}.
\item[RUN***]
A set of RunFiles on which a density matrix is stored. This density
matrix is read and added to the average. If \keyword{ORBItals} is
given, these files are not needed.
\item[NAT***]
A set of orbitals in the format generated by {\prgmfont SCF} or
{\prgmfont RASSCF}. The orbitals are used to generate a density matrix,
which is added to the average. Only required if \keyword{ORBItals} is
given.
\end{filelist}

\subsubsection{Output files}
\begin{filelist}
\item[AVEORB]
The average orbitals generated by \program{Averd}. They are stored in
the same way as SCF-orbitals and can be used as INPORB.
\end{filelist}

\subsection{Input}
\label{UG:sec:averd_input}

\begin{keywordlist}
\item[TITLe]
Title of the calculation.
%%%<KEYWORD MODULE="AVERD" NAME="TITLE" APPEAR="Title" KIND="STRING" LEVEL="BASIC">
%%Keyword: Title <basic>
%%%<HELP>
%%+Title of the calculation
%%%</HELP></KEYWORD>
%--
\item[WSET]
Followed by two rows. On the first the number of input orbitals are
given, $N$. Second row contains $N$ numbers each giving a weight
for the $k^{th}$ input density matrix to the average density. The
weights are normalized by \program{Averd}, hence only the
ratio of the numbers have any significance. {\bf This keyword
is mandatory}.
%%%<KEYWORD MODULE="AVERD" NAME="WSET" APPEAR="Relative weights" KIND="REALS_COMPUTED" SIZE="1" LEVEL="BASIC">
%%Keyword: WSet <compulsory>
%%%<HELP>
%%+Number of input sets of orbitals and relative weight for each of them.
%%%</HELP></KEYWORD>
%--
\item[PRINt]
Print level. 1 is default. Higher than 3 is not recommended for the
average user.
%%%<KEYWORD MODULE="AVERD" NAME="PRINT" APPEAR="Print level" KIND="INT" LEVEL="BASIC" DEFAULT_VALUE="1">
%%Keyword: Print <basic>
%%%<HELP>
%%+Print level. Default is 1.
%%%</HELP></KEYWORD>
%--
\item[ORBItals]
This keyword signifies that the densities should be created from
average orbitals in the files NAT***, not directly from the density
matrices on the files RUN***. The default is to use the density
matrices on RUN***.
%%%<KEYWORD MODULE="AVERD" NAME="ORBITALS" APPEAR="Densities from orbital files" KIND="SINGLE" LEVEL="BASIC">
%%Keyword: Orbitals <basic>
%%%<HELP>
%%+This keyword signifies that the densities should be created from
%%+average orbitals in the NAT*** files, not directly from the density
%%+matrices in the RUN*** files.
%%%</HELP></KEYWORD>
%--
\item[OCCUpation]
Followed by one number. The number of average orbitals with an
occupation higher than this number is reported for each symmetry.
Since the occupation is the guide for how to truncate the orbitals
in subsequent applications, this is an easy way to get hold of
that number. The default is $10^{-5}$.
%%%<KEYWORD MODULE="AVERD" NAME="OCCUPATION" APPEAR="Occupation threshold" KIND="REAL" LEVEL="BASIC" DEFAULT_VALUE="1.0D-5">
%%Keyword: Occupation <basic>
%%%<HELP>
%%+The number of average orbitals with an
%%+occupation higher than this number is reported for each symmetry.
%%+The default is 1.0d-5.
%%%</HELP></KEYWORD>
\end{keywordlist}

\subsubsection{Input example}
In this example, two density matrices are averaged and their
average orbitals are computed.
\begin{inputlisting}
 &Seward
Basis set
O.ano-s.Pierloot.10s6p3d.7s4p2d.
O  0.0000  0.0000  0.3000
End of Basis set
Basis set
H.ano-s.Pierloot.7s3p.4s1p.
H1 0.0000 -1.4300 -0.8070
H2 0.0000  1.4300 -0.8070
End of Basis Set

 &FfPt
Dipo
z 0.005
End of Input

 &Scf
Occupation
5
>>COPY $Project.RunFile RUN001

 &FfPt
Dipo
z -0.005

 &Scf
Occupation
5
End of Input
>>COPY $Project.RunFile RUN002

 &Averd &End
Wset
2
1.0 1.0
Occupation
1d-6

\end{inputlisting}
%%%</MODULE>
