Wannierisation (including SAWF)

This tutorial shows how to construct (Symmetry adapted) Wannier functions with WannierBerri, with magnetic symmetries. We will use the example of bcc Fe.

0. Compute QuantumEspresso files

in tthe tutorial repository only the input files for Quantum ESPRESSO are provided to obtain the necessary files one needs to run

pw.x < Fe_pw_scf_in > Fe_pw_scf_out
pw.x < Fe_pw_nscf_in > Fe_pw_nscf_out
wannier90.x -pp Fe
pw2wannier90.x < Fe_pw2wan_in > Fe_pw2wan_out

1. Setup

First import modules and set up the parallel environment

[1]:
import ray
# Initialize Ray with 8 CPU cores
# Do this only once at the beginning of your script. Initializing multiple times will lead to errors.
ray.init(num_cpus=8)
# If needed, you can do ray.shutdown() at the end of your script to clean up resources.
2025-11-20 05:21:54,622 INFO util.py:154 -- Missing packages: ['ipywidgets']. Run `pip install -U ipywidgets`, then restart the notebook server for rich notebook output.
2025-11-20 05:21:57,895 INFO worker.py:1918 -- Started a local Ray instance. View the dashboard at http://127.0.0.1:8266 
[1]:
[2]:

import os from matplotlib import pyplot as plt import scipy import wannierberri as wb import numpy as np path_data = "./pwscf/" # adjust path if needed to point to the data in the tests fo wannier-berri repository assert os.path.exists(path_data), f"Path {path_data} does not exist" import irrep, spglib print (f"using wannier-berri version: {wb.__version__}") print (f"using irrep version: {irrep.__version__}") print (f"using spglib version: {spglib.__version__}")
using wannier-berri version: 1.6.1
using irrep version: 2.4.1
using spglib version: 2.6.0

2. Read the bandstructure from Quantum ESPRESSO

we use the Bnadstructure object form irrep to read the bandstructure from Quantum ESPRESSO. It also can be used to read from VASP, ABINIT, etc. , see documentation of irrep for more details.

[3]:

from irrep.bandstructure import BandStructure assert os.path.exists(path_data), f"Path {path_data} does not exist" # adjust path if needed to point to the data in the tests fo wannier-berri repository bandstructure = BandStructure(code='espresso', # to work with VASP or abinit please refer to the documentation of irrep prefix=os.path.join(path_data, "Fe"), Ecut=100, normalize=False, magmom=[[0,0,1]], # set the magnetic moments for a magnetic system (units do not matter) include_TR=True) # set include_TR=False if you do not want to include the symmetries involving time reversal (magnetic symmetries) spacegroup = bandstructure.spacegroup spacegroup.show()


 ---------- CRYSTAL STRUCTURE ----------


Cell vectors in angstroms:

      Vectors of DFT cell
a0 =  1.4350   1.4350   1.4350
a1 = -1.4350   1.4350   1.4350
a2 = -1.4350  -1.4350   1.4350



 ---------- SPACE GROUP -----------


