日本語 / English
This package provides the solver library based on Shifted-Krylov subspace method and the software to calculate dynamical Green function by inputting the Hamiltonian and the vector of the excited state.
-
Latest release
https://github.com/issp-center-dev/Komega/releases/download/v2.0.0/komega-2.0.0.tar.gz
-
Release note
https://github.com/issp-center-dev/Komega/releases/tag/v2.0.0
-
Other version
- Fortran compiler (gfortran 10, 11, or 12 recommended)
- BLAS library (reference BLAS or OpenBLAS)
- LAPACK library (Used in the sample program)
- MPI library (Optional)
- Autotools (autoconf, automake, libtool) for building from source
- Manual for the Library
- Manual for the sample program
GNU LESSER GENERAL PUBLIC LICENSE Version 3
The development of Kω is supported by “Project for advancement of software usability in materials science” of ISSP, The University of Tokyo.
(*) We hope that you cite the following paper and repository when you publish the results using Kω.
Papaer: : “Kω — Open-source library for the shifted Krylov subspace method of the form (zI−H)x=b”, Takeo Hoshi, Mitsuaki Kawamura, Kazuyoshi Yoshimi, Yuichi Motoyama, Takahiro Misawa, Youhei Yamaji, Synge Todo, Naoki Kawashima, Tomohiro Sogabe, Computer Physics Communications, Volume 258, January 2021, 107536. Repository: https://github.com/issp-center-dev/Komega
app/: The directory for the softwaresrc/: The source directory for the softwaresample/: The sample directoryShiftk.nb: The mathmatica note book to test the software (for developers)denovo/: Sample files not to input either Hamiltonian and the right-hand side initial vectorfrom_file/: Sample files to input both Hamiltonian and the right-hand side initial vector
doc/: The documents directory (only japanese, english version will be provided from ver.1.0)index.html: Top page for documentslibrary/: Directory for the document of the librariysoftware/: Directory for the document of the sample program
configure: Configuration script to buildsrc/: The source directory for the librariestest/: The test directory for the libraries
The simplest procedure is as follows:
$ ./configure --prefix=install_dir
$ make
$ make installwhere install_dir should be replaced with the full path of the directory where
the library will be stored.
The following objects are generated in the directory specified by install_dir:
- In
install_dir/lib/: Static and shared libraries (libkomega.a,libkomega.so) - In
install_dir/include/: Header file for C/C++ (komega.h) install_dir/bin/ShiftK.out: Sample program
# Configure with OpenBLAS
$ ./configure --prefix=install_dir --with-blas=openblas
# Configure with reference BLAS (default)
$ ./configure --prefix=install_dirFor more details, please see the manual.
$ cd app/sample/denovo/
$ install_dir/bin/ShiftK.out namelist.def lBiCG$ cd app/sample/from_file/
$ install_dir/bin/ShiftK.out namelist.def lBiCGWhen the software works well, the following files will be generated:
output/dynamicalG.dat: Dynamical Green's function dataoutput/ResVec.dat0: Residual vector dataoutput/TriDiagComp.dat: Tridiagonal components data
The details of the file format of namelist.def is written in the manual.
See the manual.
$ gfortran myprog.f90 -L install_dir/lib -lkomega -lblas -I install_dir/include
$ gcc myprog.c -L install_dir/lib -lkomega -lblas -I install_dir/include
etc.
Add the install_dir/lib directry to the environment
variable LD_LIBRARY_PATH to execute the file with dynamic link.
Move to the test/ directory and run the comprehensive test suite:
$ cd test/
$ make
$ ./run_tests.shYou can test individual solvers:
# Complex-Complex solver
$ ./solve_cc.x < complex_freq.in
# Real-Complex solver
$ ./solve_rc.x < complex_freq.in
# Complex-Real solver
$ ./solve_cr.x < real_freq.in
# Real-Real solver
$ ./solve_rr.x < real_freq.in
# QMR solvers
$ ./solve_rc_qmr1.x < real_freq.in
$ ./solve_rc_qmr2.x < real_freq.inThe parameters in krylov.in (you can modify the file name freely) are as follows:
ndim: The dimension of the pseudo Hamiltoniannl: This parameter is used to test the projection. The vectors are calculated from the target vector up tonl(<=ndim)th vector.nz: The number of the frequencies to calculate.itermax: The maximum number of iterations.threshold: The threshold to judge the convergence.rnd_seed: The seed of random number to generate pseudo Hamiltonian.- Write the value of each frequencies line by line after this namelist.
This project uses GitHub Actions for automated testing across multiple environments:
- Ubuntu 22.04: gfortran-10 (reference BLAS), gfortran-11 (OpenBLAS)
- Ubuntu Latest: gfortran-12 (OpenBLAS)
- Sample Applications: Denovo and from_file samples
- Library Tests: All solver algorithms (BiCG, COCG, CG, QMR)
- Compiler Compatibility: Multiple gfortran versions
- BLAS Libraries: Both reference BLAS and OpenBLAS
