Skip to content

Commit

Permalink
doc/: Modify description of restart vector (binary file).
Browse files Browse the repository at this point in the history
 CalcByLOBPCG.c: Output vectors with separated files.
  • Loading branch information
mitsuaki1987 committed Aug 2, 2017
1 parent afc8c32 commit add2882
Show file tree
Hide file tree
Showing 3 changed files with 168 additions and 155 deletions.
122 changes: 61 additions & 61 deletions doc/en/chap04_en.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3809,35 +3809,28 @@ \subsubsection{File name}
\#\# indicates [string02] in a ModPara file, \&\& is the number of eigenvalues, and \$\$ is a number of rank.

\subsubsection{File format}
\begin{itemize}
\item Line 1: $[$int01$]$
\item Line 2: $[$int02$]$
\item Line 3 - $[$int02$]$+3: $[$double01$]$~~$[$double02$]$.
\end{itemize}

\subsubsection{Parameters}
\begin{itemize}

\item $[$int01$]$

{\bf Type :} Int

{\bf Description :} The total number of targets of the Hilbert spaces.

\item $[$int02$]$

{\bf Type :} Long Int

{\bf Description :} { The number of Lanczos steps.}

\item $[$double01$]$, $[$double02$]$

{\bf Type :} double

{\bf Description :} The value of eigenvectors. $[$double01$]$ is a real part and $[$double02$]$ is an imaginary part.
The fist component is not used for calculation.\\
This file is written through the following source code
(a little different fron the actual $\HPhi$ source).
\\
\begin{minipage}{15cm}
\begin{screen}
\begin{verbatim}
fp = fopen("zvo_eigenvec_0_rank_0.dat", "wb");
fwrite(&number_of_interations, sizeof(int), 1,fp);
fwrite(&local_size, sizeof(unsigned long int),1,fp);
fwrite(&eigen_vector[0], sizeof(complex double),local_size+1, fp);
fclose(fp);
\end{verbatim}
\end{screen}
\end{minipage}
where \verb|number_of_interations| is the number of iterations,
\verb|local_size| is the size of eigenvector
(if MPI is used, it differs from the dimension of the Hilbert space),
\verb|eigen_vector| is the (complex) eigenvector.

\end{itemize}
{\bf Note: } The fist component of \verb|eigen_vector| (\verb|eigen_vector[0]|)
is not used for calculation.