Space group: I4/mm'm' (# 139.537)
Number of symmetries: 16 (mod. lattice translations)

 ### 1

rotation : |  1   0   0 |
           |  0   1   0 |
           |  0   0   1 |


 gk = [kx, ky, kz]

spinor rot.         : | 1.000+0.000j  0.000+0.000j |
                      | 0.000+0.000j  1.000+0.000j |

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [-0.109397 -0.702863  0.702863] ; angle =  0 , inversion: False, time reversal: False

 ### 2

rotation : | -1   0   0 |
           |  0  -1   0 |
           |  0   0  -1 |


 gk = [-kx, -ky, -kz]

spinor rot.         : | 1.000+0.000j  0.000+0.000j |
                      | 0.000+0.000j  1.000+0.000j |

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [ 0.109397 -0.702863  0.702863] ; angle =  0 , inversion: True, time reversal: False

 ### 3

rotation : |  0   0   1 |
           |  1   0  -1 |
           |  0   1   1 |


 gk = [kx-ky+kz, kx, ky]

spinor rot.         : | 0.707-0.707j  0.000+0.000j |
                      | 0.000+0.000j  0.707+0.707j |

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [-0.  0.  1.] ; angle = 1/2 pi, inversion: False, time reversal: False

 ### 4

rotation : |  0   0  -1 |
           | -1   0   1 |
           |  0  -1  -1 |


 gk = [-kx+ky-kz, -kx, -ky]

spinor rot.         : | 0.707-0.707j  0.000+0.000j |
                      | 0.000+0.000j  0.707+0.707j |

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [-0.  0.  1.] ; angle = 1/2 pi, inversion: True, time reversal: False

 ### 5

rotation : |  0   1   1 |
           |  0  -1   0 |
           |  1   1   0 |


 gk = [kz, kx-ky+kz, kx]

spinor rot.         : | 0.000-1.000j -0.000+0.000j |
                      | 0.000+0.000j  0.000+1.000j |

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [-0.  0.  1.] ; angle = 1 pi, inversion: False, time reversal: False

 ### 6

rotation : |  0  -1  -1 |
           |  0   1   0 |
           | -1  -1   0 |


 gk = [-kz, -kx+ky-kz, -kx]

spinor rot.         : | 0.000+1.000j  0.000-0.000j |
                      |-0.000-0.000j  0.000-1.000j |

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [ 0. -0. -1.] ; angle = 1 pi, inversion: True, time reversal: False

 ### 7

rotation : |  1   1   0 |
           | -1   0   1 |
           |  1   0   0 |


 gk = [ky, kz, kx-ky+kz]

spinor rot.         : | 0.707+0.707j -0.000-0.000j |
                      | 0.000+0.000j  0.707-0.707j |

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [ 0. -0.  1.] ; angle = -1/2 pi, inversion: False, time reversal: False

 ### 8

rotation : | -1  -1   0 |
           |  1   0  -1 |
           | -1   0   0 |


 gk = [-ky, -kz, -kx+ky-kz]

spinor rot.         : | 0.707+0.707j -0.000-0.000j |
                      | 0.000+0.000j  0.707-0.707j |

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [ 0. -0.  1.] ; angle = -1/2 pi, inversion: True, time reversal: False

 ### 9

rotation : |  0  -1  -1 |
           | -1   0   1 |
           |  0   0  -1 |


 gk = [ky, kx, kx-ky+kz]

spinor rot.         : | 0.000+0.000j  0.000-1.000j |
                      | 0.000-1.000j  0.000+0.000j |

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [1. 0. 0.] ; angle = 1 pi, inversion: False, time reversal: True

 ### 10

rotation : |  0   1   1 |
           |  1   0  -1 |
           |  0   0   1 |


 gk = [-ky, -kx, -kx+ky-kz]

spinor rot.         : | 0.000+0.000j  0.000-1.000j |
                      | 0.000-1.000j  0.000+0.000j |

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [1. 0. 0.] ; angle = 1 pi, inversion: True, time reversal: True

 ### 11

rotation : | -1  -1   0 |
           |  0   1   0 |
           |  0  -1  -1 |


 gk = [kx, kx-ky+kz, kz]

spinor rot.         : |-0.000+0.000j -0.707+0.707j |
                      | 0.707+0.707j  0.000+0.000j |

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [-0.707107  0.707107  0.      ] ; angle = 1 pi, inversion: False, time reversal: True

 ### 12

rotation : |  1   1   0 |
           |  0  -1   0 |
           |  0   1   1 |


 gk = [-kx, -kx+ky-kz, -kz]

spinor rot.         : |-0.000+0.000j  0.707-0.707j |
                      |-0.707-0.707j  0.000+0.000j |

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [ 0.707107 -0.707107 -0.      ] ; angle = 1 pi, inversion: True, time reversal: True

 ### 13

rotation : | -1   0   0 |
           |  1   0  -1 |
           | -1  -1   0 |


 gk = [kx-ky+kz, kz, ky]

spinor rot.         : | 0.000-0.000j  1.000+0.000j |
                      |-1.000+0.000j  0.000+0.000j |

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [-0. -1.  0.] ; angle = 1 pi, inversion: False, time reversal: True

 ### 14

rotation : |  1   0   0 |
           | -1   0   1 |
           |  1   1   0 |


 gk = [-kx+ky-kz, -kz, -ky]

spinor rot.         : | 0.000+0.000j -1.000-0.000j |
                      | 1.000-0.000j  0.000-0.000j |

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [ 0.  1. -0.] ; angle = 1 pi, inversion: True, time reversal: True

 ### 15

rotation : |  0   0  -1 |
           |  0  -1   0 |
           | -1   0   0 |


 gk = [kz, ky, kx]

spinor rot.         : |-0.000+0.000j -0.707-0.707j |
                      | 0.707-0.707j  0.000+0.000j |

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [ 0.707107  0.707107 -0.      ] ; angle = 1 pi, inversion: False, time reversal: True

 ### 16

rotation : |  0   0   1 |
           |  0   1   0 |
           |  1   0   0 |


 gk = [-kz, -ky, -kx]

spinor rot.         : |-0.000+0.000j  0.707+0.707j |
                      |-0.707+0.707j  0.000+0.000j |

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [-0.707107 -0.707107  0.      ] ; angle = 1 pi, inversion: True, time reversal: True

3 Choose projections

This is similar to wannier90. However, in this case the projections already include the symmetry information.

[4]:

from wannierberri.symmetry.projections import Projection, ProjectionsSet # now set the transformations of WFs. Make sure, the projections are consistent with the amn file proj_s = Projection(position_num = [[0,0,0]], orbital='s', spacegroup=spacegroup) proj_p = Projection(position_num = [[0,0,0]], orbital='p', spacegroup=spacegroup) proj_d = Projection(position_num = [[0,0,0]], orbital='d', spacegroup=spacegroup) projections_set = ProjectionsSet(projections=[proj_s, proj_p, proj_d])

4 create the SymmetrizerSAWF object

The wannierberri.symemtry.sawf.SymmetrizerSAWF class is used to store the information on how the dft bands, and the Wannier functions transform under spac-group (ot magnetic group) symmetries. This information is used to construct the SAWF, to search for projections, and to symmetrize the system (using the System_R.symmetrize2 methos)

In spirit it is similar to the dmn file of Wannier90, but more developed and optimized. Compared, to the wannier90.dmn file, the SytmmetrizerSAWF has the following advantages:

  • The matrices D_wann and d_band are stored in block diagonal form, which saves memory and allows for faster calculations.

    • for d_band the blocks correspond to (almost) degenerate bands

    • for D_wann the blocks correspond to the same orbital at the same Wyckoff position

  • The information on magnetic symmeties (which symmetry operation includes time reversal)

  • The spacegroup is stored as an irrep.spacegroup.Spacegroup object, which allows for easy manipulation of the symmetry operations

[5]:
symmetrizer = wb.symmetry.sawf.SymmetrizerSAWF().from_irrep(bandstructure)
symmetrizer.set_D_wann_from_projections(projections_set)

# you can save it for later use
symmetrizer.to_npz("Fe_spd.sawf.npz")
# later can be read with
symmetrizer_read_npz = wb.symmetry.sawf.SymmetrizerSAWF().from_npz("Fe_spd.sawf.npz")
mpgrid = [4 4 4], 64
orbitals = ['s']
orbitals = ['p']
orbitals = ['d']
calculating Wannier functions for s at [[0 0 0]]
calculating Wannier functions for p at [[0 0 0]]
calculating Wannier functions for d at [[0 0 0]]
D.shape [(13, 16, 2, 2), (13, 16, 6, 6), (13, 16, 10, 10)]
num_wann 18
D_wann_block_indices [[ 0  2]
 [ 2  8]
 [ 8 18]]
saving to Fe_spd.sawf.npz :
/home/stepan/github/irrep/irrep/spacegroup.py:167: UserWarning: Negative space group number is not supported. Setting it to -1
  warnings.warn("Negative space group number is not supported. Setting it to -1")

5. Create the amn file

Note, that projections can be calculated directly form bandstructure object, and no need to evaluate them in the pw2wannier90 code. Still, one can use the amn file from pw2wannier90, but in this case one needs to be careful with the ordering of projections. Therefore, it is recommended to generate the amn file directly.

[6]:
from wannierberri.w90files.amn import AMN

amn = AMN.from_bandstructure(bandstructure=bandstructure, projections=projections_set)
finding num points from 3 projections
Creating amn. Using projections_set
ProjectionsSet with 9 Wannier functions and 0 free variables
Projection 0, 0, 0:['s'] with 1 Wannier functions on 1 points (1 per site)
Projection 0, 0, 0:['p'] with 3 Wannier functions on 1 points (3 per site)
Projection 0, 0, 0:['d'] with 5 Wannier functions on 1 points (5 per site)

6. Read and set w90 files

Read the files into w90data object, attach to it the created amn and symmetrizer objects.

Then, one may check if the files eig and amn are consistent with the symmetrizer

[7]:
w90data=wb.w90files.Wannier90data().from_w90_files(seedname=os.path.join(path_data,"Fe"),
                                                   readfiles=["mmn","eig","win"])
# check the symmetries of the amn and eig files
w90data.set_symmetrizer(symmetrizer)
w90data.set_file("amn", amn)
print (f"eig is symmetric within the accuracy of : {symmetrizer.check_eig(w90data.eig)}")
print (f"amn is symmetric within the accuracy of : {symmetrizer.check_amn(w90data.amn, warning_precision=1e-4)}")
print (f"eigenvalues at ik=0 : {w90data.eig.data[0]}")
# optionally - apply outer window, but do not set other files afterwards!
w90data.select_bands(win_min=-8,win_max= 100 )
creating empty CheckPoint from Win file
Shells found with weights [0.41728408] and tolerance 1.9406913487457526e-16
Time for MMN.__init__() : 0.6594762802124023 , read : 0.6245167255401611 , headstring 0.03495955467224121
saving to ./pwscf/Fe.mmn.npz :
eig is symmetric within the accuracy of : 1.7352815281925281e-12
ikirr=0, isym=2 kpt  0 -> 0: 0.000230701308983471
ikirr=0, isym=3 kpt  0 -> 0: 0.00023070130898347014
ikirr=0, isym=4 kpt  0 -> 0: 0.00032626092373147037
ikirr=0, isym=5 kpt  0 -> 0: 0.00032626092373147037
ikirr=0, isym=6 kpt  0 -> 0: 0.00023070130898344987
ikirr=0, isym=7 kpt  0 -> 0: 0.00023070130898344895
ikirr=0, isym=8 kpt  0 -> 0: 0.0003232644746374151
ikirr=0, isym=9 kpt  0 -> 0: 0.00032326447463741555
ikirr=0, isym=10 kpt  0 -> 0: 0.0002597776060656813
ikirr=0, isym=11 kpt  0 -> 0: 0.0002597776060656823
ikirr=0, isym=12 kpt  0 -> 0: 0.00011208902885737723
ikirr=0, isym=13 kpt  0 -> 0: 0.0001120890288699225
ikirr=0, isym=14 kpt  0 -> 0: 0.00019738739446568566
ikirr=0, isym=15 kpt  0 -> 0: 0.00019738739446568626
ikirr=11, isym=1 kpt  29 -> 55: 0.00012789598633177848
ikirr=11, isym=2 kpt  29 -> 55: 0.00013646676080472997
ikirr=11, isym=5 kpt  29 -> 55: 0.00013284000713568216
ikirr=11, isym=6 kpt  29 -> 55: 0.00012401435135331584
ikirr=11, isym=8 kpt  29 -> 55: 0.00012365167537810662
ikirr=11, isym=11 kpt  29 -> 55: 0.00012886135751490903
ikirr=11, isym=12 kpt  29 -> 55: 0.00013679953944826145
ikirr=11, isym=15 kpt  29 -> 55: 0.0001318995325391732
ikirr=12, isym=2 kpt  42 -> 42: 0.00012643305086489068
ikirr=12, isym=3 kpt  42 -> 42: 0.00012643305086490383
ikirr=12, isym=4 kpt  42 -> 42: 0.0001788096787404178
ikirr=12, isym=5 kpt  42 -> 42: 0.00017880967874035875
ikirr=12, isym=6 kpt  42 -> 42: 0.00012643305094084338
ikirr=12, isym=7 kpt  42 -> 42: 0.00012643305094086463
ikirr=12, isym=8 kpt  42 -> 42: 0.00017164256537598798
ikirr=12, isym=9 kpt  42 -> 42: 0.0001716425653760176
ikirr=12, isym=10 kpt  42 -> 42: 0.00015679955267937335
ikirr=12, isym=11 kpt  42 -> 42: 0.00015679955267935159
amn is symmetric within the accuracy of : 0.00032626092373147037
eigenvalues at ik=0 : [ 4.42624609  4.56711725 10.59844101 10.62588822 10.65695316 11.64267206
 11.654173   12.2136333  12.23125238 12.26425051 14.39895102 14.40059647
 38.53322082 38.53322147 38.53328964 38.8336636  38.83366485 38.83383108
 44.30739027 44.36770869 44.44003016 44.57458079 44.57556868 44.62903705
 44.62936834 45.32707513 45.39326779 45.45218324 50.41547735 50.43472702
 50.45476162 50.76954857]
selected_bands = [ 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 24 25 26 27 28 29 30 31]
[7]:
array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
       17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31])

