Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sidy1073662254 opened this issue Sep 1, 2024 · 1 comment

Comments

@sidy1073662254
Copy link

sidy1073662254 commented Sep 1, 2024

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
Copy link
Contributor

k-ido commented Sep 30, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants