\chapter{Introduction}
\label{sec:introduction}
Charge carrier dynamics in an organic semiconductor can often be described in terms of charge hopping between localized states. The hopping rates depend on \slink{sec:transfer_integrals}{electronic coupling elements}, \slink{sec:reorganization}{reorganization energies}, and \slink{sec:site_energies}{site energies}, which vary as a function of position and orientation of the molecules.
%The exact evaluation of these contributions in a molecular assembly is computationally prohibitive. Various, often semi-empirical, approximations are employed instead.
The purpose of the \votcaxtp package~\cite{ruhle_microscopic_2011} is to simplify the workflow for charge transport simulations, provide a uniform error-control for the methods, flexible platform for their development, and eventually allow {\em in silico} prescreening of organic semiconductors for specific applications.
The toolkit is implemented using modular concepts introduced earlier in the Versatile Object-oriented Toolkit for Coarse-graining Applications (VOTCA)~\cite{ruhle_versatile_2009}. It contains different \slink{sec:programs}{programs}, which execute specific tasks implemented in \slink{sec:calculators}{calculators} representing an individual step in the workflow. \Fig{summary} summarizes a typical chain of commands to perform a charge transport simulation:
%
First, the VOTCA code structures are adap\-ted to reading atomistic trajectories, mapping them onto \slink{segments}{conjugated segments and rigid fragments}, and substituting (if needed) rigid fragments with the optimized copies (\xtpmap). The programs \xtprun and \xtpparallel (for heavy-duty tasks) are then used to calculate all bimolecular charge hopping rates (via precalculation of all required ingredients). \slink{sec:site_energies}{Site energies (or energetic disorder)} can be determined as a combination of internal (ionization potentials/electron affinities of single molecules) as well as electrostatic and polarization contributions within the molecular environment. The calculation of \slink{sec:transfer_integrals}{electronic coupling elements} between conjugated segments from the corresponding molecular orbitals can be performed using a \slink{sec:dipro}{dimer-projection} technique based on \slink{sec:dft}{density-functional} theory (DFT). This requires explicit calculations using quantum-chemistry software for which we provide interfaces to \gaussian, \turbomole, and \nwchem. Alternatively, the \slink{sec:izindo}{molecular orbital overlap} module calculates electronic coupling elements relying on the semi-empirical INDO Hamiltonian and molecular orbitals in the format provided by the \gaussian package.
The \slink{sec:kmc}{kinetic Monte Carlo} module reads in the \slink{neighborlist}{neighbor list}, \slink{morphology}{site coordinates}, and \slink{rates}{hopping rates} and performs charge dynamics simulations using either periodic boundary conditions or charge sources and sinks.
The toolkit is written as a combination of modular C++ code and scripts. The data transfer between programs is implemented via a \slink{statefile}{state file} (sql database), which is also used to restart simulations. Analysis functions and most of the calculation routines are encapsulated by using the observer pattern~\cite{gamma_design_1995} which allows the implementation of new functions as individual modules.
In the following \sect{theory}, we summarize the \slink{sec:theory}{theoretical background} of the workflow of charge transport simulations and in particular its individual steps. \Sect{io} describes the structure and content of input and output files, while a full reference of \slink{sec:programs}{programs} and \slink{sec:calculators}{calculators} is available in \sect{reference}. For a hands-on tutorial, the reader is referred to the \hyperref[http://code.google.com/p/votca-xtp/]{\votcaxtp} project page at http://code.google.com/p/votca-xtp/.
\tikzstyle{decision} = [diamond, draw, fill=mygray]
\tikzstyle{line} = [draw, -stealth, thick]
\tikzstyle{block} = [draw, rectangle, fill=mygray, text width=0.5\linewidth]
\tikzstyle{smallblock} = [draw, rectangle, fill=mygray, text width=0.4\linewidth]
\tikzstyle{info} = [text width=0.35\linewidth]
\tikzstyle{smallinfo} = [text width=0.25\linewidth]
\tikzstyle{biginfo} = [text width=0.9\linewidth]
\begin{figure}
\centering
\newcommand{\vgap}{0.5cm}
\begin{scriptsize}
\noindent\begin{tikzpicture}
\node [block] (mapping) {{\bf Mapping}\\Converts and partitions atomistic \gromacs trajectory \vskip 0.1cm
{\noindent \cmdmap}
\vskip 0.1cm};
\node[smallinfo, left=0.0 of mapping] (input) {{\bf Input files:}\\\texttt{conf.gro}\\\,\hskip 0.1cm\gromacs trajectory\\\texttt{topol.tpr}\\\hskip0.1cm\gromacs topology\\\texttt{\xmlcsg}\\\hskip0.1cm mapping and energies\\\texttt{options.xml}\\\hskip0.1cm options for \slink{sec:calculators}{calculators}\vskip 0.2cm {\bf Output files:}\\\texttt{\sqlstate}\\\hskip0.1cm \sqlite database file for\\\hskip0.1cm data transfer between\\\hskip0.1cm modules};
\node [block, below=\vgap of mapping] (nbl) {{\bf Neighbor list}\\Indentifies close molecular pairs between which charge transfer rates will be calculated \vskip 0.1cm
{\noindent \cmdnbl}
\vskip 0.1cm};
\node [block, below=\vgap of nbl] (site_energies) {{\bf Site energies}\\Calculates electrostatic and polarization contribution to site energies \vskip 0.1cm
{\noindent \cmdemlt} };
\node [block, below=\vgap of site_energies] (int_energies) {{\bf Internal site and reorganization energies}\\Imports internal site energy (IP, EA) and reorganization energies for charging and discharging to \sqlstate \vskip 0.1cm
{\noindent \cmdeint}
\vskip 0.1cm};
% above right=0.7cm and 4cm of A
\node[decision, below=\vgap of int_energies](decision1){Transfer integrals};
%\node (AuxNode01) [text width=6em, below of = decision1, node distance=7em ] {};
\node [smallblock, below left=\vgap of decision1] (DFT_TI) {{\bf Monomers with DFT}\\Calculate the relevant transport orbitals of monomers \vskip 0.1cm
{ \cmdedft \job\, ''\wrt \run'' }};
\node [smallblock, below=\vgap of DFT_TI] (DFT_TI2) {{\bf Transfer integrals with DFT}\\Calculate electronic coupling elements for all pairs in the neighbor list \vskip 0.1cm
{ \cmdidft \job\, ''\wrt \run \rd'' }
\vskip 0.1cm};
\node [smallblock, below right=\vgap of decision1] (DFT_ZINDO) {{\bf Transfer integrals with ZINDO}\\Calculate electronic coupling elements for all pairs in the neighbor list \vskip 0.1cm
{\noindent \cmdizindo }
\vskip 0.1cm};
\node[info, below=0.2cm of DFT_ZINDO] (ti_info) {{One can choose between quantum-chemical (computationally expensive) or semi-empirical (fast, but not always sufficiently accurate) evaluation of transfer integrals.}};
\node (AuxNode01) [below=\vgap of DFT_TI2, xshift=0.25\linewidth] {};
\node [block, below=\vgap of DFT_TI2, xshift=0.275\linewidth] (outer_reorg) {{\bf Outersphere reorganization energies}\\Contribution to reorganization of surrounding molecules due to polarization. (optional for Marcus rates) \vskip 0.1cm
{\noindent \cmdouter}
\vskip 0.1cm};
\node [block, below=\vgap of outer_reorg] (rates) {{\bf Charge transfer rates}\\Calculates rates for charge transfer among all pairs in the neighborlist \vskip 0.1cm
{\noindent \cmdrates}
};
\node [block, below=\vgap of rates] (kmc) {{\bf Charge dynamics via kMC}\\Hopping of charge carriers simulated via kinetic Monte Carlo \vskip 0.1cm
{\noindent \cmdkmc }
};
\node [biginfo, below=\vgap of kmc] (calc) {{\noindent Get list of available calculators: \xtprun/\xtpparallel/\kmcrun \texttt{ -l}}\\ Get help and list of options for a calculator: \xtprun/\xtpparallel/\kmcrun \texttt{ -d }\calc{neighborlist}};
\path [line] (mapping) -- (nbl);
\path [line] (nbl) -- (site_energies);
\path [line] (site_energies) -- (int_energies);
\path [line] (int_energies) -- (decision1);
\path [line] (DFT_TI) -- (DFT_TI2);
\path [line] (decision1) -| node[yshift=0.5em, xshift=1em] {DFT} (DFT_TI);
\path [line] (decision1) -| node[yshift=0.5em, xshift=-1em] {ZINDO} (DFT_ZINDO);
\path [line] (DFT_TI2.east) -| (outer_reorg.north);
\path [line] (DFT_ZINDO.west) -| (outer_reorg);
\path [line] (outer_reorg) -- (rates);
\path [line] (rates) -- (kmc);
\end{tikzpicture}
\end{scriptsize}
\caption{A practical workflow of charge transport simulations using \votcaxtp. The \slink{sec:theory}{theoretical background} of the individual steps is given in \sect{theory}. \Sect{io} describes the content of input and output files, while a full reference of \slink{sec:programs}{programs} and \slink{sec:calculators}{calculators} is available in \sect{reference}. }
\label{fig:summary}
\end{figure}