
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Quadratic response functions: \Sec{CCQR}}
\label{sec:ccqr}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

In the \Sec{CCQR} section you have to specify the input for
coupled cluster quadratic response calculations. This section
includes:
\begin{itemize}
\item frequency-dependent third-order properties 
      $$\beta_{ABC}(\omega_A;\omega_B,\omega_C) = -
        \langle\langle A; B, C\rangle\rangle_{\omega_B,\omega_C} 
        \qquad \mbox{with~} \omega_A = -\omega_B - \omega_C
       $$
      where $A$, $B$ and $C$ can be any of the one-electron operators
      for which integrals are available in the \Sec{*INTEGRALS} 
      input part.
\item dispersion coefficients $D_{ABC}(n,m)$ for third-order properties,
      which for $n\ge 0$ are defined by the expansion
      $$ \beta_{ABC}(-\omega_B-\omega_C;\omega_B,\omega_C)  = 
        \sum_{n,m=0}^{\infty} \omega_{B}^n \, \omega_{C}^m \, D_{ABC}(n,m) 
      $$
\end{itemize}
The coupled cluster quadratic response function is at present
implemented for the coupled cluster models CCS, CC2 and CCSD.
Publications that report results obtained by CC quadratic response
calculations should cite Ref.\ \cite{Haettig:CCQR}.
For dispersion coefficients also a citation of 
Ref.\ \cite{Haettig:DISPBETA} should be included.

The response functions are evaluated for a number of 
operator triples (given using the
\Key{OPERAT}, \Key{DIPOLE}, or \Key{AVERAG} keywords) 
which are combined with pairs of frequency arguments specified using the 
keywords \Key{MIXFRE}, \Key{SHGFRE}, \Key{ORFREQ}, \Key{EOPEFR}
or \Key{STATIC}. The different frequency keywords are 
compatible and might be arbitrarely combined or repeated.
For dispersion coefficients use the keyword \Key{DISPCF}.

\begin{description}
\item[\Key{OPERAT}] \verb| |\newline
\verb|READ (LUCMD'(3A)') LABELA, LABELB, LABELC|\newline
\verb|DO WHILE (LABELA(1:1).NE.'.' .AND. LABELA(1:1).NE.'*')|\newline
\verb|  READ (LUCMD'(3A)') LABELA, LABELB, LABELC|\newline
\verb|END DO|

Read triples of operator labels. 
For each of these operator triples the quadratic response
function will be evaluated at all frequency pairs.
Operator triples which do not correspond to symmetry allowed
combination will be ignored during the calculation.
 
\item[\Key{DIPOLE}] 
Evaluate all symmetry allowed elements of the first
dipole hyperpolarizabilitiy (max. 27 components).
 
\item[\Key{PRINT }] \verb| |\newline
     \verb|READ (LUCMD,*) IPRINT|

     Set print parameter for the quadratic response section.
     % \begin{itemize}
     %   \item[0]  ??
     %   \item[5]  ??
     %   \item[10]  ??
     % \end{itemize}
 
%\\  % Experts only option !
% \item[\Key{EXPCOF}] 
% \latex{\begin{minipage}[t]{13cm}}
% \begin{verbatim}
% READ (LUCMD'(A)') LINE
% DO WHILE (LABELA(1:1).NE.'.' .AND. LABELA(1:1).NE.'*')
%   READ (LINE,*) ICA, ICB, ICC
%   READ (LUCMD'(A)') LINE
% END DO
% \end{verbatim}
% \latex{\end{minipage} \\ [2ex]}
% Read triples of order parameters for the expansion coefficients
% $d_{ABC}(l,m,n)$ of the quadratric response function
% \cite{Haettig:DISPBETA}.
 
\item[\Key{AVERAG}] \verb| |\newline
   \verb|READ (LUCMD,'(A)') LINE|

   Evaluate special tensor averages of quadratic response properties.
   Presently implemented are only the vector averages of the first
   dipole hyperpolarizability $\beta_{||}$, $\beta_{\bot}$ and 
   $\beta_K$. All three of these averages are obtained if 
   \verb+HYPERPOL+ is specified on the input line that follows
   \Key{AVERAG}.
   The \Key{AVERAG} keyword should be used before any \Key{OPERAT} 
   or \Key{DIPOLE} input in the \Key{*CCQR} section.
 
\item[\Key{MIXFRE}]  \verb| |\newline
   \verb|READ (LUCMD,*) MFREQ|\newline
   \verb|READ (LUCMD,*) (BQRFR(IDX),IDX=NQRFREQ+1,NQRFREQ+MFREQ)|\newline
   \verb|READ (LUCMD,*) (CQRFR(IDX),IDX=NQRFREQ+1,NQRFREQ+MFREQ)|

   Input for general frequency mixing 
   $\beta_{ABC}(-\omega_B-\omega_C;\omega_B,\omega_C)$: on the first line 
   following \Key{MIXFRE} the number of differenct frequency
   (for this keyword) is read, from the second and third line
   the frequency arguments $\omega_B$ and $\omega_C$ are read
   ($\omega_A$ is set to $-\omega_B-\omega_C$).

\item[\Key{SHGFRE}]  \verb| |\newline
   \verb|READ (LUCMD,*) MFREQ|\newline
   \verb|READ (LUCMD,*) (BQRFR(IDX),IDX=NQRFREQ+1,NQRFREQ+MFREQ)|

   Input for second harmonic generation $\beta_{ABC}(-2\omega;\omega,\omega)$:
   on the first line following \Key{SHGFRE} the number of different
   frequencies is read, from the second line the input for 
   $\omega_B = \omega$ is read. $\omega_C$ is set to $\omega$ 
   and $\omega_A$ to $-2\omega$.

\item[\Key{ORFREQ}]  \verb| |\newline
   \verb|READ (LUCMD,*) MFREQ|\newline
   \verb|READ (LUCMD,*) (BQRFR(IDX),IDX=NQRFREQ+1,NQRFREQ+MFREQ)|

   Input for optical rectification $\beta_{ABC}(0;\omega,-\omega)$:
   on the first line following \Key{SHGFRE} the number of different
   frequencies is read, from the second line the input for 
   $\omega_B = \omega$ is read. $\omega_C$ is set to $\omega_C = -\omega$ and
   $\omega_A$ to $0$.

\item[\Key{EOPEFR}]  \verb| |\newline
   \verb|READ (LUCMD,*) MFREQ|\newline
   \verb|READ (LUCMD,*) (BQRFR(IDX),IDX=NQRFREQ+1,NQRFREQ+MFREQ)|

   Input for the electro optical Pockels effect 
   $\beta_{ABC}(-\omega;\omega,0)$:
   on the first line following \Key{SHGFRE} the number of different
   frequencies is read, from the second line the input for 
   $\omega_B = \omega$ is read. $\omega_C$ is set to $0$ and
   $\omega_A$ to $\omega_A = -\omega$.

\item[\Key{STATIC}] 
   Add $\omega_A = \omega_B = \omega_C = 0$ to the frequency list.

\item[\Key{DISPCF}]  \verb| |\newline
   \verb|READ (LUCMD,*) NQRDSPE|

   Calculate the dispersion coefficients 
   $D_{ABC}(n,m)$ up to order $n+m =$\verb+NQRDSPE+. 
 
% \item[\Key{ALLDSP}]  debug option only!

\item[\Key{XYDEGE}] 
Assume X and Y directions as degenerate in the calculation
of the hyperpolarizability averages (this will prevent
the program to use the components $\beta_{zyy}$, $\beta_{yzy}$
$\beta_{yyz}$ for the computation of the vector averages).

\item[\Key{NOBMAT}] 
Test option:
Do not use B matrix transformations but pseudo F matrix 
transformations (with the zeroth-order Lagrange multipliers 
exchanged by first-order responses) to compute the terms
$\bar{t}^A {\bf B} t^{B} t^{C}$. This is usually less
efficient.

\item[\Key{USE R2}] 
Test option: use second-order response vectors instead of
first-order Lagrange multiplier responses.
 
\end{description}
