issp-center-dev / HPhi

Quantum Lattice Model Simulator Package
https://www.pasums.issp.u-tokyo.ac.jp/hphi/en/
GNU General Public License v3.0
82 stars 25 forks source link

HPhi: not defined #144

Closed HamidArianZad closed 3 weeks ago

HamidArianZad commented 1 year ago

Hi, I have installed HPhi according to the steps:

tar xzvf HPhi-3.5.1.tar.gz
$ mkdir HPhi.build && cd HPhi.build
$ cmake ../HPhi-3.5.1/
$ make

Here is the result of make:

Scanning dependencies of target komega
[  4%] Built target komega
Consolidate compiler generated dependencies of target HPhi
[ 95%] Built target HPhi
Scanning dependencies of target greenr2k
[ 97%] Built target greenr2k
Scanning dependencies of target cTPQ
[100%] Built target cTPQ

But, whenever I want to run the code: HPhi -s stan1.in, I get below error:

HPhi: command not found

Could you please let me know what should I do more. Thanks!!

k-ido commented 1 year ago

After running make command, you can find an executable HPhi in build/src/ directory.

If you want to install HPhi to /usr/local/bin/ directory, please run the following command on the build directory: $ make install

HamidArianZad commented 1 year ago

Thank you for reply,

I run the command $ make install after all previous steps:

$ tar xzvf HPhi-3.5.1.tar.gz
$ mkdir HPhi.build && cd HPhi.build
$ cmake ../HPhi-3.5.1/
$ make

but I get below error:

$ make install
[  4%] Built target komega
[ 95%] Built target HPhi
[ 97%] Built target greenr2k
[100%] Built target cTPQ
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/bin/HPhi
CMake Error at src/cmake_install.cmake:52 (file):
  file INSTALL cannot copy file "/home/hamid/HPhi-3.5.1/src/HPhi" to
  "/usr/local/bin/HPhi": Permission denied.
Call Stack (most recent call first):
  cmake_install.cmake:47 (include)

make: *** [Makefile:110: install] Error 1

What else I should do?

mitsuaki1987 commented 1 year ago

By default, CMake tries to install HPhi into the directory /usr/local. However, general users do not have permission to modify that directory. Therefore, please install HPhi in another place by setting:

$ cmake ../HPhi-3.5.1/ -DCMAKE_INSTALL_PREFIX=$HOME
$ make
$ make install
HamidArianZad commented 1 year ago

Thank you very much! It works for me now.

Can I design my favorite spin models that are: diamond-like chain and two-leg ladder that include multiple exchange interactions (J1, J2, J3, J4) and mixed spin-1 and spin-3/2(2,5/2,...)? I aim to study their low-temperature magnetization. I would be thankful to you if let me know in which installed file I should manually change the pre-defined lattice and Hamiltonian to define my desired model.

k-ido commented 1 year ago

I'm sorry for my late reply.

Standard mode does not support spin systems with mixed different spins. If you want to solve systems which have not been predefined in Standard mode, please use Expert mode. The following pages in HPhi's manual may be helpful.

http://issp-center-dev.github.io/HPhi/manual/master/en/html/filespecification/expertmode_en/index_expertmode_en.html http://issp-center-dev.github.io/HPhi/manual/master/en/html/tutorial/expertmode_en.html

SuHang980715 commented 1 year ago

I think I meet a same problem: when I use:

$ tar xzvf HPhi-3.5.1.tar.gz $ mkdir HPhi.build && cd HPhi.build $ cmake ../HPhi-3.5.1/ -DCMAKE_INSTALL_PREFIX=$HOME $ make $ make install

then, I still meet the bugs:

HPhi: command not found

How should I do?

k-ido commented 1 year ago

@SuHang980715 Can you find an executable HPhi in build/src/ directory after running make command? If the HPhi exists in this directory, please use it.

SuHang980715 commented 1 year ago

OK, I find it. Now it could be run successfully, thanks you very much~~

SuHang980715 commented 1 year ago

$ tar xzvf HPhi-3.5.1.tar.gz $ mkdir HPhi.build && cd HPhi.build $ cmake ../HPhi-3.5.1/ - DENABLE _ MPI = OFF $ make

Hi, the above commands are which I used in installation. Now I want to reinstall HPhi due to some reasons, how should I do?

ultimatile commented 1 year ago

To reinstall, first, delete the build directory rm -r HPhi.build (perhaps rm -rf HPhi.build is better) and then, retry your build commands.

I recommend you make several build directories to try several build configurations. For example, one is built with MPI as

tar xzvf HPhi-3.5.1.tar.gz # once done, no need to repeat
mkdir HPhi.build_MPI && cd HPhi.build_MPI
cmake ../HPhi-3.5.1/ 
make

and the other is built without MPI as

tar xzvf HPhi-3.5.1.tar.gz # once done, no need to repeat
mkdir HPhi.build_NOMPI && cd HPhi.build_NOMPI
cmake ../HPhi-3.5.1/ -DENABLE_MPI=OFF
make

Then, you have two executables HPhi.build_MPI/src/HPhi and HPhi.build_NOMPI/src/HPhi.

SuHang980715 commented 1 year ago

Thanks for your suggestions~, and I found it was indeed useful for me. Besides, as I wrote in another issues, now I am trouble with how to output all the eigenvectors in HPhi in expert mode, FullDiagonalization mode (I have set OutputEigenVec=1 in Calcmod.def file, but it is not helpful). How should I deal with it?

ultimatile commented 1 year ago

Please do not mix the different issues. FullDiag mode does not seem to support outputting eigenvectors.

SuHang980715 commented 1 year ago

OK, thanks, let me find another way to solve my problem. Thanks for your nice help again!

SuHang980715 commented 1 year ago

Could I ask another question? As I said, I have installed it on my Ubuntu system by using this command:

$ tar xzvf HPhi-3.5.1.tar.gz $ mkdir HPhi.build && cd HPhi.build $ cmake ../HPhi-3.5.1/ - DENABLE _ MPI = OFF $ make

now if I want to introduce more code into HPhi source code (for example, add a printing of error or warning information), how should I do after modifying the source code of HPhi?

mitsuaki1987 commented 1 year ago

You should type

$ make

unless you add/remove source fie.

SuHang980715 commented 1 year ago

OK, thanks for your help~