% $ this file belongs to the Molcas repository $
\section{\program{poly\_aniso}}
%%%<MODULE NAME="POLY_ANISO" APPEAR="Poly_Aniso">
%%Description:
%%%<HELP>
%%+The POLY_ANISO program allows the non-perturbative calculation of
%%+effective spin (pseudospin) Hamiltonians and static magnetic properties
%%+of mononuclear complexes and fragments completely ab initio,including
%%+the spin-orbit interaction. As a starting point it uses the results
%%+of a RASSI calculation for the ground and several excited spin-orbital
%%+multiplets.
%%+The following quantities can be computed:
%%+
%%+ 1. Parameters of pseudospin magnetic Hamiltonians:
%%+    a)  First order (linear after pseudospin) Zeeman splitting tensor (g tensor),
%%+        inclding the determination of the sign of the product gX*gY*gZ
%%+    b)  Second order (bilinear after pseudospin) zero-field splitting tensor (D tensor)
%%+    c)  Higher order zero-field splitting tensors (D^2, D^4, D^6, ... etc.)
%%+    d)  Higher order Zeeman splitting tensors (G^1, G^3, G^5, ... , etc.)
%%+    e)  Angular Moments along the main magnetic axes
%%+
%%+ 2. Crystal-Field parameters for the ground atomic multiplet for lanthanides
%%+
%%+ 3. Static magnetic properties:
%%+    a)  Van Vleck susceptibility tensor
%%+    b)  Powder magnetic susceptibility function
%%+    c)  Magnetization vector for specified directions of the applied magnetic field
%%+    d)  Powder magnetization
%%%</HELP>

\label{UG:sec:poly_aniso}
\index{Program!Poly\_aniso@\program{Poly\_Aniso}}\index{Poly\_Aniso@\program{Poly\_Aniso}}

%--------------  MAIN DESCRIPTION OF THE CODE -------------------

The \program{POLY\_ANISO} program is a routine which allows a semi-ab initio
description of the (low-lying) electronic structure and magnetic properties
of polynuclear compounds. It is based on the localized nature of the magnetic
orbitals (i.e. the $d$ or $f$ orbitals containing unpaired electrons \cite{Anderson1959,Anderson1963}).
For many compounds of interest, the localized character of magnetic orbitals leads
to very weak character of the interactions between magnetic centers. Due to this weakness of the
interaction, the metals' orbitals and corresponding localized ground and excited states
may be optimized in the absence of the magnetic interaction at all. For this purpose, various fragmentation
models may be applied. The most commonly used fragmentation model is exemplified in Scheme 1.



\begin{figure}
\centering
\scalebox{0.50}{\rotatebox{270}{\myincludegraphics{users.guide/programs/fragment}}}
\caption{Fragmentation model of a polynuclear compound. The upper scheme shows a schematic overview of a tetranuclear compund and the resulting four mononuclear fragments obtained by {\it diamagnetic atom substitution} method. By this scheme, the neighboring magnetic centers, containing unpaired electrons are computationally replaced by their diamagnetic requivalents. As example, transition metal sites TM(II) are best replaced by either diamagnetic Zn(II) or Sc(III), in function which one is the closest. For lanthanides Ln(III) the same principle is applicable, La(III) or Lu(III) are best suited to replace a given magnetic lanthanide. Individual mononuclear metal framgents are then investigated by common CASSCF/CASPT2/RASSI/SINGLE\_ANISO  computational method. A single file for each magnetic site, produced by the \program{SINGLE\_ANISO} run, is needed by the \program{POLY\_ANISO} code as input.}
\label{fig:fragment}
\end{figure}

Magnetic interaction between metal sites is very important for accurate description of low-lying states and their properties.
It can be considered as a sum of various interaction mechanisms: magnetic exchange, dipole-dipole interaction, antisymmetric exchange, etc.
In the \program {POLY\_ANISO} code we have implemented several mechanisms.

The description of the magnetic exchange interaction is done within the Lines model \cite{Lines1971}.
This model is exact in three cases:
\begin {itemize}
\item{ a) interaction between two isotropic spins (Heisenberg)},
\item{ b) interaction between one Ising spin (only $S_{z}$ component) and one isotropic (i.e. usual) spin}, and
\item{ c) interaction between two Ising spins.}
\end{itemize}
In all other cases of interaction between magnetic sites with intermediate anisotropy, the Lines model represents an
approximation. However, it was succesfully applied for a wide variety of polynuclear compounds so far.

In addition to the magnetic exchange, magnetic dipole-dipole interaction can be accounted exactly, by
using the information about each metal site already computed \textit{ab initio}. In the case of
strongly anisotropic lanthanide compounds, the dipole-dipole interaction is usualy the dominant
one. Dipolar magnetic coupling is one kind of long-range interaction between magnetic moments.
For example, a system containing two magnetic dipoles $\mu_{1}$ and $\mu_{2}$, separated by
distance $\vec r$ have a total energy:
\begin{equation}
E_{dip} = \frac{\mu_{Bohr}^{2}}{ r^{3}} [\vec\mu_{1} \cdot \vec\mu_{2} - 3(\vec \mu_{1} \vec n_{12})\cdot (\vec \mu_{2} \vec n_{12})],
\end{equation}
where $\vec\mu_{1,2}$ are the magnetic moments of sites 1 and 2, respectively; $r$ is the distance between
the two magnetic dipoles, $\vec n_{12}$ is the directional vector connecting the two magnetic dipoles (of unit length).
$\mu_{Bohr}^{2}$ is the square of the Bohr magneton; with an approximative value of 0.43297 in cm$^{-1}$/Tesla.
As inferred from the above Equation, the dipolar magnetic interaction depends on the distance and on the angle between the magnetic moments on magnetic
centers. Therefore, the cartesian coordinates of all non-equivalent magnetic centers must be provided in the input (see the keyword COOR).




