% Generated by Sphinx.
\def\sphinxdocclass{report}
\documentclass[letterpaper,10pt,english]{sphinxmanual}
\usepackage[utf8]{inputenc}
\DeclareUnicodeCharacter{00A0}{\nobreakspace}
\usepackage{cmap}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{times}
\usepackage[Bjarne]{fncychap}
\usepackage{longtable}
\usepackage{sphinx}
\usepackage{multirow}


\title{phaseshifts Documentation}
\date{July 23, 2014}
\release{0.1.4-dev}
\author{Liam Deacon}
\newcommand{\sphinxlogo}{}
\renewcommand{\releasename}{Release}
\makeindex

\makeatletter
\def\PYG@reset{\let\PYG@it=\relax \let\PYG@bf=\relax%
    \let\PYG@ul=\relax \let\PYG@tc=\relax%
    \let\PYG@bc=\relax \let\PYG@ff=\relax}
\def\PYG@tok#1{\csname PYG@tok@#1\endcsname}
\def\PYG@toks#1+{\ifx\relax#1\empty\else%
    \PYG@tok{#1}\expandafter\PYG@toks\fi}
\def\PYG@do#1{\PYG@bc{\PYG@tc{\PYG@ul{%
    \PYG@it{\PYG@bf{\PYG@ff{#1}}}}}}}
\def\PYG#1#2{\PYG@reset\PYG@toks#1+\relax+\PYG@do{#2}}

\expandafter\def\csname PYG@tok@gd\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.63,0.00,0.00}{##1}}}
\expandafter\def\csname PYG@tok@gu\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}}
\expandafter\def\csname PYG@tok@gt\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}}
\expandafter\def\csname PYG@tok@gs\endcsname{\let\PYG@bf=\textbf}
\expandafter\def\csname PYG@tok@gr\endcsname{\def\PYG@tc##1{\textcolor[rgb]{1.00,0.00,0.00}{##1}}}
\expandafter\def\csname PYG@tok@cm\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}}
\expandafter\def\csname PYG@tok@vg\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}}
\expandafter\def\csname PYG@tok@m\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}}
\expandafter\def\csname PYG@tok@mh\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}}
\expandafter\def\csname PYG@tok@cs\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}\def\PYG@bc##1{\setlength{\fboxsep}{0pt}\colorbox[rgb]{1.00,0.94,0.94}{\strut ##1}}}
\expandafter\def\csname PYG@tok@ge\endcsname{\let\PYG@it=\textit}
\expandafter\def\csname PYG@tok@vc\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}}
\expandafter\def\csname PYG@tok@il\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}}
\expandafter\def\csname PYG@tok@go\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.20,0.20,0.20}{##1}}}
\expandafter\def\csname PYG@tok@cp\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@gi\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.63,0.00}{##1}}}
\expandafter\def\csname PYG@tok@gh\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
\expandafter\def\csname PYG@tok@ni\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.84,0.33,0.22}{##1}}}
\expandafter\def\csname PYG@tok@nl\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.13,0.44}{##1}}}
\expandafter\def\csname PYG@tok@nn\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.05,0.52,0.71}{##1}}}
\expandafter\def\csname PYG@tok@no\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.38,0.68,0.84}{##1}}}
\expandafter\def\csname PYG@tok@na\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}}
\expandafter\def\csname PYG@tok@nb\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@nc\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.05,0.52,0.71}{##1}}}
\expandafter\def\csname PYG@tok@nd\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.33,0.33,0.33}{##1}}}
\expandafter\def\csname PYG@tok@ne\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@nf\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.02,0.16,0.49}{##1}}}
\expandafter\def\csname PYG@tok@si\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.44,0.63,0.82}{##1}}}
\expandafter\def\csname PYG@tok@s2\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}}
\expandafter\def\csname PYG@tok@vi\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}}
\expandafter\def\csname PYG@tok@nt\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.02,0.16,0.45}{##1}}}
\expandafter\def\csname PYG@tok@nv\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}}
\expandafter\def\csname PYG@tok@s1\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}}
\expandafter\def\csname PYG@tok@gp\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.78,0.36,0.04}{##1}}}
\expandafter\def\csname PYG@tok@sh\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}}
\expandafter\def\csname PYG@tok@ow\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@sx\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.78,0.36,0.04}{##1}}}
\expandafter\def\csname PYG@tok@bp\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@c1\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}}
\expandafter\def\csname PYG@tok@kc\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@c\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}}
\expandafter\def\csname PYG@tok@mf\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}}
\expandafter\def\csname PYG@tok@err\endcsname{\def\PYG@bc##1{\setlength{\fboxsep}{0pt}\fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{\strut ##1}}}
\expandafter\def\csname PYG@tok@kd\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@ss\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.32,0.47,0.09}{##1}}}
\expandafter\def\csname PYG@tok@sr\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.14,0.33,0.53}{##1}}}
\expandafter\def\csname PYG@tok@mo\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}}
\expandafter\def\csname PYG@tok@mi\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}}
\expandafter\def\csname PYG@tok@kn\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@o\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PYG@tok@kr\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@s\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}}
\expandafter\def\csname PYG@tok@kp\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@w\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}}
\expandafter\def\csname PYG@tok@kt\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.56,0.13,0.00}{##1}}}
\expandafter\def\csname PYG@tok@sc\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}}
\expandafter\def\csname PYG@tok@sb\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}}
\expandafter\def\csname PYG@tok@k\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@se\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}}
\expandafter\def\csname PYG@tok@sd\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}}

\def\PYGZbs{\char`\\}
\def\PYGZus{\char`\_}
\def\PYGZob{\char`\{}
\def\PYGZcb{\char`\}}
\def\PYGZca{\char`\^}
\def\PYGZam{\char`\&}
\def\PYGZlt{\char`\<}
\def\PYGZgt{\char`\>}
\def\PYGZsh{\char`\#}
\def\PYGZpc{\char`\%}
\def\PYGZdl{\char`\$}
\def\PYGZhy{\char`\-}
\def\PYGZsq{\char`\'}
\def\PYGZdq{\char`\"}
\def\PYGZti{\char`\~}
% for compatibility with earlier versions
\def\PYGZat{@}
\def\PYGZlb{[}
\def\PYGZrb{]}
\makeatother

\begin{document}

\maketitle
\tableofcontents
\phantomsection\label{index::doc}


Contents:


\chapter{Introduction}
\label{introduction:welcome-to-phaseshifts-s-documentation}\label{introduction:introduction}\label{introduction::doc}\label{introduction:id1}
This package is a Python-based implementation of the Barbieri/Van Hove
phase shift (\emph{phsh}) calculation package needed to produce phase shifts for
various LEED packages (including CLEED), as well as for certain XPD packages.

To quote the original authors site:

``The phase shift calculation is performed in several steps:
\begin{enumerate}
\item {} 
Calculation of the radial charge density for a free atom.

\item {} 
Calculation of the radial muffin-tin potential for atoms embedded in a
surface defined by the user (the surface is represented by a slab that
is periodically repeated in 3 dimensions, within vacuum between the
repeated slabs); various approximations to the exchange potential
are available; relativistic effects are taken into account.

\item {} 
Calculation of phase shifts from the muffin-tin potential.

\item {} 
Elimination of pi-jumps in the energy dependence of the phase shifts.''

\end{enumerate}

\begin{notice}{note}{Note:}
You can get the original Fortran source
(\& learn more about the \emph{phsh} programs) from:
\begin{quote}

\href{http://www.icts.hkbu.edu.hk/surfstructinfo/SurfStrucInfo\_files/leed/leedpack.html}{http://www.icts.hkbu.edu.hk/surfstructinfo/SurfStrucInfo\_files/leed/leedpack.html}
\end{quote}
\end{notice}

The aim of this package is to both automate and simplify the generation of
phase shift files in a manner that is easy for the computational hitch-hiker,
but powerful for those that wish to extend the package for particular needs.


\chapter{Installing the phaseshifts package}
\label{installing_phaseshifts:installing-phaseshifts}\label{installing_phaseshifts::doc}\label{installing_phaseshifts:installing-the-phaseshifts-package}
The \href{http://https://pypi.python.org/pypi/phaseshifts/}{phaseshifts} package
requires CPython 2.6 or later and also uses the \href{http://www.scipy.org/scipylib/download.html}{numpy}, \href{http://www.scipy.org/scipylib/download.html}{scipy} and \href{http://https://pypi.python.org/pypi/periodictable}{periodictable} packages.
Currently, it has only been tested extensively with Python 2.7 on Windows, so
there are no guarantees with other platforms. To perform a setup follow the
steps below.
\begin{enumerate}
\item {} 
Install the numpy, scipy and periodictable packages.

On systems compatible with PyPI this can be done using the command:

\begin{Verbatim}[commandchars=\\\{\}]
pip install numpy scipy periodictable
\end{Verbatim}

Or if you have the easy\_install package:

\begin{Verbatim}[commandchars=\\\{\}]
easy\PYGZus{}install install numpy scipy periodictable
\end{Verbatim}

Older versions of numpy \& scipy did not allow simultaneous installation -
if you experience problems then try first installing numpy before
attempting to install scipy.

The periodictable package allows lookup of the most common crystal
structure for a given element and is instrumental in many of the
convenience functions contained in the model module.

Alternatively download and install these packages manually following the
instructions provided for the respective packages.

\item {} 
To install the phaseshifts package:

\begin{Verbatim}[commandchars=\\\{\}]
python setup.py install
\end{Verbatim}

With any luck the package has been installed successfully. A set of test scripts
are provided, however a simple check may suffice using an interactive session of
the python interpreter:

\begin{Verbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{phaseshifts}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{phaseshifts.lib} \PYG{k+kn}{import} \PYG{n}{libphsh}  \PYG{c}{\PYGZsh{} compiled FORTRAN .pyd or .so using f2py}
\end{Verbatim}

If these execute without errors then it is likely that all is well, but in case of
problems or bugs please use the contact provided below and I will do my best to
address the problem quickly.

\end{enumerate}

\begin{notice}{tip}{Tip:}
On Windows systems it may be easier to install a scientific python distibution
rather than install the dependencies from source - \href{http://code.google.com/p/pythonxy}{Python(x,y)} with mingw (gcc \& gfortran)
installed is highly recommended.
\end{notice}


\chapter{Contact}
\label{contact:contact}\label{contact::doc}\label{contact:id1}
This package is developed/maintained in my spare time so any bug reports, patches,
or other feedback are very welcome and should be sent to: \href{mailto:liam.deacon@diamond.ac.uk}{liam.deacon@diamond.ac.uk}

The project is in the early developmental stages and so anyone who wishes to get
involved are most welcome (simply contact me using the email above).


\chapter{Acknowledgements}
\label{acknowledgements:acknowledgements}\label{acknowledgements::doc}\label{acknowledgements:id1}
As with all scientific progress, we stand on the shoulders of giants. If this
package is of use to you in publishing papers then please acknowledge the
following people who have made this package a reality:
\begin{itemize}
\item {} 
\textbf{A. Barbieri} and \textbf{M.A. Van Hove} - who developed most of the original
fortran code. Use \emph{A. Barbieri and M.A. Van Hove, private communication.}
(see \code{doc/phsh2007.txt} for further details).

\item {} 
\textbf{E.L. Shirley} - who developed part of the fortran code during work towards his
PhD thesis (refer to the thesis: \emph{E.L. Shirley, ``Quasiparticle calculations in
atoms and many-body core-valence partitioning'', University of Illinois, Urbana, 1991}).

\item {} 
\textbf{Christoph Gohlke} - who developed the elements.py module used extensively throughout
for the modelling convenience functions (see `elements.py' for license details).

\end{itemize}

I would also be grateful if you acknowledge this python package (\emph{phaseshifts}) as:
\emph{L.M. Deacon, private communication.}


\section{Thanks}
\label{acknowledgements:thanks}
I wish to personally add a heartfelt thanks to both Eric Shirley and Michel Van Hove
who have kindly allowed the use of their code in the \code{libphsh.f} file needed for the
underlying low-level functions in this package.


\chapter{Scripts}
\label{scripts:id1}\label{scripts::doc}\label{scripts:scripts}

\section{phsh.py}
\label{scripts:phsh-py}

\subsection{Command line usage}
\label{scripts:command-line-usage}
The \emph{phsh.py} script is placed into the system \code{PATH} during installation of the
phaseshifts package. It can then be used from the command line, e.g. \code{phsh.py -{-}help}
will produce a list of command line options:

\begin{Verbatim}[commandchars=\\\{\}]
usage: phsh.py [\PYGZhy{}h] \PYGZhy{}b \PYGZlt{}bulk\PYGZus{}file\PYGZgt{} \PYGZhy{}i \PYGZlt{}slab\PYGZus{}file\PYGZgt{} [\PYGZhy{}t \PYGZlt{}temp\PYGZus{}dir\PYGZgt{}] [\PYGZhy{}l \PYGZlt{}lmax\PYGZgt{}]
             [\PYGZhy{}r \PYGZlt{}start\PYGZus{}energy\PYGZgt{} \PYGZlt{}final\PYGZus{}energy\PYGZgt{} \PYGZlt{}step\PYGZgt{}] [\PYGZhy{}f \PYGZlt{}format\PYGZgt{}]
             [\PYGZhy{}S \PYGZlt{}subdir\PYGZgt{}] [\PYGZhy{}v] [\PYGZhy{}V]


phsh \PYGZhy{} quickly generate phase shifts

      Created by Liam Deacon on 2013\PYGZhy{}11\PYGZhy{}15.
      Copyright 2013\PYGZhy{}2014 Liam Deacon. All rights reserved.

      Licensed under the MIT license (see LICENSE file for details)

      Please send your feedback, including bugs notifications
      and fixes, to: liam.deacon@diamond.ac.uk

    usage:\PYGZhy{}

  optional arguments:
  \PYGZhy{}h, \PYGZhy{}\PYGZhy{}help            show this help message and exit
  \PYGZhy{}b \PYGZlt{}bulk\PYGZus{}file\PYGZgt{}, \PYGZhy{}\PYGZhy{}bulk \PYGZlt{}bulk\PYGZus{}file\PYGZgt{}
                        path to MTZ bulk or CLEED *.bul input file
  \PYGZhy{}i \PYGZlt{}slab\PYGZus{}file\PYGZgt{}, \PYGZhy{}\PYGZhy{}slab \PYGZlt{}slab\PYGZus{}file\PYGZgt{}
                        path to MTZ slab or CLEED *.inp input file
  \PYGZhy{}t \PYGZlt{}temp\PYGZus{}dir\PYGZgt{}, \PYGZhy{}\PYGZhy{}tmpdir \PYGZlt{}temp\PYGZus{}dir\PYGZgt{}
                        temporary directory for intermediate file generation
  \PYGZhy{}l \PYGZlt{}lmax\PYGZgt{}, \PYGZhy{}\PYGZhy{}lmax \PYGZlt{}lmax\PYGZgt{}
                        Maximum angular momentum quantum number. [default: 10]
  \PYGZhy{}f \PYGZlt{}format\PYGZgt{}, \PYGZhy{}\PYGZhy{}format \PYGZlt{}format\PYGZgt{}
                        Use specific phase shift format i.e. \PYGZsq{}cleed\PYGZsq{}, \PYGZsq{}curve\PYGZsq{}
                        or \PYGZsq{}none\PYGZsq{}. Choose \PYGZsq{}curve\PYGZsq{} if you wish to produce
                        XYY... data for easy plotting. \PYGZlt{}format\PYGZgt{} is case
                        in\PYGZhy{}sensitive. [default: \PYGZsq{}cleed\PYGZsq{}]
  \PYGZhy{}r \PYGZlt{}energy\PYGZgt{} [\PYGZlt{}energy\PYGZgt{} ...], \PYGZhy{}\PYGZhy{}range \PYGZlt{}energy\PYGZgt{} [\PYGZlt{}energy\PYGZgt{} ...]
                        Energy range in eV with the format:
                        \PYGZsq{}\PYGZlt{}start\PYGZgt{} \PYGZlt{}stop\PYGZgt{} [\PYGZlt{}step\PYGZgt{}]\PYGZsq{}, where the \PYGZlt{}step\PYGZgt{} value is
                        optional.  Valid for relativistic calculations
                        only. [default: (20, 600, 5)]
  \PYGZhy{}S \PYGZlt{}subdir\PYGZgt{}, \PYGZhy{}\PYGZhy{}store \PYGZlt{}subdir\PYGZgt{}
                        Keep intermediate files in subdir when done
  \PYGZhy{}v, \PYGZhy{}\PYGZhy{}verbose         set verbosity level [default: None].
  \PYGZhy{}V, \PYGZhy{}\PYGZhy{}version         show program\PYGZsq{}s version number and exit
\end{Verbatim}


\subsection{CLEED compatibility}
\label{scripts:cleed-compatibility}
It is possible to use this script to generate phase shift files iteratively
during a geometry search for the CLEED package. In this manner phase shifts
will be generated at the beginning of each cycle of the search.

For this to work, the environment variable \index{CSEARCH\_LEED}\index{environment variable!CSEARCH\_LEED}\code{CSEARCH\_LEED} must point to the
\code{phsh.py} script, which will invoke the LEED program in \index{PHASESHIFT\_LEED}\index{environment variable!PHASESHIFT\_LEED}\code{PHASESHIFT\_LEED}
after execution. When operating in this mode, the following assumptions are made:
\begin{enumerate}
\item {} 
\emph{-b \textless{}bulk\_file\textgreater{}} option is not needed and the filename is assumed by
changing the file extension of \emph{\textless{}slab\_file\textgreater{}} to `.bul'

\item {} 
\emph{-f CLEED} format is implied.

\item {} 
The generated phase shifts are stored in the directory set by the
\index{CLEED\_PHASE}\index{environment variable!CLEED\_PHASE}\code{CLEED\_PHASE} environment variable, however a named copy with the
iteration number (read from the matching `.log' file) will be placed in the
same directory as the \textless{}slab\_file\textgreater{}.

\item {} 
\emph{\textless{}lmax\textgreater{}} is equal to 10, unless additional parameter syntax is given in the CLEED
\emph{*.inp} file. To use phase shift specific lmax values, then add a new line with:

\begin{Verbatim}[commandchars=\\\{\}]
lmax:  \PYGZlt{}phase\PYGZus{}shift\PYGZgt{} \PYGZlt{}lmax\PYGZgt{}
\end{Verbatim}

for each phase shift you wish to have a different lmax to that of the default.

\item {} 
The element and oxidation of each atom in a model is guessed by reading the phase
shift tag from the CLEED input file. For example:

\begin{Verbatim}[commandchars=\\\{\}]
po:  O\PYGZus{}2\PYGZhy{}\PYGZus{}COOH ...
\end{Verbatim}

will be interpreted as a Oxygen with a -2 oxidation state and with a unique name
tag of ``O\_2-\_COOH'' to show it is in a carboxylic group. Note the `-` may be at
the beginning or the end of the oxidation sub-string. If no oxidation state is
given then the atom is assumed to have zero charge.

\item {} 
The muffin-tin radius of the phase shift species is guessed from lines with:

\begin{Verbatim}[commandchars=\\\{\}]
rm:  \PYGZlt{}phase\PYGZus{}shift\PYGZgt{} \PYGZlt{}radius\PYGZgt{}
\end{Verbatim}

However, if no value is found the radius is guessed from the
ELEMENTS dictionary within {\hyperref[modules:module-phaseshifts.elements]{\code{phaseshifts.elements}}} depending on the
valency of the given phase shift element.

\end{enumerate}

A full list of additional syntax to customise the generation of the phase shifts
when using CLEED input files can be found in
{\hyperref[modules:phaseshifts.leed.Converter.import_CLEED]{\code{phaseshifts.leed.Converter.import\_CLEED()}}}.

\begin{notice}{note}{Note:}
If the \index{PHASESHIFT\_LEED}\index{environment variable!PHASESHIFT\_LEED}\code{PHASESHIFT\_LEED} environment variable is not found, but
\index{CLEED\_PHASE}\index{environment variable!CLEED\_PHASE}\code{CLEED\_PHASE} is, however, found then the program will place the generated
files in this directory unless a specific \code{-S \textless{}subdir\textgreater{}} is provided.
\end{notice}


\chapter{phaseshifts API}
\label{modules:phaseshifts-api}\label{modules:api}\label{modules::doc}

\section{Package Contents}
\label{modules:package-contents}
This chapter covers the main modules of the phaseshifts and provides some API documentation
for those wishing to incorporate this package into their own projects.
\phantomsection\label{modules:module-phaseshifts}\index{phaseshifts (module)}

\section{Subpackages}
\label{modules:subpackages}\begin{description}
\item[{The main sub packages are listed below:}] \leavevmode\begin{itemize}
\item {} 
\code{phaseshifts.gui} - includes all the necessary files for the graphical user interface.

\item {} 
\code{phaseshifts.lib} - contains the Fortran libphsh library and the python wrappings.

\item {} 
\code{phaseshifts.doc} - source documentation for the phaseshifts package.

\item {} 
\code{phaseshifts.test} - modules for testing the phaseshift package.

\end{itemize}

\end{description}


\section{Submodules}
\label{modules:submodules}

\subsection{phaseshifts.atorb}
\label{modules:module-phaseshifts.atorb}\label{modules:phaseshifts-atorb}\index{phaseshifts.atorb (module)}
\textbf{atorb.py}

Provides convenience functions for generating input and calculating 
atomic charge densities for use with the Barbieri/Van Hove phase 
shift calculation package.
\begin{quote}\begin{description}
\item[{See}] \leavevmode
\href{http://www.icts.hkbu.edu.hk/surfstructinfo/SurfStrucInfo\_files/leed/}{http://www.icts.hkbu.edu.hk/surfstructinfo/SurfStrucInfo\_files/leed/}

\item[{Requires}] \leavevmode
f2py (for libphsh fortran wrapper generation)

\end{description}\end{quote}

\begin{notice}{note}{Note:}
To generate libphsh fortran wrappers (libphsh.pyd) for your platform
then use `python setup.py' in the lib directory of this package to 
install into your python distribution. Alternatively, use:

\begin{Verbatim}[commandchars=\\\{\}]
f2py \PYGZhy{}c \PYGZhy{}m libphsh libphsh.f
\end{Verbatim}

Windows users may have to add appropriate compiler switches, e.g.

\begin{Verbatim}[commandchars=\\\{\}]
f2py \PYGZhy{}c \PYGZhy{}m libphsh \PYGZhy{}\PYGZhy{}fcompiler=gfortran \PYGZhy{}\PYGZhy{}compiler=mingw\PYGZhy{}32 libphsh.f
\end{Verbatim}
\end{notice}
\index{Atorb (class in phaseshifts.atorb)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.atorb.Atorb}\pysiglinewithargsret{\strong{class }\code{phaseshifts.atorb.}\bfcode{Atorb}}{\emph{**kwargs}}{}
Bases: \code{object}
\paragraph{Notes}

Original author: Eric Shirley

There are nr grid points, and distances are in Bohr radii
\(a_0 \simeq 0.539 \mathrm{\AA}\)

\(r(i) = r_{min} \cdot (r_{max} / r_{min})^{(i/n_r)}\), 
\(i=1,2,3,...n_r-1,n_r\)

The orbitals are stored in phe(), first index goes \(1...n_r\), the
second index is the orbital index (\(i...n_{el}\))

Look at the atomic files after printing this out to see everything...
Suffice it to say, that the charge density at radius \(r(i)\)
in units of electrons per cubic Bohr radius is given by:

\(\sum_{j-1}^{n_el}{occ(j) \cdot phe(i,j)^2 / (4.0\,\pi\,{r(i)^2)}}\)

Think of the phe functions as plotting the radial wave-functions
as a function of radius on a logarithmic mesh...

The Dirac equation is solved for the orbitals, whereas their density
is treated by setting \(phe(i,j)\) to Dirac's 
\(\sqrt{F(i,j)^2 + G(i,j)^2}\) times the sign of \(G(i,j)\)...

So we are doing Dirac-Fock, except that we are not treating exchange 
exactly, in terms of working with major and minor components of the 
orbitals, and the phe's give the CORRECT CHARGE DENSITY...

The above approximation ought to be very small for valence states,
so you need not worry about it...

The Breit interaction has been neglected altogether...it should not 
have a huge effect on the charge density you are concerned with...
\index{calculate\_Q\_density() (phaseshifts.atorb.Atorb static method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.atorb.Atorb.calculate_Q_density}\pysiglinewithargsret{\strong{static }\bfcode{calculate\_Q\_density}}{\emph{**kwargs}}{}~\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\textbf{kwargs may be any of the following.} :

\textbf{element} : int or str, optional
\begin{quote}

Generate element atorb input file on the fly. Additional
kwargs may be used to govern the structure of the input
file - please use \code{help(phaseshifts.Atorb.gen\_input)} 
for more information.
\end{quote}

\textbf{input} : str, optional
\begin{quote}

Specify atorb input file otherwise will use the class
instance value.
\end{quote}

\textbf{output\_dir} : str, optional
\begin{quote}

Specify the output directory for the \emph{at\_*.i} file
generated, otherwise the default current working directory 
is used.
\end{quote}

\item[{Returns}] \leavevmode
\textbf{str} : filename

\end{description}\end{quote}
\paragraph{Examples}

\begin{Verbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{Atorb}\PYG{o}{.}\PYG{n}{calculate\PYGZus{}Q\PYGZus{}density}\PYG{p}{(}\PYG{n+nb}{input}\PYG{o}{=}\PYG{l+s}{\PYGZsq{}}\PYG{l+s}{atorb\PYGZus{}C.txt}\PYG{l+s}{\PYGZsq{}}\PYG{p}{)}
\PYG{g+go}{      18.008635    \PYGZhy{}33.678535}
\PYG{g+go}{       4.451786    \PYGZhy{}36.654271}
\PYG{g+go}{       1.569616    \PYGZhy{}37.283660}
\PYG{g+go}{       0.424129    \PYGZhy{}37.355634}
\PYG{g+go}{       0.116221    \PYGZhy{}37.359816}
\PYG{g+go}{       0.047172    \PYGZhy{}37.360317}
\PYG{g+go}{       0.021939    \PYGZhy{}37.360435}
\PYG{g+go}{       0.010555    \PYGZhy{}37.360464}
\PYG{g+go}{       0.005112    \PYGZhy{}37.360471}
\PYG{g+go}{       0.002486    \PYGZhy{}37.360473}
\PYG{g+go}{       0.001213    \PYGZhy{}37.360473}
\PYG{g+go}{       0.000593    \PYGZhy{}37.360473}
\PYG{g+go}{       0.000290    \PYGZhy{}37.360474}
\PYG{g+go}{    N L M J S OCC.}
\PYG{g+go}{    1   0 0  \PYGZhy{}1/2   1    2.0000        \PYGZhy{}11.493862}
\PYG{g+go}{    2   0 0  \PYGZhy{}1/2   1    2.0000         \PYGZhy{}0.788618}
\PYG{g+go}{    2   1 1  \PYGZhy{}1/2   1    0.6667         \PYGZhy{}0.133536}
\PYG{g+go}{    2   1 1  \PYGZhy{}3/2   1    1.3333         \PYGZhy{}0.133311}
\PYG{g+go}{ TOTAL ENERGY =      \PYGZhy{}37.360474  \PYGZhy{}1016.638262}
\end{Verbatim}

\begin{Verbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{Atorb}\PYG{o}{.}\PYG{n}{calculate\PYGZus{}Q\PYGZus{}density}\PYG{p}{(}\PYG{n}{element}\PYG{o}{=}\PYG{l+s}{\PYGZsq{}}\PYG{l+s}{H}\PYG{l+s}{\PYGZsq{}}\PYG{p}{)}
\PYG{g+go}{       0.500007     \PYGZhy{}0.343752}
\PYG{g+go}{       0.152392     \PYGZhy{}0.354939}
\PYG{g+go}{       0.065889     \PYGZhy{}0.357254}
\PYG{g+go}{       0.028751     \PYGZhy{}0.357644}
\PYG{g+go}{       0.012732     \PYGZhy{}0.357703}
\PYG{g+go}{       0.005743     \PYGZhy{}0.357711}
\PYG{g+go}{       0.002641     \PYGZhy{}0.357712}
\PYG{g+go}{       0.001236     \PYGZhy{}0.357713}
\PYG{g+go}{       0.000587     \PYGZhy{}0.357713}
\PYG{g+go}{       0.000282     \PYGZhy{}0.357713}
\PYG{g+go}{ N L M J S OCC.}
\PYG{g+go}{    1   0 0  \PYGZhy{}1/2   1    1.0000         \PYGZhy{}0.229756}
\PYG{g+go}{ TOTAL ENERGY =       \PYGZhy{}0.357713     \PYGZhy{}9.733932}
\end{Verbatim}

\end{fulllineitems}

\index{gen\_input() (phaseshifts.atorb.Atorb static method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.atorb.Atorb.gen_input}\pysiglinewithargsret{\strong{static }\bfcode{gen\_input}}{\emph{element}, \emph{**kwargs}}{}~\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\textbf{element} : int or str
\begin{quote}

Either the atomic number, symbol or name for a given element
\end{quote}

\textbf{output} : str, optional
\begin{quote}

File string for atomic orbital output (default: `at\_\textless{}symbol\textgreater{}.i')
\end{quote}

\textbf{ngrid} : int, optional
\begin{quote}

Number of points in radial grid (default: 1000)
\end{quote}

\textbf{rel} : bool, optional
\begin{quote}

Specify whether to consider relativistic effects
\end{quote}

\textbf{filename} : str, optional
\begin{quote}

Name for generated input file (default: `atorb')
\end{quote}

\textbf{header} : str, optional
\begin{quote}

Comment at beginning of input file
\end{quote}

\textbf{method} : str, optional
\begin{quote}

Exchange correlation method using either 0.0=Hartree-Fock,
1.0=LDA, -alpha = xalpha (default: 0.0)
\end{quote}

\textbf{relic} : float, optional
\begin{quote}

Relic value for calculation (default: 0)
\end{quote}

\textbf{mixing\_SCF} : float, optional
\begin{quote}

Self consisting field value (default: 0.5)
\end{quote}

\textbf{tolerance} : float, optional
\begin{quote}

Eigenvalue tolerance (default: 0.0005)
\end{quote}

\textbf{ech} : float, optional
\begin{quote}

(default: 100)
\end{quote}

\end{description}\end{quote}

\end{fulllineitems}

\index{get\_quantum\_info() (phaseshifts.atorb.Atorb static method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.atorb.Atorb.get_quantum_info}\pysiglinewithargsret{\strong{static }\bfcode{get\_quantum\_info}}{\emph{shell}}{}~\begin{quote}\begin{description}
\item[{Returns}] \leavevmode
\textbf{tuple} : (int, int, list{[}float, float{]}, list{[}float, float{]})
\begin{quote}

(n, l, j={[}l-s, l+s{]}, occ={[}\(n^-_r\), \(n^+_r\){]})
\end{quote}

\end{description}\end{quote}
\paragraph{Notes}
\begin{itemize}
\item {} 
\emph{n} is the principle quantum number (\(n > 0\)).

\item {} 
\emph{l} is the azimuthal quantum number (\(0 \leq l \leq n-1\)).

\item {} 
\emph{s} is the spin quantum number (\(s \pm \frac{1}{2}\)).

\item {} 
\emph{j} is the total angular momentum quantum numbers for both 
\(l-s\) or \(l+s\), respectively.

\item {} 
\(n_r\) is the occupancy of the spin-split \(l-s\) 
and \(l+s\) levels, respectively.

\end{itemize}

\end{fulllineitems}

\index{replace\_core\_config() (phaseshifts.atorb.Atorb static method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.atorb.Atorb.replace_core_config}\pysiglinewithargsret{\strong{static }\bfcode{replace\_core\_config}}{\emph{electron\_config}}{}~\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\textbf{electron\_config} : str
\begin{quote}

String containing the electronic configuration of the given 
element.
\end{quote}

\item[{Returns}] \leavevmode
\textbf{str :} :
\begin{quote}

A substituted string where the nobel gas core has been replaced.
\end{quote}

\end{description}\end{quote}
\paragraph{Examples}

\begin{Verbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{Atorb}\PYG{o}{.}\PYG{n}{replace\PYGZus{}core\PYGZus{}config}\PYG{p}{(}\PYG{l+s}{\PYGZsq{}}\PYG{l+s}{[Ar] 4s2}\PYG{l+s}{\PYGZsq{}}\PYG{p}{)}
\PYG{g+go}{ \PYGZsq{}1s2 2s2 2p6 3s2 3p6 4s2\PYGZsq{}}
\end{Verbatim}

\begin{Verbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{Atorb}\PYG{o}{.}\PYG{n}{replace\PYGZus{}core\PYGZus{}config}\PYG{p}{(}\PYG{l+s}{\PYGZsq{}}\PYG{l+s}{[Xe] 6s2 5d1}\PYG{l+s}{\PYGZsq{}}\PYG{p}{)}
\PYG{g+go}{ \PYGZsq{}1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 5s2 4d10 5p6 6s2 5d1\PYGZsq{}}
\end{Verbatim}

\end{fulllineitems}


\end{fulllineitems}



\subsection{phaseshifts.conphas}
\label{modules:module-phaseshifts.conphas}\label{modules:phaseshifts-conphas}\index{phaseshifts.conphas (module)}
\textbf{conphas.py}

Provides a native python version of the conphas (phsh3) FORTRAN program 
by W. Moritz, which is distributed as part of the SATLEED code 
(see ``Barbieri/Van Hove phase shift calculation package'' section) and can
be found at: \href{http://www.icts.hkbu.edu.hk/surfstructinfo/SurfStrucInfo\_files/}{http://www.icts.hkbu.edu.hk/surfstructinfo/SurfStrucInfo\_files/}
leed/leedpack.html

The Conphas() class also provides a number of convenience functions (see 
docstrings below).


\subsubsection{Examples}
\label{modules:examples}
\begin{Verbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{os.path} \PYG{k+kn}{import} \PYG{n}{join}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{phaseshifts.conphas} \PYG{k+kn}{import} \PYG{n}{Conphas}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{con} \PYG{o}{=} \PYG{n}{Conphas}\PYG{p}{(}\PYG{n}{output\PYGZus{}file}\PYG{o}{=}\PYG{n}{join}\PYG{p}{(}\PYG{l+s}{\PYGZsq{}}\PYG{l+s}{testing}\PYG{l+s}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s}{\PYGZsq{}}\PYG{l+s}{leedph\PYGZus{}py.d}\PYG{l+s}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{,}
\PYG{g+go}{                 lmax=10)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{con}\PYG{o}{.}\PYG{n}{set\PYGZus{}input\PYGZus{}files}\PYG{p}{(}\PYG{p}{[}\PYG{n}{join}\PYG{p}{(}\PYG{l+s}{\PYGZsq{}}\PYG{l+s}{testing}\PYG{l+s}{\PYGZsq{}}\PYG{p}{,} \PYG{l+s}{\PYGZsq{}}\PYG{l+s}{ph1}\PYG{l+s}{\PYGZsq{}}\PYG{p}{)}\PYG{p}{]}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{con}\PYG{o}{.}\PYG{n}{set\PYGZus{}format}\PYG{p}{(}\PYG{l+s}{\PYGZsq{}}\PYG{l+s}{cleed}\PYG{l+s}{\PYGZsq{}}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{con}\PYG{o}{.}\PYG{n}{calculate}\PYG{p}{(}\PYG{p}{)}
\end{Verbatim}
\index{Conphas (class in phaseshifts.conphas)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.conphas.Conphas}\pysiglinewithargsret{\strong{class }\code{phaseshifts.conphas.}\bfcode{Conphas}}{\emph{input\_files=}\optional{}, \emph{output\_file=}\optional{}, \emph{formatting=None}, \emph{lmax=10}, \emph{**kwargs}}{}
Class Conphas
\paragraph{Notes}

This work is based on the original conphas (phsh3) FORTRAN program by 
W. Moritz, which is distributed as part of the SATLEED code (see 
``Barbieri/Van Hove phase shift calculation package'' section) and can be 
found at: \href{http://www.icts.hkbu.edu.hk/surfstructinfo/SurfStrucInfo\_files/}{http://www.icts.hkbu.edu.hk/surfstructinfo/SurfStrucInfo\_files/}
leed/leedpack.html
\index{\_Conphas\_\_fix\_path() (phaseshifts.conphas.Conphas method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.conphas.Conphas._Conphas__fix_path}\pysiglinewithargsret{\bfcode{\_Conphas\_\_fix\_path}}{\emph{file\_path}}{}
Fix escaped characters in filepath

\end{fulllineitems}

\index{\_Conphas\_\_set\_data() (phaseshifts.conphas.Conphas method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.conphas.Conphas._Conphas__set_data}\pysiglinewithargsret{\bfcode{\_Conphas\_\_set\_data}}{\emph{data=None}}{}
\end{fulllineitems}

\index{calculate() (phaseshifts.conphas.Conphas method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.conphas.Conphas.calculate}\pysiglinewithargsret{\bfcode{calculate}}{}{}
Calculates continuous phase shifts from input file(s).
\paragraph{Examples}

\begin{Verbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{con} \PYG{o}{=} \PYG{n}{Conphas}\PYG{p}{(}\PYG{n}{output\PYGZus{}file}\PYG{o}{=}\PYG{l+s}{r\PYGZsq{}}\PYG{l+s}{testing}\PYG{l+s}{\PYGZbs{}}\PYG{l+s}{leedph\PYGZus{}py.d}\PYG{l+s}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{lmax}\PYG{o}{=}\PYG{l+m+mi}{10}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{con}\PYG{o}{.}\PYG{n}{set\PYGZus{}input\PYGZus{}files}\PYG{p}{(}\PYG{p}{[}\PYG{l+s}{r\PYGZsq{}}\PYG{l+s}{testing}\PYG{l+s}{\PYGZbs{}}\PYG{l+s}{ph1}\PYG{l+s}{\PYGZsq{}}\PYG{p}{]}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{con}\PYG{o}{.}\PYG{n}{set\PYGZus{}format}\PYG{p}{(}\PYG{l+s}{\PYGZsq{}}\PYG{l+s}{cleed}\PYG{l+s}{\PYGZsq{}}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{con}\PYG{o}{.}\PYG{n}{calculate}\PYG{p}{(}\PYG{p}{)}
\PYG{g+go}{ L = 0}
\PYG{g+go}{ jump between 25.0 eV and 30.0 eV; IFAK = \PYGZhy{}1}
\PYG{g+go}{ L = 1}
\PYG{g+go}{ jump between 65.0 eV and 70.0 eV; IFAK = \PYGZhy{}1}
\PYG{g+go}{ L = 2}
\PYG{g+go}{ jump between 20.0 eV and 25.0 eV; IFAK = 1}
\PYG{g+go}{ jump between 80.0 eV and 85.0 eV; IFAK = 0}
\PYG{g+go}{ L = 3}
\PYG{g+go}{ L = 4}
\PYG{g+go}{ jump between 275.0 eV and 280.0 eV; IFAK = 1}
\PYG{g+go}{ L = 5}
\PYG{g+go}{ L = 6}
\PYG{g+go}{ L = 7}
\PYG{g+go}{ L = 8}
\PYG{g+go}{ L = 9}
\PYG{g+go}{ L = 10}
\end{Verbatim}

\end{fulllineitems}

\index{load\_data() (phaseshifts.conphas.Conphas method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.conphas.Conphas.load_data}\pysiglinewithargsret{\bfcode{load\_data}}{\emph{filename}}{}
Load (discontinuous) phase shift data from file
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\textbf{file} : str
\begin{quote}

Path to phase shift file.
\end{quote}

\item[{Returns}] \leavevmode
\textbf{tuple: (double, double, int, int, ndarray)} :
\begin{quote}

(initial\_energy, energy\_step, n\_phases, lmf, data)
\end{quote}

\end{description}\end{quote}
\paragraph{Notes}
\begin{itemize}
\item {} 
\emph{initial\_energy} is the starting energy of the phase shifts.

\item {} 
\emph{energy\_step} is the change in energy between consecutive values.

\item {} 
\emph{n\_phases} is the number of phase shifts contained in the file.

\item {} 
\emph{lmf} is the maximum azimuthal quantum number considered.

\item {} 
\emph{data} is a (2 x n\_phases) array containing the phase shift data.

\end{itemize}

\end{fulllineitems}

\index{read\_datafile() (phaseshifts.conphas.Conphas method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.conphas.Conphas.read_datafile}\pysiglinewithargsret{\bfcode{read\_datafile}}{\emph{filename}}{}
Read in discontinuous phase shift file
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\textbf{filename} : str
\begin{quote}

The path to the discontinuous phase shift file
\end{quote}

\end{description}\end{quote}

\end{fulllineitems}

\index{set\_format() (phaseshifts.conphas.Conphas method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.conphas.Conphas.set_format}\pysiglinewithargsret{\bfcode{set\_format}}{\emph{formatting=None}}{}
Set appropriate format from available options
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\textbf{format} : str, optional
\begin{quote}

The format identifier for different packages; can be `cleed'
or None.
\end{quote}

\end{description}\end{quote}

\end{fulllineitems}

\index{set\_input\_files() (phaseshifts.conphas.Conphas method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.conphas.Conphas.set_input_files}\pysiglinewithargsret{\bfcode{set\_input\_files}}{\emph{input\_files=}\optional{}}{}
set list of input filenames

\end{fulllineitems}

\index{set\_lmax() (phaseshifts.conphas.Conphas method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.conphas.Conphas.set_lmax}\pysiglinewithargsret{\bfcode{set\_lmax}}{\emph{lmax}}{}
Set max orbital angular momentum (azimuthal quantum number)
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\textbf{lmax} : int
\begin{quote}

Maximum azimuthal quantum number to be considered in calculations.
\end{quote}

\end{description}\end{quote}

\end{fulllineitems}

\index{set\_output\_file() (phaseshifts.conphas.Conphas method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.conphas.Conphas.set_output_file}\pysiglinewithargsret{\bfcode{set\_output\_file}}{\emph{output\_file}}{}
set output filename

\end{fulllineitems}

\index{split\_phasout() (phaseshifts.conphas.Conphas static method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.conphas.Conphas.split_phasout}\pysiglinewithargsret{\strong{static }\bfcode{split\_phasout}}{\emph{filename}, \emph{output\_filenames=}\optional{}}{}
split phasout input file into separate files

\end{fulllineitems}


\end{fulllineitems}



\subsection{phaseshifts.elements}
\label{modules:phaseshifts-elements}\label{modules:module-phaseshifts.elements}\index{phaseshifts.elements (module)}
Properties of the chemical elements.

Each chemical element is represented as an object instance. Physicochemical
and descriptive properties of the elements are stored as instance attributes.
\begin{quote}\begin{description}
\item[{Author}] \leavevmode
\href{http://www.lfd.uci.edu/~gohlke/}{Christoph Gohlke}

\item[{Version}] \leavevmode
2013.03.18

\end{description}\end{quote}


\subsubsection{Requirements}
\label{modules:requirements}\begin{itemize}
\item {} 
\href{http://www.python.org}{CPython 2.7, 3.2 or 3.3}

\end{itemize}


\subsubsection{References}
\label{modules:references}\begin{enumerate}
\item {} 
\href{http://physics.nist.gov/PhysRefData/Compositions/}{http://physics.nist.gov/PhysRefData/Compositions/}

\item {} 
\href{http://physics.nist.gov/PhysRefData/IonEnergy/tblNew.html}{http://physics.nist.gov/PhysRefData/IonEnergy/tblNew.html}

\item {} 
\href{http://en.wikipedia.org/wiki/\%(element.name)s}{http://en.wikipedia.org/wiki/\%(element.name)s}

\item {} 
\href{http://www.miranda.org/~jkominek/elements/elements.db}{http://www.miranda.org/\textasciitilde{}jkominek/elements/elements.db}

\end{enumerate}


\subsubsection{Examples}
\label{modules:id1}
\begin{Verbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{elements} \PYG{k+kn}{import} \PYG{n}{ELEMENTS}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{ELEMENTS}\PYG{p}{)}
\PYG{g+go}{109}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{str}\PYG{p}{(}\PYG{n}{ELEMENTS}\PYG{p}{[}\PYG{l+m+mi}{109}\PYG{p}{]}\PYG{p}{)}
\PYG{g+go}{\PYGZsq{}Meitnerium\PYGZsq{}}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{ele} \PYG{o}{=} \PYG{n}{ELEMENTS}\PYG{p}{[}\PYG{l+s}{\PYGZsq{}}\PYG{l+s}{C}\PYG{l+s}{\PYGZsq{}}\PYG{p}{]}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{ele}\PYG{o}{.}\PYG{n}{number}\PYG{p}{,} \PYG{n}{ele}\PYG{o}{.}\PYG{n}{symbol}\PYG{p}{,} \PYG{n}{ele}\PYG{o}{.}\PYG{n}{name}\PYG{p}{,} \PYG{n}{ele}\PYG{o}{.}\PYG{n}{eleconfig}
\PYG{g+go}{(6, \PYGZsq{}C\PYGZsq{}, \PYGZsq{}Carbon\PYGZsq{}, \PYGZsq{}[He] 2s2 2p2\PYGZsq{})}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{ele}\PYG{o}{.}\PYG{n}{eleconfig\PYGZus{}dict}
\PYG{g+go}{\PYGZob{}(1, \PYGZsq{}s\PYGZsq{}): 2, (2, \PYGZsq{}p\PYGZsq{}): 2, (2, \PYGZsq{}s\PYGZsq{}): 2\PYGZcb{}}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{sum}\PYG{p}{(}\PYG{n}{ele}\PYG{o}{.}\PYG{n}{mass} \PYG{k}{for} \PYG{n}{ele} \PYG{o+ow}{in} \PYG{n}{ELEMENTS}\PYG{p}{)}
\PYG{g+go}{14659.1115599}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k}{for} \PYG{n}{ele} \PYG{o+ow}{in} \PYG{n}{ELEMENTS}\PYG{p}{:}
\PYG{g+gp}{... }    \PYG{n}{ele}\PYG{o}{.}\PYG{n}{validate}\PYG{p}{(}\PYG{p}{)}
\PYG{g+gp}{... }    \PYG{n}{ele} \PYG{o}{=} \PYG{n+nb}{eval}\PYG{p}{(}\PYG{n+nb}{repr}\PYG{p}{(}\PYG{n}{ele}\PYG{p}{)}\PYG{p}{)}
\end{Verbatim}


\subsection{phaseshifts.leed}
\label{modules:module-phaseshifts.leed}\label{modules:phaseshifts-leed}\index{phaseshifts.leed (module)}
Provides CLEED validator and Converter classes.

The CLEED\_validator() class provides a method for checking 
the input files for errors, whereas the Converter.import\_CLEED()
method allows importing CLEED input files as a MTZ\_model class
\index{CLEED\_validator (class in phaseshifts.leed)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.leed.CLEED_validator}\pysigline{\strong{class }\code{phaseshifts.leed.}\bfcode{CLEED\_validator}}
Bases: \code{object}

Class for validation of CLEED input files
\index{is\_CLEED\_file() (phaseshifts.leed.CLEED\_validator static method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.leed.CLEED_validator.is_CLEED_file}\pysiglinewithargsret{\strong{static }\bfcode{is\_CLEED\_file}}{\emph{filename}}{}
Determine if file is a CLEED input file
\begin{quote}\begin{description}
\item[{Returns}] \leavevmode
\textbf{True} :
\begin{quote}

if a valid filename ending in any of .bul, .inp, .bsr, .bmin
\end{quote}

\textbf{False} :
\begin{quote}

otherwise
\end{quote}

\end{description}\end{quote}

\end{fulllineitems}

\index{validate() (phaseshifts.leed.CLEED\_validator method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.leed.CLEED_validator.validate}\pysiglinewithargsret{\bfcode{validate}}{\emph{filename}, \emph{aoi=False}}{}
Checks CLEED input file for errors
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\textbf{filename} : str
\begin{quote}

Path to input file. Should be *.bul , *.ctr, *.inp or *.bmin
\end{quote}

\textbf{aoi} : bool
\begin{quote}

Check for angle of incidence parameters
\end{quote}

\end{description}\end{quote}

\end{fulllineitems}


\end{fulllineitems}

\index{CSearch (class in phaseshifts.leed)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.leed.CSearch}\pysiglinewithargsret{\strong{class }\code{phaseshifts.leed.}\bfcode{CSearch}}{\emph{model\_name}, \emph{leed\_command=None}}{}
Bases: \code{object}
\index{\_getResults() (phaseshifts.leed.CSearch method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.leed.CSearch._getResults}\pysiglinewithargsret{\bfcode{\_getResults}}{}{}
\end{fulllineitems}

\index{getIteration() (phaseshifts.leed.CSearch method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.leed.CSearch.getIteration}\pysiglinewithargsret{\bfcode{getIteration}}{\emph{iteration}}{}
\end{fulllineitems}

\index{getRFactor() (phaseshifts.leed.CSearch method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.leed.CSearch.getRFactor}\pysiglinewithargsret{\bfcode{getRFactor}}{\emph{iteration}}{}
\end{fulllineitems}

\index{getTimeStamp() (phaseshifts.leed.CSearch method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.leed.CSearch.getTimeStamp}\pysiglinewithargsret{\bfcode{getTimeStamp}}{\emph{iteration}}{}
\end{fulllineitems}

\index{setModel() (phaseshifts.leed.CSearch method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.leed.CSearch.setModel}\pysiglinewithargsret{\bfcode{setModel}}{\emph{name}}{}
\end{fulllineitems}


\end{fulllineitems}

\index{Converter (class in phaseshifts.leed)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.leed.Converter}\pysigline{\strong{class }\code{phaseshifts.leed.}\bfcode{Converter}}
Bases: \code{object}

Convert different input into phaseshift compatible input
\index{import\_CLEED() (phaseshifts.leed.Converter static method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.leed.Converter.import_CLEED}\pysiglinewithargsret{\strong{static }\bfcode{import\_CLEED}}{\emph{filename}}{}
Imports CLEED input file and converts model to muffin-tin input.
\begin{description}
\item[{It assumes the following:}] \leavevmode\begin{itemize}
\item {} 
the basis vectors a1, a2, \& a3 are x,y,z cartezian coordinates

\item {} 
if no a3 is found, the maximum z distance between atoms multiplied
by four is given

\item {} 
the unitcell is converted from cartezian to fractional coordinates

\item {} 
atom sites are converted from Angstrom to Bohr units

\item {} 
additional info from the phase shift filename is provided by 
splitting the `\_' chars:
\begin{enumerate}
\item {} 
First string segment is element or symbol, e.g. Ni

\item {} 
Second string segment is the oxidation, e.g. +2

\end{enumerate}

\item {} 
lines with `\textbf{rm:}` provide the radii dictionary of the atomic 
species

\item {} 
if no `\textbf{rm:}` found for that species, the atomic radius is used 
for zero valence, otherwise the covalent radius is used.

\end{itemize}

\end{description}

Additional information can, however, be provided using `phs:' at the 
start of a line within the input file and may have the following 
formats:
\begin{enumerate}
\item {} 
``\textbf{phs:} c \emph{\textless{}float\textgreater{}} nh \emph{\textless{}int\textgreater{}} nform \emph{\textless{}int\textgreater{}} exchange \emph{\textless{}float\textgreater{}}``

\item {} 
``\textbf{phs:} \emph{\textless{}phase\_shift\textgreater{}} valence \emph{\textless{}float\textgreater{}} radius \emph{\textless{}float\textgreater{}}``

\end{enumerate}

The identifiers \code{exchange}, \code{nform}, \code{valence} and \code{radius} may 
be abbreviated to \code{exc}, \code{nf}, \code{val} and \code{rad}, respectively.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\textbf{filename} : str
\begin{quote}

Path to input file.
\end{quote}

\item[{Returns}] \leavevmode
\textbf{phaseshifts.model.MTZ\_model} :

\item[{Raises}] \leavevmode
\textbf{IOError} : filename invalid

\textbf{ValueError} : bad formatting of input

\end{description}\end{quote}

\end{fulllineitems}


\end{fulllineitems}



\subsection{phaseshifts.model}
\label{modules:module-phaseshifts.model}\label{modules:phaseshifts-model}\index{phaseshifts.model (module)}
\textbf{model.py}

Provides convenience functions for generating input and calculating 
atomic charge densities for use with the Barbieri/Van Hove phase 
shift calculation package.
\index{Atom (class in phaseshifts.model)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.Atom}\pysiglinewithargsret{\strong{class }\code{phaseshifts.model.}\bfcode{Atom}}{\emph{element, coordinates={[}0.0, 0.0, 0.0{]}, **kwargs}}{}
Bases: \code{object}

Atom class for input into cluster model for muffin-tin potential
calculations.
\index{set\_coordinates() (phaseshifts.model.Atom method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.Atom.set_coordinates}\pysiglinewithargsret{\bfcode{set\_coordinates}}{\emph{coordinates}}{}
\end{fulllineitems}

\index{set\_mufftin\_radius() (phaseshifts.model.Atom method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.Atom.set_mufftin_radius}\pysiglinewithargsret{\bfcode{set\_mufftin\_radius}}{\emph{radius}}{}
Sets the muffin-tin radius of the atom in Angstroms.

\end{fulllineitems}

\index{set\_valence() (phaseshifts.model.Atom method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.Atom.set_valence}\pysiglinewithargsret{\bfcode{set\_valence}}{\emph{valency}}{}
Sets the valency of the atom

\end{fulllineitems}


\end{fulllineitems}

\index{CoordinatesError}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.CoordinatesError}\pysiglinewithargsret{\strong{exception }\code{phaseshifts.model.}\bfcode{CoordinatesError}}{\emph{msg}}{}
Bases: \href{http://docs.python.org/library/exceptions.html\#exceptions.Exception}{\code{exceptions.Exception}}

Coordinate exception to raise and log duplicate coordinates.

\end{fulllineitems}

\index{MTZ\_model (class in phaseshifts.model)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.MTZ_model}\pysiglinewithargsret{\strong{class }\code{phaseshifts.model.}\bfcode{MTZ\_model}}{\emph{unitcell}, \emph{atoms}, \emph{**kwargs}}{}
Bases: {\hyperref[modules:phaseshifts.model.Model]{\code{phaseshifts.model.Model}}}

Muffin-tin potential Model subclass for producing input file 
for muffin-tin calculations in the Barbieri/Van Hove phase 
shift calculation package.
\index{calculate\_MTZ() (phaseshifts.model.MTZ\_model method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.MTZ_model.calculate_MTZ}\pysiglinewithargsret{\bfcode{calculate\_MTZ}}{\emph{mtz\_string='`}, \emph{**kwargs}}{}~\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\textbf{atomic\_file} : str
\begin{quote}

The path to the atomic input file. If this is omitted the default
is generate one using the MTZ\_model.gen\_atomic() method.
\end{quote}

\textbf{cluster\_file} : str
\begin{quote}

The path to the cluster input file which may be a bulk or slab 
model.
\end{quote}

\textbf{slab} : int or bool
\begin{quote}

Determines whether the MTZ calculation is for a slab model (True).
The default is a bulk calculation.
\end{quote}

\textbf{output} : dict
\begin{quote}

Dictionary output of `mtz' - muffin-tin potential \& `output\_file'
- the path to the MTZ output file.
\end{quote}

\item[{Returns}] \leavevmode
\textbf{output\_files} : list(str)
\begin{quote}

Paths to the MTZ output file.
\end{quote}

\end{description}\end{quote}

\end{fulllineitems}

\index{create\_atorbs() (phaseshifts.model.MTZ\_model method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.MTZ_model.create_atorbs}\pysiglinewithargsret{\bfcode{create\_atorbs}}{\emph{**kwargs}}{}~\begin{quote}\begin{description}
\item[{Returns}] \leavevmode
\textbf{output\_files} : dict
\begin{quote}

Dictionary list of atorb*.i input files for the Atorb class to
calculate the charge density from.
\end{quote}

\end{description}\end{quote}

\end{fulllineitems}

\index{gen\_atomic() (phaseshifts.model.MTZ\_model method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.MTZ_model.gen_atomic}\pysiglinewithargsret{\bfcode{gen\_atomic}}{\emph{**kwargs}}{}~\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\textbf{input\_dir} : str
\begin{quote}

Input directory where at*.i files are kept.
\end{quote}

\textbf{input\_files} : tuple
\begin{quote}

List of input files to generate atomic input file from.
\end{quote}

\textbf{output\_file} : str
\begin{quote}

The filename of the resulting atomic*.i output file, which is
simply a superimposed set of the radial charge densities from
the individual input files.
\end{quote}

\item[{Returns}] \leavevmode
\textbf{output\_file} : str
\begin{quote}

Returns the output file path string.
\end{quote}

\item[{Raises}] \leavevmode
\textbf{IOError} : exception
\begin{quote}

If either input directory or files do not exist.
\end{quote}

\end{description}\end{quote}
\paragraph{Notes}

If `input\_files' is not given then the default list of input files are 
inferred from the list of atoms in the model.

\end{fulllineitems}

\index{gen\_input() (phaseshifts.model.MTZ\_model method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.MTZ_model.gen_input}\pysiglinewithargsret{\bfcode{gen\_input}}{\emph{**kwargs}}{}~\begin{quote}\begin{description}
\item[{Returns}] \leavevmode
\textbf{filename on success} :

\item[{Raises}] \leavevmode
\textbf{CoordinatesError} : exception
\begin{quote}

if the model atoms have duplicate coordinates and the `pos\_check' 
kwarg is set to True.
\end{quote}

\end{description}\end{quote}

\end{fulllineitems}

\index{get\_MTZ() (phaseshifts.model.MTZ\_model method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.MTZ_model.get_MTZ}\pysiglinewithargsret{\bfcode{get\_MTZ}}{\emph{filename}}{}
Retrieves muffin-tin potential from file

\end{fulllineitems}

\index{get\_elements() (phaseshifts.model.MTZ\_model method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.MTZ_model.get_elements}\pysiglinewithargsret{\bfcode{get\_elements}}{}{}
Return the unique elements in model

\end{fulllineitems}

\index{load\_from\_file() (phaseshifts.model.MTZ\_model method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.MTZ_model.load_from_file}\pysiglinewithargsret{\bfcode{load\_from\_file}}{\emph{filename}}{}~\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\textbf{filename} : str
\begin{quote}

The path of the input file (e.g. cluster*.i or \emph{slab}.i)
\end{quote}

\item[{Raises}] \leavevmode
\textbf{IOError} : exception
\begin{quote}

If the file cannot be read.
\end{quote}

\textbf{TypeError} : exception
\begin{quote}

If a input line cannot be parsed correctly.
\end{quote}

\end{description}\end{quote}

\end{fulllineitems}

\index{set\_exchange() (phaseshifts.model.MTZ\_model method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.MTZ_model.set_exchange}\pysiglinewithargsret{\bfcode{set\_exchange}}{\emph{alpha}}{}
Sets the alpha exchange term for muffin-tin calculation

\end{fulllineitems}

\index{set\_nform() (phaseshifts.model.MTZ\_model method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.MTZ_model.set_nform}\pysiglinewithargsret{\bfcode{set\_nform}}{\emph{nform}}{}
Sets form of muffin-tin calculation
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\textbf{nform} : int or str
\begin{quote}

This governs the type of calculation, where nform can be:

\textbf{1.} ``cav'' or 0 - use Cavendish method

\textbf{2.} ``wil'' or 1 - use William's method

\textbf{3.} ``rel'' or 2 - Relativistic calculations
\end{quote}

\end{description}\end{quote}

\end{fulllineitems}

\index{set\_nh() (phaseshifts.model.MTZ\_model method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.MTZ_model.set_nh}\pysiglinewithargsret{\bfcode{set\_nh}}{\emph{nh}}{}
Sets the nh muffin-tin zero estimation parameter

\end{fulllineitems}

\index{set\_slab\_c() (phaseshifts.model.MTZ\_model method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.MTZ_model.set_slab_c}\pysiglinewithargsret{\bfcode{set\_slab\_c}}{\emph{c}}{}~\paragraph{Examples}

For Re the bulk c distance is 2.76Å, whereas a possible slab c distance
could be \textasciitilde{}10Å.

\end{fulllineitems}


\end{fulllineitems}

\index{Model (class in phaseshifts.model)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.Model}\pysiglinewithargsret{\strong{class }\code{phaseshifts.model.}\bfcode{Model}}{\emph{unitcell}, \emph{atoms}, \emph{**kwargs}}{}
Bases: \code{object}

Generic model class.
\index{\_nineq\_atoms() (phaseshifts.model.Model method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.Model._nineq_atoms}\pysiglinewithargsret{\bfcode{\_nineq\_atoms}}{}{}~\begin{quote}\begin{description}
\item[{Returns}] \leavevmode
\textbf{nineq\_atoms, element\_dict} : tuple
\begin{quote}
\begin{description}
\item[{nineq\_atoms}] \leavevmode{[}The estimated number of inequivalent atoms based on {]}
the valence and radius of each atom.

\item[{element\_dict}] \leavevmode{[}a dictionary of each element in the atom list where {]}
each element contains an atom dictionary of `nineq\_atoms', 
`n\_atoms' and a complete `atom\_list'

\end{description}
\end{quote}

\end{description}\end{quote}

\end{fulllineitems}

\index{add\_atom() (phaseshifts.model.Model method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.Model.add_atom}\pysiglinewithargsret{\bfcode{add\_atom}}{\emph{element}, \emph{position}, \emph{**kwargs}}{}
Append an Atom instance to the model
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\textbf{element} : str or int
\begin{quote}

Either an element name, symbol or atomic number.
\end{quote}

\textbf{position} : list(float) or ndarray
\begin{quote}

(1x3) array of the fractional coordinates of the atom
within the unit cell in terms of the lattice vector a.
\end{quote}

\end{description}\end{quote}

\end{fulllineitems}

\index{check\_coordinates() (phaseshifts.model.Model method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.Model.check_coordinates}\pysiglinewithargsret{\bfcode{check\_coordinates}}{}{}
Check for duplicate coordinates of different atoms in model.
\begin{quote}\begin{description}
\item[{Raises}] \leavevmode
\textbf{CoordinateError} : exception
\begin{quote}

If duplicate positions found.
\end{quote}

\end{description}\end{quote}

\end{fulllineitems}

\index{set\_atoms() (phaseshifts.model.Model method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.Model.set_atoms}\pysiglinewithargsret{\bfcode{set\_atoms}}{\emph{atoms}}{}
Set the atoms for the model.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\textbf{atoms} : list(Atoms)
\begin{quote}

Array of Atom instances. Entries in the list which are
not of type Atom will be ignored.
\end{quote}

\item[{Raises}] \leavevmode
\textbf{TypeError} : exception
\begin{quote}

If atoms parameter is not a list.
\end{quote}

\end{description}\end{quote}

\end{fulllineitems}

\index{set\_unitcell() (phaseshifts.model.Model method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.Model.set_unitcell}\pysiglinewithargsret{\bfcode{set\_unitcell}}{\emph{unitcell}}{}
Set the unitcell for the model
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\textbf{unitcell} : Unitcell
\begin{quote}

Instance of Unitcell class to set to model.
\end{quote}

\item[{Raises}] \leavevmode
\textbf{TypeError} : exception
\begin{quote}

If unitcell parameter is not a Unitcell.
\end{quote}

\end{description}\end{quote}

\end{fulllineitems}


\end{fulllineitems}

\index{Unitcell (class in phaseshifts.model)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.Unitcell}\pysiglinewithargsret{\strong{class }\code{phaseshifts.model.}\bfcode{Unitcell}}{\emph{a}, \emph{c}, \emph{matrix\_3x3}, \emph{**kwargs}}{}
Bases: \code{object}

Unitcell class
\index{set\_a() (phaseshifts.model.Unitcell method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.Unitcell.set_a}\pysiglinewithargsret{\bfcode{set\_a}}{\emph{a}}{}~\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\textbf{a: float} :
\begin{quote}

The magnitude of the in-plane lattice vector in Angstroms
\end{quote}

\end{description}\end{quote}
\paragraph{Notes}

To retrieve a in terms of Angstroms use `unitcell.a', whereas the
internal parameter `unitcell.\_a' converts a into Bohr radii 
(1 Bohr = 0.529Å), which is used for the muffin-tin potential
calculations in libphsh (CAVPOT subroutine).

\end{fulllineitems}

\index{set\_alpha() (phaseshifts.model.Unitcell method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.Unitcell.set_alpha}\pysiglinewithargsret{\bfcode{set\_alpha}}{\emph{alpha}}{}
\end{fulllineitems}

\index{set\_beta() (phaseshifts.model.Unitcell method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.Unitcell.set_beta}\pysiglinewithargsret{\bfcode{set\_beta}}{\emph{beta}}{}
\end{fulllineitems}

\index{set\_c() (phaseshifts.model.Unitcell method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.Unitcell.set_c}\pysiglinewithargsret{\bfcode{set\_c}}{\emph{c}}{}~\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\textbf{c} : float
\begin{quote}

The magnitude of the in-plane lattice vector in Angstroms
\end{quote}

\end{description}\end{quote}
\paragraph{Notes}

To retrieve c in terms of Angstroms use `unitcell.c', whereas the
internal parameter `unitcell.\_c' converts c into Bohr radii 
(1 Bohr = 0.529Å), which is used for the muffin-tin potential
calculations in libphsh (CAVPOT subroutine).

\end{fulllineitems}

\index{set\_gamma() (phaseshifts.model.Unitcell method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.Unitcell.set_gamma}\pysiglinewithargsret{\bfcode{set\_gamma}}{\emph{gamma}}{}
\end{fulllineitems}

\index{set\_vectors() (phaseshifts.model.Unitcell method)}

\begin{fulllineitems}
\phantomsection\label{modules:phaseshifts.model.Unitcell.set_vectors}\pysiglinewithargsret{\bfcode{set\_vectors}}{\emph{m3x3}}{}
\end{fulllineitems}


\end{fulllineitems}



\subsection{phaseshifts.phsh}
\label{modules:phaseshifts-phsh}\label{modules:module-phaseshifts.phsh}\index{phaseshifts.phsh (module)}
phsh.py - quickly generate phase shifts

phsh provides convenience functions to create phase shifts files
suitable for input into LEED-IV programs such as SATLEED and CLEED.


\subsubsection{Examples}
\label{modules:id2}
\begin{Verbatim}[commandchars=\\\{\}]
phsh.py \PYGZhy{}i *.inp \PYGZhy{}b *.bul \PYGZhy{}f CLEED \PYGZhy{}S phase\PYGZus{}dir
\end{Verbatim}


\chapter{Author list}
\label{authors:author-list}\label{authors::doc}\label{authors:authors}\begin{description}
\item[{Below is a list of contributors who have helped to develop this package:}] \leavevmode\begin{itemize}
\item {} 
Liam Deacon - \emph{current maintainer}

\end{itemize}

\end{description}


\section{Get Involved}
\label{authors:get-involved}
If you would like to get involved in the phaseshifts project then
please email \href{mailto:liam.deacon@diamond.ac.uk}{liam.deacon@diamond.ac.uk}.


\chapter{License}
\label{LICENSE::doc}\label{LICENSE:license}\label{LICENSE:id1}
The MIT License (MIT)

Copyright (c) 2013-2014 Liam Deacon

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the ``Software''), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


\chapter{APPENDIX I: Barbieri/Van Hove Phase Shift Package - A Brief User Guide}
\label{phshift2007:appendix-i-barbieri-van-hove-phase-shift-package-a-brief-user-guide}\label{phshift2007::doc}
A. Barbieri, M.A. Van Hove

Lawrence Berkeley Laboratory,
University of California,
Berkeley,
California 94720, USA


\section{Acknowledgement notice}
\label{phshift2007:acknowledgement-notice}
Please acknowledge use of the Barbieri/Van Hove
phase shift package, as:

\emph{A. Barbieri and M.A. Van Hove, private communication.}


\section{Contact}
\label{phshift2007:contact}
M.A. Van Hove:  \href{mailto:vanhove@cityu.edu.hk}{vanhove@cityu.edu.hk}


\section{Contents}
\label{phshift2007:contents}
The following files should be included with the Barbieri/Van Hove
distribution. If any are missing please contact Michel Van Hove
(\href{mailto:vanhove@cityu.edu.hk}{vanhove@cityu.edu.hk}) for replacements.
\begin{itemize}
\item {} 
\code{phshift2007.rst} - This file contains this user guide
to use the phase-shifts programs. It should be
supplemented with the information contained in
the input files provided. Includes definitions of I/O files,
contents and basic hints on running the programs.

\end{itemize}

The files listed below contain FORTRAN programs that correspond to the basic
steps necessary to obtain the phase shifts needed in a LEED structural
determination.
\begin{itemize}
\item {} 
\code{PhSh0.for}    - calculation of the atomic orbital charge densities.

\item {} 
\code{PhSh1.for}    - calculation of the muffin tin potential (bulk \& slab).

\item {} 
\code{PhSh2*.for}   - calculation of phase shifts.

\item {} 
\code{PhSh3.for}    - removal of pi jumps from phase shifts.

\end{itemize}

\textbf{INPUT-OUTPUT}

Contains samples of the input and output files for the case of bulk
Rh and a \(\text{Rh} (111)-(2 \times 2)- \text{C} _2 \text{H} _3\) (H neglected) structure.
\begin{itemize}
\item {} 
\emph{atorbC}     : input of PhSh0 for C

\item {} 
\emph{atorbRh}    : input of PhSh0 for Rh

\item {} 
\emph{atC.i}      : output of PhSh0 for C

\item {} 
\emph{atomic.i}   : input of PhSh1 for \(\text{C} _2 \text{H} _3\) on Rh(111)

\item {} 
\emph{clusRh}     : input of PhSh1 for bulk Rh

\item {} 
\emph{clusC2Rh}   : input of PhSh1 for \(\text{C} _2 \text{H} _3\) on Rh(111) (slab)

\item {} 
\emph{ph1}        : input of PhSh3 (Rh)

\item {} 
\emph{ph2}        : input of PhSh3 (C)

\item {} 
\emph{leedph.d}   : output of PhSh3 (for \(\text{C} _2 \text{H} _3\) on Rh(111))

\end{itemize}
\begin{description}
\item[{Not included are two output files:}] \leavevmode\begin{itemize}
\item {} 
\emph{mufftin.d}  : output of PhSh1 for \(\text{C} _2 \text{H} _3\) (MTZ=-1.74)

\item {} 
\emph{phasout}    : output of PhSh2rel for \(\text{C} _2 \text{H} _3\) on Rh(111)

\end{itemize}

\end{description}


\section{Overview of the Programs}
\label{phshift2007:overview-of-the-programs}
We explain here how to use the PHASE SHIFTS codes to obtain the
phase shifts which are needed in a LEED calculation.

This documentation does not try to explain any of the details and
subtleties of the calculation, but rather it simply tries to put
anybody with a minimum knowledge of basic quantum mechanics in the
position of obtaining good phase shifts. Additional documentation
is contained as comments within some of the codes (but not all!).

The various codes have been obtained from different authors, whose
names can be found in the source codes. The original codes were
modified to make them more general and, at input-output level,
so as to make their use more straightforward.

The codes have been tested on an IBM RISC 6000 workstation. There
is no guarantee that the programs will work correctly when
transported to different computers with different FORTRAN compilers.

Basically, the computation of phase-shifts appropriate for a LEED
calculation can be divided into several distinct steps:


\subsection{Step 0: \texttt{PhSh0.for}}
\label{phshift2007:step-0-phsh0-for}

\subsubsection{Description}
\label{phshift2007:description}
First we need to perform a free atom self-consistent calculation
for each of the N elements for which phase shifts are required.
This is accomplished by using a self-consistent Dirac-Fock (\emph{i.e.}
relativistic approach which computes, separately for each element,
the self-consistent atomic orbitals.
Notice that no local exchange approximation is made in these codes
but some other minor approximations are used; see program for
details.

The input needed at this stage is some basic information about
the shell structure of the atom under consideration, an example
of which is provided in the file ATORB for the case of Rhodium.
The information required is usually contained in any advanced
Chemistry or Solid State book (\emph{e.g.} Ashcroft and Mermin, Solid
State Physics, Saunders College, 1976).

The orbitals can then be used to compute the total radial charge
densities associated to each element, which are collected in the
file \emph{atomic.i}.


\subsubsection{Files}
\label{phshift2007:files}
\textbf{INPUT:} \emph{atorb}

\textbf{OUTPUT:} \emph{atelem.i}

To summarize, the user will run \code{PhSh0.for} for the different inputs
\emph{atorb1}, \emph{atorb2}, ..... \emph{atorbN}, corresponding to the \(N\) elements of
interest and produce the corresponding output \emph{atelem1.i},
\emph{atelem2.i}, .... \emph{atelemN.i} for the charge density of each of the
\(N\) elements.

\begin{notice}{note}{Note:}
The occupation number for each level corresponds to the
total number of electrons filling that level. For
instance, in the case of Rh, the orbital 3,2,2,-2.5
has \(l = 2\) and \(j = 2 + 1/2\). The occupancy of the filled level
is then \(N^+_{occ} = 2j + 1 = 6\).
In the case of partially filled orbitals when the atomic
configuration available does not distinguish between
\(l + 1/2\) and \(l - 1/2\) levels, it is customary to assign the
occupancy so that the ratio for the partially filled
orbitals equals the ratio of the occupancies if those
orbitals were completely filled. Consider for instance
the case of Rh where the atomic configuaration (Ashcroft
and Mermin) is {[}Kr{]}4 \emph{d} 8 5 \emph{s} 1. There is no ambiguity
associated to the 5,0,0,1/2 level and \(N_{occ} = 1\) in that case.
As for the 4,2,2,3/2 and 4,2,2,5/2 levels the ratio of
full occupancies is 4/6 ; the eight 4 \emph{d} electrons will then be
split among the two levels so as to preserve the 4/6
ratio: hence 3.2/4.8. The sum of all occupancies for a
neutral atom should of course equal \(Z\).
\end{notice}


\subsection{Step 1: \texttt{PhSh1.for}}
\label{phshift2007:step-1-phsh1-for}

\subsubsection{Description}
\label{phshift2007:id1}
\textbf{Run interactively}

Now one computes the muffin tin potential by following Mattheiss'
prescription (Ref. T. L. Loucks, Augmented Plane Waves Method,
Benjamin, 1967). In essence, the atomic charge densities of the
different elements making up the structure that we are
interested in are superimposed to reflect the actual position of
these elements in the structure. Note that for the purpose of
obtaining the phase shifts needed in a LEED calculation it is not
necessary to know the exact position of the atoms in the structure
we are interested in, because the phase shifts and hence the
calculated intensities are not strongly dependent on the manner in
which the phase shifts are produced. (In principle, one could
iterate the phase shift calculation after the LEED structure
analysis to further refine the structure.) For the substrate atoms,
a bulk terminated structure will be sufficient in almost all cases.
In general, we prefer using a slab-supercell approach in defining
the surface structure rather than embedding the adatoms in a
sometimes artificial bulk structure. The slab is a free-standing
film with a thickness of a few atomic layers, repeated periodically
as a stack of identical slabs separated by slices of vacuum. The
main subtlety about the slab approach is related to the definition
of the muffin tin zero (see comment 3).

The total potential energy in each muffin-tin sphere is obtained
by adding the electrostatic component computed by using the charge
density distribution, and a local Slater-like exchange term.
The final potential is then shifted to set its zero at the level
of the average energy in the interstitial region (Muffin Tin Zero).
This part of the program is relatively well documented.


\subsubsection{Files}
\label{phshift2007:id2}
\textbf{INPUT:}
\begin{itemize}
\item {} 
\emph{cluster.i} - Mainly contains the structural information
about the slab which will be used to produce
the muffin-tin potential. See example
provided for a Rh crystal in \emph{clusterRh.i}
and for a \(\text{Rh} (111)-(2 \times 2)- \text{C} _2 \text{H} _3\)
surface with H neglected in \emph{clusterC2Rh.i}.

\item {} 
\emph{atomic.i}  - It contains the atomic charge densities for
the NINEQ inequivalent atoms specified in
\emph{cluster.i}. Furthermore,
\emph{atomic.i} has to be generated from the output
\emph{atelemJ.i}  \(J = 1, N\) by appending the \emph{atelem*}
files corresponding to the different elements
in the order in which they appear as
inequivalent atoms in the file \emph{cluster.i}

\item {} 
interactively:  question: slab or bulk calculation?
answer: 1 (slab) or 0 (bulk)
enter value for bmtz (bulk muffin tin
zero; see comment 3)

\end{itemize}
\begin{description}
\item[{\textbf{OUTPUT:}}] \leavevmode\begin{itemize}
\item {} 
\emph{mufftin.d}

\item {} 
\emph{check.o}

\item {} 
\emph{bmtz} (if bulk calculation)

\end{itemize}

\end{description}

\begin{notice}{note}{Note:}\begin{enumerate}
\item {} 
Cluster.i contains an option for producing output suitable
for the three versions of the next step. The value
of the alpha constant can be obtained from
K. Schwarz, Phys. Rev. B 5, 2466 (1972)

\item {} 
Notice that an \emph{atelem.i} corresponding to one element
might need to be appended more than once to generate
\emph{atomic.i}. For instance in the case of \emph{clusterRh.i} :
\emph{atomic.i} = \emph{atelemRh.i} + \emph{atelemRh.i} + \emph{atelemRh.i}

In the case of clusterC2Rh.i:

\emph{atomic.i} = \emph{atelemRh.i} + \emph{atelemRh.i} + \emph{atelemRh.i} +
\emph{atelemRh.i} + \emph{atelemC.i} + \emph{atelemC.i}

Where `+' indicates the appending of one file after the other

\item {} 
The specification of the Muffin tin zero requires some
care when doing a calculation for a slab. Here by slab
we mean a specified geometry in \emph{cluster.i} with a large
vacuum gap between slabs. The computed muffin tin zero
(mtz) is the average of the energy in the interstitial
region, including the vacuum: the average is highly distorted
by the presence of the vacuum. A reasonable value for
mtz is the bulk value even in the case of a slab
calculation (small errors are anyway adjusted by the
fitting of the inner potential in the LEED calculation).
Therefore the suggested procedure is the following:
\begin{itemize}
\item {} 
Perform first a bulk calculation for the substrate
with the appropriate input files.  When asked whether
a bulk or slab calculation input  0 (bulk)
and record the output value of bulk mtz

\item {} 
Perform a second slab calculation
(of course now with different input files); input 1 for
slab calculation and, when asked, use the
previously recorded value as input for \emph{bmtz}.
The output of this second calculation will be used in
STEP 2.

\end{itemize}

\end{enumerate}
\begin{quote}

Running this step interactively will clarify our points.
\end{quote}
\end{notice}


\subsection{Step 2: \texttt{PhSh2cav.for}, \texttt{PhSh2wil.for} \& \texttt{PhSh2rel.for}}
\label{phshift2007:step-2-phsh2cav-for-phsh2wil-for-phsh2rel-for}

\subsubsection{Description}
\label{phshift2007:id3}
Here one computes the phase shifts from the muffin-tin
potential(s).

An important detail is that, as a function of energy, the
calculated phase shifts may, and often do, show discontinuities
by ::math::\emph{pi}, i.e. jumps by ::math::\emph{pi} at some energies.
Since the LEED programs interpolate phase shifts between energies at which
they are provided, such discontinuities would give totally
erroneous results at such discontinuities. Therefore these
discontinuities must be removed: this is done internally
in \emph{PhSh2wil.for}, but separately in \code{PhSh3.for} after
\code{PhSh2cav.for} or \code{PhSh2rel.for} is run.


\subsubsection{Different packages}
\label{phshift2007:different-packages}\begin{itemize}
\item {} 
\code{PhSh2cav.for} is a Cavendish program which produces non-
relativistic phase shifts (Schroedinger equation), with
possible discontinuities in energy.

\item {} 
\code{PhSh2wil.for} is a program, written originally by Williams,
which again produces non-relativistic phase shifts
(Schroedinger equation), but without continuities in energy.
This is the preferred program for non-relativistic
phase-shifts calculations.

\item {} 
\code{PhSh2rel.for} computes relativistic phase shifts (Dirac
equation), but is possibly discontinuous in energy.

\end{itemize}


\subsubsection{Files}
\label{phshift2007:id4}\begin{description}
\item[{\textbf{INPUT:}}] \leavevmode\begin{itemize}
\item {} 
\emph{mufftin.d} - (as output from STEP 1)

\end{itemize}

\item[{\textbf{OUTPUT:}}] \leavevmode\begin{itemize}
\item {} 
\emph{phasout}

\item {} 
\emph{dataph.d}

\item {} 
\emph{inpdat}

\item {} 
\emph{leedph.d} (in wil only)

\end{itemize}

\end{description}

\begin{notice}{note}{Note:}\begin{enumerate}
\item {} 
Whether one can run the cav, wil or rel version
depends on the input NFORM specified in STEP 1 in
the input \emph{cluster.i}.

\item {} 
The energy range (20-300 eV) for which phase shifts are
computed, the energy spacing (5eV) and the number of
phase-shifts (13) are set. An easy way to modify these is
to use NFORM=2, because the values will appear in an
obvious way in the input \emph{mufftin.d}. Such input (the
output of STEP 1) can be edited and the parameters can
be modified for each of the inequivalent atoms in the
calculation.

\item {} 
The output \emph{phasout} contains the phase shifts of all the
inequivalent atoms NIEQ (the number of such atoms was
specified in \emph{cluster.i} of STEP 1) in the calculation.
\emph{phasout} will be  used to create the input files needed in
STEP 3.

\item {} 
\emph{dataph.d} is an output of the phase shifts in a form
suited to plotting such data.

\end{enumerate}
\end{notice}


\subsection{Step 3: \texttt{PhSh3.for}}
\label{phshift2007:step-3-phsh3-for}

\subsubsection{Description}
\label{phshift2007:id5}
\textbf{Run interactively}

The phase shifts produced from \emph{phsh2cav.for} and \emph{phsh2rel.for}
are not necessarily continuous in energy (since phase
shifts are defined modulo pi). \emph{phsh3.for} makes them continuous
and produces output suitable as input for LEED programs.
For the output of \code{phsh2wil.for}, \code{phsh3.for} is used to reformat
the phase shifts.


\subsubsection{Files}
\label{phshift2007:id6}\begin{description}
\item[{\textbf{INPUT:}}] \leavevmode\begin{itemize}
\item {} 
\emph{phJ} \(J = 1, N\)  generated from phasout. For this purpose
\emph{phasout} must be split into files each containing
phase shifts of a single element. \emph{phJ} will contain
the phase shifts of the \emph{J} `th element in the
input file for the LEED programs (\emph{i.e.} \emph{tleed5.i})

\end{itemize}

\item[{\textbf{OUTPUT:}}] \leavevmode\begin{itemize}
\item {} 
\emph{leedph.d}

\item {} 
\emph{dataph.d}

\end{itemize}

\end{description}

\begin{notice}{note}{Note:}
The actual number of sets of phase-shifts that one might
want to use in a LEED calculation might be different
from NINEQ. It is quite typical for instance to use a
single set of phase shifts to describe substrate atoms
in different layers.
\end{notice}


\chapter{Indices and tables}
\label{index:indices-and-tables}\begin{itemize}
\item {} 
\emph{genindex}

\item {} 
\emph{modindex}

\item {} 
\emph{search}

\end{itemize}


\renewcommand{\indexname}{Python Module Index}
\begin{theindex}
\def\bigletter#1{{\Large\sffamily#1}\nopagebreak\vspace{1mm}}
\bigletter{p}
\item {\texttt{phaseshifts}}, \pageref{modules:module-phaseshifts}
\item {\texttt{phaseshifts.atorb}}, \pageref{modules:module-phaseshifts.atorb}
\item {\texttt{phaseshifts.conphas}}, \pageref{modules:module-phaseshifts.conphas}
\item {\texttt{phaseshifts.elements}}, \pageref{modules:module-phaseshifts.elements}
\item {\texttt{phaseshifts.leed}}, \pageref{modules:module-phaseshifts.leed}
\item {\texttt{phaseshifts.model}}, \pageref{modules:module-phaseshifts.model}
\item {\texttt{phaseshifts.phsh}}, \pageref{modules:module-phaseshifts.phsh}
\end{theindex}

\renewcommand{\indexname}{Index}
\printindex
\end{document}
