aiidateam / qe-tools

A set of useful tools for Quantum ESPRESSO
MIT License
28 stars 13 forks source link

Problem when encountering comments #18

Closed giovannipizzi closed 5 years ago

giovannipizzi commented 5 years ago

In the following file:

&control
    pseudo_dir  = 'pseudo/'
    calculation = 'scf',
    prefix = 'Si_exc1',
 /
 &system
    ibrav = 0
    ! ibrav =  -3, 
    celldm(1) = 20.385647759,   
    nat =  1,
    ntyp = 1,
    ecutwfc = 30
 /
 &electrons
 /

ATOMIC_SPECIES
 Si 28.086  Si.pbe-n-rrkjus_psl.1.0.0.UPF

ATOMIC_POSITIONS {bohr}
Si    0. 0. 0.

CELL_PARAMETERS {alat}
-1.0 1.0 1.0
 1.0 -1.0 1.0
 1.0 1.0 -1.0

K_POINTS {automatic}
  6 6 6 1 1 1

if I run

import os, qe_tools

s = qe_tools.PwInputFile(os.path.abspath(FILENAME))

print("With comment:")
for v in s.get_structure_from_qeinput()['cell']:
    print(v)

I get:

With comment:
[-5.393810088203304, 5.393810088203304, 5.393810088203304]
[5.393810088203304, -5.393810088203304, 5.393810088203304]
[5.393810088203304, 5.393810088203304, -5.393810088203304]

If I instead remove the comments, I get:

Without comment:
[-10.787620176406609, 10.787620176406609, 10.787620176406609]
[10.787620176406609, -10.787620176406609, 10.787620176406609]
[10.787620176406609, 10.787620176406609, -10.787620176406609]

I think the reason is that it is not ignoring the commented line (indeed, from the QE docs, we have for ibrav=-3:

          cubic I (bcc), more symmetric axis:
      v1 = (a/2)(-1,1,1), v2 = (a/2)(1,-1,1),  v3 = (a/2)(1,1,-1)

from which the factor 1/2 between the two cases comes.

giovannipizzi commented 5 years ago

Released 1.1.2 (FYI @lekah) with this bug fix Pinging also @sphuber and @borellim (todo: remember to upgrade dependencies in aiida-quantuemespresso if a specific version is "frozen", or maybe change them to say anything of the form 1.1.x is fine - I don't remember what we do now)