diagonal matrix elements of the velocity operator

Deals with issues related to computation of optical spectra in reciprocal space: RPA, TDDFT, local field effects.

Moderators: Davide Sangalli, andrea.ferretti, myrta gruning, andrea marini, Daniele Varsano, Conor Hogan

Post Reply
Xiaoming Wang
Posts: 67
Joined: Fri Dec 18, 2020 7:14 am

diagonal matrix elements of the velocity operator

Post by Xiaoming Wang » Wed Aug 11, 2021 5:06 pm

Hello,

In the ndb.dipoles dataset, the DIP_v only contains the off-diagonal matrix elements (i.e., <c|v^\hat|v>). Is it possible to calculate the diagonal matrix elements, i.e. <n|v^\hat|n>, n is any KS state and v^\hat is the velocity operator?

Best,
Xiaoming
Xiaoming Wang
The University of Toledo

User avatar
Daniele Varsano
Posts: 3810
Joined: Tue Mar 17, 2009 2:23 pm
Contact:

Re: diagonal matrix elements of the velocity operator

Post by Daniele Varsano » Wed Aug 11, 2021 6:24 pm

Dear Xiamong,

uncommenting the variable #DipBandsALL yambo will calculate all the dipoles matrix elements.
the variables appears building the input as:
./yambo -dipoles -V all


Best,
Daniele
Dr. Daniele Varsano
S3-CNR Institute of Nanoscience and MaX Center, Italy
MaX - Materials design at the Exascale
http://www.nano.cnr.it
http://www.max-centre.eu/

Xiaoming Wang
Posts: 67
Joined: Fri Dec 18, 2020 7:14 am

Re: diagonal matrix elements of the velocity operator

Post by Xiaoming Wang » Wed Aug 11, 2021 6:50 pm

Thanks Daniele, it works but some strange behavior results. I have 576 kpts (12*12*4), the first 44 kpts data are missing for DIP_v but not for DIP_iR.
E.g. using ncdump -v DIP_v ndb.dipoles, I got something like

Code: Select all

netcdf ndb {
dimensions:
        D_0000000003 = 3 ;
        D_0000000001 = 1 ;
        D_0000000002 = 2 ;
        D_0000000004 = 4 ;
        D_0000000011 = 11 ;
        D_0000000100 = 100 ;
        D_0000000032 = 32 ;
        D_0000000008 = 8 ;
        D_0000000576 = 576 ;
variables:
        float HEAD_VERSION(D_0000000003) ;
        float HEAD_REVISION(D_0000000001) ;
        float SERIAL_NUMBER(D_0000000001) ;
        float SPIN_VARS(D_0000000002) ;
        float HEAD_R_LATT(D_0000000004) ;
        float HEAD_WF(D_0000000001) ;
        float FRAGMENTED(D_0000000001) ;
        float TEMPERATURES(D_0000000002) ;
        float PARS(D_0000000011) ;
        char APPROACH(D_0000000001, D_0000000100) ;
        char KINDS(D_0000000001, D_0000000100) ;
        char WAVE_FUNC_XC(D_0000000001, D_0000000100) ;
        float DIP_iR(D_0000000001, D_0000000576, D_0000000008, D_0000000032, D_0000000003, D_0000000002) ;
        float DIP_P(D_0000000001, D_0000000576, D_0000000008, D_0000000032, D_0000000003, D_0000000002) ;
        float DIP_v(D_0000000001, D_0000000576, D_0000000008, D_0000000032, D_0000000003, D_0000000002) ;
data:

 DIP_v =
  _, _,
  _, _,
  _, _,
  _, _,
  _, _,
  _, _,
  _, _,
  _, _,
  _, _,
  _, _,
  _, _,
  _, _,
  _, _,
  _, _,

What's the possible reason of that?

Best,
Xiaoming
Xiaoming Wang
The University of Toledo

Xiaoming Wang
Posts: 67
Joined: Fri Dec 18, 2020 7:14 am

Re: diagonal matrix elements of the velocity operator

Post by Xiaoming Wang » Wed Aug 11, 2021 6:56 pm

Here is my report file

Code: Select all

     /$$     /$$ /$$$$$$  /$$      /$$ /$$$$$$$   /$$$$$$
    |  $$   /$$//$$__  $$| $$$    /$$$| $$__  $$ /$$__  $$
     \  $$ /$$/| $$  \ $$| $$$$  /$$$$| $$  \ $$| $$  \ $$
      \  $$$$/ | $$$$$$$$| $$ $$/$$ $$| $$$$$$$ | $$  | $$
       \  $$/  | $$__  $$| $$  $$$| $$| $$__  $$| $$  | $$
        | $$   | $$  | $$| $$\  $ | $$| $$  \ $$| $$  | $$
        | $$   | $$  | $$| $$ \/  | $$| $$$$$$$/|  $$$$$$/
        |__/   |__/  |__/|__/     |__/|_______/  \______/

         Version 5.0.3 Revision 19584 Hash 1cce2ba63
                          Branch is
            MPI+OpenMP+SLK+SLEPC+HDF5_MPI_IO Build
                  http://www.yambo-code.org

 08/11/2021 at 11:33 yambo @ r1i6n31
 ==================================================

 Cores-Threads       : 36(CPU)-1(threads)
 MPI Cores           :   36
 Threads per core    :  1
 Threads total       :   36
 Nodes Computing     :  1
 Nodes IO            :  1

 Fragmented WFs      : yes
 CORE databases      : .
 Additional I/O      : .
 Communications      : .
 Input file          : optics.in
 Report file         : ./r_optics_dipoles_02
 Verbose log/report  : no
 Log files           : ./LOG

 Precision           : SINGLE

 [RD./SAVE//ns.db1]--------------------------------------------------------------
  Bands                                            :   40
  K-points                                         :   576
  G-vectors                                        :  21171 [RL space]
  Components                                       :  2695 [wavefunctions]
  Symmetries                                       :  1 [spatial]
  Spinor components                                :  1
  Spin polarizations                               :  1
  Temperature                                      :  0.000000 [eV]
  Electrons                                        :  16.00000
  WF G-vectors                                     :   4073
  Max atoms/species                                :  2
  No. of atom species                              :  2
  Exact exchange fraction in XC                    :  0.000000
  Exact exchange screening in XC                   :  0.000000
  Magnetic symmetries                              : no
 - S/N 002115 ---------------------------------------------- v.05.00.03 r.19584 -

 [02] CORE Variables Setup
 =========================


  [02.01] Unit cells
  ==================

  Cell kind             :  HCP
  Atoms in the cell     :  B  N
  number of B  atoms    :  2
  number of N  atoms    :  2
  Alat factors          :   4.72809   4.09465  12.50432 [a.u.]

  Direct lattice volume :  242.0823 [a.u.]
  Direct lattice vectors:  A[ 1 ]  A[ 2 ]  A[ 3 ]
   A[ 1 ]:  1.000000  0.000000  0.000000  [iru]
   A[ 2 ]: -0.500000  1.000000  0.000000  [iru]
   A[ 3 ]:  0.000000  0.000000  1.000000  [iru]

  Recip. lattice volume :  1.024653 [a.u.]
  Recip. lattice vectors:  B[ 1 ]  B[ 2 ]  B[ 3 ]
   B[ 1 ]:  1.000000  0.500000  0.000000  [iku]
   B[ 2 ]:  0.000000  1.000000  0.000000  [iku]
   B[ 3 ]:  0.000000  0.000000  1.000000  [iku]

  [02.02] Symmetries
  ==================

  Inversion symmetry    : no
  Spatial inversion     : no
  K-space Time-reversal : no
  Magnetic symmetries   : no
  Group table correct   : yes
  Symmetries units      :  [cc]

   [S 1]:  1.000000  0.000000  0.000000  0.000000  1.000000  0.000000  0.000000  0.000000  1.000000

  [02.03] Reciprocal space
  ========================

  nG shells         :  1116
  nG charge         :  21171
  nG WFs            :   4073
  nC WFs            :  2695
  G-vecs. in first 80 shells:  [ Number ]
     1    3    5    7   13   25   37   39   51
    53   65   71   83   95  107  109  121  127
   139  151  163  175  187  189  201  213  225
    237   249   251   263   287   311   323   335   359
    371   373   397   403   415   427   439   463   475
    487   499   511   513   537   549   561   573   585
    591   603   627   639   651   663   675   677   689
    713   737   749   761   785   809   821   833   845
    869   881   883   907   931   943   955   967
  ...
  Shell energy in first 80 shells:  [ mHa ]
    0.00000      126.244      504.975      1136.19      1177.32      1303.57      1682.30      2019.90      2313.52
    3156.09      3197.22      3531.97      3658.22      4036.95      4333.42      4544.77      4668.17      4709.30
    4835.54      5214.27      5551.87      5722.10      5845.49      6185.94      6688.07      6729.20      7363.27
    7865.39      8076.75      8079.60      8241.27      8367.51      8746.25      9254.07      9256.92      9377.46
    9717.92      10225.7      10261.2      10595.9      10722.2      10895.2      11100.9      11397.4      11403.1
    11611.6      11732.1      12615.8      12624.4      12786.0      12788.9      13752.0      13757.7      13801.7
    14127.9      14254.1      14427.2      14632.9      14935.0      15140.7      15264.1      15275.5      15305.2
    15431.5      15810.2      16147.8      16156.3      16320.9      16441.4      16452.8      16781.9      17284.0
    17325.1      17333.7      18179.1      18461.3      18467.0      18672.7      18675.5      18807.5
  ...

  [02.04] K-grid lattice
  ======================

  Compatible Grid is   : 3D
  Base K vectors       :  K_min[ 1 ]  K_min[ 2 ]  K_min[ 3 ]
  K_min[ 1 ] : -0.833333E-1 -0.745058E-8   0.00000    [rlu]
  K_min[ 2 ] :  0.000000  0.083333  0.000000 [rlu]
  K_min[ 3 ] :  0.000000  0.000000  0.250000 [rlu]
  Grid dimensions      :  12  12   4
  K lattice UC volume  :  0.001779 [a.u.]

  [02.05] Energies & Occupations
  ==============================

  [X] === General ===
  [X] Electronic Temperature                        :  0.000000  0.000000 [eV K]
  [X] Bosonic    Temperature                        :  0.000000  0.000000 [eV K]
  [X] Finite Temperature mode                       : no
  [X] El. density                                   :  0.44602E+24 [cm-3]
  [X] Fermi Level                                   :  4.782450 [eV]

  [X] === Gaps and Widths ===
  [X] Conduction Band Min                           :  4.308568 [eV]
  [X] Valence Band Max                              :  0.000000 [eV]
  [X] Filled Bands                                  :   8
  [X] Empty Bands                                   :    9   40
  [X] Direct Gap                                    :  4.673592 [eV]
  [X] Direct Gap localized at k-point               :  211
  [X] Indirect Gap                                  :  4.308568 [eV]
  [X] Indirect Gap between k-points                 :  211   25
  [X] Last valence band width                       :  3.198007 [eV]
  [X] 1st conduction band width                     :  4.079237 [eV]



 [03] Transferred momenta grid and indexing
 ==========================================

 [RD./SAVE//ndb.kindx]-----------------------------------------------------------
  Fragmentation                                    : no
  Polarization last K                              :   576
  QP states                                        :     1   576
  X grid is uniform                                : yes
  Grids                                            : X B S
  *ERR*BS scattering                               : yes
  COLL scattering                                  : no
  Sigma scattering                                 : yes
  X scattering                                     : yes
 - S/N 002115 ---------------------------------------------- v.05.00.03 r.19584 -
 [BZ sampling] Q-grid is User defined and/or read from the database

 IBZ Q-points :   576
 BZ  Q-points :   576

 K/Q-points units:
 rlu = crystal or reduced units; cc = cartesian coordinates; iku = interal k-units

 Q [  1]:  0.000000  0.000000  0.000000 [rlu]
 Q [  2]:  0.000000  0.000000  0.250000 [rlu]
 Q [  3]:  0.000000  0.000000 -0.500000 [rlu]
 Q [  4]:  0.000000  0.000000 -0.250000 [rlu]
 Q [  5]:  0.000000  0.083333  0.000000 [rlu]
 Q [  6]:  0.000000  0.083333  0.250000 [rlu]
 Q [  7]:  0.000000  0.083333 -0.500000 [rlu]
 Q [  8]:  0.000000  0.083333 -0.250000 [rlu]
 Q [  9]:  0.000000  0.166667  0.000000 [rlu]
 Q [ 10]:  0.000000  0.166667  0.250000 [rlu]
 Q [ 11]:  0.000000  0.166667 -0.500000 [rlu]
 Q [ 12]:  0.000000  0.166667 -0.250000 [rlu]
 Q [ 13]:  0.000000  0.250000  0.000000 [rlu]
 Q [ 14]:  0.000000  0.250000  0.250000 [rlu]
 Q [ 15]:  0.000000  0.250000 -0.500000 [rlu]
 Q [ 16]:  0.000000  0.250000 -0.250000 [rlu]
 Q [ 17]:  0.000000  0.333333  0.000000 [rlu]
 Q [ 18]:  0.000000  0.333333  0.250000 [rlu]
 Q [ 19]:  0.000000  0.333333 -0.500000 [rlu]
 Q [ 20]:  0.000000  0.333333 -0.250000 [rlu]
 Q [ 21]:  0.000000  0.416667  0.000000 [rlu]
 Q [ 22]:  0.000000  0.416667  0.250000 [rlu]
 Q [ 23]:  0.000000  0.416667 -0.500000 [rlu]
 Q [ 24]:  0.000000  0.416667 -0.250000 [rlu]
 Q [ 25]:  0.000000 -0.500000  0.000000 [rlu]
 Q [ 26]:  0.000000 -0.500000  0.250000 [rlu]
 Q [ 27]:  0.000000 -0.500000 -0.500000 [rlu]
 Q [ 28]:  0.000000 -0.500000 -0.250000 [rlu]
 Q [ 29]:  0.000000 -0.416667  0.000000 [rlu]
 Q [ 30]:  0.000000 -0.416667  0.250000 [rlu]
 Q [ 31]:  0.000000 -0.416667 -0.500000 [rlu]
 Q [ 32]:  0.000000 -0.416667 -0.250000 [rlu]
 Q [ 33]:  0.000000 -0.333333  0.000000 [rlu]
 Q [ 34]:  0.000000 -0.333333  0.250000 [rlu]
 Q [ 35]:  0.000000 -0.333333 -0.500000 [rlu]
 Q [ 36]:  0.000000 -0.333333 -0.250000 [rlu]
 Q [ 37]:  0.000000 -0.250000  0.000000 [rlu]
 Q [ 38]:  0.000000 -0.250000  0.250000 [rlu]
 Q [ 39]:  0.000000 -0.250000 -0.500000 [rlu]
 Q [ 40]:  0.000000 -0.250000 -0.250000 [rlu]
 Q [ 41]:  0.000000 -0.166667  0.000000 [rlu]
 Q [ 42]:  0.000000 -0.166667  0.250000 [rlu]
 Q [ 43]:  0.000000 -0.166667 -0.500000 [rlu]
 Q [ 44]:  0.000000 -0.166667 -0.250000 [rlu]
 Q [ 45]:  0.000000 -0.083333  0.000000 [rlu]
 Q [ 46]:  0.000000 -0.083333  0.250000 [rlu]
 Q [ 47]:  0.000000 -0.083333 -0.500000 [rlu]
 Q [ 48]:  0.000000 -0.083333 -0.250000 [rlu]
 Q [ 49]:  0.833333E-1  0.745058E-8   0.00000    [rlu]
 Q [ 50]:  0.833333E-1  0.745058E-8  0.250000    [rlu]

 Remaining 526 points informations can be written running with -fatlog


  [03.01] X indexes
  =================


   [03.01.01] Sigma indexes
   ========================

   [WR./SAVE//ndb.kindx]-----------------------------------------------------------
    Fragmentation                                    : no
    Polarization last K                              :   576
    QP states                                        :     1   576
    X grid is uniform                                : yes
    Grids                                            : X S
    BS scattering                                    : no
    COLL scattering                                  : no
    Sigma scattering                                 : yes
    X scattering                                     : yes
   - S/N 002115 ---------------------------------------------- v.05.00.03 r.19584 -

 [04] Dipoles
 ============


 [WARNING] DIPOLES database not correct or missing
 [RD./SAVE//ns.kb_pp_pwscf]------------------------------------------------------
  Fragmentation                                    : yes
 - S/N 002115 ---------------------------------------------- v.05.00.03 r.19584 -
 [WF-Oscillators/G space/Transverse up loader] Normalization (few states)  min/max  :  0.000000  1.000000

 [WR./SAVE//ndb.dipoles]---------------------------------------------------------
  Brillouin Zone Q/K grids (IBZ/BZ)                :   576   576   576   576
  RL vectors                                       :   4077 [WF]
  Fragmentation                                    : yes
  Electronic Temperature                           :  0.000000 [K]
  Bosonic    Temperature                           :  0.000000 [K]
  DIP band range                                   :    1   40
  DIP band range limits                            :   40    1
  DIP e/h energy range                             : -1.000000 -1.000000 [eV]
  RL vectors in the sum                            :   4077
  [r,Vnl] included                                 : yes
  Bands ordered                                    : no
  Direct v evaluation                              : no
  Approach used                                    : G-space v
  Dipoles computed                                 : R V P
  Wavefunctions                                    : Perdew, Burke & Ernzerhof(X)+Perdew, Burke & Ernzerhof(C)
 - S/N 002115 ---------------------------------------------- v.05.00.03 r.19584 -

 [WARNING] [r,Vnl^pseudo] included in position and velocity dipoles.

 [WARNING] In case H contains other non local terms, these are neglected

 Timing [Min/Max/Average]: 42s/42s/42s

 [05] Timing Overview
 ====================

 Clock: global (MAX - min (if any spread is present) clocks)
             io_ATMPROJ_pwscf :      0.0030s P21 [MAX]      0.0000s P4 [min]
      IO_and_Messaging_switch :      0.0024s P26 (388 calls,   0.006 msec avg) [MAX]      0.0000s P16 (  4 calls,   0.005 msec avg) [min]
                 io_KB_abinit :      0.0004s P33 [MAX]      0.0000s P35 [min]
               io_Double_Grid :      0.0005s P3 [MAX]      0.0001s P32 [min]
                        io_BS :      0.0030s P4 [MAX]      0.0001s P28 [min]
                   io_COL_CUT :      0.0005s P12 [MAX]      0.0003s P2 [min]
                        io_HF :      0.0010s P2 [MAX]      0.0006s P20 [min]
                         io_X :      0.0020s P4 (  4 calls,   0.500 msec avg) [MAX]      0.0009s P2 (  4 calls,   0.236 msec avg) [min]
                  io_fragment :     16.1635s P36 (768 calls,   0.021 msec avg) [MAX]      0.0016s P29 [min]
                 PP_uspp_init :      0.0190s P33 (192 calls,   0.099 msec avg) [MAX]      0.0056s P10 (192 calls,   0.029 msec avg) [min]
            DIPOLE_transverse :     41.7091s P33 [MAX]      0.0229s P30 [min]
                        io_WF :     11.3757s P12 (577 calls,   0.020 msec avg) [MAX]      0.0284s P30 [min]
                  io_KB_pwscf :     20.1779s P27 (578 calls,   0.035 msec avg) [MAX]      0.0633s P30 (  3 calls,  21.099 msec avg) [min]
                      io_GROT :      0.0806s P2 (  3 calls,  26.861 msec avg) [MAX]      0.0790s P17 (  3 calls,  26.328 msec avg) [min]
                     io_QINDX :      0.1374s P1 (  3 calls,  45.785 msec avg) [MAX]      0.1051s P7 (  3 calls,  35.033 msec avg) [min]
              bz_samp_indexes :      0.1075s P7 [MAX]      0.1051s P2 [min]
                   io_DIPOLES :      0.6986s P1 (197 calls,   3.546 msec avg) [MAX]      0.2946s P3 (  5 calls,  58.925 msec avg) [min]
                  WF_load_FFT :     10.7566s P12 (192 calls,   0.056 msec avg) [MAX]      0.6056s P34 (192 calls,   3.154 msec avg) [min]
                      Dipoles :     42.8304s P34 [MAX]     42.8303s P26 [min]

 [06] Memory Overview
 ====================

 Memory Usage: global (Only MASTER cpu here). [O] stands for group 'O'
 Memory treshold are: 73.31400 [Mb] (basic treshold)  733.1400 [Mb] (SAVEs treshold)


         Max memory used   :  135.3400 [Mb]

 [07] Game Over & Game summary
 =============================

 08/11/2021 at 11:33 yambo @ r1i6n31 [start]
 08/11/2021 at 11:34                 [end]

 Timing   [Min/Max/Average]: 44s/44s/44s
             [Time-Profile]: 44s

 .-ACKNOWLEDGMENT
 |
 | The users of YAMBO have little formal obligations with respect to
 | the YAMBO group (those specified in the GNU General Public
 | License, http://www.gnu.org/copyleft/gpl.txt). However, it is
 | common practice in the scientific literature, to acknowledge the
 | efforts of people that have made the research possible. In this
 | spirit, please find below the reference we kindly ask you to use
 | in order to acknowledge YAMBO
 |
 | Many-body perturbation theory calculations using the yambo code
 | D. Sangalli, A. Ferretti, H. Miranda, C. Attaccalite, I. Marri, E. Cannuccia, P. Melo,
 | M Marsili, F Paleari, A Marrazzo, G Prandini, P Bonfà, M O Atambo, F Affinito,
 | M Palummo, A Molina-Sánchez, C Hogan, M Grüning, D Varsano and A Marini.
 | J. Phys.: Condens. Matter 31, 325902 (2019).
 |
 | Yambo: An ab initio tool for excited state calculations
 | A. Marini, C. Hogan, M. Grüning, D. Varsano
 | Computer Physics Communications 180, 1392 (2009).
 |

 .-Input file  optics.in
 | optics                           # [R] Linear Response optical properties
 | dipoles                          # [R] Oscillator strenghts (or dipoles)
 | BoseTemp= 0.000000         eV    # Bosonic Temperature
 | NLogCPUs= 1                      # [PARALLEL] Live-timing CPU`s (0 for all)
 | DIP_CPU= "6.2.3"                 # [PARALLEL] CPUs for each role
 | DIP_ROLEs= "v.c.k"               # [PARALLEL] CPUs roles (k,c,v)
 | DIP_Threads= 1                   # [OPENMP/X] Number of threads for dipoles
 | X_Threads=0                      # [OPENMP/X] Number of threads for response functions
 | DipBandsALL                    # [DIP] Compute all bands range, not only valence and conduction
 | DipComputed= "R V P"             # [DIP] [default R P V; extra P2 Spin Orb]

Xiaoming Wang
The University of Toledo

Xiaoming Wang
Posts: 67
Joined: Fri Dec 18, 2020 7:14 am

Re: diagonal matrix elements of the velocity operator

Post by Xiaoming Wang » Thu Nov 04, 2021 1:55 am

Not sure if it is a bug. For my system, the not complete or none written of DIP_v is due to the parallelism over conduction or valence bands used. Parallel over kpoint only solve the problem.

Best,
Xiaoming
Xiaoming Wang
The University of Toledo

Xiaoming Wang
Posts: 67
Joined: Fri Dec 18, 2020 7:14 am

Re: diagonal matrix elements of the velocity operator

Post by Xiaoming Wang » Sat Dec 04, 2021 5:14 pm

Hello,

I'm wondering if the problem for band parallelization can be solved? Since my system has fewer k points but lots of bands.

Best,
Xiaoming
Xiaoming Wang
The University of Toledo

User avatar
Daniele Varsano
Posts: 3810
Joined: Tue Mar 17, 2009 2:23 pm
Contact:

Re: diagonal matrix elements of the velocity operator

Post by Daniele Varsano » Sat Dec 04, 2021 5:44 pm

Dear Xiaoming,
thanks for reporting, sorry I have overlooked this. We will have a look asap.

Best,
Daniele
Dr. Daniele Varsano
S3-CNR Institute of Nanoscience and MaX Center, Italy
MaX - Materials design at the Exascale
http://www.nano.cnr.it
http://www.max-centre.eu/

Post Reply