\documentclass{jarticle}
\usepackage{longtable}
\usepackage{indentfirst} 
\usepackage{amsmath,amssymb,bm}
\usepackage[dvipdfm]{graphicx,color}
\newcommand{\tr}[1]{\textcolor{red}{#1}}
\newcommand{\tb}[1]{\textcolor{blue}{#1}}
\addtolength{\oddsidemargin}{-15mm}
\addtolength{\evensidemargin}{-15mm}
\addtolength{\textwidth}{30mm}
\addtolength{\topmargin}{-15mm}
\addtolength{\textheight}{30mm}

\title{\huge RESPACK Manual}
\author{\Large Kazuma Nakamura \\ (Department of Basic Sciences,
Kyushu Institute of Technology)}

\begin{document}
\maketitle
\begin{figure}[h] 
\centering
\includegraphics[width=8cm]{respack.eps}
\label{title}
\end{figure}

\clearpage 

\tableofcontents

\clearpage 

\section{Introduction}

\subsection{Program}

{\sc RESPACK} is a first-principles calculation software for evaluating the interaction parameters of materials, and is able to calculate the maximally localized Wannier functions, the RPA response functions, and frequency-dependent electronic interaction parameters. {\sc RESPACK} consists of three programs:
\begin{enumerate}
\item dielectric function calculation (\verb+chiqw+),
\item Wannier function calculation (\verb+wannier+),
\item electronic interaction calculation (direct integral: \verb+calc_w3d+, exchange integral: \verb+calcj3d+).
\end{enumerate}
These three programs are independent and each program needs
\begin{itemize}
\item input file (namelist form)
\item files as band-calculation output
\end{itemize}
{\sc RESPACK} receives its input data from a band calculation code using norm-conserving pseudopotentials with plane-wave basis sets. Automatic generation scripts which convert a result of the band calculation to an input for {\sc RESPACK} is prepared for {\sc xTAPP} and {\sc Quantum ESPRESSO} codes. The software has been used successfully for a wide range of materials such as metals, semiconductors, transition-metal compounds, and organic compounds. It supports {\sc OpenMP/MPI} and can be used in both laboratory-computer environment and System B at ISSP, the University of Tokyo.

In this manual, we describe procedures to evaluate effective interaction parameters of Al as a benchmark. We also describe procedures of the case of La$_2$CuO$_4$ for constrained RPA calculation. Examples of Si, TiO$_2$, SrVO$_3$, organic compound (TMTSF)$_2$PF$_6$ are also presented.

\subsection{Unit system}

Programs are described in atomic units, but for input and output, \AA, \verb+Ry+, \verb+eV+, and lattice coordinates are used.

\subsection{Download source code}
The latest source is downloaded from the official website https://sites.google.com/view/kazuma7k6r. Please download \verb+RESPACK.tar.gz+.

\subsection{\label{compile}Compiling source code}

Firstly, you unpack the source code \verb+RESPACK.tar.gz+ in your machine. In a directory \verb+RESPACK+, you see four directories (i) \verb+sample+ containing the inputs of calculation examples, (ii) \verb+src+ containing source codes, (iii) \verb+util+ containing necessary scripts to supplement calculation, and (iv) \verb+GPL+ containing the software license. When moving to \verb+src+, you find three source directories; \verb+calc_int+, \verb+chiqw+, \verb+wannier+. \verb+Makefile+ for source compilation are prepared in each source directory. Then, you move to the directory you want to run and make. In the case of \verb+chiqw+, the work so far is as follows: 
\vspace{5mm}\hrule
\begin{verbatim}
> tar -zxvf RESPACK.tar.gz  
> cd RESPACK/ 
> ls 
GPL/ sample/ src/ util/ 
> cd src/ 
> ls 
calc_int/ chiqw/ wannier/ 
> cd chiqw/ 
> ls 
Makefile est_NTK.f90  m_fft3d.f90     est_nwx2.f90 m_rdinput.f90
chiqw.F  gen_grid.f90 m_tetrahedron.F chiqw_sub.F  inv.F90 
config.h invZGE.F90
> make 
> ls calc_chiqw 
calc_chiqw 
\end{verbatim}
\hrule\vspace{5mm}
After \verb+make+, an executable file \verb+calc_chiqw+ is generated. This procedure is the same for other programs.

\subsection{Calculation directory}
In this tutorial, the directory in which the calculation is performed is the current directory marked as ``\verb+./+". Then, you move the executable files generated via \verb+make+ in the current directory. The calculation results are accommodated in \verb+./dir-xxx+.  This is the preparation stage for calculation.

\clearpage 

\section{\label{gendirwfn}Making input files of RESPACK} 

{\sc RESPACK} is a program package that calculates dielectric functions using the calculation result obtained with band calculation, and it is assumed that band calculation is executed in advance. In this section, we describe the procedure to connect to {\sc RESPACK} from the results obtained using the band calculation software {\sc xTAPP} and {\sc Quantum ESPRESSO}. Details of the band calculation are given in the official manual of each software. Here, we focus on the procedures necessary for {\sc RESPACK} calculation.

\subsection{\label{xtapp2respack}From xTAPP to RESPACK}

After {\sc xTAPP} band calculation is completed, we generate input files of {\sc RESPACK} calculation with a script. First, we move to directory \verb+RESPACK/util/+\verb+xtapp2respack+ and compile \verb+wfn2respack.F90+:
\vspace{5mm}\hrule
\begin{verbatim}
> ./COMPILE.wfn2respack.csh
\end{verbatim}
\hrule\vspace{5mm}
An executable file \verb+wfn2respack+ is generated in the directory. This \verb+wfn2respack+ and a script file \verb+xtapp2respack.sh+ are used for convert. Then, you move back to the directory where band calculation was executed and copy the two files to this directory. From a wave function file (\verb+@@@.wfn+) and a structure file (\verb+@@@.str+) (where \verb+@@@+ specifies the material name in {\sc xTAPP}), {\sc RESPACK} input files are generated. After executing the script, the directory \verb+./dir-wfn+ is created and 8 files named \verb+dat.xxx+ are generated in this directory. For example, in the case of Al calculation, the work so far is as follows:
\vspace{5mm}\hrule
\begin{verbatim}
> ./xtapp2respack.sh -b ./wfn2respack Al
> ls ./dir-wfn 
dat.bandcalc dat.eigenvalue dat.kg       dat.lattice 
dat.nkm      dat.sample-k   dat.symmetry dat.wfn
\end{verbatim}
\hrule\vspace{5mm}
Each file to be generated is as follows. For the format of each file, see the \ref{fileformat} chapter.
\vspace{5mm}\hrule
\begin{enumerate}
\item \verb+./dir-wfn/dat.bandcalc+ (band calculation information)
\item \verb+./dir-wfn/dat.sample-k+ (sample k points)
\item \verb+./dir-wfn/dat.nkm+ (the number of expanded G vector)
\item \verb+./dir-wfn/dat.eigenvalue+ (energy eigenvalue)
\item \verb+./dir-wfn/dat.kg+ (reciprocal lattice G vector)
\item \verb+./dir-wfn/dat.wfn+ (wave function)
\item \verb+./dir-wfn/dat.lattice+ (lattice vector)
\item \verb+./dir-wfn/dat.symmetry+ (Symmetry information)
\end{enumerate}
%\hrule\vspace{5mm}
%The above is the procedure from {\sc xTAPP} band calculation to {\sc RESPACK} calculation.

\subsection{From {\sc Quantum ESPRESSO} to RESPACK}

After {\sc Quantum ESPRESSO} band calculation is completed, we generate input files of the {\sc RESPACK} calculation as follows. The procedure is written in \verb+README.txt+ in directory \verb+RESPACK/util/qe2respack+. Please go to this directory and do the following steps:
\begin{enumerate}
\item Edit \verb+Makefile+ in a directory \verb+RESPACK/util/qe2respack+

Setting the variable \verb+QEROOT+ in \verb+Makefile+ to the root directory for using \verb+Quantum ESPRESSO+ \verb+iotk toolkit+, editing the link part to LAPACK etc. (For details, see \verb+README.txt+)

\item Execute \verb+make+ in \verb+RESPACK/util/qe2respack+

\verb+qe2respack+ is generated. 

\item Edit \verb+qe2respack.sh+ in \verb+RESPACK/util/qe2respack+

Set the variable \verb+qe2respack_root+ in \verb+qe2respack.sh+ to the directory where \verb+qe2respack.sh+ and executable file \verb+qe2respack+ are located.

\item Execute the script as follows:
\begin{verbatim}
> bash qe2respack.sh ./outdir/prefix.save/
\end{verbatim}
Here, \verb+./outdir/prefix.save/+ is the directory containing the output of {\sc Quantum ESPRESSO} band calculation.
\end{enumerate}
After executing these procedures, the directory \verb+./dir-wfn+ is created under the directory that executed step 4. Files named \verb+dat.xxx+ (see \ref{xtapp2respack}) is generated. 

\clearpage 

\section{\label{wannier}wannier}

Here, we describe the procedure of Wannier function calculation (\verb+wannier+). The calculation conditions are 6$\times$6$\times$6 $k$-point sampling (the total number of the irreducible $k$ points is 16) and 36-Ry wave function cutoff. The total number of bands to be calculated is 50 (occupied band number 1, Partial occupied band number 1, unoccupied band number 48, including a band up to about 120 eV above the Fermi level).
\vspace{-3mm}
\subsection{\label{input-wannier}Input file}
Here, we explain the input file \verb+input.in+ for carrying out the Wannier function calculation of Al. The input file uses the Fortran namelist format. The input of the Wannier function calculation consists of three namelists [\verb+&param_wannier+ (condition of the Wannier-function calculation), \verb+&param_interpolation+ (condition of the Wannier interpolation-band calculation), \verb+&param_visualization+ (condition of visualization of the realspace Wannier functions)].
\vspace{-3mm}
\subsubsection{\&param\_wannier} 
The namelist \verb+&param_wannier+ contains parameters for the calculation of the Wannier function. Parameters can be arranged freely. Parameters defined in the namelist are set to default values if not defined. The explanation of each parameter is written in the right of \verb+!+. A mark ``\verb+n+" in the explanation part indicates that the parameter is a required variable, and an error occurs if you forget to input. A parameter written as ``\verb+o+" represents an optional parameter, and if you omit the input, the default value is set.
\vspace{3mm}\hrule
\begin{verbatim}
&param_wannier 
N_wannier=9,                !n: Number of Wannier functions you want to calculate
Lower_energy_window=-10.0d0,!n: Lower limit of energy window (eV)
Upper_energy_window= 35.0d0,!n: Upper limit of energy window (eV)
N_initial_guess=9,          !n: Number of initial Gaussian
icell=0,                    !o: Crystal lattice information
EPS_SPILLAGE=1.0d-4,        !o: Convergence threshold in spillage minimization (au)
EPS_SPREAD=1.0d-6,          !o: Convergence threshold in spread minimization (au)
DAMP=0.1d0,                 !o: Convergence factor in spillage minimization
MAX_STEP_LENGTH=4.0d0,      !o: Step length in spread minimization
set_inner_window=F,         !o: Whether to set the inner window
Lower_inner_window=10.0d0,  !o: Lower limit of energy inner window (eV)
Upper_inner_window=35.0d0,  !o: Upper limit of energy inner window (eV)
flg_initial_guess_direc=0,　!o: Coordinate system displaying initial Gaussian 
flg_BMAT=0/                 !o: Whether to set linear coefficients of initial Gaussian
s   0.2d0 0.0d0 0.0d0 0.0d0 !n: Orbital type, Gaussian width, Gaussian position s@Al
px  0.2d0 0.0d0 0.0d0 0.0d0 !n: px@Al
py  0.2d0 0.0d0 0.0d0 0.0d0 !n: py@Al
pz  0.2d0 0.0d0 0.0d0 0.0d0 !n: pz@Al
dxy 0.2d0 0.0d0 0.0d0 0.0d0 !n: dxy@Al
dyz 0.2d0 0.0d0 0.0d0 0.0d0 !n: dyz@Al
dz2 0.2d0 0.0d0 0.0d0 0.0d0 !n: dz2@Al
dzx 0.2d0 0.0d0 0.0d0 0.0d0 !n: dzx@Al
dx2 0.2d0 0.0d0 0.0d0 0.0d0 !n: dx2-y2@Al
\end{verbatim}
\hrule\vspace{3mm}
\verb+&param_wannier+ requires four necessary parameters: \verb+N_wannier+, \verb+Lower_energy_window+, \\ \verb+Upper_energy_window+, {\tt N\_initial\_guess}. \verb+Lower_energy_window+ and \verb+Upper_energy_window+ are variables that specify the energy window. The program makes \verb+N_wannier+ pieces of the Wannier functions from this energy range. Figure~\ref{EW} shows the relationship between band dispersion and energy window. The lower limit of the energy window was set to $-10$ eV, and the upper limit was set to +35 eV. Nine Wannier functions (\verb+N_wannier = 9+) are made from the bands within this window.

\verb+N_initial_guess+ is a variable specifying the number of initial Gaussian. We prepare nine in this calculation (\verb+N_initial_guess = 9+). The initial Gaussians are also necessary inputs. This corresponds to "\verb+s 0.2d0 0.0d0 0.0d0 0.0d0+" to "\verb+dx2 0.2d0 0.0d0 0.0d0 0.0d0+". We use nine Gaussians of type {\tt s, px, py, pz, dxy, dyz, dz2, dzx, dx2-y2} placed on the Al site as initial guess, where {\tt x, y, z} is the Cartesian coordinates used to represent the Bravais lattice.
\begin{figure}[h] 
\centering
\includegraphics[width=8cm]{Energy-Window.Al.eps}
\caption{Band structure of Al. The lower limit of the energy window is $-10$ eV ({\tt Lower\_energy\_window=-10.0}) and the upper limit is +35 eV ({\tt Upper\_energy\_window=35.0}). From the bands in this window, nine Wannier functions ({\ tt N\_wannier=9}) were created from nine initial Gaussian ({\tt N\_initial\_guess=9}).}
\label{EW}
\end{figure}

\verb+icell+ is a variable that specifies crystal lattice. \verb+icell=0+ (default) is an automatic search. \verb+EPS_SPILLAGE+, \verb+EPS_SPREAD+, \verb+DAMP+, \verb+MAX_STEP_LENGTH+ are parameters for convergence of the calculation. These are set to the default values.

\verb+set_inner_window+ is a parameter that specifies the inner energy window. \verb+Lower_inner_window+ and \verb+Upper_inner_window+ are variables that specify the inner energy window. When these parameters are specified, the Wannier functions are constructed so that the bands within the inner energy window always coincides with the original bands. In this Al calculation, \verb+set_inner_window=F+, so the inner window is not set. Details of these parameters are described in La$_2$CuO$_4$ calculation (chapter \ref{La2CuO4}).

\verb+flg_initial_guess_direc+ is a variable specifying the coordinate system for displaying the Gaussian function. If you want to change to local coordinates instead of the Cartesian coordinates, you set \verb+flg_initial_guess_direc=1+. This is explained with the input of TiO$_2$ as an example in the \ref{TiO2} chapter.

\verb+flg_BMAT+ is a variable related to the procedure for making the initial guess of the Wannier function. If \verb+flg_BMAT=1+, we linearly combine the Gaussians to make initial guess as follows:
\begin{eqnarray}
w_{j}^{in}({\bf r})=\sum_{i}B_{ij} g_i({\bf r}). \nonumber
\end{eqnarray} 
As in this calculation, if \verb+flg_BMAT=0+, the linear combination is not performed, and hence the B matrix is an identity matrix. If \verb+flg_BMAT=1+ is set, the coefficient $B_{ij}$ of the linear combination is read following the information of the initial Gaussian. This will be explained with reference to the Si input in the \ref{Si} chapter. 
\vspace{-3mm}
\subsubsection{\&param\_interpolation}  
The namelist \verb+&param_interpolation+ contains input variables for drawing the Wannier-interpolation band. The interpolation-band calculation is always performed, so variables in this namelist must be entered. An error occurs if you forget to specify them. Variable explanations are indicated in the right of \verb+!+. 
\vspace{5mm}\hrule
\begin{verbatim}
&param_interpolation   
N_sym_points=5,   !n: Total number of symmetric k points in calculation lines
Ndiv=40/          !o: Number of divisions between symmetric k points
0.500 0.500 0.500 !n: Symmetric k point; SK_sym_pts(1:3,1); L
0.000 0.000 0.000 !n: Symmetric k point; SK_sym_pts(1:3,2); G
0.500 0.000 0.500 !n: Symmetric k point; SK_sym_pts(1:3,3); X
0.500 0.250 0.750 !n: Symmetric k point; SK_sym_pts(1:3,4); W
0.500 0.500 0.500 !n: Symmetric k point; SK_sym_pts(1:3,5); L 
\end{verbatim}
\hrule\vspace{3mm}
In this namelist, you specify the number of symmetric $k$ points in the Brillouin zone, \verb+N_sym_points+. \verb+Ndiv+ is the number of divisions between two symmetric $k$ points and is an optional parameter. The default value is \verb+40+. Below this namelist, give the coordinates of the symmetric $k$ point (in reciprocal lattice coordinates). It is desirable to compare the original bands obtained by the band calculation with the Wannier-interpolation bands, and to check whether the latter is well reproduced the former.

\subsubsection{\&param\_visualization} 

The namelist \verb+&param_visualization+ contains input variables for drawing the realspace Wannier function. When calculation was completed, the data of the realspace Wannier functions for drawing in visualization software {\sc VESTA} (http://jp-minerals.org/vesta/jp/) is obtained.
\vspace{5mm}\hrule
\begin{verbatim}
&param_visualization   
flg_vis_wannier=1,!o: Calculate realspace Wannier function (Do not: 0, do 1)
N_write_wannier=9,!o: Total number of realspace Wannier functions to be calculated
ix_vis_min=-1,    !o: Draw range of Wannier function (starting lattice in a1 direction)
ix_vis_max= 1,    !o: Draw range of Wannier function (end lattice in a1 direction)
iy_vis_min=-1,    !o: Draw range of Wannier function (starting lattice in a2 direction)
iy_vis_max= 1,    !o: Draw range of Wannier function (end lattice in a2 direction)
iz_vis_min=-1,    !o: Draw range of Wannier function (starting lattice in a3 direction)
iz_vis_max= 1,    !o: Draw range of Wannier function (end lattice in a3 direction)
\end{verbatim}
\hrule\vspace{5mm}
If you want to calculate the realspace Wannier function, you set \verb+flg_vis_wannier=1+. The default is \verb+0+, which does not perform calculation. \verb+N_write_wannier+ is the number of the realspace Wannier functions you want to calculate. By default, this variable is set to \verb+N_wannier+. You can specify fewer than \verb+N_wannier+. In this case, the program calculates \verb+N_write_wannier+ numbers of the Wannier functions (see chapter \ref{select-wannier}).
\vspace{-3mm}
\subsection{\label{file-wannier}Band-calculation files to be prepared}
The files necessary for calculation are the files generated in the chapter~\ref{gendirwfn}.
\vspace{5mm}\hrule
\begin{enumerate}
\item \verb+./dir-wfn/dat.bandcalc+ (band calculation information)
\item \verb+./dir-wfn/dat.sample-k+ (sampling irreducible k points)
\item \verb+./dir-wfn/dat.nkm+ (number of expanded G vector)
\item \verb+./dir-wfn/dat.eigenvalue+ (energy eigenvalue)
\item \verb+./dir-wfn/dat.kg+ (reciprocal lattice G vector)
\item \verb+./dir-wfn/dat.wfn+ (wave function)
\item \verb+./dir-wfn/dat.lattice+ (lattice vector)
\item \verb+./dir-wfn/dat.symmetry+ (symmetry information)
\end{enumerate}
\hrule %\vspace{5mm}

\subsection{\label{job-wannier}Execute job}
The job is executed as follows. The commands in the sh system are as follows.
\vspace{5mm}\hrule
\begin{verbatim}
> export OMP_NUM_THREADS=16
> export MKL_NUM_THREADS=16
> ./calc_wannier < input.in > LOG.wannier  
\end{verbatim}
\hrule\vspace{5mm}
\verb+calc_wannier+ is an executable file for calculating the Wannier function. Jobs are executed with \verb+input.in+ placed in the current directory and band-calculation files placed in \verb+./dir-wfn+. This job is \verb+openmp+ job (using 16 threads). The standard output of the calculation is output to \verb+LOG.wannier+.
\vspace{-3mm}
\subsection{\label{result-wannier}Calculation result}
When the job is executed, the directory \verb+dir-wan+ is created under the calculation directory. The calculation result is output in this directory. The output file is as follows.
\vspace{3mm}\hrule
\begin{enumerate}
\item \verb+./dir-wan/dat.h_mat_r+ (realspace transfer matrix)
\item \verb+./dir-wan/dat.iband+ (Wannier-interpolation band)
\item \verb+./dir-wan/dat.umat+ (unitary matrix)
\item \verb+./dir-wan/dat.wan+ (expansion coefficients of Wannier function)
\item \verb+./dir-wan/dat.wan-center+ (center position of Wannier function)
\item \verb+./dir-wan/dat.ns-nb+ (band information considered in Wannier-function calculation)
\item \verb+./dir-wan/dat.wan-realspace-001.grd-dat.wan-realspace-009.grd+ (realspace Wannier function)
\item \verb+./dir-wan/dat.frmsf+ (Fermi surface data)
\end{enumerate}
\hrule \vspace{3mm}

\verb+dat.h_mat_r+ contains data for the realspace transfer matrix: the Kohn-Sham Hamiltonian matrix elements with the Wannier function $\langle w_{i{\bf 0}}|h_{KS}|w_{j{\bf R}}\rangle$. The range of the lattice ${\bf R}$ is \verb+-Na1:Na1+ along the $a_1$ direction, \verb+-Na2:Na2+ along the direction of $a_2$, \verb+-Na3:Na3+ along the $a_3$ direction (The values of \verb+Na1+, \verb+Na2+, \verb+Na3+ are automatically set from the sample-$k$ point number).

In this program, the $i$ th Wannier function of the lattice {\bf R} is defined as follows:
\begin{eqnarray}
w_{i{\bf R}}({\bf r})=\frac{1}{\sqrt{N}}\sum_{{\bf k}}^{N}e^{-i{\bf kR}} \sum_{\alpha=N_s({\bf k})}^{N_b({\bf k})} U_{\alpha i}^{{\bf k}} \psi_{\alpha{\bf k}}({\bf r}), \label{wir}
\end{eqnarray} 
Here, $N$ is the total number of Monkhorst-Pack $k$ mesh. $N_s({\bf k})$ is the starting point number of the bands used to make the Wannier function, and $N_b({\bf k}) $ is the total number of those bands, which are also automatically calculated in the program. $N_s({\bf k}), N_b({\bf k})$ are stored in \verb+dat.ns-nb+, the transformation matrix \{$U_{\alpha i}^{{\bf k}}$\} is contained in \verb+dat.umat+. Note that these quantities depend on the $k$ point. $\psi_{\alpha {\bf k}}({\bf r})$ is the Bloch wave function and is defined as follows: 
\begin{eqnarray}
\psi_{\alpha{\bf k}}({\bf r})=\frac{1}{\sqrt{N}} \sum_{{\bf G}} c_{{\bf k+G},\alpha} \frac{1}{\sqrt{\Omega}} e^{i({\bf k+G})\cdot{\bf r}}. \label{pak} 
\end{eqnarray} 
Here, $\Omega$ is the volume of the calculation cell. Both the Wannier function $w_{i {\bf R}}({\bf r})$ and the Bloch function $\psi_{\alpha{\bf k}}({\bf r})$ are normalized in the crystal volume. When one inserts Eq.~(\ref{pak}) into the Eq.~(\ref{wir}), the Wannier function at the home cell ({\bf R=0}) is written as
\begin{eqnarray}
w_{i{\bf 0}}({\bf r})=\frac{1}{N}\sum_{{\bf k}}^{N} \sum_{{\bf G}} \tilde{c}_{{\bf k+G},i} \frac{1}{\sqrt{\Omega}} e^{i({\bf k+G})\cdot{\bf r}} \label{wi0}　
\end{eqnarray}
with 
\begin{eqnarray} 
\tilde{c}_{{\bf k+G},i}=\sum_{\alpha=N_s({\bf k})}^{N_b({\bf k})} U_{\alpha i}^{{\bf k}} c_{{\bf k+G},\alpha} \label{cikg}.  
\end{eqnarray}
Here, \{$w_{i {\bf 0}}({\bf r})$\} are stored in \verb+dat.wan-realspace-@@@.grd+ (\verb+@@@+ is the number of the output Wannier function, $i$). Also, \{$\tilde{c}_{i \bf k+G}$\} are stored in \verb+dat.wan+.

\verb+dat.iband+ is the Wannier-interpolation band. In \verb+gnuplot+, plot as follows (Fig.~\ref{iband}).
\vspace{5mm}\hrule
\begin{verbatim}
gnuplot> plot 'dir-wan/dat.iband' w line 
\end{verbatim}
\hrule\vspace{5mm}
\begin{figure}[h] 
\centering
\includegraphics[width=8cm]{dat.iband.Al.eps}
\caption{Calculated Wannier interpolation band. Unit of vertical axis is {\tt eV}.}
\label{iband}
\end{figure}

\verb+dat.wan-realspace-@@@.grd+ is the realspace Wannier function data. This data is output in the reading form of \verb+VESTA+. Figure~\ref{vesta} is the result with \verb+VESTA+. You can create this olot simply by dragging \verb+dat.wan-realspace-@@@.grd+ onto the drawing window of \verb+VESTA+.
\begin{figure}[h] 
\centering
\includegraphics[width=8cm]{dat.wan-realspace-Al.eps}
\caption{Real space Wannier function. The 9th Wannier function ({\tt dat.wan-realspace-009.grd}) is drawn, which is the $d_{x^2-y^2}$ orbital.}
\label{vesta}
\end{figure}

\verb+dat.frmsf+ is the Fermi surface data. It is output in the reading form of \verb+FermiSurfer+ (the Fermi surface drawing software). Figure~\ref{frmsf} is the result with \verb+FermiSurfer+. If \verb+FermiSurfer+ is installed, you can make this plot simply by clicking \verb+dat.frmsf+.
\begin{figure}[h] 
\centering
\includegraphics[width=6cm]{Al-21x21x21-frmsf.eps}
\caption{The Fermi surface drawn by Fermi surface drawing software {\tt FermiSurfer}. In this calculation, we used dense $k$-point sampling of 21 $\times$ 21 $\times$ 21.}
\label{frmsf}
\end{figure}

\clearpage

\section{chiqw}

\subsection{\label{input-chiqw}Input file (\&param\_chiqw)}


Below is the input file \verb+input.in+ for carrying out the dielectric function calculation of Al. \verb+&param_chiqw+ is the name of the namelist, and variables are listed below this line. A brief description of variables on the left and variables on the right. In \verb+&param_chiqw+, all variables are optional parameters (explanatory part has \ verb + o + attached). Since variable values are defaulted, the user may omit the input. Default values are presented in the example below.
\vspace{5mm}\hrule
\begin{verbatim}
&param_chiqw 
Ecut_for_eps=3.6d0,           !o: Cutoff of polarization function (Ry)
Num_freq_grid=70,             !o: Total number of calculation frequencies
N_CALC_BAND=50,               !o: Total number of bands considered in polarization calculation
MPI_num_proc_per_qcomm=6,     !o: Total MPI per community
MPI_num_qcomm=1,              !o: Total number of communities
MPI_io_rank=0,                !o: MPI number to be outputted to standard output
shift_ef=0.0d0,               !o: Artificial shift of Fermi level (eV)
Max_excitation_energy=200.0d0,!o: Maximum excitation energy to be considered in calculation (eV)
Green_func_delt=0.1d0,        !o: Smearing value in tetrahedron calculation (eV)
ttrhdrn_dmna=1.0d-3,          !o: Degeneracy judge parameter in tetrahedron calculation (eV)
ttrhdrn_dmnr=1.0d-3,          !o: Degeneracy judge parameter in tetrahedron calculation (eV)
flg_cRPA=0,                   !o: constrained RPA option (0: normal RPA, 1: constrained RPA)
flg_calc_type=0               !o: 0: all-q-calc, 1: gamma-only, 2: bulk job
\end{verbatim}
\hrule\vspace{5mm}

\verb+Ecut_for_eps+ is the cutoff energy of the polarization function (unit: Ry). By default, it is set to 1/10 of the cutoff energy of the wave function used in the band calculation (in this case, since the wave function cutoff is 36 Ry, the polarization function cutoff is set to 3.6 Ry). \verb+Num_freq_grid+ is the total number of calculation frequencies of the polarization function. By default, a log grid of 70 points is generated. \verb+N_CALC_BAND+ is the number of bands considered in the polarization calculation. By default, the number of bands calculated by the band calculation is set. From this number of bands, the maximum excitation energy $E_{max}$ is determined. The calculated frequency is taken up to $2E_{max}$ by considering the Lorentz tail of the polarization function.

\verb+MPI_num_proc_per_qcomm+, \verb+MPI_num_qcomm+, \verb+MPI_io_rank+ are parameters for MPI calculation. In the case of the above setting value, 6 MPI calculation is assumed, and the output is in charge of the master MPI. \verb+Green_func_delt+, \verb+ttrhdrn_dmna+, \verb+ttrhdrn_dmnr+ are parameters for tetrahedron calculation. All default values are prepared. \verb+shift_ef+ is used when artificially shifting the Fermi level and wanting to execute \verb+chiqw+ calculation (unit is eV). \verb+Max_excitation_energy+ is set when you want to limit excitation energy (unit is eV).

\verb+flg_cRPA+ is a variable that specifies whether or not limited RPA calculation is performed. By default, normal RPA calculation is performed, so \verb+flg_cRPA=0+. When performing constrained RPA calculation (\verb+flg_cRPA=1+), there are two strategies. One is to specify the exclusion polarization by the Wannier function, and the other is to specify the exclusion polarization by specifying the energy window. The default is the former (if you want to use the latter option please contact me). In the case of the former constrained RPA calculation, \verb+wannier+ calculation (chapter \ref{wannier}) must be executed before \verb+chiqw+ calculation. The constrained RPA calculation will be described in detail in the subsequent La$_2$CuO$_4$ calculation (chapter \ref{La2CuO4} chapter).

An option to specify the calculation $q$ point is also provided (\verb+flg_calc_type=2+). Details are described in the chapter \ref{bulkjob}.

\subsection{\label{file-chiqw}Band-calculation data file to be prepared}
The files necessary for calculation are the following eight files generated in the \ref{gendirwfn} chapter.
\vspace{5mm}\hrule
\begin{enumerate}
\item \verb+./dir-wfn/dat.bandcalc+ (Band calculation information)
\item \verb+./dir-wfn/dat.sample-k+ (sample k points)
\item \verb+./dir-wfn/dat.nkm+ (Expanded G number)
\item \verb+./dir-wfn/dat.eigenvalue+ (energy eigenvalue)
\item \verb+./dir-wfn/dat.kg+ (reciprocal lattice vector)
\item \verb+./dir-wfn/dat.wfn+ (wave function)
\item \verb+./dir-wfn/dat.lattice+ (basic translation vector)
\item \verb+./dir-wfn/dat.symmetry+ (Symmetry)
\end{enumerate}
\hrule\vspace{5mm}

Band calculation data for the \verb+chiqw+ calculation must be $k$ point data of Monkhorst-Pack mesh. The band calculation data for the \verb+chiqw+ calculation must be data calculated at the $k$ point of the Monkhorst-Pack mesh. The data \verb+dat.sample-k+, \verb+dat.nkm+, \verb+dat.eigenvalue+, \verb+dat.kg+, \verb+dat.wfn+ obtained for irreducible $k$ points are converted to all $k$-point data on the Monkhorst-Pack mesh by using symmetry information of \verb+dat.symmetry+.


\subsection{\label{job-chiqw}Execute job}
The job is executed as follows. Specifications in sh system are as follows.
\vspace{5mm}\hrule
\begin{verbatim}
> export OMP_NUM_THREADS=16
> export MKL_NUM_THREADS=16
> mpirun -np 6 ./calc_chiqw < input.in > LOG.chiqw  
\end{verbatim}
\hrule\vspace{5mm}

\verb+calc_chiqw+ is an executable file for dielectric function calculation. \verb+calc_chiqw+ is created by compiling in the directory \verb+RESPACK/src/chiqw+ (see the \ref{compile} section). The job is executed with input file \verb+input.in+ and band calculation files placed in the directory \verb+./dir-wfn+. This job is a hybrid parallel job (each MPI process consists of 16 threads and is executed in the 6 MPI process). If you omit \verb+MPI_num_proc_per_qcomm+, \verb+MPI_num_qcomm+ of \verb+&param_chiqw+, \verb+MPI_num_proc_per_qcomm=6+, \\ \verb+ MPI_num_qcomm=1+ is automatically set. \verb+input.in+ is read as standard input. Standard output of calculation (standard output is in charge by MPI master by default) is output to \verb+LOG.chiqw+.


\subsection{\label{result-chiqw}Calculation result}
When the job is executed, a directory \verb+dir-eqs+ is created under the calculation directory. The frequency-grid information (\verb+dat.wgrid+) and basic information (\verb+dat.chiqwcalc+) are output in the directory \verb+dir-eqs+. Furthermore, the directory \verb+qxxx+ attatched with the $q$ point number is generated under the \verb+dir-eqs+ directory. Calculation results are output in this directory. The total number of q points (i.e., the total number of the \verb+qxxx+ directories to be generated) is the total number of irreducible $q$ points (16 in this Al calculation). For the files in each \verb+qxxx+ directory, for example, in the 16th $q$ point, the following output file is generated in the directory \verb+q016+.
\vspace{5mm}\hrule
\begin{enumerate}
\item \verb+./dir-eps/dat.wgrid+ (Frequency grid)
\item \verb+./dir-eps/dat.chiqwcalc+ (chiqw calculation information)
\item \verb+./dir-eps/q016/dat.log.400+ (Calculation end flag)
\item \verb+./dir-eps/q016/dat.epsqw.600+ (Inverse dielectric function data)
\item \verb+./dir-eps/q016/dat.epsqw.600001-dat.epsqw.600070+ (Diagonal terms of inverse dielectric matrix for each frequency)
\end{enumerate}
\hrule\vspace{5mm}

\verb+dat.log.400+ is the calculation end flag. Inverse dielectric matrix \{$\epsilon_{{\bf GG'}}^{-1}({\bf q},\omega)$\} is accommodated in \verb+dat.epsqw.600+ in the binary format. For the file of 600000 series (\verb+dat.epsqw.600000+), we store the diagonal term data of the inverse dielectric matrix by the number of frequency grids. The first column is $|{\bf q + G}|$ (unit is bohr$^{- 1}$), the second column is $\epsilon_{{\bf GG}}^{-1}{\bf q}, \omega_1)$, and the third column is the imaginary part. In the case of this job (\verb+Num_freq_grid=70+), it is generated from \verb+dat.epsqw.600001+ to \verb+dat.epsqw.600070+. For example, \verb+dat.epsqw.600001+ contains the dielectric matrix at the first $\omega_1$ in the frequency grid $\epsilon_{{\bf GG}}^{-1}({\bf q },\omega_1)$ are accommodated. Also, \verb+dat.epsqw.600070+ has the diagonal term of the dielectric matrix $\epsilon_{{\bf GG}}^{-1}({\bf q}, \omega_{70})$ are accommodated.


Perform the following procedure to plot the diagonal data $\epsilon_{{\bf GG}}^{-1}({\bf q},\omega)$. Here we plot the result of $\omega^{-1}=0$.
\vspace{5mm}\hrule
\begin{verbatim}
> cat dir-eps/q0*/dat.epsqw.600001 > epsq0
> gnuplot
gnuplot> plot 'epsq0' u 1:2,'epsq0' u 1:3  
\end{verbatim}
\hrule\vspace{5mm}
\begin{figure}[h] 
\centering
\includegraphics[width=8cm]{epsq0-Al.eps}
\caption{Diagonal terms of of the inverse dielectric matrix for the all q  points $\epsilon_{{\bf GG}}^{-1}({\bf q}, \omega_1)$ (Red is the real part, green is the imaginary part). The horizontal axis is $|{\bf q+G}|$ (bohr $^{-1}$). In this result, the result at $\omega_1=0$ is plotted.}
\label{epsqw}
\end{figure}

For the electron energy loss spectrum [$-{\rm Im}\epsilon_{{\bf 00}}^{-1}({\bf 0},\omega)$], perform the following procedure. First extract the character string \verb+`0000000'+ ({\bf q=0, G=0} components) in \verb+dat.epsqw.600*+ with the \verb+grep+ command. Next, \verb+paste+ command combines with frequency data \verb+dat.wgrid+ to create \verb+eels+. When plotting the sixth column of this file, a spectrum like the figure \ref{eels} is drawn (the fifth column is the real part). The specific procedure is as follows.
\vspace{5mm}\hrule
\begin{verbatim}
> grep '0000000     ' dir-eps/q0*/dat.epsqw.600* > dat 
> sed -e '1,1d' dir-eps/dat.wgrid > grd (Frequency data generation without the first line)
> paste grd dat > eels 
> gnuplot 
gnuplot> plot `eels' u 1:5, `eels' u 1:6 
\end{verbatim}
\hrule\vspace{5mm}
\begin{figure}[h] 
\centering
\includegraphics[width=8cm]{eels-Al.eps}
\caption{Calculation result for the eels spectrum [$\epsilon_{{\bf 00}}^{-1}(\Gamma,\omega)$]. (Red is the real part, green is the imaginary part). The horizontal axis is $\omega$ (hartree). A large peak (green) appears at about 1 hartree position, which is the intensity due to Al plasmon absorption.}
\label{eels}
\end{figure}

\clearpage 

\section{calc\_w3d and calc\_j3d}
Evaluations of direct-Coulomb and exchange integrals are executed in separate executable file (direct calculation is performed with \verb+calc_w3d+, exchange calculation is \verb+calc_j3d+), which can be performed with common inputs and files. Note that the integral evaluation must be done after the dielectric function calculation and the Wannier function calculation.
\subsection{\label{input-calc-int}Input file (\&param\_calc\_int)}
Below is the input file \verb+input.in+ for executing the interaction-integral evaluation (\verb+calc_w3d+, \verb+calc_j3d+). Default values are prepared for all variables in the namelist \verb+&param_calc_int+.
\vspace{5mm}\hrule
\begin{verbatim}
&param_calc_int 
calc_ifreq=1, !o: Frequency to be calculated
ix_int_min=0, !o: Calc range of exchange (start lattice in a1 direc) (calc_j3d only)
ix_int_max=0, !o: Calc range of exchange (end lattice in a1 direc) (calc_j3d only)
iy_int_min=0, !o: Calc range of exchange (start lattice in a2 direc) (calc_j3d only)
iy_int_max=0, !o: Calc range of exchange (end lattice in a2 direc) (calc_j3d only)
iz_int_min=0, !o: Calc range of exchange (start lattice in a3 direc) (calc_j3d only)
iz_int_max=0/ !o: Calc range of exchange (end lattice in a3 direc) (calc_j3d only)
\end{verbatim}
\hrule\vspace{5mm}
The important thing in performing the integral calculation is to calculate the inverse dielectric matrix of all irreducible $q$ points before entering this calculation. This is because it is impossible to generate all the data on the Monkhorst-Pack mesh if the data at the irreducible $q$ point is insufficient. \verb+RESPACK+ checks the presence/absence of end flag of the dielectric calculation \verb+dat.log.400+ in \verb+./dir-eps/qxxx+, and stops calculation when there is not.

\subsection{\label{file-calc-int}Data file to be prepared}
Calculations use the following files.
\vspace{5mm}\hrule
\begin{enumerate}
\item \verb+./dir-wfn/dat.bandcalc+ (Band calculation information)
\item \verb+./dir-wfn/dat.sample-k+ (Sampling irreducible k points)
\item \verb+./dir-wfn/dat.nkm+ (Expanded G number)
\item \verb+./dir-wfn/dat.kg+ (Reciprocal lattice vector)
\item \verb+./dir-wfn/dat.lattice+ (Basic translation vector)
\item \verb+./dir-wfn/dat.symmetry+ (Symmetry information)
\item \verb+./dir-eps/dat.wgrid+ (Frequency grid)
\item \verb+./dir-eps/dat.chiqwcalc+ (chiqw calculation information)
\item \verb+./dir-eps/qxxx/dat.epsqw.600+ (Inverse dielectric function data)
\item \verb+./dir-wan/dat.wan+ (Expansion coefficients of Wannier function)
\item \verb+./dir-wan/dat.wan-center+ (Center position of Wannier function)
\end{enumerate}
\hrule\vspace{5mm}

\subsection{\label{job-calc-int}Execute job}
The job is executed as follows. Specifications in sh system are as follows.
\vspace{5mm}\hrule
\begin{verbatim}
> export OMP_NUM_THREADS=16
> export MKL_NUM_THREADS=16
> ./calc_w3d (or ./calc_j3d) < input.in > LOG.W3d (or LOG.J3d)  
\end{verbatim}
\hrule\vspace{5mm}
\verb+calc_w3d+ or \verb+calc_j3d+ are executable files for interaction calculation. The job is executed with the input file \verb+input.in+ placed in the current directory and the files placed in the directories \verb+./dir-wfn+, \verb+./dir-eps+, \verb+./dir-wan+. This job is \verb+openmp+ job (using 16 threads). The standard output of \verb+calc_w3d+ is output to \verb+LOG.W3d+, and the standard output of \verb+calc_j3d+ is output to \verb+LOG.J3d+.

\subsection{\label{result-calc-int}Calculation results}
When the job is executed, \verb+dir-intW+ and \verb+dir-intJ+ are created under the calculation directory, and the calculation result is output as a file in these directories. The result of \verb+calc_w3d+ is contained in \verb+dir-intW+, and the result of \verb+calc-j3d+ is contained in \verb+dir-intJ+. The output file is as follows.
\vspace{5mm}\hrule
\begin{enumerate}
\item \verb+./dir-intW/dat.Wmat+ [Screened Coulomb integral, Eq (5)]
\item \verb+./dir-intW/dat.Vmat+ [Bare Coulomb integral, Eq (7)] 
\item \verb+./dir-intW/dat.VvsR.001 - dat.VvsR.009+ ($V(r)$) 
\item \verb+./dir-intW/dat.WvsR.001 - dat.WvsR.009+ ($W(r)$)
\item \verb+./dir-intW/dat.UvsE.001-001 - dat.UvsE.009-009+ ($U(\omega)$)
\item \verb+./dir-intJ/dat.Jmat+ [Screened exchange integral, Eq (6)] 
\item \verb+./dir-intJ/dat.Xmat+ [Bare exchange integral, Eq (8)]
\item \verb+./dir-intJ/dat.JvsE.001-001 - dat.JvsE.009-009+ ($J(\omega)$)
\end{enumerate}
\hrule\vspace{5mm}
The screened direct-Coulomb and exchange integrals are defined as follows: 
\begin{eqnarray}
W_{ij}({\bf R},\omega)&=&\int_V d{\bf r} \int_V  d{\bf r'}
w_{i{\bf 0}}^*({\bf r}) 
w_{i{\bf 0}}({\bf r}) 
W({\bf r,r'},\omega) 
w_{j{\bf R}}^*({\bf r'}) 
w_{j{\bf R}}({\bf r'}), \label{Wij} \\
J_{ij}({\bf R},\omega)&=&\int_V  d{\bf r}\int_V d{\bf r'}
w_{i{\bf 0}}^*({\bf r}) 
w_{j{\bf R}}({\bf r}) 
W({\bf r,r'},\omega) 
w_{j{\bf R}}^*({\bf r'}) 
w_{i{\bf 0}}({\bf r'}). \label{Jij}
\end{eqnarray}
The integral means the volume of the crystal volume $V$. These integrals are matrix element of the screened Coulomb interaction between the $i$th Wannier function of the home cell ({\bf R=0}) and the $j$th Wannier function of the cell {\bf R} $W({\bf r,r'} \omega)$. In the case of a bare Coulomb interaction $v({\bf r,r'})=${\Large $\frac{1}{|{\bf r-r'}|}$} instead of $W({\bf r,r'}.\omega)$, the results are the bare exchange integrals.`
\begin{eqnarray}
V_{ij}({\bf R})&=&\int_V d{\bf r} \int_V  d{\bf r'}
w_{i{\bf 0}}^*({\bf r}) 
w_{i{\bf 0}}({\bf r}) 
v({\bf r,r'}) 
w_{j{\bf R}}^*({\bf r'}) 
w_{j{\bf R}}({\bf r'}), \label{Vij} \\
X_{ij}({\bf R})&=&\int_V  d{\bf r}\int_V d{\bf r'}
w_{i{\bf 0}}^*({\bf r}) 
w_{j{\bf R}}({\bf r}) 
v({\bf r,r'}) 
w_{j{\bf R}}^*({\bf r'}) 
w_{i{\bf 0}}({\bf r'}). \label{Kij}
\end{eqnarray}

Calculated data of \verb+dat.Wmat+, \verb+dat.Jmat+, \verb+dat.Vmat+, \verb+dat.Xmat+ are output as a matrix of \verb+N_wannier×N_wannier+ of each cell {\bf R}. The direct integral is calculated for all {\bf R}, while the exchange integral is calculated only in the grid range \verb+ix_intJ_min+ $\sim$ \verb+iz_intJ_max+ specified by oneself, because they are heavy calculations.

\verb+dat.WvsR.xxx+ is the distance dependence of the static direct-Coulomb integral [$W_{ij}({\bf R},0)$]. The direct integrals between the $i$the Wannier function of the home cell ({\bf R=0}) and all the Wannier functions are calculated. By default, $\omega=0$ is calculated (\verb+calc_ifreq=1+), but by changing this variable you can output finite $\omega$ results. In this Al calculation, \verb+N_wannier=9+, so nine files are output. To see the screened effect, you might plot \verb+dat.VvsR.xxx+ together. The output is as follows (figure \ref{WvsR} is the output result):
\vspace{5mm}\hrule
\begin{verbatim}
gnuplot> plot 'dir-intW/dat.VvsR.001', 'dir-intW/dat.WvsR.001'  
\end{verbatim}
\hrule\vspace{5mm}
\begin{figure}[h] 
\centering
\includegraphics[width=8cm]{WvsR-Al.eps}
\caption{Distance dependence of bare direct-Coulomb integral (red) and static screened direct-Coulomb integral (green). The horizontal axis is the distance (unit: \AA) between the Wannier functions $w_{i{\bf 0}}$ and $w_{j{\bf R}}$, and the unit of the vertical axis is {\tt eV}. This result is for $i$={\tt 001}. The bare direct-Coulomb integral is attenuated with ${\Huge \frac{1}{R}}$ (blue) and static screened direct-Coulomb integral has values only onsite due to metallic screening.}
\label{WvsR}
\end{figure}

The frequency dependence of onsite screened direct-Coulomb integral [$W_ {ii}({\bf 0}, \omega)$] is plotted as follows (figure \ref{UvsE} is the output result). This output is $W_{11}({\bf 0}, \omega)$, but, in this program, $W_{ij}({\bf 0}, \omega)$ are calculated for all pairs of the Wannier functions $i$ and $j$. 
\vspace{5mm}\hrule
\begin{verbatim}
gnuplot> plot 'dir-intW/dat.UvsE.001-001' u 1:3, 'dir-intW/dat.UvsE.001-001' u 1:4  
\end{verbatim}
\hrule\vspace{5mm}
\begin{figure}[h] 
\centering
\includegraphics[width=8cm]{UvsE-Al.eps}
\caption{Frequency dependence of onsite screened direct-Coulomb integral. Red is the real part, and green is the imaginary part. The horizontal axis shows the frequency $\omega$ ({\tt eV}), and the unit of the vertical axis is {\tt eV}. A pole due to the plasmon excitation can be seen around 20 eV.}
\label{UvsE}
\end{figure}

The frequency dependence of onsite screened exchange integral [$J_ {ij}({\bf 0}, \omega)$] is plotted as follows (figure \ref{JvsE} is the output result). This output is $J_{12}({\bf 0}, \omega)$, but, in this program, $J_{ij}({\bf 0}, \omega)$ are calculated for all pairs of the Wannier functions $i$ and $j$. 
\vspace{5mm}\hrule
\begin{verbatim}
gnuplot> plot 'dir-intJ/dat.JvsE.001-002' u 1:3, 'dir-intJ/dat.JvsE.001-002' u 1:4  
\end{verbatim}
\hrule\vspace{5mm}
\begin{figure}[h] 
\centering
\includegraphics[width=8cm]{JvsE-Al.eps}
\caption{Frequency dependence of onsite screened exchange integral. Red is the real part, and green is the imaginary part. The horizontal axis shows the frequency $\omega$ ({\tt eV}), and the unit of the vertical axis is {\tt eV}. We also see a pole around 20 eV, but the overall energy scale is about 1/10 of direct integration.}
\label{JvsE}
\end{figure}

\clearpage 

\section{\label{Al-summary}Summary: Al calculation input} 
We shows the entire input of {\sc RESPACK} calculation for Al. Below is an input file \verb+input.in+ which omitted all the optional variables.  It is understood that there is a necessary parameter only for \verb+wannier+ calculation, and all others are default setting.
\vspace{3mm}\hrule
\begin{verbatim}
&param_wannier 
N_wannier=9,                !n: Number of Wannier functions you want to calculate
Lower_energy_window=-10.0d0,!n: Lower limit of energy window (eV)
Upper_energy_window= 35.0d0,!n: Upper limit of energy window (eV)
N_initial_guess=9/          !n: Number of initial Gaussian
s   0.2d0 0.0d0 0.0d0 0.0d0 !n: Orbital type, Gaussian width, Gaussian position s@Al
px  0.2d0 0.0d0 0.0d0 0.0d0 !n: px@Al
py  0.2d0 0.0d0 0.0d0 0.0d0 !n: py@Al
pz  0.2d0 0.0d0 0.0d0 0.0d0 !n: pz@Al
dxy 0.2d0 0.0d0 0.0d0 0.0d0 !n: dxy@Al
dyz 0.2d0 0.0d0 0.0d0 0.0d0 !n: dyz@Al
dz2 0.2d0 0.0d0 0.0d0 0.0d0 !n: dz2@Al
dzx 0.2d0 0.0d0 0.0d0 0.0d0 !n: dzx@Al
dx2 0.2d0 0.0d0 0.0d0 0.0d0 !n: dx2-y2@Al

&param_interpolation   
N_sym_points=5/   !n: Total number of symmetric k points in calculation lines
0.500 0.500 0.500 !n: Symmetric k point; SK_sym_pts(1:3,1); L
0.000 0.000 0.000 !n: Symmetric k point; SK_sym_pts(1:3,2); G
0.500 0.000 0.500 !n: Symmetric k point; SK_sym_pts(1:3,3); X
0.500 0.250 0.750 !n: Symmetric k point; SK_sym_pts(1:3,4); W
0.500 0.500 0.500 !n: Symmetric k point; SK_sym_pts(1:3,5); L 
&param_visualization
/  

&param_chiqw 
/

&param_calc_int 
/
\end{verbatim}
\hrule\vspace{3mm}

In this demonstration, the calculation condition is loosened to shorten the calculation time. For convergence, it is necessary to make strict conditions. The Wannier function mainly depends on the density of the $k$ points and the wave function cutoff. The dielectric function depends on the number of unoccupied bands, the dielectric function cutoff. For Al calculation, it is better to take 10$\times$10$\times$10-$k$ points, wave function cutoff 64 Ry, dielectric cutoff 10 Ry, unoccupied band number 50. In the case of constrained RPA, it is generally advisable to include up to several tens of eV above the Fermi level for the number of unoccupied bands.

\clearpage 

\section{\label{La2CuO4}La$_2$CuO$_4$ (Interaction evaluation using constrained RPA)} 

Before, we described the procedure of interaction evaluation using {\sc RESPACK }. As another example in this chapter, the interaction evaluation of the transition-metal oxide La$_2$CuO$_4$ is described. In particular, we will describe the setting of the inner energy window in \verb+wannier+ calculation and the constrained RPA option in \verb+chiqw+ calculation. Band computation (using {\sc xTAPP}) is a $k$-point sampling of 6$\times$6$\times$6 (30 irreducible $k$ points), a wave function cutoff of 81 Ry, a total number of bands of 60 (occupied band number 26, partial occupied band number 1, unoccupied band number 33, including a band up to about 15 eV above the Fermi level).
%\vspace{5mm}
%\subsection{xTAPP} 
%以下が La$_2$CuO$_4$ の \verb+xTAPP+ バンド計算を実施するためのインプットファイル \verb+La2CuO4.cg+ である. 
%\vspace{5mm}\hrule
%\begin{verbatim}
%# main data
%&tappinput
% lattice_factor=1.889726878,              !格子定数の参照値 (au)
% lattice_list=-1.89085, 1.89085, 6.62435, !格子ベクトル
%               1.89085,-1.89085, 6.62435, !格子ベクトル
%               1.89085, 1.89085,-6.62435, !格子ベクトル
% cutoff_wave_function = 8.0,              !平面波カットオフ (Ry) の平方根
% number_element = 3,                      !元素数
% number_atom = 7,                         !原子数
% number_band = 60,                        !計算バンドの総数
% store_wfn = 1,                           !計算バンドの総数波動関数の出力有無
% initial_lpt = 0,                         !初期ポテンシャルの読込有無 (0:読まない) 
% xc_type = PBE,                           !交換相関汎関数の種類
% elec_kbt=0.01,                           !金属計算時に導入されるスメアリング (au)
% SCF_CONVERGE = 1.0E-015,                 !計算の収束閾値
% control_uptime = 3600/                   !計算時間の上限 (sec) 
%
%# atom data
%11 29                                       !原子種1(=Cu)の価電子数, 原子番号
%11 57                                       !原子種2(=La)の価電子数, 原子番号
% 6  8                                       !原子種3(= O)の価電子数, 原子番号
% 2  0.361006958   0.361006958   0.000000000 !原子種2(=La), 位置(格子座標系) 
% 2  0.638993042   0.638993042   0.000000000 !原子種2(=La), 位置(格子座標系) 
% 1  0.000000000   0.000000000   0.000000000 !原子種1(=Cu), 位置(格子座標系) 
% 3  0.500000000   0.000000000   0.500000000 !原子種3(= O), 位置(格子座標系) 
% 3  0.000000000   0.500000000   0.500000000 !原子種3(= O), 位置(格子座標系) 
% 3  0.185459862   0.185459862   0.000000000 !原子種3(= O), 位置(格子座標系) 
% 3  0.814540138   0.814540138   0.000000000 !原子種3(= O), 位置(格子座標系) 
%
%# k-points data
%&smpl_kpt
% dos_mode = METHFESSEL_PAXTON, !状態密度の計算法
% bz_number_tile = 1,           !k点サンプリングのためのパラメータ1
% bz_mesh = 18/                 !k点サンプリングのためのパラメータ2
% 10 10 10                      !k点サンプリングのためのパラメータ3
%  2  2  2                      !k点サンプリングのためのパラメータ4
%
%# symmetry data
%&SYMMETRY
% SYMMETRY_FORMAT = reciprocal,       !回転行列・部分並進ベクトルの記述形式
% NUMBER_SYM_OP = 16/                 !対称性の数
%  1  0  0  0  1  0  0  0  1  0  0  0 !回転対称性行列, 部分並進ベクトル
% -1  0  0  0 -1  0  0  0 -1  0  0  0
%  1  0 -1  1  0  0  1 -1  0  0  0  0
% -1  0  1 -1  0  0 -1  1  0  0  0  0
%  0  1 -1  1  0 -1  0  0 -1  0  0  0
%  0 -1  1 -1  0  1  0  0  1  0  0  0
%  0  1  0  0  1 -1 -1  1  0  0  0  0
%  0 -1  0  0 -1  1  1 -1  0  0  0  0
%  0 -1  1  0 -1  0  1 -1  0  0  0  0
%  0  1 -1  0  1  0 -1  1  0  0  0  0
% -1  0  1  0 -1  1  0  0  1  0  0  0
%  1  0 -1  0  1 -1  0  0 -1  0  0  0
% -1  0  0 -1  0  1 -1  1  0  0  0  0
%  1  0  0  1  0 -1  1 -1  0  0  0  0
%  0 -1  0 -1  0  0  0  0 -1  0  0  0
%  0  1  0  1  0  0  0  0  1  0  0  0
%
%# file map data
%&filemap
% basename = 'La2CuO4', !物質名
% number_PP_file = 3/   !擬ポテンシャルの総数
% ps-Cu ps-Cu.ichr      !原子種1の擬ポテンシャル名
% ps-La ps-La.ichr      !原子種2の擬ポテンシャル名
% ps-O  ps-O.ichr       !原子種3の擬ポテンシャル名
%
%# struct_opt data
%&struct_opt
% number_cycle = 0/    !構造最適化の有無 (0: 行わない)
%
%# str_opt_constr data
% 1                   !構造最適化設定1: 逆質量テンソル設定1
% 0                   !構造最適化設定2: 逆質量テンソル設定2
%
%# trace band data
%&trace_band
% number_band = 60,                        !計算バンド数
% number_trace_block = 5/                   !バンド分散を構成する区間の数
%   G      X      P       N      G      Z   !対称k点ラベル
% 0.0d0  0.0d0  0.25d0  0.0d0  0.0d0  0.5d0 !対称k点のb1成分; ak(1,iblk) 
% 0.0d0  0.0d0  0.25d0  0.5d0  0.0d0  0.5d0 !対称k点のb2成分; ak(2,iblk)
% 0.0d0  0.5d0  0.25d0  0.0d0  0.0d0 -0.5d0 !対称k点のb3成分; ak(3,iblk)
%      20     20      20     20     20      !対称k点間の分割数
%\end{verbatim}
%\hrule\vspace{5mm}
%
%この物質の結晶構造は, 体心正方格子であり, 3 種の原子種からなる (\verb+number_element=3+). ブラベー格子内に 7 つの原子 (Laが2つ, Cuが1つ, Oが4つ) を含む (\verb+number_atom=7+). 平面波カットオフエネルギーは 64 Ry にセットされた (\verb+cutoff_wave_function=8.0+). 計算バンド数は 60 にセットされた (\verb+number_band=60+). 交換相関汎関数は PBE96 が採用された (\verb+xc_type=PBE+). 金属計算のため, 0.01 au のスメアリングが導入された (\verb+elec_kbt=0.01+). 収束は, Al 計算と同様, 厳しくとっている (\verb+SCF_CONVERGE=1.0E-015+). この計算では, 9$\times$9$\times$9 $k$ 点サンプリングが採られた (このサイズの $k$ 点サンプリングよりも小さいと, \verb+wannier+ 計算がうまく収束しなかった). 電荷密度評価は Methfessel-Paxton アルゴリズムが使われる (\verb+dos_mode=METHFESSEL_PAXTON+). 体心正方格子の場合は対称操作は 16 通りであり (\verb+NUMBER_SYM_OP=16+), 既約 $k$ 点数は 75 となった. 擬ポテンシャルは自作したが \verb+xTAPP+ 付属の擬ポテンシャルライブラリから採る場合は, 平面波カットオフを 144 Ry 程度 (\verb+cutoff_wave_function=12.0+) まで上げておいた方が良い. 

%\subsection{input.in} 
In this calculation, since the constrained RPA calculation is performed, the variable \verb+flg_cRPA+ of the namelist \verb+&param_chiqw+ is set to \verb+1+. To reduce the computational cost, the polarization function cutoff is set to 3 Ry (8.1 Ry by default). In case of the constrained RPA, we need to implement \verb+wannier+ calculation before \verb+chiqw+ calculation because we use the Wannier function to define exclusion polarization. Therefore, the order of calculation is \verb+wannier+ $\to$ \verb+chiqw+ $\to$ \verb+calc_w3d (calc_j3d)+. Below is \verb+RESPACK+ calculation input \verb+input.in+ of La$_2$CuO$_4$ (body cntered tetragonal lattice). In this input, each input of \verb+wannier+, \verb+chiqw+, \verb+calc_w3d (calc_j3d)+ are put together and all the default setting parameters are omitted.
\vspace{3mm}\hrule
\begin{verbatim}
&param_chiqw 
Ecut_for_eps=3.0d0, !Cutoff of polarization function (Ry)
flg_cRPA=1/         !Constrained RPA option (0: normal RPA, 1: constrained RPA)

&param_wannier 
N_wannier=1,                !Number of Wannier functions you want to calculate
Lower_energy_window=10.0d0, !Lower limit of energy window (eV)
Upper_energy_window=15.6d0, !Upper limit of energy window (eV)
N_initial_guess=1,          !Number of initial Gaussian
set_inner_window=T,         !Setting of inner energy window
Lower_inner_window=12.60d0, !Energy inner window lower limit (eV)
Upper_inner_window=13.40d0/ !Energy inner window lower limit (eV)
dx2 0.2d0 0.0d0 0.0d0 0.0d0 !Orbital type, Gaussian width, Gaussian position dx2-y2@Cu

&param_interpolation   
N_sym_points=6/    !Total number of symmetric k points in calculation lines
0.000 0.000  0.000 !Symmetric k point; SK_sym_pts(1:3,1); G
0.000 0.000  0.500 !Symmetric k point; SK_sym_pts(1:3,1); X
0.250 0.250  0.250 !Symmetric k point; SK_sym_pts(1:3,1); P
0.000 0.500  0.000 !Symmetric k point; SK_sym_pts(1:3,1); N
0.000 0.000  0.000 !Symmetric k point; SK_sym_pts(1:3,1); G
0.500 0.500 -0.500 !Symmetric k point; SK_sym_pts(1:3,1); Z

&param_visualization
flg_vis_wannier=1/ !Calculate realspace Wannier function (Do not: 0, do 1)                    

&param_calc_int 
/
\end{verbatim}
\hrule\vspace{3mm}

In this \verb+wannier+ calculation, we set the energy window to \verb+Lower_energy_ window=10.0 eV+ to \verb+Upper_energy_ window=15.6 eV+. We make the Wannier function with initial guess of $d_{x^2-y^2}$ centered at the position of the copper atom (\verb+dx 2 0.2d0 0.0d0 0.0d0 0.0d0+). In this calculation, the inner window is set (\verb+set_inner_ window=T+). The inner window is set to \verb+Lower_inner_ window=12.6 eV+ to \verb+Upper_inner_window=13.4 eV+. The band within this inner window is accurately reproduced, and the inner window is usually set to sandwich the Fermi level of metal (12.97 eV in this calculation).



The resulting Wannier-interpolation band and realspace Wannier function are shown in Fig.~\ref{band-La2CuO4} and \ref{vesta-La2CuO4}. We show the wavenumber dependence of the static inverse dielectric function by constrained RPA and normal RPA for figures~\ref{epsqw-cRPA-La2CuO4} and \ref{epsqw-fRPA-La2CuO4}. We also show the electron energy loss spectrum (eels) by constrained RPA and normal RPA on figures~\ref{eels-cRPA-La2CuO4} and \ref{eels-fRPA-La2CuO4}. The distance dependence of the direct integrals is shown in Fig.~\ref{WvsR-La2CuO4}, where red, green, and blue are bare, constrained-RPA, and normal-RPA direct integrals, respectively. We show the frequency dependence of on-site screened direct integral by constrained RPA and normal RPA for figures~\ref{UvsE-cRPA-La2CuO4} and \ref{UvsE-fRPA-La2CuO4}.

\begin{figure}[h] 
\centering
\includegraphics[width=14cm]{dat.iband.La2CuO4.eps}
\caption{Caluclated Wannier interpolation band. The unit of the vertical axis is {\tt eV}. The lower limit of the energy window was set to 10 eV ({\tt Lower\_energy\_window=10.0}) and the upper limit was set to 15.6 eV ({\tt Upper\_energy\_window=15.6}). A single Wannier orbital ({\tt N\_wannier=1}) from the band in this window was made from one initial Gaussian ({\tt N\_initial\_guess=1}). The inner energy window was set to {\tt Lower\_inner\_window=12.6 eV}, {\tt Upper\_inner\_window=13.4 eV}.}
\label{band-La2CuO4}
\end{figure}
\begin{figure}[h] 
\centering
\includegraphics[width=10cm]{dat.wan-realspace-La2CuO4.eps}
\caption{Realspace Wannier function.}
\label{vesta-La2CuO4}
\end{figure}
\begin{figure}[h] 
\centering
\includegraphics[width=8cm]{epsq0-cRPA-La2CuO4.eps}
\caption{Diagonal data of calculated inverse dielectric matrix with constrained RPA, $\epsilon_{{\bf GG}}^{-1} ({\bf q}, \omega_1)$. (Red is the real part, green is the imaginary part). The horizontal axis is $|{\bf q+G}|$ (bohr $^{- 1}$). The result of $\omega_1=0$ is plotted.}
\label{epsqw-cRPA-La2CuO4}
\end{figure}
\begin{figure}[h] 
\centering
\includegraphics[width=8cm]{epsq0-fRPA-La2CuO4.eps}
\caption{Diagonal data of calculated inverse dielectric matrix with normal RPA, $\epsilon_{{\bf GG}}^{-1} ({\bf q}, \omega_1)$. (Red is the real part, green is the imaginary part). The horizontal axis is $|{\bf q+G}|$ (bohr $^{- 1}$). The result of $\omega_1=0$ is plotted.}
\label{epsqw-fRPA-La2CuO4}
\end{figure}
\begin{figure}[h] 
\centering
\includegraphics[width=8cm]{eels-cRPA-La2CuO4.eps}
\caption{Calculated eels with constrained RPA [$\epsilon_{{\bf 00}}^{-1}(\Gamma, \omega)$] (red is the real part, green is the imaginary part). The horizontal axis is the logarithm of the frequency $\omega$ (hartree).}
\label{eels-cRPA-La2CuO4}
\end{figure}
\begin{figure}[h] 
\centering
\includegraphics[width=8cm]{eels-fRPA-La2CuO4.eps}
\caption{Calculated eels with normal RPA [$\epsilon_{{\bf 00}}^{-1}(\Gamma, \omega)$] (red is the real part, green is the imaginary part). The horizontal axis is the logarithm of the frequency $\omega$ (hartree).}
\label{eels-fRPA-La2CuO4}
\end{figure}
\begin{figure}[h] 
\centering
\includegraphics[width=8cm]{WvsR-La2CuO4.eps}
\caption{Distance dependence of direct Coulomb integral [bare (red), constrained-RPA (green), normal-RPA (blue)]. The horizontal axis is the distance (unit: \AA) between the Wannier functions $w_{i{\bf 0}}$ and $w_{j{\bf R}}$, and the unit of the vertical axis is {\tt eV} is there. Bare direct integral is attenuated with ${\Huge \frac{1}{R}}$. Constrained-RPA direct integral has finite interaction offsite. Normal-RPA direct integral has on-site value only because of metal screening.}
\label{WvsR-La2CuO4}
\end{figure}
\begin{figure}[h] 
\centering
\includegraphics[width=8cm]{UvsE-cRPA-La2CuO4.eps}
\caption{Frequency dependence of onsite screened direct integral with constrained RPA. Red is the real part, and green is the imaginary part. The horizontal axis is the logarithm of the frequency $\omega$ ({\tt eV}). The unit of the vertical axis is {\tt eV}.}
\label{UvsE-cRPA-La2CuO4}
\end{figure}
\begin{figure}[h] 
\centering
\includegraphics[width=8cm]{UvsE-fRPA-La2CuO4.eps}
\caption{Frequency dependence of onsite screened direct integral with normal RPA. Red is the real part, and green is the imaginary part. The horizontal axis is the logarithm of the frequency $\omega$ ({\tt eV}). The unit of the vertical axis is {\tt eV}.}
\label{UvsE-fRPA-La2CuO4}
\end{figure}

\clearpage 

\section{\label{TiO2}TiO$_2$ (Wannier function calculation with local coordinates)} 
We explain the calculation to construct the Wannier function by setting the initial Gaussian along the local coordinates  As an example, we consider constructing the $t_{2g} $ Wannier function of TiO$_2$ (rutile structure). The following is \verb+input.in+ for this calculation. Band calculation is preformed using {\sc xTAPP} with $k$-point sampling 6$\times$6$\times$6 (64 irreducible $k$ points) and 64-Ry wavefunction cutoff.

\vspace{3mm}\hrule
\begin{verbatim}
&param_wannier 
N_wannier=6,                !Number of Wannier functions you want to calculate
LOWER_energy_window= 7.0d0, !Lower limit of energy window (eV)
UPPER_energy_window=11.0d0, !Upper limit of energy window (eV)
flg_initial_guess_direc=1,  !Display coordinate of initial Gaussian
N_initial_guess=6/          !Number of initial Gaussian
dxy 0.20 0.00 0.00 0.00  0.46 -0.46 0.76 0.46 -0.46 -0.76  0.71 0.71 0.00 !dxy@Ti1
dyz 0.20 0.00 0.00 0.00  0.46 -0.46 0.76 0.46 -0.46 -0.76  0.71 0.71 0.00 !dyz@Ti1
dzx 0.20 0.00 0.00 0.00  0.46 -0.46 0.76 0.46 -0.46 -0.76  0.71 0.71 0.00 !dzx@Ti1
dxy 0.20 0.50 0.50 0.50 -0.46 -0.46 0.76 0.46  0.46  0.76 -0.71 0.71 0.00 !dxy@Ti2
dyz 0.20 0.50 0.50 0.50 -0.46 -0.46 0.76 0.46  0.46  0.76 -0.71 0.71 0.00 !dyz@Ti2
dzx 0.20 0.50 0.50 0.50 -0.46 -0.46 0.76 0.46  0.46  0.76 -0.71 0.71 0.00 !dzx@Ti2

&param_interpolation   
N_sym_points=5/ !Total number of symmetric k points in calculation lines
0.50 0.00 0.50  !Symmetric k point; SK_sym_pts(1:3,1); M
0.00 0.00 0.50  !Symmetric k point; SK_sym_pts(1:3,1); Z
0.00 0.00 0.00  !Symmetric k point; SK_sym_pts(1:3,1); G
0.50 0.00 0.00  !Symmetric k point; SK_sym_pts(1:3,1); X
0.00 0.50 0.00  !Symmetric k point; SK_sym_pts(1:3,1); Y

&param_visualization   
FLG_VIS_WANNIER=1/ !Calculate realspace Wannier function (Do not: 0, do 1)     
\end{verbatim}
\hrule\vspace{3mm}

In this \verb+wannier+ calculation, we set the energy window to \verb+Lower_energy_window=7.0 eV+ to \verb+Upper_energy_window=11.0 eV+ to include the $t_{2 g}$ band. Also in this calculation the namelist variable \verb+flg_initial_guess_direc+ has been set to \verb+1+. As a result, the display coordinate of the initial Gaussian is changed to the local coordinate system. With this flag set, in addition to the basic information of the initial Gaussian, additional local coordinates defining display coordinates are additionally input. Specifically, it is input as follows.

\vspace{5mm}\hrule
\begin{verbatim}
dxy 0.20 0.50 0.50 0.50 -0.46 -0.46 0.76  0.46 0.46 0.76  -0.71 0.71 0.00
\end{verbatim}
\hrule\vspace{5mm}
In the above, we place \verb+dxy+ Gaussian [orbital index \verb+0.2 (au)+] as lattice coordinates at the position of \verb+(0.50, 0.50, 0.50)+. Also, this Gaussian is displayed along the local coordinates (${\ bf L}_x, {\bf L}_y, {\bf L}_z$). Here, each local coordinate is as follows.
\begin{eqnarray} 
{\bf L}_x &=& -0.46 {\bf e}_x -0.46 {\bf e}_y + 0.76 {\bf e}_z, \nonumber \\
{\bf L}_y &=& +0.46 {\bf e}_x +0.46 {\bf e}_y + 0.76 {\bf e}_z, \nonumber \\
{\bf L}_z &=& -0.71 {\bf e}_x +0.71 {\bf e}_y + 0.00 {\bf e}_z, \nonumber 
\end{eqnarray} 
Here, ${\bf e}_x, {\bf e}_y, {\bf e}_z$ represent the Cartesian coordinate system which is used in the band calculation. The local coordinates ${\bf L}_x, {\bf L}_y, {\bf L}_z$ are defined by the TiO$_6$ octahedron unit. ${\bf L}_x, {\bf L}_y, {\bf L}_z$ and ${\ bf e}_x, {\bf e}_y, {\bf e}_z$ are shown in figure~\ref{TiO2-local}. Regarding the components of the local coordinates, the user must calculate the value from the structure information on its own. In this case, we calculated them from the coordinates of Ti and adjacent O of TiO$_6$ octahedron unit.
\begin{figure}[h] 
\centering
\includegraphics[width=10cm]{TiO2-local.eps}
\caption{Definition of local coordinates and Cartesian coordinates in rutile type TiO$_2$. The green frame is TiO$_6$ octahedron unit.}
\label{TiO2-local}
\end{figure}

Figure~\ref{vesta-TiO2}$ is the resulting d_{xy}$ type realspace Wannier function. It can be seen that the $d_{xy}$ orbital is obtained based on the local coordinate system defined by Fig.~\ref{TiO2-local}.
\begin{figure}[h] 
\centering
\includegraphics[width=10cm]{dat.wan-realspace-TiO2.eps}
\caption{Calculated realspace $t_{2g}$ Wannier function for rutile TiO$_2$.}
\label{vesta-TiO2}
\end{figure}

\clearpage 

\section{\label{Si}Si (Wannier function using B matrix)} 

Here is a calculation example for constructing the Wannier function by linearly combining initial Gaussian. We consider the Si calculation as an example. The following is \verb+input.in+ for this calculation. Band calculation is preformed using {\sc xTAPP} with $k$-point sampling 6$\times$6$\times$6 (16 irreducible $k$ points) and 36-Ry wavefunction cutoff.
\vspace{3mm}\hrule
\begin{verbatim}
&param_wannier 
N_wannier=8,                  !Lower limit of energy window (eV)
Upper_energy_window=17.0d0,   !Upper limit of energy window (eV)
N_initial_guess=8,            !Number of initial Gaussian
flg_BMAT=1/                   !0:BMAT=unit matrix, 1:reading BMAT      
s  0.5d0 0.00d0 0.00d0 0.00d0 !s@Si1
px 0.5d0 0.00d0 0.00d0 0.00d0 !px@Si1
py 0.5d0 0.00d0 0.00d0 0.00d0 !py@Si1
pz 0.5d0 0.00d0 0.00d0 0.00d0 !pz@Si1
s  0.5d0 0.25d0 0.25d0 0.25d0 !s@Si2
px 0.5d0 0.25d0 0.25d0 0.25d0 !px@Si2
py 0.5d0 0.25d0 0.25d0 0.25d0 !py@Si2
pz 0.5d0 0.25d0 0.25d0 0.25d0 !pz@Si2
0.50 -0.50  0.50 -0.50 0.00  0.00  0.00  0.00 !B_MAT(ig=1,iw=1:8)
0.50  0.50 -0.50 -0.50 0.00  0.00  0.00  0.00 !B_MAT(ig=2,iw=1:8)
0.50 -0.50 -0.50  0.50 0.00  0.00  0.00  0.00 !B_MAT(ig=3,iw=1:8)
0.50  0.50  0.50  0.50 0.00  0.00  0.00  0.00 !B_MAT(ig=4,iw=1:8)
0.00  0.00  0.00  0.00 0.50  0.50 -0.50  0.50 !B_MAT(ig=5,iw=1:8)
0.00  0.00  0.00  0.00 0.50 -0.50  0.50  0.50 !B_MAT(ig=6,iw=1:8)
0.00  0.00  0.00  0.00 0.50  0.50  0.50 -0.50 !B_MAT(ig=7,iw=1:8)
0.00  0.00  0.00  0.00 0.50 -0.50 -0.50 -0.50 !B_MAT(ig=8,iw=1:8)


0.50 0.00 0.50  !

&param_interpolation   
N_sym_points=5/   !Total number of symmetric k points in calculation lines
0.500 0.500 0.500 !Symmetric k point; SK_sym_pts(1:3,1); L
0.000 0.000 0.000 !Symmetric k point; SK_sym_pts(1:3,1); G
0.500 0.000 0.500 !Symmetric k point; SK_sym_pts(1:3,1); X
0.500 0.250 0.750 !Symmetric k point; SK_sym_pts(1:3,1); W
0.500 0.500 0.500 !Symmetric k point; SK_sym_pts(1:3,1); L

&param_visualization   
flg_vis_wannier=1/ !Calculate realspace Wannier function (Do not: 0, do 1)  
\end{verbatim}
\hrule\vspace{3mm}

In this calculation, eight $sp^3$ type Wannier functions of Si are constructed from a linear combination of eight $s$-type and $p$-type Gaussian functions. The B matrix information which is the coefficient of the linear combination is input following the initial Gaussian information. For the B matrix component, the user must calculate the value from the structure information of the calculation system on its own. In this case, the component was calculated from the direction along the covalent bond of Si. The size of the B matrix is 8$\times$8, with rows representing the sequence of Gaussian functions and columns representing the sequence of the Wannier orbitals. The component $B_{ij}$ of the B matrix is defined as follows.
\begin{eqnarray}
w_{j}^{in}({\bf r})=\sum_{i}B_{ij} g_i({\bf r}) \nonumber 
\end{eqnarray} 
Here, $g_i$ is the $i$th Gaussian function, $w_{j}^{in}$ is the initial guess of the $j$th Wannier function. The input format of B matrix is as follows.
\vspace{5mm}\hrule
\begin{verbatim}
do ig=1,N_initial_guess 
 read(5,*) (B_MAT(ig,iw),iw=1,N_wannier) !real(8)
enddo
\end{verbatim}
\hrule\vspace{5mm}

If you add \verb+reading_bmat_format=1+ to the namelist, you can switch in rows and columns of matrix B by entering. In this case, the row is the Wannier function and the column is the Gaussian function.
\vspace{5mm}\hrule
\begin{verbatim}
do iw=1,N_wannier
 read(5,*) (B_MAT(ig,iw),iw=1,N_initial_guess)
enddo
\end{verbatim}
\hrule\vspace{5mm}

We show calculated $sp^3$-type realspace Wannier function in Fig.~\ref{vesta-Si}.
\begin{figure}[h] 
\centering
\includegraphics[width=10cm]{dat.wan-realspace-Si.eps}
\caption{Calculated realspace $sp^3$-type Wannier function of Si.}
\label{vesta-Si}
\end{figure}

\clearpage 

\section{\label{SrVO3}SrVO$_3$ (Interaction evaluation using constrained RPA)} 

Below is the input for computing the interaction matrix elements of the $t_{2g}$ Wannier functions of SrVO$_3$ using constrained RPA.
\vspace{3mm}\hrule
\begin{verbatim}
&param_chiqw
Ecut_for_eps=5.0d0,!Cutoff of polarization function (Ry)
flg_cRPA=1/        !Constrained RPA option (0: normal RPA, 1: constrained RPA)

&param_wannier 
N_wannier=3,                  !Number of Wannier functions you want to calculate
Lower_energy_window=6.5d0,    !Lower limit of energy window (eV)
Upper_energy_window=9.7d0,    !Upper limit of energy window (eV)
N_initial_guess=3/            !Number of initial Gaussian
dxy 0.5d0 0.5d0  0.5d0  0.5d0 !dxy@V
dyz 0.5d0 0.5d0  0.5d0  0.5d0 !dyz@V
dzx 0.5d0 0.5d0  0.5d0  0.5d0 !dzx@V

&param_interpolation   
N_sym_points=5/   !Total number of symmetric k points in calculation lines
0.500 0.500 0.500 !Symmetric k point; SK_sym_pts(1:3,1); R 
0.000 0.000 0.000 !Symmetric k point; SK_sym_pts(1:3,1); G 
0.500 0.000 0.000 !Symmetric k point; SK_sym_pts(1:3,1); X 
0.500 0.500 0.000 !Symmetric k point; SK_sym_pts(1:3,1); M 
0.000 0.000 0.000 !Symmetric k point; SK_sym_pts(1:3,1); G 

&param_visualization   
/ 

&param_calc_int 
/
\end{verbatim}
\hrule\vspace{3mm}

The input variables are set for {\sc xTAPP}. Note that the setting values of the energy window depend on the band calculation. The above input is a simplified version contained in the directory \verb+sample+. If you want convergence it is better to take 10$times$10$\times$10 $k$ points, 100-Ry wavefunction cutoff, 15-Ry dielectric function cutoff, total number of bands around 100. As SrVO$_3$ has more than one plasmon excitation, it is better to keep the frequency grid as dense as possible. Specifically, it is advisable to set \verb+Num_freq_grid=150+. Note that the transition metal has a strong localization and the quantitativeness of the interaction parameter may be influenced by the pseudopotential. It is better to use a pseudopotential that is as stiff as possible.

\clearpage 

\section{\label{TMTSF}(TMTSF)$_2$PF$_6$ (Interaction evaluation using constrained RPA))} 
Below is the input for calculating the interaction matrix element of organic compound (TMTSF)$_2$PF$_6$ using constrained RPA, where we made \verb+HOMO+ Wannier functions of organic molecules. Calculation was carried out in System B of Institute for Solid State Physics. It is a parallel job of 12 communities based on building a community with 6 MPI (total of 72 MPI). 1 MPI consists of 24 threads. The calculation time was about 100 minutes. {\sc xTAPP} was used for band calculation.

\vspace{2mm}\hrule
\begin{verbatim}
&param_chiqw 
flg_cRPA=1,       !Constrained RPA option (0: normal RPA, 1: constrained RPA)
MPI_num_qcomm=12/ !Total number of MPI communities

&param_wannier 
N_wannier=2,                    !Number of Wannier functions you want to calculate
Lower_energy_window=2.7d0,      !エLower limit of energy window (eV)
Upper_energy_window=4.5d0,      !Upper limit of energy window (eV)
FLG_BMAT=1,                     !0:BMAT=unit matrix, 1:reading BMAT    
N_initial_guess=6/              !Number of initial Gaussian
px 0.20 0.26635 0.45950 0.44800 !px@central site of TMTSF molecule #1
py 0.20 0.26635 0.45950 0.44800 !py@central site of TMTSF molecule #1
pz 0.20 0.26635 0.45950 0.44800 !pz@central site of TMTSF molecule #1
px 0.20 0.73365 0.54050 0.55200 !px@central site of TMTSF molecule #2
py 0.20 0.73365 0.54050 0.55200 !py@central site of TMTSF molecule #2
 0.9995851478  0.0000000000     !B_MAT(ig=1,iw=1:2)
 0.0012540916  0.0000000000     !B_MAT(ig=2,iw=1:2)
-0.0287742877  0.0000000000     !B_MAT(ig=3,iw=1:2)
 0.0000000000  0.9996715835     !B_MAT(ig=4,iw=1:2)
 0.0000000000 -0.0140153561     !B_MAT(ig=5,iw=1:2)
 0.0000000000 -0.0214544857     !B_MAT(ig=6,iw=1:2)

&param_interpolation   
N_sym_points=5/   !Total number of symmetric k points in calculation lines
0.000 0.500 0.000 !Symmetric k point; SK_sym_pts(1:3,1); Y
0.000 0.000 0.000 !Symmetric k point; SK_sym_pts(1:3,1); G
0.500 0.000 0.000 !Symmetric k point; SK_sym_pts(1:3,1); X
0.500 0.500 0.000 !Symmetric k point; SK_sym_pts(1:3,1); M 
0.000 0.000 0.000 !Symmetric k point; SK_sym_pts(1:3,1); G

&param_visualization   
/

&param_calc_int 
/
\end{verbatim}
\hrule

\clearpage 

\section{\label{bulkjob}Chiqw calculation with specifying q points} 

Below is the input for executing the \verb+chiqw+ calculation by specifying the calculation $q$ point. In this case, we set the variable \verb+flg_calc_type=2+ in the namelist \verb+&param_chiqw+. We enumerate the number of \verb+q+ points we want to calculate under the namelist, with \verb+5+ as the total number of $q$ points we want to compute (\verb+n_calc_q=5+). Note that this number is along the sequence of \verb+k+ points in the file \verb+dat.sample-k+ containing irreducible \verb+k+ point vectors. In this example, five $q$ points 4, 8, 14, 22, and 27 are calculated.

\vspace{3mm}\hrule
\begin{verbatim}
&param_chiqw 
flg_calc_type=2, !0:all-q-calc, 1:gamma-only, 2:bulkjob mode 
n_calc_q=5/      !Total number of q points to calculate
4 8 14 22 27     !Numbers of q points to be calculated
\end{verbatim}
\hrule\vspace{3mm}

\section{\label{select-wannier}Wannier calculation with specifying realspace orbitals} 

Below is the input for executing the \verb+wannier+ calculation by specifying the realspace Wannier function. In this case, in the namelist \verb+&param_visualization+, we set the variable \verb+N_write_wannier+ to the number you want to find. Under this designation, we list the number of the Wannier function you want to obtain below the namelist. In this example, the 1st, 5th and 8th Wannier functions are subject to realspace Wannier calculation.

\vspace{3mm}\hrule
\begin{verbatim}
&param_visualization 
N_write_wannier=3/ !Total number of realspace Wannier functions you want to calculate
1 5 8              !Number of the realspace Wannier function you want to calculate
\end{verbatim}
\hrule\vspace{3mm}


\clearpage 

\section{\label{fileformat}File format (reading format)} 

\begin{enumerate}
\item \verb+dat.bandcalc+ (Band calculation information)
\begin{verbatim}
OPEN(117,FILE='./dir-wfn/dat.bandcalc') 
read(117,*) Ecut_for_psi !Wavefunction cutoff energy (Ry) real(8)
read(117,*) FermiEnergy  !Fermi energy (au) real(8)
read(117,*) Etot         !Total energy (au) real(8) 
\end{verbatim}
\item \verb+dat.sample-k+ [Sample k point vector (irreducible k point)] 
\begin{verbatim}
OPEN(101,FILE='./dir-wfn/dat.sample-k') 
read(101,*) Nk_irr !Total number of irreducible k point integer
do ik=1,Nk_irr 
 read(101,*) (SKI(i,ik),i=1,3) !Irreducible k point vector real(8)
enddo 
\end{verbatim}
\item \verb+dat.eigenvalue+ [Band energy (irrelevant k points)]
\begin{verbatim}
OPEN(111,FILE='./dir-wfn/dat.eigenvalue') 
rewind(111)
read(111,*) NBAND !Number of bands
do ik=1,Nk_irr 
 do ib=1,NBAND 
  read(111,*) E_EIGI(ib,ik) !Band energy (au) (au) real(8)
 enddo 
enddo      
\end{verbatim}
\item \verb+dat.nkm+ [Expanded G number (irreducible k point)]
]
\begin{verbatim}
OPEN(132,FILE='./dir-wfn/dat.nkm-nw') 
rewind(132)
do ik=1,Nk_irr 
 read(132,*) NGI(ik) !Expanded G number integer
enddo  
\end{verbatim}
\item \verb+dat.kg+ [Expanded G vector (irreducible k point)]
\begin{verbatim}
OPEN(104,FILE='./dir-wfn/dat.kg')
do ik=1,Nk_irr 
 read(104,*) NG_for_psi !Expansion G number at ik point integer
 do ig=1,NG_for_psi 
  read(104,*) (KGI(i,ig,ik),i=1,3) !Expansion G vector at irreducible ik point integer
 enddo 
enddo 
\end{verbatim}
 
\vspace{3cm}

\item \verb+dat.wfn+ [Wavefunction (irreducible k point)] 
\begin{verbatim}
OPEN(102,FILE='./dir-wfn/dat.wfn',FORM='unformatted') 
read(102) ncomp !Number of components
do ik=1,Nk_irr  
 do ib=1,NBAND
  read(102)((C0(ic,i,ib,ik),ic=1,ncomp),i=1,NGI(ik))!Wave function complex (8)
 enddo 
enddo
!In the current version, only ncomp = 1 is supported

\end{verbatim}
\item \verb+dat.lattice+ (Lattice vector)
\begin{verbatim}
OPEN(105,FILE='./dir-wfn/dat.lattice') 
read(105,*) a1(1), a1(2), a1(3) !a1 vector in bohr units real(8)
read(105,*) a2(1), a2(2), a2(3) !a2 vector in bohr units real(8) 
read(105,*) a3(1), a3(2), a3(3) !a3 vector in bohr units real(8) 
\end{verbatim}
\item \verb+dat.symmetry+ (Symmetry, ++Expression that works in inverse space++)
\begin{verbatim}
OPEN(100,FILE='./dir-wfn/dat.symmetry') 
read(100,*) nsymq !Number of symmetry operation integer
read(100,*) nnp   !Partial translation integer
do iop=1,nsymq 
 read(100,*) ((rg(i,j,iop),i=1,3),j=1,3) !Rotation symmetry integer
 read(100,*) (pg(i,iop),i=1,3)           !Partial translational symmetry integer 
enddo 
\end{verbatim}
%!波動関数データ`C0' はバンド分割され, 親が子に配る量だけ読み, 配る
%!C0＝`OCC' (占有) or `VIR' (非占有) 

%\item ++++破棄++++ \verb+dat.sample-q+ (計算q点ベクトル) 
%\begin{verbatim}
%OPEN(127,FILE='./dir-wfn/dat.sample-q')
%read(127,*) Nq_irr !既約q点数 integer 
%do iq=1,Nq_irr !誘電関数を計算したいq点総数 (input.in参照)
% read(127,*) (SQ(i,iq),i=1,3) !サンプルq点 real(8)
%enddo
%\end{verbatim}
%\item \verb+dat.wgrid+ (周波数グリッド)
%\item \verb+dat.epsqw.600+ (誘電関数データ)
%\item \verb+dat.epsqw.600***+ (各周波数の誘電行列対角要素)
%\item \verb+dat.bmat+ (初期ガウシアンのための線形結合係数) 
%\item \verb+dat.h_mat_r+ (実空間トランスファー行列)
%\item \verb+dat.iband+ (ワニエ内挿バンド)
%\item \verb+dat.umat+ (ユニタリー行列)
%\item \verb+dat.wan+ (ワニエ関数を平面波展開したときの展開係数)
%\item \verb+dat.wan-center+ (ワニエ関数の中心位置)
%\item \verb+dat.ns-nb+ (ワニエ関数計算で考慮したバンド情報)
%\item \verb+dat.wan-realspace.grd+ (実空間ワニエ関数)
%\item \verb+dat.Vmat+ (裸の直接積分)
%\item \verb+dat.VvsR+ ($V(r)$) 
%\item \verb+dat.Wmat+ (遮蔽直接積分)
%\item \verb+dat.WvsR+ ($W(r)$)
%\item \verb+dat.UvsE+ ($U(\omega)$)
%\item \verb+dat.Xmat+ (裸の交換積分) 
%\item \verb+dat.Jmat+ (遮蔽交換積分) 
%\item \verb+dat.JvsE+ ($J(\omega)$) 
\end{enumerate}

\clearpage 

\section{\label{license}License} 

The program package and source code of this software package are distributed pursuant to GNU General Public License version 3 (GPL v3).

\section{\label{howtocite}How to quote} 

When quoting {\sc RESPACK}, it would be appreciated if you could quote the following papers: 
\begin{enumerate} 
\item K. Nakamura, Y. Nohara, Y. Yoshimoto, Y. Nomura, Phys. Rev. B {\bf 93}, 085124 (2016).　
\item K. Nakamura, Y. Yoshimoto, T. Kosugi, R. Arita, M. Imada, J. Phys. Soc. Jpn {\bf 78}, 083710 (2009).
\item K. Nakamura, R. Arita, M. Imada, J. Phys. Soc. Jpn {\bf 77}, 093711 (2008).
\item Y. Nohara, S. Yamamoto, T. Fujiwara, Phys. Rev. B {\bf 79}, 195110 (2009).
\item T. Fujiwara, S. Yamamoto, Y. Ishii, J. Phys. Soc. Jpn. {\bf 72}, 777 (2003).
\end{enumerate} 

\end{document}

\subsection{xTAPP} 

以下が Al の \verb+xTAPP+ バンド計算を実施するためのインプットファイル \verb+Al.cg+ である. \verb+xTAPP+ バンド計算のインプットは, \verb+#+ で始まるセクションの集合で構成される. 入力データの種類ごとにセクションが設けられている. 各セクションを構成する入力データ群は, Fortran のネームリスト形式で読み込まれるものや, 標準形式で読みこまれるものがある. \verb+&+で始まる行がネームリスト名に対応する. このインプットでは, 必要な変数のみ提示しており, デフォルト指定されるものは書かれていない. 変数が左に, 簡単な説明が右の \verb+!+ 以降にある. 下は, $7\times7\times7$ $k$点サンプリング, 波動関数のカットオフが36 Ry, 計算バンドの数が50という条件での Alバンド計算のインプットでがある.
\vspace{5mm}\hrule
\begin{verbatim}
# main data                    !必ず, #の後に一マスあけること
&tappinput
 lattice_factor = 7.60         !格子定数の参照値 (au)
 lattice_list = 0.5, 0.5, 0.0, !格子ベクトル
                0.0, 0.5, 0.5, !格子ベクトル
                0.5, 0.0, 0.5, !格子ベクトル
 cutoff_wave_function = 6.0,   !平面波カットオフエネルギー (Ry) の平方根
 number_element = 1,           !元素数
 number_atom = 1,              !原子数
 number_band = 50,             !計算バンドの総数
 store_wfn = 1,                !波動関数の出力有無
 initial_lpt = 0,              !初期ポテンシャルの読込有無 (0:読まない) 
 scf_converge = 1.0E-015,      !計算の収束閾値
 xc_type = PBE,                !交換相関汎関数の種類
 elec_kbt=0.01,                !金属計算時に導入されるスメアリング (au)
 control_uptime = 3600/        !計算時間の上限 (sec) 

# atom data                   
 3 13                          !価電子数, 原子番号
 1 0.000  0.000  0.000         !原子種, 位置(格子座標系) 

# k-points data
&smpl_kpt
 dos_mode = METHFESSEL_PAXTON, !状態密度の計算法
 bz_number_tile = 1,           !k点サンプリングのためのパラメータ1
 bz_mesh = 14/                 !k点サンプリングのためのパラメータ2
 8 8 8                         !k点サンプリングのためのパラメータ3
 2 2 2                         !k点サンプリングのためのパラメータ4

# symmetry data
&SYMMETRY
 SYMMETRY_FORMAT = reciprocal,       !回転行列・部分並進ベクトルの記述形式
 NUMBER_SYM_OP = 24/                 !対称性の数/
 1  0  0  0  1  0  0  0  1   0  0  0 !回転対称性行列, 部分並進ベクトル
 0  1  0  0  0  1  1  0  0   0  0  0
 0  0  1  1  0  0  0  1  0   0  0  0
 1  0  0  0  0  1  0  1  0   0  0  0
 0  0  1  0  1  0  1  0  0   0  0  0
 0  1  0  1  0  0  0  0  1   0  0  0
-1 -1 -1  0  1  0  0  0  1   0  0  0
-1 -1 -1  0  0  1  0  1  0   0  0  0
-1 -1 -1  1  0  0  0  0  1   0  0  0
-1 -1 -1  0  0  1  1  0  0   0  0  0
-1 -1 -1  1  0  0  0  1  0   0  0  0
-1 -1 -1  0  1  0  1  0  0   0  0  0
 0  1  0 -1 -1 -1  0  0  1   0  0  0
 0  0  1 -1 -1 -1  0  1  0   0  0  0
 1  0  0 -1 -1 -1  0  0  1   0  0  0
 0  0  1 -1 -1 -1  1  0  0   0  0  0
 1  0  0 -1 -1 -1  0  1  0   0  0  0
 0  1  0 -1 -1 -1  1  0  0   0  0  0
 0  1  0  0  0  1 -1 -1 -1   0  0  0
 0  0  1  0  1  0 -1 -1 -1   0  0  0
 1  0  0  0  0  1 -1 -1 -1   0  0  0
 0  0  1  1  0  0 -1 -1 -1   0  0  0
 1  0  0  0  1  0 -1 -1 -1   0  0  0
 0  1  0  1  0  0 -1 -1 -1   0  0  0

# file map data
&filemap
 basename = 'Al',    !物質名
 number_PP_file = 1/ !擬ポテンシャルの総数
 ps-Al ps-Al.ichr    !擬ポテンシャル名

# struct_opt data 
&struct_opt
number_cycle = 0/    !構造最適化の有無 (0: 行わない)

# str_opt_constr data
 1                   !構造最適化設定1: 逆質量テンソル設定1
 0                   !構造最適化設定2: 逆質量テンソル設定2

# trace band data
&trace_band
 number_band = 50,             !計算バンド数
 number_trace_block = 4/       !バンド分散を構成する区間の数
   L     G     X     W     L   !対称k点ラベル
 0.500 0.000 0.500 0.500 0.500 !対称k点のb1成分; ak(1,iblk) 
 0.500 0.000 0.000 0.250 0.500 !対称k点のb2成分; ak(2,iblk)
 0.500 0.000 0.500 0.750 0.500 !対称k点のb3成分; ak(3,iblk)
      30    30    30    30     !対称k点間の分割数
\end{verbatim}
\hrule\vspace{5mm}

インプットは8つのセクションからなっている. 以下各セクションについて説明する. 

\begin{enumerate} 
\item main data セクション

このセクションはバンド計算に必要なパラメータを記述する. ネームリスト \verb+&tappinput+ 以下に各パラメータが並ぶ. 本計算では, 面心立法格子 (fcc) のブラベー格子がとられている (\verb+lattice_list=0.5, 0.5, 0.0, 0.0, 0.5, 0.5, 0.5, 0.0, 0.5+). 計算バンド数は 50 バンドとなっている (\verb+number_band=50+). この計算では, ユニットセル内の電子数は 3 なので, 占有バンド数は大体 2-3 であるが, 後に続く分極計算の精度のため, 非占有バンドを含めて 50 とっている. 波動関数の収束精度は, 後に続く \verb+RESPACK+ 計算の精度 (例えばワニエ関数の対称性等) に影響することがあるので, バンド計算の収束は厳しくとっておいた方がよい (\verb+scf_converge=1.0E-015+). 

\item atom data セクション

このセクションは原子の電荷および位置情報を記述する. 標準入力形式が用いられる. 

\item k-points data セクション

このセクションは計算 $k$ 点の設定を記述する. ネームリスト \verb+&smpl_kpt+ 以下に各パラメータが並ぶ. 今回のパラメータ設定では, $7\times7\times7$ $k$ 点サンプリング (Monkhorst-Pack メッシュ) が採られる. 記述形式の詳細は \verb+xTAPP+ 公式マニュアルに譲る. \verb+dos_mode+ は電子密度を計算するためのアルゴリズムを指定する. アルミニウムのような金属では, Methfessel-Paxton 法が通常採用される (\verb+dos_mode=METHFESSEL_PAXTON+). Methfessel-Paxton 方で用いられるスメアリング値は, \verb+main data+ セクションで設定される (\verb+elec_kbt=0.01+) 

\item symmetry data セクション

このセクションは系の対称性を記述する. ネームリスト \verb+&symmetry+ 以下に各パラメータが並ぶ. fcc では24個の空間対称性がある (\verb+NUMBER_SYM_OP=24+). 時間反転対称性もデフォルトで課される. 対称操作を施す前の $k$ 点 ({\bf k}) と施した後の $k$ 点 ({\bf k'}) には以下の関係がある: 
\begin{eqnarray}
{\bf k'}={\bf R k}+{\bf T} 
\end{eqnarray} 
ここで, {\bf R}は $3\times3$ の回転行列, {\bf T}は部分並進ベクトルであり, {\bf k'} が \verb+k-points data+ セクションで生成された Monkhorst-Pack メッシュ上になければエラーとなる. この過程を経て, 既約 $k$ 点が選定される. 今回の計算の場合は, 20点である. なお, \{{\bf R}\} と \{{\bf T}\} 自体は \verb+xTAPP+ のユーティリティファイル \verb+sym2xti.py+ で作成できるので, 自ら設定する必要はない. 詳細は公式マニュアルに譲る. 

\item file map data セクション

このセクションは擬ポテンシャル情報を記述する. ネームリスト \verb+&filemap+ 以下に必要情報が並ぶ. \verb+ps-Al+ と \verb+ps-Al.ichr+ が計算に使用される擬ポテンシャルで \verb+xTAPP+ の擬ポテンシャルライブラリから採った. 


\item struct\_opt data セクション

\item str\_opt\_constr data セクション


\item trace band data セクション

このセクションはバンド計算終了後にバンド分散を描くための情報を記述する. ネームリスト \verb+&trace_band+ 以下に必要情報が並ぶ. このインプットでは \verb+L+ $\to$ $\Gamma$ $\to$ \verb+X+ $\to$ \verb+W+ $\to$ \verb+L+ のラインでバンド分散が描かれる. 
\end{enumerate} 

\subsection{\label{job-xtapp}ジョブの実行}

\subsubsection{cgmrpt (バンド計算)}  

\verb+xTAPP+ バンド計算は以下のように実行する. sh系での入力コマンドは
\vspace{5mm}\hrule
\begin{verbatim}
> ln -s Al.cg fort.10 
> ls 
inipot cgmrpt Al.cg fort.10 ps-Al ps-Al.ichr 
> export OMP_NUM_THREADS=16
> export MKL_NUM_THREADS=16
> mpirun -x OMP_NUM_THREADS -x MKL_NUM_THREADS -np 6 ./inipot > LOG.INIPOT 
> mpirun -x OMP_NUM_THREADS -x MKL_NUM_THREADS -np 6 ./cgmrpt > LOG.CGMRPT  
\end{verbatim}
\hrule\vspace{5mm}
計算前に, インプットファイルを \verb+fort.10+ にリンクする必要があることに注意されたい. \verb+inipot+と \verb+cgmrpt+ が \verb+xTAPP+ バンド計算実行ファイルである (\verb+inipot+ が計算前処理, \verb+cgmrpt+ がバンド計算本体に相当する). これらの実行ファイルについては \verb+xTAPP+ 公式マニュアルに譲る. カレントディレクトリに置かれた \verb+Al.cg+ のもと, ジョブは実行される. このジョブはハイブリッド並列ジョブである (各MPIプロセスが 16 スレッドからなり, 6 MPIプロセスにて実行される). 計算の標準出力 (標準出力はMPIのマスターが担当する) は \verb+LOG.INIPOT+ および \verb+LOG.CGMRPT+ に出力される. 

\subsubsection{\label{vbpef}vbpef (バンド分散曲線の描画)}  
バンド計算が正常終了すると, 収束一体ポテンシャルが得られる. この収束ポテンシャルのもとで, バンド分散が計算される. この計算では, 収束ポテンシャルが読みこまれるので, 先に示した \verb+Al.cg+ の \verb+main data+ セクションの変数 \verb+initial_lpt+ を \verb+0+ から \verb+1+ に修正する. 
\vspace{5mm}\hrule
\begin{verbatim}
# main data   
&tappinput
 ・・・
 initial_lpt = 1, !初期ポテンシャルの読みこみ有無 (1:読みこむ) 
 ・・・
\end{verbatim}
\hrule\vspace{5mm}
その後, バンド分散を描くためのジョブ (\verb+vbpef+) を実行する. この実行ファイルについても \verb+xTAPP+ 公式マニュアルに譲る. 
\vspace{5mm}\hrule
\begin{verbatim}
> export OMP_NUM_THREADS=16
> export MKL_NUM_THREADS=16
> mpirun -x OMP_NUM_THREADS -x MKL_NUM_THREADS -np 6 ./inipot > LOG.INIPOT 
> mpirun -x OMP_NUM_THREADS -x MKL_NUM_THREADS -np 6 ./vbpef > LOG.VBPEF   
\end{verbatim}
\hrule\vspace{5mm}
\verb+RESPACK+ 計算においては, 誘電関数計算 (\verb+chiqw+) にせよ, ワニエ関数計算 (\verb+wannier+) にせよ, バンド分散データに基づいてインプットパラメータを設定する必要があるので, バンド分散曲線計算の正常稼働によく注意されたい. 
