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
91 stars 25 forks source link

Use a random phase initial state when calculating dynamical Green’s functions #181

Open sidy1073662254 opened 1 month ago

sidy1073662254 commented 1 month ago

Hi, dear developers,

Recently, I used HPhi to calculate a two-dimensional Hubbard model. I have calculated its ground energy and eigenvector. Next, I want to claculate the dynamical Green’s functions, such as $<\psi |\frac{1}{H-E+i\eta}|\psi>$. And, I want to use a random phase initial state as $\psi$, such as 1/N{\exp(i\theta_1),\exp(i\theta_2),...}, where, \theta_1, \theta_2,... are random real number from 0 to 2\pi. And N is a normalization coefficient. How can I achieve this?

Thank you very much. YD Shen.

`import subprocess import math import sys import os

Set path(command) to Hphi

if len(sys.argv) == 2: path_to_HPhi = os.path.abspath(sys.argv[1]) else: print("Error") print("Usage: python do_all.py path_to_HPhi.") print("path_to_HPhi: relative or absolute path to HPhi.") exit(1)

################################# W=4########################### L=4############################ nelectrons=4#################### ################################

########################################################### f = open('StdFace.def','w') f.write('W = %i\n' % (W)) f.write('L = %i\n' % (L)) std_text = """model = "hubbard" method = "CG" lattice = "square" t = 1.0 U = 0.5 2Sz = 0 EigenvecIO = "out" """ f.write(std_text) f.write('nelec = %i' % (nelectrons)) f.close() ###########################################################

subprocess.call([path_to_HPhi,'-sdry','StdFace.def']) subprocess.call([path_to_HPhi,'-e','namelist.def'])`

k-ido commented 6 days ago

Sorry for our late reply. We do not implement the generator of such an initial vector. If you want to generate random phase states using HPhi, please modify MakeIniVec.c.

Another option is to make a script for generating initial states you want. The file format for a wavefunction in HPhi is introduced in the following page. http://issp-center-dev.github.io/HPhi/manual/master/en/html/filespecification/outputfiles_en/eigenvec_en.html