\newpage
\subsection{{tmpvec.dat}}
Expand All @@ -3847,46 +3840,53 @@ \subsection{{tmpvec.dat}}
\subsubsection{File name}
\begin{itemize}
\item{Lanczos method: \#\#\_tmpvec\_rank\_\$\$.dat}
\item{TPQ method: \#\#\_tmpvec\_set\_\&\&\_rank\_\$\$.dat} .
\item{TPQ and LOBPCG method: \#\#\_tmpvec\_set\_\&\&\_rank\_\$\$.dat} .
\end{itemize}
\#\# indicates [string02] in a ModPara file, and \$\$ is the number of rank. \&\& is the sampling number for the TPQ calculation.
\#\# indicates [string02] in a ModPara file, and \$\$ is the number of rank.
\&\& is the sampling number for the TPQ calculation.

\subsubsection{File format}
\begin{itemize}
\item Line 1: $[$int01$]$
\item Line 2: $[$int02$]$
\item Lines 3 - 3+$[$int01$]$: $[$double01$]$~~$[$double02$]$
\item Lines 4+$[$int01$]$ - 4+2$\times[$int01$]$: $[$double03$]$~~$[$double04$]$.
\end{itemize}

\subsubsection{Parameters}
\begin{itemize}

\item $[$int01$]$

{\bf Type :} Int

{\bf Description :} { The number of Lanczos (TPQ) steps for the Lanczos (TPQ) method.}

\item $[$int02$]$

{\bf Type :} Long Int

{\bf Description :} The total number of targets of the Hilbert spaces.

\item $[$double01$]$, $[$double02$]$

{\bf Type :} double

{\bf Description :} The coefficient of the vector $\vec{v}_{k+1}$ in Eq.~(\ref{eq: LanczosVector}) for the Lanczos method ($\vec{y}_{k+1}$ in Eq~.(\ref{eq: TPQVector}) for the TPQ method). $[$double01$]$ is a real part and $[$double02$]$ is an imaginary part. The fist component is not used for calculation.

\item $[$double03$]$, $[$double04$]$
This file is written through the following source code
(a little different fron the actual $\HPhi$ source).

{\bf Type :} double

{\bf Description :} The coefficient of the vector $\vec{v}_{k}$ in Eq.~(\ref{eq: LanczosVector}) for the Lanczos method ($\vec{y}_{k}$ in Eq~.(\ref{eq: TPQVector}) for the TPQ method). $[$double03$]$ is a real part and $[$double04$]$ is an imaginary part. The fist component is not used for calculation.\\
Lanczos
\\
\begin{minipage}{16cm}
\begin{screen}
\begin{verbatim}
fp = fopen("zvo_tmpvec_rank_0.dat", "wb");
fwrite(&number_of_interations, sizeof(int), 1,fp);
fwrite(&local_size, sizeof(unsigned long int),1,fp);
fwrite(&last_vector[0], sizeof(complex double),local_size+1, fp);
fwrite(&second_last_vector[0], sizeof(complex double),local_size+1, fp);
fclose(fp);
\end{verbatim}
\end{screen}
\end{minipage}

\end{itemize}
TPQ and LOBPCG
\\
\begin{minipage}{16cm}
\begin{screen}
\begin{verbatim}
fp = fopen("zvo_tmpvec_set_0_rank_0.dat", "wb");
fwrite(&number_of_interations, sizeof(int), 1,fp);
fwrite(&local_size, sizeof(unsigned long int),1,fp);
fwrite(&last_vector[0], sizeof(complex double),local_size+1, fp);
fclose(fp);
\end{verbatim}
\end{screen}
\end{minipage}
where \verb|number_of_interations| is the number of iterations,
\verb|local_size| is the size of eigenvector
(if MPI is used, it differs from the dimension of the Hilbert space),
\verb|last_vector| is the vector at the last iteration and
\verb|second_last_vector| is the vector at the second last iteration.

{\bf Note: } The fist component of \verb|last_vector| and \verb|second_last_vector|
(\verb|last_vector[0]| and \verb|second_last_vector[0]|)
are not used for calculation.

\newpage
\subsection{{DynamicalGreen.dat}}
Expand Down
117 changes: 57 additions & 60 deletions doc/jp/chap04_jp.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3772,35 +3772,27 @@ \subsubsection{ファイル名}
\#\#はModParaファイル内の[string02]で指定されるヘッダ、\&\&は固有値の番号、\$\$はランク番号を表します。

\subsubsection{ファイル形式}
\begin{itemize}
\item 1行目:$[$int01$]$
\item 2行目:$[$int02$]$
\item 3行目 - $[$int02$]$+3行: $[$double01$]$~~$[$double02$]$
\end{itemize}
\subsubsection{パラメータ}
\begin{itemize}

\item $[$int01$]$

{\bf 形式 :} int型

{\bf 説明 :} { 計算に要したLanczosステップ数を表します。}

\item $[$int02$]$

{\bf 形式 :} long int型

{\bf 説明 :} 計算対象のヒルベルト空間数を指定する整数。


\item $[$double01$]$, $[$double02$]$

{\bf 形式 :} double型

{\bf 説明 :} 固有ベクトルの値を表します。一番最初の成分に計算に使用しない値が入っています。\\
$[$double01$]$が実部、$[$double02$]$が虚部を表します。\\
\end{itemize}
次のようなソースコードを用いて、バイナリファイルとして出力されます
(実際の$\HPhi$のソースコードとは変数名等が異なります)。
\\
\begin{minipage}{15cm}
\begin{screen}
\begin{verbatim}
fp = fopen("zvo_eigenvec_0_rank_0.dat", "wb");
fwrite(&number_of_interations, sizeof(int), 1,fp);
fwrite(&local_size, sizeof(unsigned long int),1,fp);
fwrite(&eigen_vector[0], sizeof(complex double),local_size+1, fp);
fclose(fp);
\end{verbatim}
\end{screen}
\end{minipage}
ただし、\verb|number_of_interations|は反復回数、
\verb|local_size|は固有ベクトルのサイズ(MPI並列を使っている場合は全ヒルベルト次元とは異なります)、
\verb|eigen_vector|は複素固有ベクトルをそれぞれ表します。

\verb|eigen_vector|の一番最初の成分に計算に使用しない値が入っています。

\newpage
\subsection{{tmpvec.dat}}
\label{Subsec:restart}
Expand All @@ -3811,46 +3803,51 @@ \subsection{{tmpvec.dat}}
\subsubsection{ファイル名}
\begin{itemize}
\item{Lanczos法:\#\#\_tmpvec\_rank\_\$\$.dat}
\item{TPQ法:\#\#\_tmpvec\_set\_\&\&\_rank\_\$\$.dat}
\item{TPQ法, LOBPCG法\#\#\_tmpvec\_set\_\&\&\_rank\_\$\$.dat}
\end{itemize}
\#\#はModParaファイル内の[string02]で指定されるヘッダ、\$\$はランク番号を表します。また、\&\&はTPQ時のサンプリングの番号を表します。
\#\#はModParaファイル内の[string02]で指定されるヘッダ、
\$\$はランク番号を表します。また、\&\&はTPQ時のサンプリングの番号
もしくはLOBPCG法での固有値の番号を表します。

\subsubsection{ファイル形式}
\begin{itemize}
\item 1行目:$[$int01$]$
\item 2行目:$[$int02$]$
\item 3行目 - $[$int02$]$+3行: $[$double01$]$~~$[$double02$]$
\item 4行目 - 2$\times$$[$int02$]$+4行: $[$double03$]$~~$[$double04$]$
\end{itemize}
\subsubsection{パラメータ}
\begin{itemize}

\item $[$int01$]$

{\bf 形式 :} int型

{\bf 説明 :} { 計算に要したステップ数を表します。Lanczos法ではLanczosステップ数、TPQ法ではハミルトニアンを乗算した回数が出力されます。}
次のようなソースコードを用いて、バイナリファイルとして出力されます
(実際の$\HPhi$のソースコードとは変数名等が異なります)。

\item $[$int02$]$

{\bf 形式 :} int型

{\bf 説明 :} 計算対象のヒルベルト空間数を指定する整数。

\item $[$double01$]$, $[$double02$]$

{\bf 形式 :} double

{\bf 説明 :} Lanczos法の場合は Eq.~(\ref{eq: LanczosVector})の$\vec{v}_{k+1}$、TPQ法の場合はEq~.(\ref{eq: TPQVector})の$\vec{y}_{k+1}$がそれぞれ出力されます。 $[$double01$]$が実部、$[$double02$]$が虚部を表します。一番最初の成分に計算に使用しない値が入っています。\\

\item $[$double03$]$, $[$double04$]$

{\bf 形式 :} double

{\bf 説明 :} Lanczos法の場合は Eq.~(\ref{eq: LanczosVector})の$\vec{v}_{k}$、TPQ法の場合はEq~.(\ref{eq: TPQVector})の$\vec{y}_{k}$がそれぞれ出力されます。 $[$double01$]$が実部、$[$double02$]$が虚部を表します。一番最初の成分に計算に使用しない値が入っています。\\
Lanczos
\\
\begin{minipage}{16cm}
\begin{screen}
\begin{verbatim}
fp = fopen("zvo_tmpvec_rank_0.dat", "wb");
fwrite(&number_of_interations, sizeof(int), 1,fp);
fwrite(&local_size, sizeof(unsigned long int),1,fp);
fwrite(&last_vector[0], sizeof(complex double),local_size+1, fp);
fwrite(&second_last_vector[0], sizeof(complex double),local_size+1, fp);
fclose(fp);
\end{verbatim}
\end{screen}
\end{minipage}

TPQおよびLOBPCG
\\
\begin{minipage}{16cm}
\begin{screen}
\begin{verbatim}
fp = fopen("zvo_tmpvec_set_0_rank_0.dat", "wb");
fwrite(&number_of_interations, sizeof(int), 1,fp);
fwrite(&local_size, sizeof(unsigned long int),1,fp);
fwrite(&last_vector[0], sizeof(complex double),local_size+1, fp);
fclose(fp);
\end{verbatim}
\end{screen}
\end{minipage}
ただし、\verb|number_of_interations|は反復回数、
\verb|local_size|は固有ベクトルのサイズ(MPI並列を使っている場合は全ヒルベルト次元とは異なります)、
\verb|last_vector|は最後の反復でのベクトル、
\verb|second_last_vector|は最後から2番目の反復でのベクトルをそれぞれ表します。

\end{itemize}
\verb|last_vector|、\verb|second_last_vector|の一番最初の成分に計算に使用しない値が入っています。

\newpage
\subsection{{DynamicalGreen.dat}}
Expand Down
Loading

0 comments on commit add2882

Please sign in to comment.