%\begin {itemize}
%\item Parameters of pseudospin magnetic Hamiltonians (the methodology is described in \cite{Chibotaru:3}):
%\begin {enumerate}
%\%item First rank (linear after pseudospin) Zeeman splitting tensor $g_{\alpha\beta}$, its main values, including the sign of the product $g_{X} \cdot g_{Y} \cdot g_{Z}$, and the main magnetic axes.
%\item Second rank (bilinear after pseudospin) zero-field splitting tensor $D_{\alpha\beta}$, its main values and the anisotropy axes. The anisotropy axes are given in two coordinate systems: a) in the initial Cartesian coordinate system ({\it x, y, z}) and b) in the coordinate system of the main magnetic axes ({\it Xm, Ym, Zm}).
%\item Higher rank ZFS tensors ($D^4, D^6, $ ... , etc.) and Zeeman splitting tensors ($G^3, G^5,$ ... , etc.) for complexes with moderate and strong spin-orbit coupling.
%\item Angular moments along the main magnetic axes.
%\end {enumerate}

%\item All (27) parameters of the {\it ab initio} Crystal field acting on the ground atomic multiplet of lanthanides, and the decomposition of the CASSCF/RASSI wave functions into functions with definite projections of the total angular moment on the quantization axis.

%\item Static magnetic properties:
%\begin {enumerate}
%\item Van Vleck susceptibility tensor  $\chi_{\alpha\beta}(T)$
%\item Powder magnetic susceptibility function ${\chi}(T)$
%\item Magnetization vector $\vec M (\vec H)$ for specified directions of the applied magnetic field $\vec H$
%\item Powder magnetization ${M_{mol}(H)}$
%\end {enumerate}
%\end {itemize}
%
%The magnetic Hamiltonians are defined for a desired group of $N$ electronic states obtained in \program{RASSI} calculation to which a pseudospin \textit{\~S} (it reduces to a true spin \textit{S} in the absence of spin-orbit coupling) is subscribed according to the relation $N=2$\textit{\~S}$+1$. For instance, the two wave functions of a Kramers doublet correspond to \textit{\~S}=1/2. The implementation is done for \textit{\~S}=1/2, 1, 3/2, ... ,15/2.

%The second version of the \program{POLY\_ANISO} program allows the calculation of all 27 parameters of the exact Crystal-Field acting on the ground atomic multiplet for lanthanides. Moreover, the {\it ab initio} wave functions corresponding to the lowest atomic multiplet $|J,M_J>$ are decomposed in a linear combination of functions with definite projection of the total moment on the quantization axis.

%The calculation of magnetic properties takes into account the contribution of excited states (the ligand-field and charge transfer states of the complex or mononuclear fragment included in the RASSI calculation) via their thermal population and Zeeman admixture. The intermolecular exchange interaction between magnetic molecules in a crystal can be taken into account during the simulation of magnetic properties by a phenomenological parameter $zJ$ specified by the user (see keyword MLTP).
%
%\subsection{Dependencies}
%\label{UG:sec:single_aniso_dependencies}
%\index{POLY\_ANISO!Dependencies}\index{Dependencies!POLY\_ANISO}
%The \program{POLY\_ANISO} program takes all needed {\it ab initio} information from the \file{RUNFILE}: i.e. matrix elements of angular momentum, spin-orbit energy spectrum and mixing coefficients, number of mixed states and their multiplicity, etc. In order to find the necessary information in the \file{RUNFILE}, the keywords MEES and SPIN are mandatory for \program{RASSI}. The \program {SEWARD} keyword ANGM is also compulsory.
%
%


%--------------  MAIN DESCRIPTION OF THE REQUIRED FILES -------------------
%\subsection{Files}
% \label{UG:sec:single_aniso_files}
%\index{POLY\_ANISO!Files}\index{Files!POLY\_ANISO}
%
\subsubsection{Input files}
The program Poly\_Aniso needs the following files:
\begin{filelist}
\item[aniso\_XX.input] This is an ASCII text file generated by the MOLCAS/SINGLE\_ANISO program.
It should be provided for POLY\_ANISO \textit {aniso\_i.input} ($i=$1, 2, 3 etc.): one file for each magnetic center.
In cases when the entire polynuclear cluster or molecule has exact point group symmetry, only
\textit{aniso\_i.input} files for crystallographically non-equivalent centers should be given.
\item[chitexp.input]  -- set directly in the standard input (key TEXP)
\item[magnexp.input]  -- set directly in the standard input (key HEXP)
\end{filelist}


\subsubsection{Output files}
\begin{filelist}
\item[zeeman\_energy\_$xxx$.txt]
A series of files named \textit{zeeman\_energy\_$xxx$.txt} is produced in the \$WorkDir only in case keyword ZEEM is
employed (see below). Each file is an ASCII text formated and contains Zeeman spectra of the investigated
compound for each value of the applied magnetic field.
\item[chit\_compare.txt]
A text file contining the experimental and calculated magnetic susceptibility data.
\item[magn\_compare.txt]
A text file contining the experimental and calculated powder magnetisation data.
\end{filelist}
Files \file{chit\_compare.txt} and \file{chit\_compare.txt} may be used in connection with a simple \program{GNUPLOT} script
in order to plot the comparison between experimental and calculated data.





%--------------  MAIN DESCRIPTION OF THE KEYWORDS DEFINED IN THE STANDARD INPUT -------------------
\subsection{Input}
\label{UG:sec:poly_aniso_input}
\index{Input!POLY\_ANISO}\index{POLY\_ANISO!Input}
This section describes the keywords used to control the standard input file.
Only two keywords NNEQ, PAIR (and SYMM if the polynuclear cluster has symmetry) are
mandatory for a minimal execution of the program, while the other keywords allow
customization of the execution of the \program{POLY\_ANISO}.

\subsubsection{Mandatory keywords defining the calculation}

\textit{Keywords defining the polynuclear cluster}
\begin{keywordlist}
%%---
\item[NNEQ]
%%%%<KEYWORD MODULE="POLY_ANISO" NAME="TITLE" KIND="STRING" LEVEL="BASIC">
%%%Keyword: TITLE basic
%%%%<HELP>
%%%+One line following this one is regarded as title.
%%%%</HELP></KEYWORD>