7. Wannierise

[8]:
froz_max=25
w90data.wannierise( init = "amn",
                froz_min=4,
                froz_max=froz_max,
                print_progress_every=1,
                num_iter=10,
                conv_tol=1e-6,
                mix_ratio_z=1.0,
                localise=True,
                sitesym=True,
                )
####################################################################################################
starting WFs
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |     2.167979361966
  0.000000000000    0.000000000000    0.000000000000   |     2.135060677808
  0.000000000000    0.000000000000    0.000000000000   |     4.628058066037
  0.000000000000    0.000000000000    0.000000000000   |     3.329571098344
  0.000000000000    0.000000000000    0.000000000000   |     4.322487480489
  0.000000000000    0.000000000000    0.000000000000   |     3.584574854550
  0.000000000000    0.000000000000    0.000000000000   |     4.322487480489
  0.000000000000    0.000000000000    0.000000000000   |     3.584574854550
  0.000000000000    0.000000000000    0.000000000000   |     0.623926041361
  0.000000000000    0.000000000000    0.000000000000   |     0.518521462142
  0.000000000000    0.000000000000    0.000000000000   |     0.878829361456
  0.000000000000    0.000000000000    0.000000000000   |     0.638700754293
  0.000000000000    0.000000000000    0.000000000000   |     0.878829361456
  0.000000000000    0.000000000000    0.000000000000   |     0.638700754293
  0.000000000000    0.000000000000    0.000000000000   |     0.624821499201
  0.000000000000    0.000000000000    0.000000000000   |     0.520666761458
  0.000000000000    0.000000000000    0.000000000000   |     0.869282398928
  0.000000000000    0.000000000000    0.000000000000   |     0.636283831530
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |    34.903356100352 <- sum
                                          maximal spread =   4.628058066037
