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

ibrav > 1 not supported yet. #408

Open
francescomambretti opened this issue Jan 17, 2023 · 3 comments
Open

ibrav > 1 not supported yet. #408

francescomambretti opened this issue Jan 17, 2023 · 3 comments

Comments

@francescomambretti
Copy link

Dear developers/users, I am facing an issue while using dpdata on Quantum Espresso files.
I have scf0.in and scf0.out files in the same folder of my Python script with dpdata commands. More in detail, my script is a two-line code:
import dpdata
dataset = dpdata.LabeledSystem('./scf0.out',fmt='qe/pw/scf')

when I execute it, the following message is printed:
ibrav > 1 not supported yet.

In fact ibrav=8 in my input: is it forbidden? Am I doing anything wrong?

Thanks, best regards

@wanghan-iapcm
Copy link
Contributor

Hello,

You are not doing anything wrong, dpdata by far does not support the cases ibrav > 1. please see

dpdata/dpdata/qe/scf.py

Lines 30 to 52 in 2e148f2

if ibrav == 0:
for iline in lines:
if 'CELL_PARAMETERS' in iline and 'angstrom' not in iline.lower():
raise RuntimeError("CELL_PARAMETERS must be written in Angstrom. Other units are not supported yet.")
blk = get_block(lines, 'CELL_PARAMETERS')
for ii in blk:
ret.append([float(jj) for jj in ii.split()[0:3]])
ret = np.array(ret)
elif ibrav == 1:
a = None
for iline in lines:
line = iline.replace("=", " ").replace(",", "").split()
if len(line) >= 2 and "a" == line[0]:
#print("line = ", line)
a = float(line[1])
if len(line) >= 2 and "celldm(1)" == line[0]:
a = float(line[1])*bohr2ang
#print("a = ", a)
if not a:
raise RuntimeError("parameter 'a' or 'celldm(1)' cannot be found.")
ret = np.array([[a,0.,0.],[0.,a,0.],[0.,0.,a]])
else:
sys.exit('ibrav > 1 not supported yet.')

We are not expert in the QE package and the definition of ibrav is very complicated, so we are not confident in implementing the cases by ourselves. If you are willing to contribute, it is definitely welcome.

@francescomambretti
Copy link
Author

Hi, thanks for the reply. I have also just started with QE, so I am afraid that my contribution could be really poor, for the moment.
I have managed to accomplish the task I want with some bash code.
Thanks again

@wanghan-iapcm
Copy link
Contributor

I will keep this issue OPEN so anyone is able to contribute will see it.

@wanghan-iapcm wanghan-iapcm reopened this Jan 23, 2023
@njzjz njzjz added the qe label Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants