2.4. Basic usage¶
HPhi++ has two modes: Standard mode and Expert mode. Here, the basic flows of calculations of the Standard and expert modes are shown.
2.4.1. Standard mode¶
The procedure of calculation through the standard mode is as follows:
- Create a directory for a calculation scenario
First, you create a working directory for the calculation.
- Create input files for Standard mode
In Standard mode, you can choose a model (the Heisenberg model, Hubbard model, etc.) and a lattice (the square lattice, triangular lattice, etc.) from those provided; you can specify some parameters (such as the first/second nearest neighbor hopping integrals and the on-site Coulomb integral) for them. Finally, you have to specify the numerical method (such as the Lanczos method) employed in this calculation. The input file format is described in How to use HPhi.
- Run
Run an executable
HPhi
in the terminal by setting option ”-s
” (or ”--standard
”) and the name of the input file written in the previous step.
- Serial/OpenMP parallel
$ Path /HPhi -s Input_file_name
- MPI parallel/ Hybrid parallel
$ mpiexec -np number_of_processes Path /HPhi -s Input_file_name
When you use a queuing system in workstations or super computers, sometimes the number of processes is specified as an argument for the job-submitting command. If you need more information, please refer to your system manuals. The number of processes depends on the target system of the models. The details of setting the number of processes are shown in Creating input files for Expert mode .
- Watch calculation logs
Log files are outputted in the “output” folder, which is automatically created in the directory for a calculation scenario. The details of the output files are shown in Output files .
- Results
If the calculation is completed normally, the result files are outputted in the “output” folder. The details of the output files are shown in Output files
Tip
export OMP_NUM_THREADS=16
2.4.2. Expert mode¶
- The calculation procedure for Expert mode is as follows.
- Create a directory for a calculation scenario
First, you create a directory and give it the name of a calculation scenario (you can attach an arbitrary name to a directory).- Create input files for Expert mode
For Expert mode, you should create input files for constructing Hamiltonian operators, calculation conditions, and a list file for the filenames of the input files (see the file formats shown in Input files for Expert mode).Note
A list file can be easily created by using Standard mode.- Run
Run HPhi++ in the terminal by setting option “
-e
” (or “--expert
”) and the file name of a list file.- Serial/OpenMP
$ Path/HPhi -e Input_List_file\_name
- MPI/Hybrid
$ mpiexec -np number_of_processes Path/HPhi -e Input_List_file_name
A number of processes depend on a target of system for models. The details of setting a number of processes are shown in Creating input files for Expert mode.- While running
Log files are outputted in the “output” folder which is automatically created in the directory for a calculation scenario. The details of the output files are shown in Output files.- Results
If the calculation is finished normally, the result files are outputted in the “output” folder. The details of the output files are shown in Output files.
2.4.3. Creating input files for Expert mode¶
This mode is for creating input files for Expert mode. A set of input files created using this mode gives a model provided in Standard mode. The usage is shown as follows.
Create an input file for Standard mode.
Setting an option “-sdry” and an input file (in this example, StdFace.def), run HPhi++.
$ Path/HPhi -sdry StdFace.defIn this case, you should not use MPI parallelization (mpirun, mpiexec, etc.).
The following files are created as the input files for Expert mode in the current working directory.
calcmod.def greentwo.def namelist.def zTrans.def greenone.def modpara.def zInterAll.def zlocspn.def
2.4.4. Setting the process number for MPI/hybrid parallelization¶
For using MPI/hybrid parallelization, the process number must be set as follows.
- Standard mode
- Hubbard/Kondo model
Whenmodel
in the input file for Standard mode is set as"Fermion Hubbard"
,"Kondo Lattice"
, or"Fermion HubbardGC"
, the process number must be equal to \(4^n\).
- Spin model
Whenmodel
in the input file for Standard mode is set as"Spin"
or"SpinGC"
, the process number must be equal to \((2S+1)^n\), where2S
is set in the input file (the default value is \(1\)).
- Expert mode
- Hubbard/Kondo model
When the model is selected as the Fermion Hubbard model or Kondo model by settingCalcModel
in a CalcMod file, the process number must be equal to \(4^n\). See CalcMod file for details of theCalcModel
file.
- Spin model
When the model is selected as the spin model by setting
CalcModel
in a CalcMod file, the process number is fixed by a LocSpin file. The process number must be equal to the number calculated by multiplying the state number of the localized spin (2S
+1) in descending order by the site number. See LocSpin file for details of the LocSpin file.For example, when a LocSpin file is given as follows, the process number must be equal to \(2=1+1,~6=2\times(2+1),~24=6\times(3+1)\).
================================ NlocalSpin 3 ================================ ========i_0IteElc_2S ====== ================================ 0 3 1 2 2 1
2.4.5. Printing version ID¶
By using the -v
option as follows, you can check which version of HPhi++ you are using.
$ PATH/HPhi -v