####################################################################################################
####################################################################################################
Iteration 0 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |     2.203483691149
  0.000000000000    0.000000000000    0.000000000000   |     2.509245933278
  0.000000000000    0.000000000000    0.000000000000   |     3.382089018039
  0.000000000000    0.000000000000    0.000000000000   |     2.406169529969
  0.000000000000    0.000000000000    0.000000000000   |     3.744256641181
  0.000000000000    0.000000000000    0.000000000000   |     2.411471074860
  0.000000000000    0.000000000000    0.000000000000   |     3.744256641181
  0.000000000000    0.000000000000    0.000000000000   |     2.411471074860
  0.000000000000    0.000000000000    0.000000000000   |     0.558757852198
  0.000000000000    0.000000000000    0.000000000000   |     0.479797415762
  0.000000000000    0.000000000000    0.000000000000   |     0.691277486973
  0.000000000000    0.000000000000    0.000000000000   |     0.545135294956
  0.000000000000    0.000000000000    0.000000000000   |     0.691277486973
  0.000000000000    0.000000000000    0.000000000000   |     0.545135294956
  0.000000000000    0.000000000000    0.000000000000   |     0.558472848893
  0.000000000000    0.000000000000    0.000000000000   |     0.481149710480
  0.000000000000    0.000000000000    0.000000000000   |     0.688671666747
  0.000000000000    0.000000000000    0.000000000000   |     0.543242041440
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |    28.595360703893 <- sum
                                          maximal spread =   3.744256641181
standard deviation = 0.0
####################################################################################################
####################################################################################################
Iteration 1 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |     1.511383966230
  0.000000000000    0.000000000000    0.000000000000   |     1.739820847832
  0.000000000000    0.000000000000    0.000000000000   |     1.781447693629
  0.000000000000    0.000000000000    0.000000000000   |     1.628533308207
  0.000000000000    0.000000000000    0.000000000000   |     3.281631586711
  0.000000000000    0.000000000000    0.000000000000   |     1.630267437212
  0.000000000000    0.000000000000    0.000000000000   |     3.281631586711
  0.000000000000    0.000000000000    0.000000000000   |     1.630267437212
  0.000000000000    0.000000000000    0.000000000000   |     0.494709837537
  0.000000000000    0.000000000000    0.000000000000   |     0.441239668807
  0.000000000000    0.000000000000    0.000000000000   |     0.456060008475
  0.000000000000    0.000000000000    0.000000000000   |     0.408575772261
  0.000000000000    0.000000000000    0.000000000000   |     0.456060008475
  0.000000000000    0.000000000000    0.000000000000   |     0.408575772261
  0.000000000000    0.000000000000    0.000000000000   |     0.494907365274
  0.000000000000    0.000000000000    0.000000000000   |     0.441316678429
  0.000000000000    0.000000000000    0.000000000000   |     0.455229358533
  0.000000000000    0.000000000000    0.000000000000   |     0.408542677890
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |    20.950201011685 <- sum
                                          maximal spread =   3.281631586711
standard deviation = 0.8003206622049709
####################################################################################################
####################################################################################################
Iteration 2 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |     1.362224924211
  0.000000000000    0.000000000000    0.000000000000   |     1.472937056154
  0.000000000000    0.000000000000    0.000000000000   |     1.457718496520
  0.000000000000    0.000000000000    0.000000000000   |     1.529840205816
  0.000000000000    0.000000000000    0.000000000000   |     1.456723827207
  0.000000000000    0.000000000000    0.000000000000   |     1.530956139597
  0.000000000000    0.000000000000    0.000000000000   |     1.456723827207
  0.000000000000    0.000000000000    0.000000000000   |     1.530956139597
  0.000000000000    0.000000000000    0.000000000000   |     0.486936612531
  0.000000000000    0.000000000000    0.000000000000   |     0.436039801139
  0.000000000000    0.000000000000    0.000000000000   |     0.436247882006
  0.000000000000    0.000000000000    0.000000000000   |     0.399300574167
  0.000000000000    0.000000000000    0.000000000000   |     0.436247882006
  0.000000000000    0.000000000000    0.000000000000   |     0.399300574167
  0.000000000000    0.000000000000    0.000000000000   |     0.487029546924
  0.000000000000    0.000000000000    0.000000000000   |     0.436032084548
  0.000000000000    0.000000000000    0.000000000000   |     0.435685685976
  0.000000000000    0.000000000000    0.000000000000   |     0.399337387750
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |    16.150238647520 <- sum
                                          maximal spread =   1.530956139597
standard deviation = 0.9875399652520943
####################################################################################################
####################################################################################################
Iteration 3 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |     1.336689195847
  0.000000000000    0.000000000000    0.000000000000   |     1.426135451568
  0.000000000000    0.000000000000    0.000000000000   |     1.410144153450
  0.000000000000    0.000000000000    0.000000000000   |     1.503583240111
  0.000000000000    0.000000000000    0.000000000000   |     1.408845519952
  0.000000000000    0.000000000000    0.000000000000   |     1.504093615635
  0.000000000000    0.000000000000    0.000000000000   |     1.408845519952
  0.000000000000    0.000000000000    0.000000000000   |     1.504093615635
  0.000000000000    0.000000000000    0.000000000000   |     0.484805759054
  0.000000000000    0.000000000000    0.000000000000   |     0.435004249546
  0.000000000000    0.000000000000    0.000000000000   |     0.431288818695
  0.000000000000    0.000000000000    0.000000000000   |     0.398518785968
  0.000000000000    0.000000000000    0.000000000000   |     0.431288818695
  0.000000000000    0.000000000000    0.000000000000   |     0.398518785968
  0.000000000000    0.000000000000    0.000000000000   |     0.484821502521
  0.000000000000    0.000000000000    0.000000000000   |     0.434993153711
  0.000000000000    0.000000000000    0.000000000000   |     0.431033032291
  0.000000000000    0.000000000000    0.000000000000   |     0.398529211104
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |    15.831232429701 <- sum
                                          maximal spread =   1.504093615635
standard deviation = 0.871773945906299
####################################################################################################
####################################################################################################
Iteration 4 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |     1.336819736119
  0.000000000000    0.000000000000    0.000000000000   |     1.410097209653
  0.000000000000    0.000000000000    0.000000000000   |     1.397473248443
  0.000000000000    0.000000000000    0.000000000000   |     1.497483855365
  0.000000000000    0.000000000000    0.000000000000   |     1.396033305901
  0.000000000000    0.000000000000    0.000000000000   |     1.497867807927
  0.000000000000    0.000000000000    0.000000000000   |     1.396033305901
  0.000000000000    0.000000000000    0.000000000000   |     1.497867807927
  0.000000000000    0.000000000000    0.000000000000   |     0.483678254143
  0.000000000000    0.000000000000    0.000000000000   |     0.434771219582
  0.000000000000    0.000000000000    0.000000000000   |     0.428955919762
  0.000000000000    0.000000000000    0.000000000000   |     0.398416845016
  0.000000000000    0.000000000000    0.000000000000   |     0.428955919762
  0.000000000000    0.000000000000    0.000000000000   |     0.398416845016
  0.000000000000    0.000000000000    0.000000000000   |     0.483705102151
  0.000000000000    0.000000000000    0.000000000000   |     0.434775693751
  0.000000000000    0.000000000000    0.000000000000   |     0.428699151637
  0.000000000000    0.000000000000    0.000000000000   |     0.398430635177
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |    15.748481863232 <- sum
                                          maximal spread =   1.497867807927
standard deviation = 0.0266592941968786
####################################################################################################
####################################################################################################
Iteration 5 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |     1.340792946321
  0.000000000000    0.000000000000    0.000000000000   |     1.404481684172
  0.000000000000    0.000000000000    0.000000000000   |     1.394020734813
  0.000000000000    0.000000000000    0.000000000000   |     1.496403738064
  0.000000000000    0.000000000000    0.000000000000   |     1.392655975042
  0.000000000000    0.000000000000    0.000000000000   |     1.496697394748
  0.000000000000    0.000000000000    0.000000000000   |     1.392655975042
  0.000000000000    0.000000000000    0.000000000000   |     1.496697394748
  0.000000000000    0.000000000000    0.000000000000   |     0.483083373588
  0.000000000000    0.000000000000    0.000000000000   |     0.434723507371
  0.000000000000    0.000000000000    0.000000000000   |     0.427783949521
  0.000000000000    0.000000000000    0.000000000000   |     0.398425290594
  0.000000000000    0.000000000000    0.000000000000   |     0.427783949521
  0.000000000000    0.000000000000    0.000000000000   |     0.398425290594
  0.000000000000    0.000000000000    0.000000000000   |     0.483122681610
  0.000000000000    0.000000000000    0.000000000000   |     0.434731279818
  0.000000000000    0.000000000000    0.000000000000   |     0.427548819382
  0.000000000000    0.000000000000    0.000000000000   |     0.398439740686
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |    15.728473725637 <- sum
                                          maximal spread =   1.496697394748
standard deviation = 0.00917511715090996
####################################################################################################
####################################################################################################
Iteration 6 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |     1.344512020445
  0.000000000000    0.000000000000    0.000000000000   |     1.402193767249
  0.000000000000    0.000000000000    0.000000000000   |     1.393308993951
  0.000000000000    0.000000000000    0.000000000000   |     1.496475141341
  0.000000000000    0.000000000000    0.000000000000   |     1.392083893817
  0.000000000000    0.000000000000    0.000000000000   |     1.496718346372
  0.000000000000    0.000000000000    0.000000000000   |     1.392083893817
  0.000000000000    0.000000000000    0.000000000000   |     1.496718346372
  0.000000000000    0.000000000000    0.000000000000   |     0.482745852175
  0.000000000000    0.000000000000    0.000000000000   |     0.434712906463
  0.000000000000    0.000000000000    0.000000000000   |     0.427190396335
  0.000000000000    0.000000000000    0.000000000000   |     0.398486542238
  0.000000000000    0.000000000000    0.000000000000   |     0.427190396335
  0.000000000000    0.000000000000    0.000000000000   |     0.398486542238
  0.000000000000    0.000000000000    0.000000000000   |     0.482786100221
  0.000000000000    0.000000000000    0.000000000000   |     0.434721412582
  0.000000000000    0.000000000000    0.000000000000   |     0.426980331539
  0.000000000000    0.000000000000    0.000000000000   |     0.398500729561
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |    15.725895613051 <- sum
                                          maximal spread =   1.496718346372
standard deviation = 0.003320526934782148
####################################################################################################
####################################################################################################
Iteration 7 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |     1.347313343498
  0.000000000000    0.000000000000    0.000000000000   |     1.401242434446
  0.000000000000    0.000000000000    0.000000000000   |     1.393323810881
  0.000000000000    0.000000000000    0.000000000000   |     1.496694572446
  0.000000000000    0.000000000000    0.000000000000   |     1.392250090838
  0.000000000000    0.000000000000    0.000000000000   |     1.496895935169
  0.000000000000    0.000000000000    0.000000000000   |     1.392250090838
  0.000000000000    0.000000000000    0.000000000000   |     1.496895935169
  0.000000000000    0.000000000000    0.000000000000   |     0.482542648770
  0.000000000000    0.000000000000    0.000000000000   |     0.434710215313
  0.000000000000    0.000000000000    0.000000000000   |     0.426901684004
  0.000000000000    0.000000000000    0.000000000000   |     0.398558407703
  0.000000000000    0.000000000000    0.000000000000   |     0.426901684004
  0.000000000000    0.000000000000    0.000000000000   |     0.398558407703
  0.000000000000    0.000000000000    0.000000000000   |     0.482581762601
  0.000000000000    0.000000000000    0.000000000000   |     0.434717885782
  0.000000000000    0.000000000000    0.000000000000   |     0.426718296302
  0.000000000000    0.000000000000    0.000000000000   |     0.398571712623
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |    15.727628918091 <- sum
                                          maximal spread =   1.496895935169
