Page 1 of 1

How to add blank lines to the output of o-gw*.qp

Posted: Wed Dec 24, 2025 1:05 pm
by lyzhao
Dear all,
Could you tell me how to modify the src file (may be QP_of.F) to add blank lines to the output of o-gw*.qp at each k point.
that is, change from

Code: Select all

#    K-point            Band               Eo [eV]              E-Eo [eV]          Sc|Eo [eV]
#
        1                  1                 -17.93766            -9.933513           1.090004
        1                  2                 -5.390117            -4.946246           1.058876
        1                  3                 -1.386996            -4.484918           0.937772
        1                  4                -1.386987            -4.485260           0.937435
        1                  5                 4.584253             1.216447          -0.998785
        2                  1                 -15.99499            -9.029319           1.115146
        2                  2                 -7.015398            -5.931352           0.997163
        2                  3                 -3.698058            -5.000331           0.962454
        2                  4                -2.683181            -4.019266           0.970213
        2                  5                 7.088098             4.239224          -0.944775
        3                  1                 -14.27528            -8.886320           1.092589
        3                  2                 -8.099078            -5.859301           1.017284
        3                  3                 -7.270516            -6.156611           1.005850
        3                  4                 0.000000            -3.507087           0.917450
        3                  5                 4.633116             4.356365          -0.910707
to

Code: Select all

#    K-point            Band               Eo [eV]              E-Eo [eV]          Sc|Eo [eV]
#
        1                  1                 -17.93766            -9.933513           1.090004
        1                  2                 -5.390117            -4.946246           1.058876
        1                  3                 -1.386996            -4.484918           0.937772
        1                  4                -1.386987            -4.485260           0.937435
        1                  5                 4.584253             1.216447          -0.998785
        add the blank line
        2                  1                 -15.99499            -9.029319           1.115146
        2                  2                 -7.015398            -5.931352           0.997163
        2                  3                 -3.698058            -5.000331           0.962454
        2                  4                -2.683181            -4.019266           0.970213
        2                  5                 7.088098             4.239224          -0.944775
        add the blank line
        3                  1                 -14.27528            -8.886320           1.092589
        3                  2                 -8.099078            -5.859301           1.017284
        3                  3                 -7.270516            -6.156611           1.005850
        3                  4                 0.000000            -3.507087           0.917450
        3                  5                 4.633116             4.356365          -0.910707
best regards.

Re: How to add blank lines to the output of o-gw*.qp

Posted: Wed Dec 24, 2025 9:47 pm
by Davide Sangalli
Something along these lines

Code: Select all

  ik_ref=0
  !
  do i_qp=1,QP_n_states
     !
     if ( QP_table(i_qp,3)/=ik_ref) then
        ik_ref=QP_table(i_qp,3)
        call msg('o '//what,"","")
     endif
     !                                                                  
     ! Fill the COL type with values                                    
     !===============================                                   
     call OUTPUT_driver(what,TITLES=(/"K-point","Band   "/),I_VALUES=(/QP_table(i_qp,3),QP_table(i_qp,1)/))

Re: How to add blank lines to the output of o-gw*.qp

Posted: Fri Jan 02, 2026 10:47 am
by Daniele Varsano
Dear Youzhao,

the lines indicated by Davide are found in:
.src/qp/QP_of.F

alternatively, you can post-process the output with an external bash/python/your_favourite script.

Best,

Daniele