This keyword defines several important parameters of the calculation. On the
first line after the keyword the program reads 2 values:
1) the number of types of different magnetic centers (NON-EQ) of the cluster and
2) a letter $T$ or $F$ in the second position of the same line.
The number of NON-EQ is the total number of magnetic centers of the cluster
which cannot be related by point group symmetry.
In the second position the answer to the question: \textit{Have all NON-EQ centers been computed ab initio?}
is given: $T$ for \textit{True} and $F$ for \textit{False}.
On the following line the program will read NON-EQ values specifying the
number of equivalent centers of each type.
On the following line the program will read NON-EQ integer numbers specifying
the number of low-lying spin-orbit functions from each center forming the local
exchange basis.

Some examples valid for situations where all sites have been
computed \textit {ab initio} (case $T$, \textit {True}):

\begin{tabular}{p{0.3\linewidth} p{0.3\linewidth} p{0.3\linewidth}}
%\begin{inputlisting}
{\color{Blue} \texttt {NNEQ}} & {\color{Blue} \texttt {NNEQ}}     & {\color{Blue} \texttt {NNEQ}}  \\
 \texttt {2  T}  &  \texttt {3  T}     &  \texttt {6  T} \\
 \texttt {1  2}  &  \texttt {2  1  1}  &  \texttt {1  1  1  1  1  1} \\
 \texttt {2  2}  &  \texttt {4  2  3}  &  \texttt {2  4  3  5  2  2} \\
%\end{inputlisting}
\hline
\cellcolor{gray!15}{\tiny There are two kinds of magnetic centers in the cluster; both have been computed ab initio;
       the cluster consists of 3 magnetic centers: one center of the first kind and two centers
       of the second kind. From each center we take into the exchange coupling only the ground
       doublet. As a result the Nexch=$2^1 \times 2^2=8$  \textit{aniso\_1.input} (for $–$ type 1)
       and \textit{aniso\_2.input} (for $–$ type 2) files must be present.} &
\cellcolor{gray!15}{\tiny There are three kinds of magnetic centers in the cluster; all three have been computed ab initio;
       the cluster consists of four magnetic centers: two centers of the first kind, one center of the
       second kind and one center of the third kind. From each of the centers of the first kind we take
       into exchange coupling four spin-orbit states, two states from the second kind and three states
       from the third center. As a result the Nexch=$4^2 \times 2^1 \times 3^1=96$.
       Three files \textit {aniso\_i.input} for each center ($i$=1,2,3) must be present.} &
\cellcolor{gray!15}{\tiny There are 6 kinds of magnetic centers in the cluster; all six have been computed ab initio;
       the cluster consists of 6 magnetic centers: one center of each kind. From the center of the
       first kind we take into exchange coupling two spin-orbit states, four states from the second center,
       three states from the third center, five states from the fourth center and two states from the
       fifth and sixth centers. As a result the Nexch=$2^1 \times 4^1 \times 3^1 \times 5^1 \times 2^1 \times 2^1=480$.
       Six files \textit {aniso\_i.input} for each center ($i$=1,2,...,6) must be present.} \\
\hline
\end{tabular}

Only in cases when some centers have NOT been computed ab initio (i.e. for which no aniso\_i.input file exists),
the program will read an additional line consisting of NON$-$EQ letters ($A$ or $B$) specifying the type of each of
the NON$-$EQ centers:
$A$ – the center is computed ab initio and $B –$ the center is considered isotropic.
On the following \texttt{number$-$of$-$B$-$centers} line(s) the isotropic $g$ factors of the
center(s) defined as $B$ are read. The spin of the $B$ center(s) is defined: $S=(N-1)/2$,
where $N$ is the corresponding number of states to be taken into the exchange coupling
for this particular center.

Some examples valid for mixed situations: the system consists of centers computed \textit{ab initio} and
isotropic centers (case $F$, \textit {False}):

\begin{tabular}{p{0.3\linewidth} p{0.3\linewidth} p{0.3\linewidth}}
{\color{Blue} \texttt {NNEQ}} & {\color{Blue} \texttt {NNEQ}}     & {\color{Blue} \texttt {NNEQ}}  \\
 \texttt {2  F}  &  \texttt {3  F}     &  \texttt {6  F} \\
 \texttt {1  2}  &  \texttt {2  1  1}  &  \texttt {1  1  1  1  1  1} \\
 \texttt {2  2}  &  \texttt {4  2  3}  &  \texttt {2  4  3  5  2  2} \\
 \texttt {A  B}  &  \texttt {A  B  B}  &  \texttt {B  B  A  A  B  A} \\
 \texttt {2.3 }  &  \texttt {2.1}      &  \texttt {2.12} \\
 \texttt { }     &  \texttt {2.0}      &  \texttt {2.43} \\
 \texttt { }     &  \texttt { }        &  \texttt {2.00} \\
\hline
\cellcolor{gray!15}{\tiny There are two kinds of magnetic centers in the cluster;
       the center of the first type has been computed \textit{ab initio}, while the
       centers of the second type are considered isotropic with $g=$2.3; the cluster
       consists of three magnetic centers: one center of the first kind and two centers
       of the second kind. Only the ground doublet state from each center is considered
       for the exchange coupling. As a result the Nexch=$2^1 \times 2^2=8$.
       File \textit{aniso\_1.input} (for $–$ type 1) must be present.} &
\cellcolor{gray!15}{\tiny There are three kinds of magnetic centers in the cluster;
       the first center type has been computed \textit{ab initio}, while the
       centers of the second and third types are considered isotropic with $g=$2.1 (second type)
       and $g=$2.0 (third type); the cluster consists of four magnetic centers: two centers
       of the first kind, one center of the second kind and one center of the third kind.
       From each of the centers of the first kind, four spin-orbit states are considered
       for the exchange coupling, two states from the second kind and three states from the
       center of the third kind.
       As a result the Nexch=$4^2 \times 2^1 \times 3^1=96$.
       The file \textit {aniso\_1.input} must be present.} &
\cellcolor{gray!15}{\tiny There are six kinds of magnetic centers in the cluster; only
       three centers have been computed \textit{ab initio}, while the other three centers
       are considered isotropic; the $g$ factor of the first center is 2.12 ($S=1⁄2$);
       of the second center 2.43 ($S=3⁄2$); of the fifth center 2.00 ($S=1⁄2$); the entire
       cluster consists of six magnetic centers: one center of each kind. From the center
       of the first kind, two spin-orbit states are considered in the exchange coupling,
       four states from the second center, three states from the third center, five
       states from the fourth center and two states from the fifth and sixth centers.
       As a result the Nexch=$2^1 \times 4^1 \times 3^1 \times 5^1 \times 2^1 \times 2^1=480$.
       Three files \textit {aniso\_3.input} and \textit{aniso\_4.input} and \textit{aniso\_6.input}
       must be present.} \\
\hline
\end{tabular}

There is no maximal value for NNEQ, although the calculation becomes quite heavy in case the number of
exchange functions is large.

\item[SYMM]
%%%%<KEYWORD MODULE="POLY_ANISO" NAME="TYPE" KIND="INT" LEVEL="BASIC">
%%%Keyword: TYPE basic
%%%%<HELP>
%%%+Specifies which magnetic properties must be computed. The program will read one of the following numbers (1-7):
%%+
%%+ 1:  --  the g- and D-tensors (only)
%%+ 2:  --  the powder magnetic susceptibility, the magnetic susceptibility tensor,
%%+         magnetic susceptibility in the direction of the main magnetic axis.
%%+ 3:  --  the  powder molar magnetization, the magnetization vectors for certain directions of the field.
%%+ 4:  --  1 + 2
%%+ 5:  --  1 + 3
%%+ 6:  --  2 + 3
%%+ 7:  --  1 + 2 + 3.  This is the default value.
%+
%%%</HELP></KEYWORD>
Specifies rotation matrices to symmetry equivalent sites. This keyword is mandatory in the case more centers of a given type are present in the calculation.
This keyword is mandatory when the calculated polynuclear compound has exact crystallographic point group symmetry. In other words, when the number of
equivalent centers of any kind $i$ is larger than 1, this keyword must be employed. Here the rotation matrices from the one
center to all the other of the same type are declared.
On the following line the program will read the number $1$ followed on the next lines by as many 3x3 rotation matrices as the total number of
equivalent centers of type $1$. Then the rotation matrices of centers of type $2$, $3$ and so on, follow in the same format.
When the rotation matrices contain irrational numbers (e.g. ($\sin{\frac{\pi}{6}}=\frac{\sqrt{3}}{2}$), then more digits than presented in the examples
below are advised to be given: $\frac{\sqrt{3}}{2}=0.86602540378$.


Examples:

\begin{tabular}{p{0.3\linewidth} p{0.3\linewidth} p{0.3\linewidth}}
{\color{Blue} \texttt {NNEQ}} & {\color{Blue} \texttt {NNEQ}}     & {\color{Blue} \texttt {NNEQ}}  \\
 \texttt {2  F}  &  \texttt {3  F}     &  \texttt {6  F} \\
 \texttt {1  2}  &  \texttt {2  1  1}  &  \texttt {1  1  1  1  1  1} \\
 \texttt {2  2}  &  \texttt {4  2  3}  &  \texttt {2  4  3  5  2  2} \\
 \texttt {A  B}  &  \texttt {A  B  B}  &  \texttt {B  B  A  A  B  A} \\
 \texttt {2.3 }  &  \texttt {2.1}      &  \texttt {2.12} \\
 \texttt {    }  &  \texttt {2.0}      &  \texttt {2.43} \\
 \texttt {    }  &  \texttt {2.0}      &  \texttt {2.00} \\
\hline
{\color{Blue}\texttt {SYMM}} & {\color{Blue} \texttt {SYMM}}  &  \\
 \texttt {1           }     &  \texttt {1            }        &   \\
 \texttt {1.0 0.0 0.0 }     &  \texttt {1.0 0.0 0.0  }        &   \\
 \texttt {0.0 1.0 0.0 }     &  \texttt {0.0 1.0 0.0  }        &   \\
 \texttt {0.0 0.0 1.0 }     &  \texttt {0.0 0.0 1.0  }        &   \\
 \texttt {2           }     &  \texttt {0.0 -1.0 0.0 }        &   \\
 \texttt {1.0 0.0 0.0 }     &  \texttt {1.0 0.0  0.0 }        &   \\
 \texttt {0.0 1.0 0.0 }     &  \texttt {0.0 0.0  1.0 }        &   \\
 \texttt {0.0 0.0 1.0 }     &  \texttt {2            }        &   \\
 \texttt {-1.0 0.0 0.0 }    &  \texttt {1.0 0.0 0.0  }        &   \\
 \texttt {0.0 -1.0 0.0 }    &  \texttt {0.0 1.0 0.0  }        &   \\
 \texttt {0.0 0.0 -1.0 }    &  \texttt {0.0 0.0 1.0  }        &   \\
 \texttt { }                &  \texttt {3            }        &   \\
 \texttt { }                &  \texttt {1.0 0.0 0.0  }        &   \\
 \texttt { }                &  \texttt {0.0 1.0 0.0  }        &   \\
 \texttt { }                &  \texttt {0.0 0.0 1.0  }        &   \\
\hline
\cellcolor{gray!15}{\tiny The cluster computed here is a trinuclear compound, with one center
       computed ab initio, while the other two centers, related to each other by inversion,
       are considered isotropic with $g_{x}=g_{y}=g_{z}=$2.3.
       The rotation matrix for the first center is $I$ (identity, unity) since the center is
       unique. For the centers of type 2, there are two matrices 3x3 since we have two centers
       in the cluster. The rotation matrix of the first center of type 2 is Identity while the
       rotation matrix for the equivalent center of type 2 is the inversion matrix.} &
\cellcolor{gray!15}{\tiny In this input a tetranuclear compound is defined, all centers are
       computed ab initio. There are two centers of type “1”, related one to each other by $C_{2}$
       symmetry around the Cartesian Z axis. Therefore the SYMM keyword is mandatory.
       There are two matrices for centers of type 1, and one matrix (identity) for the
       centers of type 2 and type 3.
       } &
\cellcolor{gray!15}{\tiny In this case the computed system has no symmetry. Therefore,
       the SYMM keyword may be skipped } \\
\hline
\end{tabular}

More examples are given in the \textit{Tutorial} section.

\end{keywordlist}






%%---
\textit{Keywords defining the magnetic exchange interactions}

This section defines the keywords used to set up the interacting pairs of magnetic centers
and the corresponding exchange interactions.

A few words about the numbering of the magnetic centers of the
cluster in the \program{POLY\_ANISO}. First all equivalent centers of the type 1 are
numbered, then all equivalent centers of the type 2, etc. These labels of the magnetic
centers are used further for the declaration of the magnetic coupling.
The pseudo-code is:

\begin{sourcelisting}
k=0
Do i=1, number-of-non-equivalent-sites
  Do j=1, number-of-equivalent-sites-of-type(i)
     k=k+1
     site-number(i,j)=k
  End Do
End Do
\end{sourcelisting}


\begin{keywordlist}
\item[PAIR or LIN1]
%%%%<KEYWORD MODULE="POLY_ANISO" NAME="TYPE" KIND="INT" LEVEL="BASIC">
%%%Keyword: TYPE basic
%%%%<HELP>
%%%+Specifies which magnetic properties must be computed. The program will read one of the following numbers (1-7):
%%+
%%+ 1:  --  the g- and D-tensors (only)
%%+ 2:  --  the powder magnetic susceptibility, the magnetic susceptibility tensor,
%%+         magnetic susceptibility in the direction of the main magnetic axis.
%%+ 3:  --  the  powder molar magnetization, the magnetization vectors for certain directions of the field.
%%+ 4:  --  1 + 2
%%+ 5:  --  1 + 3
%%+ 6:  --  2 + 3
%%+ 7:  --  1 + 2 + 3.  This is the default value.
%+
%%%</HELP></KEYWORD>

Specifies the Lines interaction(s) between metal pairs. One parameter per interactiing pair is required.
\begin{sourcelisting}
LIN9
   READ number-of-interacting-pairs
   Do i=1, number-of-interacting-pairs
      READ site-1, site-2,   J
   End Do
\end{sourcelisting}


\item[ALIN or LIN3]
%%%%<KEYWORD MODULE="POLY_ANISO" NAME="TYPE" KIND="INT" LEVEL="BASIC">
%%%Keyword: TYPE basic
%%%%<HELP>
%%%+Specifies which magnetic properties must be computed. The program will read one of the following numbers (1-7):
%%+
%%+ 1:  --  the g- and D-tensors (only)
%%+ 2:  --  the powder magnetic susceptibility, the magnetic susceptibility tensor,
%%+         magnetic susceptibility in the direction of the main magnetic axis.
%%+ 3:  --  the  powder molar magnetization, the magnetization vectors for certain directions of the field.
%%+ 4:  --  1 + 2
%%+ 5:  --  1 + 3
%%+ 6:  --  2 + 3
%%+ 7:  --  1 + 2 + 3.  This is the default value.
%+
%%%</HELP></KEYWORD>

Specifies the anisotropic interactions between metal pairs. Three parameters per interacting pair are required.

\begin{sourcelisting}
LIN9
   READ number-of-interacting-pairs
   Do i=1, number-of-interacting-pairs
      READ site-1, site-2,   Jxx, Jyy, Jzz
   End Do
\end{sourcelisting}
$J_{\alpha\beta}$, where $\alpha$ and $\beta$ are main values of the Cartesian components of the (3x3) matrix defining the exchange interaction between site-1 and site-2.


\item[LIN9]
%%%%<KEYWORD MODULE="POLY_ANISO" NAME="TYPE" KIND="INT" LEVEL="BASIC">
%%%Keyword: TYPE basic
%%%%<HELP>
%%%+Specifies which magnetic properties must be computed. The program will read one of the following numbers (1-7):
%%+
%%+ 1:  --  the g- and D-tensors (only)
%%+ 2:  --  the powder magnetic susceptibility, the magnetic susceptibility tensor,
%%+         magnetic susceptibility in the direction of the main magnetic axis.
%%+ 3:  --  the  powder molar magnetization, the magnetization vectors for certain directions of the field.
%%+ 4:  --  1 + 2
%%+ 5:  --  1 + 3
%%+ 6:  --  2 + 3
%%+ 7:  --  1 + 2 + 3.  This is the default value.
%+
%%%</HELP></KEYWORD>

Specifies the full anisotropic interaction matrices between metal pairs. Nine parameters per interacting pair is required.

\begin{sourcelisting}
LIN9
   READ number-of-interacting-pairs
   Do i=1, number-of-interacting-pairs
      READ site-1, site-2,   Jxx, Jxy, Jxz,   Jyx, Jyy, Jyz,  Jzx, Jzy, Jzz
   End Do
\end{sourcelisting}
$J_{\alpha\beta}$, where $\alpha$ and $\beta$ are Cartesian components if the (3x3) matrix defining the exchange interaction between site-1 and site-2.


\item[COOR]
Specifies the symmetrized coordinates of the metal sites. This keyword enables computation of dipole-dipole
magnetic interaction between metal sites defined in the keywords PAIR, ALIN, LIN1, LIN3 or LIN9.

\begin{sourcelisting}
COOR
   Do i=1, number-of-non-equivalent-sites
      READ coordinates of center 1
      READ coordinates of center 2
      ...
   End Do
\end{sourcelisting}


\end{keywordlist}





\textit{Other keywords}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Normally \program {POLY\_ANISO} runs without specifying any of the following keywords.



Argument(s) to a keyword are always supplied on the next line of the input file.
%
\subsubsection{Optional general keywords to control the input}
\begin{keywordlist}
%%---
%\item[TITLe]
%%%%<KEYWORD MODULE="POLY_ANISO" NAME="TITLE" KIND="STRING" LEVEL="BASIC">
%%%Keyword: TITLE basic
%%%%<HELP>
%%%+One line following this one is regarded as title.
%%%%</HELP></KEYWORD>
%One line following this one is regarded as title.






%--------------------------------------------
\item[MLTP]
%%%<KEYWORD MODULE="POLY_ANISO" NAME="MLTP" KIND="INT" LEVEL="BASIC" DEFAULT_VALUE="1">
%%Keyword: MLTP basic
%%%<HELP>
%%+The number of molecular multiplets (i.e. groups of spin-orbital eigenstates)
%%+for which g, D and higher magnetic tensors will be calculated (default MLTP=1).
%+The program reads two lines: the first is the number of multiplets (NMULT) and
%+the second the array of NMULT numbers specifying the dimension of each multiplet.
%+The default is to select one multiplet which has the dimension equal to the
%+multiplicity of the ground term. In cases of strong spin-orbit coupling the usage
%+of this keyword is mandatory.
%%%</HELP></KEYWORD>
The number of molecular multiplets (i.e. groups of spin-orbital eigenstates) for which
$g$, $D$ and higher magnetic tensors will be calculated (default MLTP=1).
The program reads two lines: the first is the number of multiplets (NMULT) and the
second the array of NMULT numbers specifying the dimension (multiplicity) of each multiplet.

Example:
\begin{inputlisting}
MLTP
10
2 4 4 2 2   2 2 2 2 2
\end{inputlisting}
\program{POLY\_ANISO} will compute the $g$ and $D-$ tensors for 10 groups of states.
The groups 1 and 4-10 are doublets (\~{S}=$|$1/2$>$), while the groups 2 and 3 are quadruplets,
having the effective spin \~{S}=$|$3/2$>$. For the latter cases, the ZFS ($D-$) tensors will be computed.






%--------------------------------------------
\item[TINT]
%%%<KEYWORD MODULE="POLY_ANISO" NAME="TINT" KIND="REAL" LEVEL="BASIC">
%%Keyword: TINT basic
%%%<HELP>
%%+Specifies the temperature points for the evaluation of the magnetic susceptibility.
%%+The program will read four numbers: Tmin, Tmax, nT, and dltT0. Units of temperature = Kelvin (K).
%%+
%%+ Tmin  -- the minimal temperature (Default 0.0K)
%%+ Tmax  -- the maximal temperature (Default 300.0K)
%+ nT    -- number of temperature points (Default 101)
%+ dltT0 -- the minimal temperature above the 0.0K that helps to avoid infinite
%+          values during calculation (Default 0.001K).
%%%</HELP></KEYWORD>

Specifies the temperature points for the evaluation of the magnetic susceptibility. The program will read four numbers: $T_{min}$, $T_{max}$, $nT$, and $\delta T_0$.
\begin{itemize}
 \item $T_{min}$ -- the minimal temperature (Default 0.0K)
 \item $T_{max}$ -- the maximal temperature (Default 300.0K)
 \item $nT$    -- number of temperature points (Default 101)
\end{itemize}
Example:
\begin{inputlisting}
TINT
0.0  330.0  331
\end{inputlisting}
\program{POLY\_ANISO} will compute temperature dependence of the magnetic susceptibility in 331 points evenly distributed in temperature interval: 0.0K -- 330.0K.






%--------------------------------------------
\item[HINT]
%%%<KEYWORD MODULE="POLY_ANISO" NAME="HINT" KIND="REAL" LEVEL="BASIC">
%%Keyword: HINT basic
%%%<HELP>
%+Specifies the field points for the evaluation of the molar magnetization.
%+The program will read four numbers: Hmin, Hmax, nH, and dltH0. Units of magnetic field = Tesla (T).
%+
%+ Hmin  -- the minimal field (Default 0.0 T)
%+ Hmax  -- the maximal field (Default 300.0 T)
%+ nH    -- number of field points (Default 101)
%%%</HELP></KEYWORD>
Specifies the field points for the evaluation of the magnetization in a certain direction. The program will read four numbers: $H_{min}$, $H_{max}$ and $nH$
\begin{itemize}
 \item $H_{min}$ -- the minimal field (Default 0.0T)
 \item $H_{max}$ -- the maximal filed (Default 10.0T)
 \item $nH$    -- number of field points (Default 101)
\end{itemize}
Example:
\begin{inputlisting}
HINT
0.0  20.0  201
\end{inputlisting}
\program{POLY\_ANISO} will compute the molar magnetization in 201 points evenly distributed in field interval: 0.0T -- 20.0T.





%--------------------------------------------
\item[TMAG]
%%%<KEYWORD MODULE="POLY_ANISO" NAME="TMAG" KIND="REAL" LEVEL="BASIC">
%%Keyword: TMAG basic
%%%<HELP>
%+Specifies the temperature at which the field-dependent magnetization is calculated. Default is 2.0 K
%%%</HELP></KEYWORD>
Specifies the temperature(s) at which the field-dependent magnetization is calculated. Default is one temperature point, T=2.0 K.
Example:
\begin{inputlisting}
TMAG
6   1.8 2.0 2.4  2.8 3.2 4.5
\end{inputlisting}




%--------------------------------------------
\item[ENCU]
%%%<KEYWORD MODULE="POLY_ANISO" NAME="ENCU" KIND="INT" LEVEL="BASIC">
%%Keyword: ENCU basic
%%%<HELP>
%%+This keyword is used to define the cut-off energy for the lowest states for which
%%+Zeeman interaction is taken into account exactly. The contribution to the
%%+magnetization coming from states that are higher in energy than E (see below)
%%+is done by second order perturbation theory. The program will read two integer
%%+numbers: NK and MG. Default values are: NK=100, MG=100. The field-dependent magnetization
%%+is calculated at the temperature value TMAG.
%%%</HELP></KEYWORD>
This flag is used to define the cut-off energy for the lowest states for which Zeeman interaction is taken into account exactly. The contribution to the magnetization coming from states that are higher in energy than $E$ (see below) is done by second order perturbation theory. The program will read two integer numbers: $NK$ and $MG$. Default values are: $NK=100$,$MG=100$.
\begin{displaymath}
E=NK \cdot k_{Boltz} \cdot TMAG + MG \cdot \mu_{Bohr} \cdot H_{max}
\end{displaymath}
The field-dependent magnetization is calculated at the (highest) temperature value defined in either TMAG or HEXP.
Example:
\begin{inputlisting}
ENCU
250  150
\end{inputlisting}
If $H_{max}$ = 10T and TMAG=1.8K, then the cut-off energy is:
\begin{displaymath}
 E=100 \cdot 250 \cdot k_{Boltz} \cdot 1.8 + 150 \cdot \mu_{Bohr} \cdot 10 = 1013.06258 (cm^{-1})
\end{displaymath}
This means that the magnetization coming from all spin-orbit states with energy lower than $E=1013.06258 (cm^{-1})$ will be computed exactly.
ERAT, NCUT and ENCU are mutually exclusive.





%--------------------------------------------
\item[ERAT]
%%%<KEYWORD MODULE="POLY_ANISO" NAME="ERAT" KIND="INT" LEVEL="BASIC">
%%Keyword: ERAT basic
%%%<HELP>
%%+This keyword is used to define the cut-off energy for the lowest states for which
%%+Zeeman interaction is taken into account exactly. The contribution to the
%%+magnetization coming from states that are higher in energy than E (see below)
%%+is done by second order perturbation theory. The program will read one real number in the domain 0.0 - 1.0.
%%+The field-dependent magnetization
%%+is calculated at the temperature value TMAG.
%%%</HELP></KEYWORD>
This flag is used to define the cut-off energy for the lowest states for which Zeeman interaction
is taken into account exactly. The contribution to the molar magnetization coming from states that
are higher in energy than $E$ (see below) is done by second order perturbation theory.
The program reads one real number in the domain (0.0-1.0). Default is 1.0 ( all exchange states are
included in the Zeeman interaction).
\begin{displaymath}
E=  erat \cdot Maximal-spread-of-exchange-splitting
\end{displaymath}
The field-dependent magnetization is calculated at all temperature points defined in either TMAG or HEXT.
Example:
\begin{inputlisting}
ERAT
0.75
\end{inputlisting}
ERAT, NCUT and ENCU are mutually exclusive.


%--------------------------------------------
\item[NCUT]
%%%<KEYWORD MODULE="POLY_ANISO" NAME="ERAT" KIND="INT" LEVEL="BASIC">
%%Keyword: ERAT basic
%%%<HELP>
%%+This keyword is used to define the cut-off energy for the lowest states for which
%%+Zeeman interaction is taken into account exactly. The contribution to the
%%+magnetization coming from states that are higher in energy than E (see below)
%%+is done by second order perturbation theory. The program will read one real number in the domain 0.0 - 1.0.
%%+The field-dependent magnetization
%%+is calculated at all temperature values defined in TMAG or HEXP.
%%%</HELP></KEYWORD>
This flag is used to define the number of low-lying exchange states for which Zeeman interaction is taken into
account exactly. The contribution to the magnetization coming from the remaining exchange states is done by second
order perturbation theory. The program will read one integer number. The field-dependent magnetization is calculated at all temperature points defined in either TMAG or HEXT.
Example:
\begin{inputlisting}
NCUT
125
\end{inputlisting}
In case the defined number is larger than the total number of exchange states in the calculation ($Nexch$), then $nCut$ is set to be equal to $Nexch$.
ERAT, NCUT and ENCU are mutually exclusive.






%--------------------------------------------
\item[MVEC]
%%%<KEYWORD MODULE="POLY_ANISO" NAME="MVEC" KIND="REAL" LEVEL="BASIC">
%%Keyword: MVEC basic
%%%<HELP>
%+Defines the number of directions for which the magnetization vector will be computed.
%+On the first line below the keyword, the number of directions should be mentioned (NDIR. Default 0).
%+The program will read NDIR lines for spherical coordinates specifying the direction
%+"i" of the magnetic field (theta_i and phi_i). These values should be in radians.
%%%</HELP></KEYWORD>
Defines the number of directions for which the magnetization vector will be computed.
On the first line below the keyword, the number of directions should be mentioned (NDIR. Default 0).
The program will read NDIR lines for cartesian coordinates specifying the direction $i$ of the
applied magnetic field ($\theta_i$ and $\phi_i$). These values may be arbitrary real numbers.
The direction(s) of applied magnetic field are obtained by normalizing the length of each vector to one.
Example:
\begin{inputlisting}
MVEC
4
0.0000  0.0000   0.1000
1.5707  0.0000   2.5000
1.5707  1.5707   1.0000
0.4257  0.4187   0.0000
\end{inputlisting}
The above input requests computation of the magnetization vector in four directions of applied field.
The actual directions on the unit sphere are:
\begin{sourcelisting}
4
0.00000  0.00000  1.00000
0.53199  0.00000  0.84675
0.53199  0.53199  0.33870
0.17475  0.17188  0.00000
\end{sourcelisting}




%--------------------------------------------
\item[MAVE]
%%%<KEYWORD MODULE="POLY_ANISO" NAME="MAVE" KIND="INT" LEVEL="BASIC">
%%Keyword: MAVE basic
%%%<HELP>
%%+Specifies the number of directions of the applied magnetic field for the computation
%%+of the powder molar magnetization. The program will read two numbers: N_theta and N_phi.
%%+ N_theta -- number of "theta" points in the interval (0, pi/2) (i.e. on the Z axis ) (Default 12)
%+ N_phi   -- number of  "phi"  points in the interval (0, 2*pi).(i.e. on the equator) (Default 24)
%+The number of directions over which the actual averaging will take place is roughly the product of N_theta and N_phi.
%%%</HELP></KEYWORD>
This keyword specifies the grid density used for the computation of powder molar
magnetization. The program uses Lebedev-Laikov distribution of points on the unit sphere.[]
The program reads two integer numbers: $nsym$ and $ngrid$. The $nsym$ defines which
part of the sphere is used for averaging. It takes one of the three values: 1 (half-sphere),
2 (a quater of a sphere) or 3 (an octant of the sphere). $ngrid$ takes values from 1
(the smallest grid) till 32 (the largest grid, i.e. the densiest). The default is to
consider integration over a half-sphere (since $M(H)=-M(-H)$): $nsym$=1 and $ngrid$=15
(i.e 185 points distributed over half-sphere). In case of symmetric compounds, powder
magnetization may be averaged over a smaller part of the sphere, reducing thus the number
of points for the integration. The user is responsible to choose the appropriate integration scheme.
Default value for $grid-number$=15 (185 directions equally distributed in the given area).
Note that the program\'s default is rather conservative.


%--------------------------------------------
\item[TEXP]
%%%<KEYWORD MODULE="POLY_ANISO" NAME="TEXP" KIND="REAL" LEVEL="BASIC">
%%Keyword: TEXP basic
%%%<HELP>
%%+This keyword allows computation of the magnetic susceptibility at experimental
%%+temperature points. On the line below the keyword, the number of experimental
%%+points NT is defined, and on the next NT lines the program reads the experimental
%%+temperature (in K) and the experimental magnetic susceptibility (in cm^3Kmol^{-1} ).
%%+TEXP and TINT keywords are mutually exclusive. The POLY_ANISO will also print the
%+standard deviation from the experiment.
%%%</HELP></KEYWORD>
This keyword allows computation of the magnetic susceptibility $\chi T(T)$ at experimental points.
On the line below the keyword, the number of experimental points NT is defined, and on the next NT lines the program reads the experimental temperature (in K) and the experimental magnetic susceptibility (in $cm^3Kmol^{-1}$ ). TEXP and TINT keywords are mutually exclusive. The magnetic susceptibility routine will also print the standard deviation from the experiment.
\begin{sourcelisting}
TEXP
   READ  number-of-T-points
   Do i=1, number-of-T-points
      READ ( susceptibility(i, Temp), TEMP = 1, number-of-T-points )
   End Do
\end{sourcelisting}
%





%--------------------------------------------
\item[HEXP]
%%%<KEYWORD MODULE="POLY_ANISO" NAME="HEXP" KIND="REAL" LEVEL="BASIC">
%%Keyword: HEXP basic
%%%<HELP>
%%+This keyword allows computation of the molar magnetization at experimental field points.
%%+On the line below the keyword,the number of experimental points NH is defined, and on
%%+the next NH lines the program reads the experimental field strength (Tesla) and the
%%+experimental magnetization (in Bohr magnetons). HEXP and HINT are mutually exclusive.
%%+The POLY_ANISO will print the standard deviation from the experiment.
%%%</HELP></KEYWORD>
This keyword allows computation of the molar magnetization $M_{mol} (H)$ at experimental points.
On the line below the keyword,the number of experimental points $NH$ is defined, and on the next $NH$ lines the program reads the experimental field intensity (Tesla) and the experimental magnetization (in $\mu_{Bohr}$). HEXP and HINT are mutually exclusive. The magnetization routine will print the standard deviation from the experiment.
\begin{sourcelisting}
HEXP
   READ  number-of-T-points-for-M,  all-T-points-for-M-in-K
   READ  number-of-field-points
   Do i=1, number-of-field-points
      READ ( Magn(i, iT), iT=1, number-of-T-points-for-M )
   End Do
\end{sourcelisting}





%--------------------------------------------
\item[ZJPR]
%%<KEYWORD MODULE="POLY_ANISO" NAME="ZJPR" KIND="REAL" LEVEL="BASIC">
%Keyword: ZJPR basic
%%<HELP>
%+This keyword specifies the value (in cm^-1) of a phenomenological parameter of a
%+mean molecular field acting on the spin of the complex (the average intermolecular
%+exchange constant). It is used in the calculation of all magnetic properties (not for
%+spin Hamiltonians) (Default is 0.0)
%%</HELP></KEYWORD>
This keyword specifies the value (in $cm^{-1}$) of a phenomenological parameter of a mean molecular field acting on the spin of the complex (the average intermolecular exchange constant). It is used in the calculation of all magnetic properties (not for spin Hamiltonians) (Default is 0.0)




%--------------------------------------------
\item[PRLV]
%%%<KEYWORD MODULE="POLY_ANISO" NAME="PRLV" KIND="INT" LEVEL="BASIC">
%%Keyword: PRLV basic
%%%<HELP>
%%+This keyword controls the print level.
%%+  2 -- normal. (Default)
%%+  3 or larger (debug)
%%%</HELP></KEYWORD>
This keyword controls the print level.
\begin{itemize}
 \item 2 -- normal. (Default)
 \item 3 or larger (debug)
\end{itemize}
\end{keywordlist}
%
%\subsubsection{An input example}
%\begin{inputlisting}
%&POLY_ANISO
%TITLe
%magnetic properties for Co complex
%TYPE
%2
%MVEC
%3
%0.000000		0.000000
%1.570796		0.000000
%1.570796		1.570796
%MLTP
%3
%4 4 2
%ZJPR
%-0.2
%ENCU
%250 400
%HINT
%0.0  20.0  100  0.01
%TINT
%0.0  330.0  331  0.01
%MAVE
%16 18
%\end{inputlisting}
%%%</MODULE>