standard deviation = 0.002670715728483146
####################################################################################################
####################################################################################################
Iteration 8 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |     1.349279441734
  0.000000000000    0.000000000000    0.000000000000   |     1.400811780016
  0.000000000000    0.000000000000    0.000000000000   |     1.393479174310
  0.000000000000    0.000000000000    0.000000000000   |     1.496866989060
  0.000000000000    0.000000000000    0.000000000000   |     1.392540866483
  0.000000000000    0.000000000000    0.000000000000   |     1.497033294669
  0.000000000000    0.000000000000    0.000000000000   |     1.392540866483
  0.000000000000    0.000000000000    0.000000000000   |     1.497033294669
  0.000000000000    0.000000000000    0.000000000000   |     0.482414983342
  0.000000000000    0.000000000000    0.000000000000   |     0.434708233408
  0.000000000000    0.000000000000    0.000000000000   |     0.426766064154
  0.000000000000    0.000000000000    0.000000000000   |     0.398623282569
  0.000000000000    0.000000000000    0.000000000000   |     0.426766064154
  0.000000000000    0.000000000000    0.000000000000   |     0.398623282569
  0.000000000000    0.000000000000    0.000000000000   |     0.482452304937
  0.000000000000    0.000000000000    0.000000000000   |     0.434714966708
  0.000000000000    0.000000000000    0.000000000000   |     0.426607426650
  0.000000000000    0.000000000000    0.000000000000   |     0.398635780273
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |    15.729898096187 <- sum
                                          maximal spread =   1.497033294669
standard deviation = 0.0019562225180870824
####################################################################################################
####################################################################################################
Iteration 9 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |     1.350617224491
  0.000000000000    0.000000000000    0.000000000000   |     1.400610048647
  0.000000000000    0.000000000000    0.000000000000   |     1.393612120407
  0.000000000000    0.000000000000    0.000000000000   |     1.496976670894
  0.000000000000    0.000000000000    0.000000000000   |     1.392792240369
  0.000000000000    0.000000000000    0.000000000000   |     1.497112775284
  0.000000000000    0.000000000000    0.000000000000   |     1.392792240369
  0.000000000000    0.000000000000    0.000000000000   |     1.497112775284
  0.000000000000    0.000000000000    0.000000000000   |     0.482332924427
  0.000000000000    0.000000000000    0.000000000000   |     0.434706432629
  0.000000000000    0.000000000000    0.000000000000   |     0.426705768816
  0.000000000000    0.000000000000    0.000000000000   |     0.398674481755
  0.000000000000    0.000000000000    0.000000000000   |     0.426705768816
  0.000000000000    0.000000000000    0.000000000000   |     0.398674481755
  0.000000000000    0.000000000000    0.000000000000   |     0.482368705362
  0.000000000000    0.000000000000    0.000000000000   |     0.434712252824
  0.000000000000    0.000000000000    0.000000000000   |     0.426568704167
  0.000000000000    0.000000000000    0.000000000000   |     0.398686278371
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |    15.731761894667 <- sum
                                          maximal spread =   1.497112775284
standard deviation = 0.0013569096669656753
####################################################################################################
####################################################################################################
Final state (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |     1.350617224491
  0.000000000000    0.000000000000    0.000000000000   |     1.400610048647
  0.000000000000    0.000000000000    0.000000000000   |     1.393612120407
  0.000000000000    0.000000000000    0.000000000000   |     1.496976670894
  0.000000000000    0.000000000000    0.000000000000   |     1.392792240369
  0.000000000000    0.000000000000    0.000000000000   |     1.497112775284
  0.000000000000    0.000000000000    0.000000000000   |     1.392792240369
  0.000000000000    0.000000000000    0.000000000000   |     1.497112775284
  0.000000000000    0.000000000000    0.000000000000   |     0.482332924427
  0.000000000000    0.000000000000    0.000000000000   |     0.434706432629
  0.000000000000    0.000000000000    0.000000000000   |     0.426705768816
  0.000000000000    0.000000000000    0.000000000000   |     0.398674481755
  0.000000000000    0.000000000000    0.000000000000   |     0.426705768816
  0.000000000000    0.000000000000    0.000000000000   |     0.398674481755
  0.000000000000    0.000000000000    0.000000000000   |     0.482368705362
  0.000000000000    0.000000000000    0.000000000000   |     0.434712252824
  0.000000000000    0.000000000000    0.000000000000   |     0.426568704167
  0.000000000000    0.000000000000    0.000000000000   |     0.398686278371
----------------------------------------------------------------------------------------------------
  0.000000000000    0.000000000000    0.000000000000   |    15.731761894667 <- sum
                                          maximal spread =   1.497112775284
standard deviation = 0.0013569096669656753
####################################################################################################
####################################################################################################
Final state (from chk)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
 -0.000000000054    0.000000000318   -0.000000000190   |     1.351142720401
  0.000000000052    0.000000000217   -0.000000000010   |     1.400541083688
 -0.000000000215    0.000000003312   -0.000000000530   |     1.393657762055
  0.000000000049    0.000000002885   -0.000000000026   |     1.497016529980
 -0.000000000175    0.000000000866   -0.000000001458   |     1.392889669654
  0.000000000205    0.000000002866   -0.000000000311   |     1.497138573376
  0.000000000211    0.000000000183    0.000000000532   |     1.392889669378
  0.000000000384    0.000000000091    0.000000000654   |     1.497138573775
 -0.000000000006    0.000000000076   -0.000000000041   |     0.482300373174
 -0.000000000006    0.000000000056    0.000000000006   |     0.434705551852
 -0.000000000025    0.000000000253    0.000000000005   |     0.426685444150
 -0.000000000012    0.000000000289   -0.000000000004   |     0.398695745674
 -0.000000000002   -0.000000000001   -0.000000000024   |     0.426685444137
  0.000000000004    0.000000000007    0.000000000001   |     0.398695745683
  0.000000000022    0.000000000137   -0.000000000001   |     0.482335406015
  0.000000000007    0.000000000180    0.000000000002   |     0.434710946105
  0.000000000003    0.000000000011   -0.000000000061   |     0.426558526105
 -0.000000000000   -0.000000000014    0.000000000009   |     0.398707218154
----------------------------------------------------------------------------------------------------
  0.000000000442    0.000000011733   -0.000000001450   |    15.732494983356 <- sum
                                          maximal spread =   1.497138573775
####################################################################################################
time for creating wannierizer 0.3021097183227539
time for iterations 0.4940640926361084
time for updating 0.3911716938018799
total time for wannierization 4.156568288803101
saving to ./pwscf/Fe.chk :

9. Create System_w90 object

[9]:

system = wb.system.System_w90(w90data= w90data, berry=True, transl_inv_JM=True, symmetrize=True) # optionally - save it for later use system.save_npz("Fe_system")
setting Rvec
setting AA..
setting AA - OK
recentering JM - OK
Real-space lattice:
 [[ 1.4349963  1.4349963  1.4349963]
 [-1.4349963  1.4349963  1.4349963]
 [-1.4349963 -1.4349963  1.4349963]]
Number of wannier functions: 18
Number of R points: 89
Recommended size of FFT grid [4 4 4]
saving system of class System_w90 to Fe_system
 properties: ['num_wann', 'real_lattice', 'iRvec', 'periodic', 'is_phonon', 'wannier_centers_cart', 'pointgroup']
saving num_wann
saving num_wann to Fe_system/num_wann.npz
 - Ok!
saving real_lattice
saving real_lattice to Fe_system/real_lattice.npz
 - Ok!
saving iRvec
saving iRvec to Fe_system/iRvec.npz
 - Ok!
saving periodic
saving periodic to Fe_system/periodic.npz
 - Ok!
saving is_phonon
saving is_phonon to Fe_system/is_phonon.npz
 - Ok!
saving wannier_centers_cart
saving wannier_centers_cart to Fe_system/wannier_centers_cart.npz
 - Ok!
saving pointgroup
saving pointgroup to Fe_system/pointgroup.npz
 - Ok!
saving Ham - Ok!
saving AA - Ok!

8. Bands along path

8.1 calculate bands

[10]:
# all kpoints given in reduced coordinates
path=wb.Path(system,
                nodes=[
                    [0.0000, 0.0000, 0.0000 ],   #  G
                    [0.500 ,-0.5000, -0.5000],   #  H
                    [0.7500, 0.2500, -0.2500],   #  P
                    [0.5000, 0.0000, -0.5000],   #  N
                    [0.0000, 0.0000, 0.000  ]
                        ] , #  G
                labels=["G","H","P","N","G"],
                length=200 )   # length [ Ang] ~= 2*pi/dk

bands_path=wb.evaluate_k_path(system, path=path)


Starting run()
Using the follwing calculators :
############################################################

 'tabulate'  :  <wannierberri.calculators.tabulate.TabulatorAll object at 0x7799b64d3830>  :
    TabulatorAll - a pack of all k-resolved calculators (Tabulators)

 Includes the following tabulators :
--------------------------------------------------
 "Energy" : <wannierberri.calculators.tabulate.Energy object at 0x7796c49ab1d0> : calculator not described

--------------------------------------------------

############################################################
Calculation along a path - checking calculators for compatibility
tabulate <wannierberri.calculators.tabulate.TabulatorAll object at 0x7799b64d3830>
All calculators are compatible
Symmetrization switched off for Path
Grid is regular
The set of k points is a Path() with 215 points and labels {0: 'G', 70: 'H', 130: 'P', 165: 'N', 214: 'G'}
generating K_list
Done
Done, sum of weights:215.0

############################################################
Iteration 0 out of 0
processing 215 K points : using  8 processes.
# K-points calculated  Wall time (sec)  Est. remaining (sec)   Est. total (sec)
/home/stepan/github/wannier-berri-work/wannier-berri-soc-nscf/wannierberri/grid/path.py:165: UserWarning: symmetry is not used for a tabulation along path
  warnings.warn("symmetry is not used for a tabulation along path")
time for processing    215 K-points on   8 processes:     2.2960 ; per K-point          0.0107 ; proc-sec per K-point          0.0854
time1 =  0.008922338485717773
Totally processed 215 K-points
run() finished

8.2 plot bands

[11]:

# plot the bands and compare with pw # EF = 12 A = np.loadtxt("./pwscf/Fe_bands_pw.dat") bohr_ang = scipy.constants.physical_constants['Bohr radius'][0] / 1e-10 alatt = 5.4235* bohr_ang A[:,0]*= 2*np.pi/alatt A[:,1] = A[:,1] plt.scatter(A[:,0], A[:,1], c="black", s=5) bands_path.plot_path_fat(path, quantity=None, # save_file="Fe_bands.pdf", Eshift=0, Emin=-10, Emax=50, iband=None, mode="fatband", fatfactor=20, cut_k=False, linecolor="red", close_fig=False, show_fig=False, label=f"WB" ) plt.ylim(4, 40) plt.hlines(froz_max, 0, A[-1,0], linestyles="dashed", label="frozen window", color="black") plt.hlines(12.6, 0, A[-1,0], linestyles="dashed", label="Fermi level", color="green") plt.legend() plt.savefig("Fe_bands.pdf")
../../_images/tutorials_6_wannierisation_wannierise_20_0.png

9. AHC and Ohmic conductivity

9.1 calculate

[12]:
results_grid = {}
efermi = np.linspace(12.4,12.8,1001)
param = dict(Efermi=efermi)
calculators_grid = {
     "CDOS": wb.calculators.static.CumDOS(**param),
                "ohmic": wb.calculators.static.Ohmic_FermiSea(**param),
                "ahc_internal": wb.calculators.static.AHC(kwargs_formula={"external_terms":False}, **param),
            "ahc_external": wb.calculators.static.AHC(kwargs_formula={"internal_terms":False}, **param ),
}

grid =  wb.Grid(system, NKFFT=6, NK=48)

result_grid = wb.run(system,
                     grid,
                     calculators_grid,
                    fout_name="Fe_grid",
                    adpt_num_iter=0,
                    symmetrize=False,  # we do not symmetrize here so that we can chaeck how symmetric are the WFs
                    use_irred_kpt=False,
                    print_progress_step=1,
                    print_Kpoints=False,
                    )


# plot the bands to compare with pw




Starting run()
Using the follwing calculators :
############################################################

 'CDOS'  :  <wannierberri.calculators.static.CumDOS object at 0x7797361b9820>  : Cumulative density of states
 'ohmic'  :  <wannierberri.calculators.static.Ohmic_FermiSea object at 0x7797361ba6f0>  : Ohmic conductivity (:math:`S/m`)

        | With Fermi sea integral. Eq(31) in `Ref <https://www.nature.com/articles/s41524-021-00498-5>`__
        | Output: :math:`\sigma_{\alpha\beta} = e^2/\hbar \tau \int [dk] \partial_\beta v_\alpha f`for \tau=1fs| Instruction: :math:`j_\alpha = \sigma_{\alpha\beta} E_\beta`
 'ahc_internal'  :  <wannierberri.calculators.static.AHC object at 0x7797361bbfb0>  : Anomalous Hall conductivity (:math:`s^3 \cdot A^2 / (kg \cdot m^3) = S/m`)

        | With Fermi sea integral Eq(11) in `Ref <https://www.nature.com/articles/s41524-021-00498-5>`__
        | Output: :math:`O = -e^2/\hbar \int [dk] \Omega f`
        | Instruction: :math:`j_\alpha = \sigma_{\alpha\beta} E_\beta = \epsilon_{\alpha\beta\delta} O_\delta E_\beta`
 'ahc_external'  :  <wannierberri.calculators.static.AHC object at 0x7797361bac60>  : Anomalous Hall conductivity (:math:`s^3 \cdot A^2 / (kg \cdot m^3) = S/m`)

        | With Fermi sea integral Eq(11) in `Ref <https://www.nature.com/articles/s41524-021-00498-5>`__
        | Output: :math:`O = -e^2/\hbar \int [dk] \Omega f`
        | Instruction: :math:`j_\alpha = \sigma_{\alpha\beta} E_\beta = \epsilon_{\alpha\beta\delta} O_\delta E_\beta`
############################################################
Calculation on  grid - checking calculators for compatibility
CDOS <wannierberri.calculators.static.CumDOS object at 0x7797361b9820>
ohmic <wannierberri.calculators.static.Ohmic_FermiSea object at 0x7797361ba6f0>
ahc_internal <wannierberri.calculators.static.AHC object at 0x7797361bbfb0>
ahc_external <wannierberri.calculators.static.AHC object at 0x7797361bac60>
All calculators are compatible
Grid is regular
The set of k points is a Grid() with NKdiv=[8 8 8], NKFFT=[6 6 6], NKtot=[48 48 48]
generating K_list
Done in 0.0033354759216308594 s
K_list contains 512 Irreducible points(100.0%) out of initial 8x8x8=512 grid
Done, sum of weights:1.0

############################################################
Iteration 0 out of 0
processing 512 K points : using  8 processes.
# K-points calculated  Wall time (sec)  Est. remaining (sec)   Est. total (sec)
                   8              1.1                  68.4                  69.5
                  24              2.8                  56.2                  58.9
                  40              4.0                  47.1                  51.1
                  56              5.6                  45.8                  51.4
                  72              7.2                  43.9                  51.1
                  88              8.7                  42.1                  50.8
                 104             10.4                  40.7                  51.1
                 120             11.9                  38.9                  50.8
                 136             13.4                  37.1                  50.5
                 152             15.0                  35.6                  50.7
                 168             16.6                  34.0                  50.6
                 184             18.1                  32.3                  50.4
                 200             20.0                  31.1                  51.1
                 216             21.3                  29.2                  50.6
                 232             23.2                  28.1                  51.3
                 248             24.7                  26.3                  50.9
                 264             26.2                  24.6                  50.8
                 280             27.9                  23.1                  51.0
                 296             29.5                  21.5                  51.0
                 312             31.2                  20.0                  51.2
                 328             32.7                  18.3                  51.0
                 336             33.7                  17.6                  51.3
                 344             34.7                  16.9                  51.7
                 360             36.3                  15.3                  51.6
                 376             37.8                  13.7                  51.5
                 392             39.3                  12.0                  51.3
                 408             41.0                  10.5                  51.5
                 424             42.7                   8.9                  51.5
                 440             44.2                   7.2                  51.4
                 456             45.7                   5.6                  51.3
                 472             47.6                   4.0                  51.7
                 488             49.3                   2.4                  51.8
                 504             50.7                   0.8                  51.5
time for processing    512 K-points on   8 processes:    51.6142 ; per K-point          0.1008 ; proc-sec per K-point          0.8065
time1 =  0.08094215393066406
Totally processed 512 K-points
run() finished

5.2 Plot

[13]:
def plotxyz(axes, x, data, pre = "", label="",ls="-"):
    for i in range(3):
        ax =axes[i]
        ax.plot(x, data[:,i], ls, label=label)
        ax.set_title(f"{pre}{'xyz'[i]}")



quantities =  ["ahc_internal", "ahc_external","ohmic"]

nfig = len(quantities)
for quantity in quantities:
    fig = None
    res = result_grid.results[quantity]
    data = res.data
    E = res.Energies[0]
    if fig is None:
        if data.ndim == 2:
            nfigx = 1
            nfigy = data.shape[1]
        elif data.ndim == 3:
            nfigx = data.shape[1]
            nfigy = data.shape[2]
        fig, axes = plt.subplots(nfigx, nfigy, figsize=(5*nfigy,5*nfigx))
    if nfigx ==1:
        plotxyz(axes, E, data)
    else:
        for i in range(nfigx):
            plotxyz(axes[i], E, data[:,i], pre="xyz"[i], )
    for ax in axes.flat:
        ax.legend()
    fig.suptitle(quantity)
    plt.show()
    plt.close()

/tmp/ipykernel_144042/1474735278.py:31: UserWarning: No artists with labels found to put in legend.  Note that artists whose label start with an underscore are ignored when legend() is called with no argument.
  ax.legend()
../../_images/tutorials_6_wannierisation_wannierise_24_1.png
../../_images/tutorials_6_wannierisation_wannierise_24_2.png
../../_images/tutorials_6_wannierisation_wannierise_24_3.png
[ ]: