GPAW + WannierBerri: spinless bandstructure (diamond)

This tutorial demonstrates how to wannierize a spinless bandstructure of diamond

Prerequisites

Make sure you have installed the following packages:

pip install wannierberri gpaw ase irrep

Step 1: Gpaw calculation

self-consistent calculation

[1]:
import numpy as np
from ase import Atoms
from gpaw import GPAW, PW, MixerSum
from irrep.spacegroup import SpaceGroup
seed = "diamond"

a = 3.227

lattice = a * (np.ones((3, 3)) - np.eye(3)) / 2
positions = np.array(
    [
        [0, 0, 0],
        [1 / 4, 1 / 4, 1 / 4],
    ]
)
typeat = [1, 1]

atoms = Atoms(
    "C2", cell=lattice, pbc=[1, 1, 1], scaled_positions=positions
)


calc = GPAW(
    mode=PW(500),
    xc="PBE",
    symmetry={'symmorphic': False},
    kpts={"size": [8, 8, 8], "gamma": True},
    convergence={"density": 1e-6},
    mixer=MixerSum(0.25, 8, 100),
    txt=f"{seed}-scf.txt"
)

atoms.calc = calc
atoms.get_potential_energy()
calc.write(f"{seed}-scf.gpw", mode="all")

Non-self-consistent calculation in the irreducible Brillouin zone

Now we get the list of irreducible k-points (using irrep.SpaceGroup object) and perform a non-self-consistent calculation only on these k-points. We use irrep (instead of internal GPAW symmetrization), because it cann account for non-symmorphic symmetries, and also magnetic symmetries (see other tutorials)

[2]:
calc_scf = GPAW(f'{seed}-scf.gpw', txt=None)
sg = SpaceGroup.from_gpaw(calc_scf)
sg.show()
irred_kpt = sg.get_irreducible_kpoints_grid((4, 4, 4))
calc_nscf_irred = calc_scf.fixed_density(
    kpts=irred_kpt,
    symmetry={'symmorphic': False},
    nbands=20,
    convergence={'bands': 20},
    txt=f'{seed}-nscf-irred.txt')
calc_nscf_irred.write(f'{seed}-nscf.gpw', mode='all')
typat used for spacegroup detection (accounting magmoms): [6 6]


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


Cell vectors in angstroms:

      Vectors of DFT cell
a0 =  0.0000   1.6135   1.6135
a1 =  1.6135   0.0000   1.6135
a2 =  1.6135   1.6135   0.0000



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


Space group: Fd-3m1' (# 227.129)
Number of symmetries: 96 (mod. lattice translations)

 ### 1

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


 gk = [kx, ky, kz]

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [ 0.091821 -0.314892  0.944676] ; angle =  0 , inversion: False, time reversal: False

 ### 2

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [ 0.091821 -0.314892  0.944676] ; angle =  0 , inversion: False, time reversal: True

 ### 3

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 4

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 5

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 6

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 7

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 8

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 9

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 10

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 11

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 12

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


 gk = [ky, kx, kz]

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 13

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 14

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 15

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 16

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 17

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


 gk = [kz, kx, ky]

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [0.57735 0.57735 0.57735] ; angle = 2/3 pi, inversion: False, time reversal: False

 ### 18

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [0.57735 0.57735 0.57735] ; angle = 2/3 pi, inversion: False, time reversal: True

 ### 19

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 20

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 21

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [-0.57735  0.57735 -0.57735] ; angle = 2/3 pi, inversion: False, time reversal: False

 ### 22

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [-0.57735  0.57735 -0.57735] ; angle = 2/3 pi, inversion: False, time reversal: True

 ### 23

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 24

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 25

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [ 0.57735  0.57735 -0.57735] ; angle = -2/3 pi, inversion: False, time reversal: False

 ### 26

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [ 0.57735  0.57735 -0.57735] ; angle = -2/3 pi, inversion: False, time reversal: True

 ### 27

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 28

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


 gk = [kz, ky, kx]

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 29

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [-0.57735  0.57735  0.57735] ; angle = -2/3 pi, inversion: False, time reversal: False

 ### 30

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [-0.57735  0.57735  0.57735] ; angle = -2/3 pi, inversion: False, time reversal: True

 ### 31

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 32

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 33

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


 gk = [ky, kz, kx]

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [-0.57735 -0.57735 -0.57735] ; angle = 2/3 pi, inversion: False, time reversal: False

 ### 34

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [-0.57735 -0.57735 -0.57735] ; angle = 2/3 pi, inversion: False, time reversal: True

 ### 35

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 36

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 37

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [-0.57735  0.57735  0.57735] ; angle = 2/3 pi, inversion: False, time reversal: False

 ### 38

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [-0.57735  0.57735  0.57735] ; angle = 2/3 pi, inversion: False, time reversal: True

 ### 39

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 40

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 41

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [ 0.57735 -0.57735  0.57735] ; angle = 2/3 pi, inversion: False, time reversal: False

 ### 42

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [ 0.57735 -0.57735  0.57735] ; angle = 2/3 pi, inversion: False, time reversal: True

 ### 43

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 44

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


 gk = [kx, kz, ky]

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 45

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [-0.57735 -0.57735  0.57735] ; angle = -2/3 pi, inversion: False, time reversal: False

 ### 46

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

axis: [-0.57735 -0.57735  0.57735] ; angle = -2/3 pi, inversion: False, time reversal: True

 ### 47

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 48

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 49

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

axis: [-0.091821 -0.314892  0.944676] ; angle =  0 , inversion: True, time reversal: False

 ### 50

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


 gk = [kx, ky, kz]

translation         :  [   0.2500   0.2500   0.2500 ]

axis: [-0.091821 -0.314892  0.944676] ; angle =  0 , inversion: True, time reversal: True

 ### 51

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 52

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 53

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 54

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 55

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 56

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 57

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 58

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 59

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


 gk = [ky, kx, kz]

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 60

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 61

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 62

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

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

 ### 63

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 64

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 65

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

axis: [0.57735 0.57735 0.57735] ; angle = 2/3 pi, inversion: True, time reversal: False

 ### 66

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


 gk = [kz, kx, ky]

translation         :  [   0.2500   0.2500   0.2500 ]

axis: [0.57735 0.57735 0.57735] ; angle = 2/3 pi, inversion: True, time reversal: True

 ### 67

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 68

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 69

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

axis: [ 0.57735 -0.57735  0.57735] ; angle = -2/3 pi, inversion: True, time reversal: False

 ### 70

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

axis: [ 0.57735 -0.57735  0.57735] ; angle = -2/3 pi, inversion: True, time reversal: True

 ### 71

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 72

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 73

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

axis: [ 0.57735  0.57735 -0.57735] ; angle = -2/3 pi, inversion: True, time reversal: False

 ### 74

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

axis: [ 0.57735  0.57735 -0.57735] ; angle = -2/3 pi, inversion: True, time reversal: True

 ### 75

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


 gk = [kz, ky, kx]

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 76

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 77

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

axis: [-0.57735  0.57735  0.57735] ; angle = -2/3 pi, inversion: True, time reversal: False

 ### 78

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

axis: [-0.57735  0.57735  0.57735] ; angle = -2/3 pi, inversion: True, time reversal: True

 ### 79

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 80

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 81

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

axis: [0.57735 0.57735 0.57735] ; angle = -2/3 pi, inversion: True, time reversal: False

 ### 82

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


 gk = [ky, kz, kx]

translation         :  [   0.2500   0.2500   0.2500 ]

axis: [0.57735 0.57735 0.57735] ; angle = -2/3 pi, inversion: True, time reversal: True

 ### 83

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 84

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 85

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

axis: [ 0.57735 -0.57735 -0.57735] ; angle = -2/3 pi, inversion: True, time reversal: False

 ### 86

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

axis: [ 0.57735 -0.57735 -0.57735] ; angle = -2/3 pi, inversion: True, time reversal: True

 ### 87

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 88

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 89

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

axis: [ 0.57735 -0.57735  0.57735] ; angle = 2/3 pi, inversion: True, time reversal: False

 ### 90

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

axis: [ 0.57735 -0.57735  0.57735] ; angle = 2/3 pi, inversion: True, time reversal: True

 ### 91

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


 gk = [kx, kz, ky]

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 92

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 93

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

axis: [ 0.57735  0.57735 -0.57735] ; angle = 2/3 pi, inversion: True, time reversal: False

 ### 94

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


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

translation         :  [   0.2500   0.2500   0.2500 ]

axis: [ 0.57735  0.57735 -0.57735] ; angle = 2/3 pi, inversion: True, time reversal: True

 ### 95

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

 ### 96

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


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

translation         :  [   0.0000   0.0000   0.0000 ]

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

Compute the dft bandstructure along a high-symmetry path

This is done to compare with the wannierized bandstructure later.

[3]:
calc_bands = GPAW(f"{seed}-scf.gpw",).fixed_density(
    nbands=16,
    symmetry='off',
    kpts={'path': 'WLGXWKG', 'npoints': 60},
    convergence={'bands': 8})

  ___ ___ ___ _ _ _
 |   |   |_  | | | |
 | | | | | . | | | |
 |__ |  _|___|_____|  25.7.0
 |___|_|

User:   stepan@C3MP-C019202L
Date:   Wed Oct 22 03:47:27 2025
Arch:   x86_64
Pid:    346977
CWD:    /home/stepan/github/WannierBerri-tutorial/tutorials/8_GPAW/8_1_diamond
Python: 3.12.12
gpaw:   /home/stepan/github/WannierBerri-tutorial/.conda/lib/python3.12/site-packages/gpaw
_gpaw:  /home/stepan/github/WannierBerri-tutorial/.conda/lib/python3.12/site-packages/
        _gpaw.cpython-312-x86_64-linux-gnu.so
ase:    /home/stepan/github/WannierBerri-tutorial/.conda/lib/python3.12/site-packages/ase (version 3.26.0)
numpy:  /home/stepan/github/WannierBerri-tutorial/.conda/lib/python3.12/site-packages/numpy (version 2.3.4)
scipy:  /home/stepan/github/WannierBerri-tutorial/.conda/lib/python3.12/site-packages/scipy (version 1.16.2)
libxc:  5.2.3
units:  Angstrom and eV
cores: 1
OpenMP: False
OMP_NUM_THREADS: 1

Input parameters:
  convergence: {bands: 8}
  gpts: [12 12 12]
  kpts: {npoints: 60,
         path: WLGXWKG}
  mixer: {backend: pulay,
          beta: 0.25,
          method: sum,
          nmaxold: 8,
          weight: 100}
  mode: {ecut: 500.0,
         name: pw}
  nbands: 16
  symmetry: off
  xc: PBE

Initialize ...

species:
  C:
    name: Carbon
    id: 4aa54d4b901d75f77cc0ea3eec22967b
    Z: 6.0
    valence: 4
    core: 2
    charge: 0.0
    file: /home/stepan/gpaw-data/gpaw-setups-24.11.0/C.PBE.gz
    compensation charges: {type: gauss,
                           rc: 0.20,
                           lmax: 2}
    cutoffs: {filter: 1.14,
              core: 1.14}
    projectors:
      #              energy  rcut
      - 2s(2.00)   -13.751   0.635
      - 2p(2.00)    -5.284   0.635
      -  s          13.461   0.635
      -  p          21.927   0.635
      -  d           0.000   0.635

    # Using partial waves for C as LCAO basis

Reference energy: -2055.256231  # eV

Spin-paired calculation

Convergence criteria:
 Maximum [total energy] change in last 3 cyles: 0.0005 eV / valence electron
 Maximum integral of absolute [dens]ity change: 0.0001 electrons / valence electron
 Maximum integral of absolute [eigenst]ate change: 4e-08 eV^2 / valence electron
 Maximum number of scf [iter]ations: 333
 (Square brackets indicate name in SCF output, whereas a 'c' in
 the SCF output indicates the quantity has converged.)

Symmetries present (total): 1

  ( 1  0  0)
  ( 0  1  0)
  ( 0  0  1)

60 k-points
60 k-points in the irreducible part of the Brillouin zone
       k-points in crystal coordinates                weights
   0:     0.50000000    0.25000000    0.75000000       0.01666667
   1:     0.50000000    0.28125000    0.71875000       0.01666667
   2:     0.50000000    0.31250000    0.68750000       0.01666667
   3:     0.50000000    0.34375000    0.65625000       0.01666667
   4:     0.50000000    0.37500000    0.62500000       0.01666667
   5:     0.50000000    0.40625000    0.59375000       0.01666667
   6:     0.50000000    0.43750000    0.56250000       0.01666667
   7:     0.50000000    0.46875000    0.53125000       0.01666667
   8:     0.50000000    0.50000000    0.50000000       0.01666667
   9:     0.45454545    0.45454545    0.45454545       0.01666667
          ...
  59:     0.00000000    0.00000000    0.00000000       0.01666667

Wave functions: Plane wave expansion
  Cutoff energy: 500.000 eV
  Number of coefficients (min, max): 181, 222
  Pulay-stress correction: 0.000000 eV/Ang^3 (de/decut=0.000000)
  Using Numpy's FFT
  ScaLapack parameters: grid=1x1, blocksize=None
  Wavefunction extrapolation:
    Improved wavefunction reuse through dual PAW basis

Occupation numbers: Fermi-Dirac:
  width: 0.1000  # eV


Eigensolver
   Davidson(niter=2)

Densities:
  Coarse grid: 12*12*12 grid
  Fine grid: 24*24*24 grid
  Total Charge: 0.000000

Density mixing:
  Method: separate
  Backend: pulay
  Linear mixing parameter: 0.25
  old densities: 8
  Damping of long wavelength oscillations: 100

Hamiltonian:
  XC and Coulomb potentials evaluated on a 24*24*24 grid
  Using the PBE Exchange-Correlation functional
  External potential:
    NoExternalPotential


XC parameters: PBE with 2 nearest neighbor stencil

Memory estimate:
  Process memory now: 199.25 MiB
  Calculator: 6.37 MiB
    Density: 0.78 MiB
      Arrays: 0.34 MiB
      Localized functions: 0.23 MiB
      Mixer: 0.21 MiB
    Hamiltonian: 0.23 MiB
      Arrays: 0.22 MiB
      XC: 0.00 MiB
      Poisson: 0.00 MiB
      vbar: 0.00 MiB
    Wavefunctions: 5.36 MiB
      Arrays psit_nG: 3.25 MiB
      Eigensolver: 0.11 MiB
      Projections: 0.38 MiB
      Projectors: 1.35 MiB
      PW-descriptor: 0.27 MiB

Total number of cores used: 1

Number of atoms: 2
Number of atomic orbitals: 8
Number of bands in calculation: 16
Number of valence electrons: 8
Bands to converge: 8

... initialized

Initializing position-dependent things.

Creating initial wave functions:
  8 bands from LCAO basis set
  8 bands from random numbers





          C
       C





Atomic positions and initial magnetic moments

Positions:
   0 C      0.000000    0.000000    0.000000    ( 0.0000,  0.0000,  0.0000)
   1 C      0.806750    0.806750    0.806750    ( 0.0000,  0.0000,  0.0000)

Unit cell:
           periodic     x           y           z      points  spacing
  1. axis:    yes    0.000000    1.613500    1.613500    12     0.1553
  2. axis:    yes    1.613500    0.000000    1.613500    12     0.1553
  3. axis:    yes    1.613500    1.613500    0.000000    12     0.1553

  Lengths:   2.281834   2.281834   2.281834
  Angles:   60.000000  60.000000  60.000000

Effective grid spacing dv^(1/3) = 0.1694

     iter     time        total  log10-change:
                         energy   eigst   dens
iter:   1 03:47:28   -10.023943   +1.54       c
iter:   2 03:47:29   -10.024911   -0.61       c
iter:   3 03:47:29   -10.024916c  -2.83       c
iter:   4 03:47:30   -10.024916c  -5.07       c
iter:   5 03:47:30   -10.024916c  -7.24       c
iter:   6 03:47:31   -10.024916c  -9.38c      c

Converged after 6 iterations.

Dipole moment: (-1.857210, -1.857210, -1.857210) |e|*Ang

Energy contributions relative to reference atoms: (reference = -2055.256231)

Kinetic:        +58.466655
Potential:      -41.548711
External:        +0.000000
XC:             -26.955332
Entropy (-ST):   -0.000000
Local:           +0.012472
SIC:             +0.000000
--------------------------
Free energy:    -10.024916
Extrapolated:   -10.024916

Showing only first 2 kpts
 Kpt  Band  Eigenvalues  Occupancy
  0     2      6.44407    2.00000
  0     3      6.44414    2.00000
  0     4     29.71457    0.00000
  0     5     29.71459    0.00000

  1     2      6.16314    2.00000
  1     3      7.55668    2.00000
  1     4     28.81707    0.00000
  1     5     30.36033    0.00000


Fermi level: 19.61555

Gap: 4.845 eV
Transition (v -> c):
  (s=0, k=59, n=3, [0.00, 0.00, 0.00]) -> (s=0, k=29, n=4, [0.38, 0.00, 0.38])
Direct/indirect transitions are different
Direct gap: 6.434 eV
Transition at: (s=0, k=19, n=3, [0.00, 0.00, 0.00])
[5]:

bs_dft = calc_bands.band_structure() bs_dft.plot(show=True, emax=40.0)
../../../_images/tutorials_8_GPAW_1.diamond_diamond_6_0.png
[5]:
<Axes: ylabel='energies [eV]'>

Step 2: Wannierization

In this case we use sp3 projections on each carbon atom.

[6]:
from wannierberri.symmetry.projections import Projection, ProjectionsSet
from wannierberri.w90files.w90data import Wannier90data
positions = sg.positions

proj_sp3 = Projection(
    position_num=positions,
    orbital='sp3',
    spacegroup=sg,
    rotate_basis=True
)
proj_set = ProjectionsSet(projections=[proj_sp3])

2025-10-22 03:48:14,956 INFO util.py:154 -- Missing packages: ['ipywidgets']. Run `pip install -U ipywidgets`, then restart the notebook server for rich notebook output.

create the “w90 files”

Here we are NOT using the gpaw-wannier90 interface, and actually not creating the w90 files, but directly access the wavefunctions from the GPAW calculation, use symmetry operations from irrep, and create the necessary data to be used with wannierberri. Those files still retain the same naming convention as the w90 files for consistency, but htey are binary npz files, which are convenient to work with numpy

[7]:

# seedname_ref = os.path.join(path_data, "diamond-irred") w90data = Wannier90data().from_gpaw( calculator=calc_nscf_irred, spin_channel=0, projections=proj_set, select_grid=(4,4,4), seedname="diamond-wannnier", irreducible=True, files=["amn", "mmn", "eig", "symmetrizer"], unitary_params=dict(error_threshold=0.1, warning_threshold=0.01, nbands_upper_skip=8), )
finding num points from 1 projections
got irreducible=True, mp_grid=None, seedname=diamond-wannnier, files=['amn', 'mmn', 'eig', 'symmetrizer'], read_npz_list=None, write_npz_list=None, projections=ProjectionsSet with 8 Wannier functions and 0 free variables
Projection 0.0, 0.0, 0.0:['sp3'] with 8 Wannier functions on 2 points (4 per site), unk_grid=None, normalize=True
self.irreducible=True
mpgrid = [4 4 4], 8
/home/stepan/github/wannier-berri-work/wannier-berri-soc-nscf/wannierberri/w90files/w90data.py:185: UserWarning: Failed to read symmetrizer from diamond-wannnier.symmetrizer.npz: [Errno 2] No such file or directory: 'diamond-wannnier.symmetrizer.npz'
  warnings.warn(f"Failed to read symmetrizer from {fname}: {e}")
orbitals = ['sp3']
calculating Wannier functions for sp3 at [[0.   0.   0.  ]
 [0.25 0.25 0.25]]
D.shape [(8, 48, 8, 8)]
num_wann 8
D_wann_block_indices [[0 8]]
saving to diamond-wannnier.symmetrizer.npz :
saving to diamond-wannnier.eig.npz :
Creating amn. Using projections_set
ProjectionsSet with 8 Wannier functions and 0 free variables
Projection 0.0, 0.0, 0.0:['sp3'] with 8 Wannier functions on 2 points (4 per site)
saving to diamond-wannnier.amn.npz :
mpgrid = [4 4 4], 64
NK= 64, selected_kpoints = [0 1 2 3 4 5 6 7], kptirr = [0 1 2 3 4 5 6 7]
Shells found with weights [0.52755554] and tolerance 3.894270040588992e-16
saving to diamond-wannnier.mmn.npz :
[8]:
w90data.wannierise(
    froz_min=-10,
    froz_max=30,
    num_iter=1000,
    conv_tol=1e-10,
    print_progress_every=20,
    sitesym=True,
    localise=True
)
/home/stepan/github/wannier-berri-work/wannier-berri-soc-nscf/wannierberri/wannierise/wannierizer.py:230: UserWarning: Ray is not initialized, running in serial mode
  warnings.warn("Ray is not initialized, running in serial mode")
Symmetrizer_Uirr initialized for ikirr=0, kpt=0, [0. 0. 0.] with 48 symmetries, max error in included blocks: 9.981980985815973e-12 ; excluded bands are [18 19] out of 20 total bands (accuracy threshold 1e-06)
Symmetrizer_Uirr initialized for ikirr=1, kpt=1, [0.   0.   0.25] with 6 symmetries, max error in included blocks: 7.1253546418360705e-09 ; excluded bands are [] out of 20 total bands (accuracy threshold 1e-06)
Symmetrizer_Uirr initialized for ikirr=2, kpt=2, [0.  0.  0.5] with 12 symmetries, max error in included blocks: 2.9212327752830694e-09 ; excluded bands are [] out of 20 total bands (accuracy threshold 1e-06)
Symmetrizer_Uirr initialized for ikirr=3, kpt=3, [0.   0.25 0.25] with 8 symmetries, max error in included blocks: 1.548361409101639e-09 ; excluded bands are [19] out of 20 total bands (accuracy threshold 1e-06)
Symmetrizer_Uirr initialized for ikirr=4, kpt=4, [0.   0.25 0.5 ] with 2 symmetries, max error in included blocks: 3.946495907847236e-17 ; excluded bands are [] out of 20 total bands (accuracy threshold 1e-06)
Symmetrizer_Uirr initialized for ikirr=5, kpt=5, [0.   0.25 0.75] with 4 symmetries, max error in included blocks: 3.157196726277789e-16 ; excluded bands are [] out of 20 total bands (accuracy threshold 1e-06)
Symmetrizer_Uirr initialized for ikirr=6, kpt=6, [0.  0.5 0.5] with 16 symmetries, max error in included blocks: 1.3015340217295822e-15 ; excluded bands are [] out of 20 total bands (accuracy threshold 1e-06)
Symmetrizer_Uirr initialized for ikirr=7, kpt=7, [0.25 0.5  0.75] with 8 symmetries, max error in included blocks: 1.4175855692851728e-08 ; excluded bands are [] out of 20 total bands (accuracy threshold 1e-06)
####################################################################################################
starting WFs
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.143991077331    0.143991077331    0.143991077331   |     1.356967658760
  0.143991077331   -0.143991077331   -0.143991077331   |     1.356967658760
 -0.143991077331    0.143991077331   -0.143991077331   |     1.356967658760
 -0.143991077331   -0.143991077331    0.143991077331   |     1.356967658760
  0.662758922669    0.950741077331    0.950741077331   |     1.356967658760
  0.950741077331    0.950741077331    0.662758922669   |     1.356967658760
  0.662758922669    0.662758922669    0.662758922669   |     1.356967658760
  0.950741077331    0.662758922669    0.950741077331   |     1.356967658760
----------------------------------------------------------------------------------------------------
  3.227000000000    3.227000000000    3.227000000000   |    10.855741270078 <- sum
                                          maximal spread =   1.356967658760
####################################################################################################
####################################################################################################
Iteration 0 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.142087983068    0.142087983068    0.142087983068   |     1.117818329221
  0.142087983068   -0.142087983068   -0.142087983068   |     1.117818329221
 -0.142087983068    0.142087983068   -0.142087983068   |     1.117818329221
 -0.142087983068   -0.142087983068    0.142087983068   |     1.117818329221
  0.664662016932    0.948837983068    0.948837983068   |     1.117818329221
  0.948837983068    0.948837983068    0.664662016932   |     1.117818329221
  0.664662016932    0.664662016932    0.664662016932   |     1.117818329221
  0.948837983068    0.664662016932    0.948837983068   |     1.117818329221
----------------------------------------------------------------------------------------------------
  3.227000000000    3.227000000000    3.227000000000   |     8.942546633766 <- sum
                                          maximal spread =   1.117818329221
standard deviation = 0.0
####################################################################################################
####################################################################################################
Iteration 20 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.132663594393    0.132663594393    0.132663594393   |     0.668149516615
  0.132663594393   -0.132663594393   -0.132663594393   |     0.668149516615
 -0.132663594393    0.132663594393   -0.132663594393   |     0.668149516615
 -0.132663594393   -0.132663594393    0.132663594393   |     0.668149516615
  0.674086405607    0.939413594393    0.939413594393   |     0.668149516615
  0.939413594393    0.939413594393    0.674086405607   |     0.668149516615
  0.674086405607    0.674086405607    0.674086405607   |     0.668149516615
  0.939413594393    0.674086405607    0.939413594393   |     0.668149516615
----------------------------------------------------------------------------------------------------
  3.227000000000    3.227000000000    3.227000000000   |     5.345196132917 <- sum
                                          maximal spread =   0.668149516615
standard deviation = 0.0002763155667799797
####################################################################################################
####################################################################################################
Iteration 40 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.132573817039    0.132573817039    0.132573817039   |     0.670025433650
  0.132573817039   -0.132573817039   -0.132573817039   |     0.670025433650
 -0.132573817039    0.132573817039   -0.132573817039   |     0.670025433650
 -0.132573817039   -0.132573817039    0.132573817039   |     0.670025433650
  0.674176182961    0.939323817039    0.939323817039   |     0.670025433650
  0.939323817039    0.939323817039    0.674176182961   |     0.670025433650
  0.674176182961    0.674176182961    0.674176182961   |     0.670025433650
  0.939323817039    0.674176182961    0.939323817039   |     0.670025433650
----------------------------------------------------------------------------------------------------
  3.227000000000    3.227000000000    3.227000000000   |     5.360203469199 <- sum
                                          maximal spread =   0.670025433650
standard deviation = 1.1720448551015002e-05
####################################################################################################
####################################################################################################
Iteration 60 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.132572087957    0.132572087957    0.132572087957   |     0.670094018087
  0.132572087957   -0.132572087957   -0.132572087957   |     0.670094018087
 -0.132572087957    0.132572087957   -0.132572087957   |     0.670094018087
 -0.132572087957   -0.132572087957    0.132572087957   |     0.670094018087
  0.674177912043    0.939322087957    0.939322087957   |     0.670094018087
  0.939322087957    0.939322087957    0.674177912043   |     0.670094018087
  0.674177912043    0.674177912043    0.674177912043   |     0.670094018087
  0.939322087957    0.674177912043    0.939322087957   |     0.670094018087
----------------------------------------------------------------------------------------------------
  3.227000000000    3.227000000000    3.227000000000   |     5.360752144695 <- sum
                                          maximal spread =   0.670094018087
standard deviation = 3.912139414939158e-07
####################################################################################################
####################################################################################################
Iteration 80 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.132572039253    0.132572039253    0.132572039253   |     0.670096319368
  0.132572039253   -0.132572039253   -0.132572039253   |     0.670096319368
 -0.132572039253    0.132572039253   -0.132572039253   |     0.670096319368
 -0.132572039253   -0.132572039253    0.132572039253   |     0.670096319368
  0.674177960747    0.939322039253    0.939322039253   |     0.670096319368
  0.939322039253    0.939322039253    0.674177960747   |     0.670096319368
  0.674177960747    0.674177960747    0.674177960747   |     0.670096319368
  0.939322039253    0.674177960747    0.939322039253   |     0.670096319368
----------------------------------------------------------------------------------------------------
  3.227000000000    3.227000000000    3.227000000000   |     5.360770554947 <- sum
                                          maximal spread =   0.670096319368
standard deviation = 1.4000561223871412e-08
####################################################################################################
####################################################################################################
Iteration 100 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.132572038139    0.132572038139    0.132572038139   |     0.670096411436
  0.132572038139   -0.132572038139   -0.132572038139   |     0.670096411436
 -0.132572038139    0.132572038139   -0.132572038139   |     0.670096411436
 -0.132572038139   -0.132572038139    0.132572038139   |     0.670096411436
  0.674177961861    0.939322038139    0.939322038139   |     0.670096411436
  0.939322038139    0.939322038139    0.674177961861   |     0.670096411436
  0.674177961861    0.674177961861    0.674177961861   |     0.670096411436
  0.939322038139    0.674177961861    0.939322038139   |     0.670096411436
----------------------------------------------------------------------------------------------------
  3.227000000000    3.227000000000    3.227000000000   |     5.360771291492 <- sum
                                          maximal spread =   0.670096411436
standard deviation = 1.2295780266103002e-09
####################################################################################################
####################################################################################################
Iteration 120 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.132572038159    0.132572038159    0.132572038159   |     0.670096421038
  0.132572038159   -0.132572038159   -0.132572038159   |     0.670096421038
 -0.132572038159    0.132572038159   -0.132572038159   |     0.670096421038
 -0.132572038159   -0.132572038159    0.132572038159   |     0.670096421038
  0.674177961841    0.939322038159    0.939322038159   |     0.670096421038
  0.939322038159    0.939322038159    0.674177961841   |     0.670096421038
  0.674177961841    0.674177961841    0.674177961841   |     0.670096421038
  0.939322038159    0.674177961841    0.939322038159   |     0.670096421038
----------------------------------------------------------------------------------------------------
  3.227000000000    3.227000000000    3.227000000000   |     5.360771368303 <- sum
                                          maximal spread =   0.670096421038
standard deviation = 3.7251528453698876e-10
####################################################################################################
####################################################################################################
Iteration 140 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.132572038163    0.132572038163    0.132572038163   |     0.670096423843
  0.132572038163   -0.132572038163   -0.132572038163   |     0.670096423843
 -0.132572038163    0.132572038163   -0.132572038163   |     0.670096423843
 -0.132572038163   -0.132572038163    0.132572038163   |     0.670096423843
  0.674177961837    0.939322038163    0.939322038163   |     0.670096423843
  0.939322038163    0.939322038163    0.674177961837   |     0.670096423843
  0.674177961837    0.674177961837    0.674177961837   |     0.670096423843
  0.939322038163    0.674177961837    0.939322038163   |     0.670096423843
----------------------------------------------------------------------------------------------------
  3.227000000000    3.227000000000    3.227000000000   |     5.360771390741 <- sum
                                          maximal spread =   0.670096423843
standard deviation = 1.3506680084049232e-10
####################################################################################################
Converged after 146 iterations
####################################################################################################
Final state (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.132572038162    0.132572038162    0.132572038162   |     0.670096424259
  0.132572038162   -0.132572038162   -0.132572038162   |     0.670096424259
 -0.132572038162    0.132572038162   -0.132572038162   |     0.670096424259
 -0.132572038162   -0.132572038162    0.132572038162   |     0.670096424259
  0.674177961838    0.939322038162    0.939322038162   |     0.670096424259
  0.939322038162    0.939322038162    0.674177961838   |     0.670096424259
  0.674177961838    0.674177961838    0.674177961838   |     0.670096424259
  0.939322038162    0.674177961838    0.939322038162   |     0.670096424259
----------------------------------------------------------------------------------------------------
  3.227000000000    3.227000000000    3.227000000000   |     5.360771394075 <- sum
                                          maximal spread =   0.670096424259
standard deviation = 9.996729837096587e-11
####################################################################################################
time for creating wannierizer 0.10314059257507324
time for iterations 2.6817893981933594
time for updating 2.481640338897705
total time for wannierization 2.795734167098999
saving to diamond-wannnier.chk :

Create the System object to be used in WannierBerri calculations

It is called “System_w90” class, although it now does not use the w90 wannierization, but the class is the same.

[9]:
from wannierberri.system.system_w90 import System_w90

system = System_w90(w90data=w90data, berry=True)
setting Rvec
setting AA..
setting AA - OK
Real-space lattice:
 [[0.     1.6135 1.6135]
 [1.6135 0.     1.6135]
 [1.6135 1.6135 0.    ]]
Number of wannier functions: 8
Number of R points: 123
Recommended size of FFT grid [4 4 4]

Step 3: Compute the wannierized bandstructure along the high-symmetry path

create the k path for wannierberri

[10]:
from wannierberri.evaluate_k import evaluate_k_path

kpoints = {
    'G': [0.0, 0.0, 0.0],
    'X': [0.5, 0.0, 0.5],
    'W': [0.5, 0.25, 0.75],
    'L': [0.5, 0.5, 0.5],
    'K': [0.375, 0.375, 0.75],
}

path_labels = "WLGXWKG"

path , bands_wannier= evaluate_k_path(system,
                                nodes=[kpoints[label] for label in path_labels],
                                labels=list(path_labels),
                                length=100,
                                return_path=True)  # length~=2pi/dk



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

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

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

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

############################################################
Calculation along a path - checking calculators for compatibility
tabulate <wannierberri.calculators.tabulate.TabulatorAll object at 0x74fae8d45b80>
All calculators are compatible
Symmetrization switched off for Path
Grid is regular
The set of k points is a Path() with 140 points and labels {0: 'W', 22: 'L', 49: 'G', 80: 'X', 95: 'W', 106: 'K', 139: 'G'}
generating K_list
Done
Done, sum of weights:140.0

############################################################
Iteration 0 out of 0
processing 140 K points : in serial.
# K-points calculated  Wall time (sec)  Est. remaining (sec)   Est. total (sec)
time for processing    140 K-points in serial:     0.1071 ; per K-point          0.0008 ; proc-sec per K-point          0.0008
time1 =  0.0017597675323486328
Totally processed 140 K-points
run() finished
/home/stepan/github/wannier-berri-work/wannier-berri-soc-nscf/wannierberri/grid/path.py:163: UserWarning: symmetry is not used for a tabulation along path
  warnings.warn("symmetry is not used for a tabulation along path")

Plot the bandstructures

[11]:
from matplotlib import pyplot as plt
fig, ax = plt.subplots(figsize=(8,6))
bs_dft.plot(show=False, emax=40.0, ax=ax, label="DFT")
bands_wannier.plot_path_fat(path=path,
                       label="wannierised sp3",
                        # linecolor="orange",
                        axes=ax,
                        close_fig=False,
                        show_fig=False,
                        kwargs_line=dict(linestyle='--', lw=1.0),
    )
plt.show()


../../../_images/tutorials_8_GPAW_1.diamond_diamond_17_0.png

One can see that the wannierized bandstructure (dashed lines) well reproduces the DFT bandstructure (solid lines) in the energy window of interest. Note, that we started from a very coarse DFT grid of 4,4,4 k-points, and still obtained a good agreement after wannierization. You may try to increase the grid on the nscf step, and see how it improves the agreement further.

Bonding and antibonding states

Another option for projections is to use bonding and antibonding states. For that we place the wannier centers on the centers of the bonds, and use s-type projections (or bonding and pz-type for antibonding states, with the “z-axis” along the bond direction [111]. Note, that we specify only one bond position, the other 3 are generated by symmetry operations, and their “zaxis” are also rotated accordingly.

Bonding states describe the valence bands, while antibonding states describe the conduction bands, so they can be wannierised separately.

[12]:
proj_bonding = Projection(
    position_num=[1/8, 1/8, 1/8],
    orbital='s',
    spacegroup=sg,
    rotate_basis=True
)
proj_antibonding = Projection(
    position_num=[1/8, 1/8, 1/8],
    orbital='pz',
    zaxis=[1,1,1],
    rotate_basis=True,
    spacegroup=sg)

proj_set_bonding = ProjectionsSet(projections=[proj_bonding, proj_antibonding])


# seedname_ref = os.path.join(path_data, "diamond-irred")
w90data_bonding= Wannier90data().from_gpaw(
    calculator=calc_nscf_irred,
    spin_channel=0,
    projections=proj_set_bonding,
    select_grid=(4,4,4),
    seedname="diamond-wannnier-bonding",
    irreducible=True,
    files=["amn", "mmn", "eig", "symmetrizer"],
    unitary_params=dict(error_threshold=0.1,
                        warning_threshold=0.01,
                        nbands_upper_skip=8),
)

w90data_bonding.wannierise(
    froz_min=-10,
    froz_max=30,
    num_iter=1000,
    conv_tol=1e-10,
    print_progress_every=20,
    sitesym=True,
    localise=True
)

system_bonding = System_w90(w90data=w90data_bonding, berry=True)
bands_wannier_bonding = evaluate_k_path(system_bonding,
                                        path=path,
                                        return_path=False)
finding num points from 2 projections
got irreducible=True, mp_grid=None, seedname=diamond-wannnier-bonding, files=['amn', 'mmn', 'eig', 'symmetrizer'], read_npz_list=None, write_npz_list=None, projections=ProjectionsSet with 8 Wannier functions and 0 free variables
Projection 0.125, 0.125, 0.125:['s'] with 4 Wannier functions on 4 points (1 per site)
Projection 0.125, 0.125, 0.125:['pz'] with 4 Wannier functions on 4 points (1 per site), unk_grid=None, normalize=True
self.irreducible=True
mpgrid = [4 4 4], 8
/home/stepan/github/wannier-berri-work/wannier-berri-soc-nscf/wannierberri/w90files/w90data.py:185: UserWarning: Failed to read symmetrizer from diamond-wannnier-bonding.symmetrizer.npz: [Errno 2] No such file or directory: 'diamond-wannnier-bonding.symmetrizer.npz'
  warnings.warn(f"Failed to read symmetrizer from {fname}: {e}")
orbitals = ['s']
orbitals = ['pz']
calculating Wannier functions for s at [[0.125 0.125 0.125]
 [0.625 0.125 0.125]
 [0.125 0.125 0.625]
 [0.125 0.625 0.125]]
calculating Wannier functions for pz at [[0.125 0.125 0.125]
 [0.625 0.125 0.125]
 [0.125 0.125 0.625]
 [0.125 0.625 0.125]]
D.shape [(8, 48, 4, 4), (8, 48, 4, 4)]
num_wann 8
D_wann_block_indices [[0 4]
 [4 8]]
saving to diamond-wannnier-bonding.symmetrizer.npz :
saving to diamond-wannnier-bonding.eig.npz :
Creating amn. Using projections_set
ProjectionsSet with 8 Wannier functions and 0 free variables
Projection 0.125, 0.125, 0.125:['s'] with 4 Wannier functions on 4 points (1 per site)
Projection 0.125, 0.125, 0.125:['pz'] with 4 Wannier functions on 4 points (1 per site)
saving to diamond-wannnier-bonding.amn.npz :
mpgrid = [4 4 4], 64
NK= 64, selected_kpoints = [0 1 2 3 4 5 6 7], kptirr = [0 1 2 3 4 5 6 7]
Shells found with weights [0.52755554] and tolerance 3.894270040588992e-16
saving to diamond-wannnier-bonding.mmn.npz :
Symmetrizer_Uirr initialized for ikirr=0, kpt=0, [0. 0. 0.] with 48 symmetries, max error in included blocks: 1.0890745466351084e-11 ; excluded bands are [18 19] out of 20 total bands (accuracy threshold 1e-06)
Symmetrizer_Uirr initialized for ikirr=1, kpt=1, [0.   0.   0.25] with 6 symmetries, max error in included blocks: 5.443829703638712e-09 ; excluded bands are [] out of 20 total bands (accuracy threshold 1e-06)
Symmetrizer_Uirr initialized for ikirr=2, kpt=2, [0.  0.  0.5] with 12 symmetries, max error in included blocks: 3.0788811014029363e-09 ; excluded bands are [] out of 20 total bands (accuracy threshold 1e-06)
Symmetrizer_Uirr initialized for ikirr=3, kpt=3, [0.   0.25 0.25] with 8 symmetries, max error in included blocks: 1.3882726113667303e-09 ; excluded bands are [19] out of 20 total bands (accuracy threshold 1e-06)
Symmetrizer_Uirr initialized for ikirr=4, kpt=4, [0.   0.25 0.5 ] with 2 symmetries, max error in included blocks: 1.1443916996305594e-16 ; excluded bands are [] out of 20 total bands (accuracy threshold 1e-06)
Symmetrizer_Uirr initialized for ikirr=5, kpt=5, [0.   0.25 0.75] with 4 symmetries, max error in included blocks: 2.355138688025663e-16 ; excluded bands are [] out of 20 total bands (accuracy threshold 1e-06)
Symmetrizer_Uirr initialized for ikirr=6, kpt=6, [0.  0.5 0.5] with 16 symmetries, max error in included blocks: 2.3611053522184124e-15 ; excluded bands are [] out of 20 total bands (accuracy threshold 1e-06)
Symmetrizer_Uirr initialized for ikirr=7, kpt=7, [0.25 0.5  0.75] with 8 symmetries, max error in included blocks: 2.1164307741030392e-08 ; excluded bands are [] out of 20 total bands (accuracy threshold 1e-06)
/home/stepan/github/wannier-berri-work/wannier-berri-soc-nscf/wannierberri/wannierise/wannierizer.py:230: UserWarning: Ray is not initialized, running in serial mode
  warnings.warn("Ray is not initialized, running in serial mode")
####################################################################################################
starting WFs
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.403375000000    0.403375000000    0.403375000000   |     0.924526485432
  0.403375000000    1.210125000000    1.210125000000   |     0.924526485432
  1.210125000000    1.210125000000    0.403375000000   |     0.924526485432
  1.210125000000    0.403375000000    1.210125000000   |     0.924526485432
  0.403375000000    0.403375000000    0.403375000000   |     8.132041709224
  0.403375000000    1.210125000000    1.210125000000   |     8.132041709224
  1.210125000000    1.210125000000    0.403375000000   |     8.132041709224
  1.210125000000    0.403375000000    1.210125000000   |     8.132041709224
----------------------------------------------------------------------------------------------------
  6.454000000000    6.454000000000    6.454000000000   |    36.226272778621 <- sum
                                          maximal spread =   8.132041709224
####################################################################################################
####################################################################################################
Iteration 0 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.403375000000    0.403375000000    0.403375000000   |     0.825856384392
  0.403375000000    1.210125000000    1.210125000000   |     0.825856384392
  1.210125000000    1.210125000000    0.403375000000   |     0.825856384392
  1.210125000000    0.403375000000    1.210125000000   |     0.825856384392
  0.403375000000    0.403375000000    0.403375000000   |     4.344417167714
  0.403375000000    1.210125000000    1.210125000000   |     4.344417167714
  1.210125000000    1.210125000000    0.403375000000   |     4.344417167714
  1.210125000000    0.403375000000    1.210125000000   |     4.344417167714
----------------------------------------------------------------------------------------------------
  6.454000000000    6.454000000000    6.454000000000   |    20.681094208426 <- sum
                                          maximal spread =   4.344417167714
standard deviation = 0.0
####################################################################################################
####################################################################################################
Iteration 20 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.403375000000    0.403375000000    0.403375000000   |     0.524452355823
  0.403375000000    1.210125000000    1.210125000000   |     0.524452355823
  1.210125000000    1.210125000000    0.403375000000   |     0.524452355823
  1.210125000000    0.403375000000    1.210125000000   |     0.524452355823
  0.403375000000    0.403375000000    0.403375000000   |     1.159073119782
  0.403375000000    1.210125000000    1.210125000000   |     1.159073119782
  1.210125000000    1.210125000000    0.403375000000   |     1.159073119782
  1.210125000000    0.403375000000    1.210125000000   |     1.159073119782
----------------------------------------------------------------------------------------------------
  6.454000000000    6.454000000000    6.454000000000   |     6.734101902418 <- sum
                                          maximal spread =   1.159073119782
standard deviation = 0.0013988037846829234
####################################################################################################
####################################################################################################
Iteration 40 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.403375000000    0.403375000000    0.403375000000   |     0.526961095890
  0.403375000000    1.210125000000    1.210125000000   |     0.526961095890
  1.210125000000    1.210125000000    0.403375000000   |     0.526961095890
  1.210125000000    0.403375000000    1.210125000000   |     0.526961095890
  0.403375000000    0.403375000000    0.403375000000   |     1.152652321790
  0.403375000000    1.210125000000    1.210125000000   |     1.152652321790
  1.210125000000    1.210125000000    0.403375000000   |     1.152652321790
  1.210125000000    0.403375000000    1.210125000000   |     1.152652321790
----------------------------------------------------------------------------------------------------
  6.454000000000    6.454000000000    6.454000000000   |     6.718453670720 <- sum
                                          maximal spread =   1.152652321790
standard deviation = 2.7437403699544996e-05
####################################################################################################
####################################################################################################
Iteration 60 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.403375000000    0.403375000000    0.403375000000   |     0.527013595301
  0.403375000000    1.210125000000    1.210125000000   |     0.527013595301
  1.210125000000    1.210125000000    0.403375000000   |     0.527013595301
  1.210125000000    0.403375000000    1.210125000000   |     0.527013595301
  0.403375000000    0.403375000000    0.403375000000   |     1.152500950564
  0.403375000000    1.210125000000    1.210125000000   |     1.152500950564
  1.210125000000    1.210125000000    0.403375000000   |     1.152500950564
  1.210125000000    0.403375000000    1.210125000000   |     1.152500950564
----------------------------------------------------------------------------------------------------
  6.454000000000    6.454000000000    6.454000000000   |     6.718058183463 <- sum
                                          maximal spread =   1.152500950564
standard deviation = 8.001790599685563e-07
####################################################################################################
####################################################################################################
Iteration 80 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.403375000000    0.403375000000    0.403375000000   |     0.527015133259
  0.403375000000    1.210125000000    1.210125000000   |     0.527015133259
  1.210125000000    1.210125000000    0.403375000000   |     0.527015133259
  1.210125000000    0.403375000000    1.210125000000   |     0.527015133259
  0.403375000000    0.403375000000    0.403375000000   |     1.152496375592
  0.403375000000    1.210125000000    1.210125000000   |     1.152496375592
  1.210125000000    1.210125000000    0.403375000000   |     1.152496375592
  1.210125000000    0.403375000000    1.210125000000   |     1.152496375592
----------------------------------------------------------------------------------------------------
  6.454000000000    6.454000000000    6.454000000000   |     6.718046035403 <- sum
                                          maximal spread =   1.152496375592
standard deviation = 2.5315161728739307e-08
####################################################################################################
####################################################################################################
Iteration 100 (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.403375000000    0.403375000000    0.403375000000   |     0.527015183532
  0.403375000000    1.210125000000    1.210125000000   |     0.527015183532
  1.210125000000    1.210125000000    0.403375000000   |     0.527015183532
  1.210125000000    0.403375000000    1.210125000000   |     0.527015183532
  0.403375000000    0.403375000000    0.403375000000   |     1.152496229725
  0.403375000000    1.210125000000    1.210125000000   |     1.152496229725
  1.210125000000    1.210125000000    0.403375000000   |     1.152496229725
  1.210125000000    0.403375000000    1.210125000000   |     1.152496229725
----------------------------------------------------------------------------------------------------
  6.454000000000    6.454000000000    6.454000000000   |     6.718045653030 <- sum
                                          maximal spread =   1.152496229725
standard deviation = 8.123813457747742e-10
####################################################################################################
Converged after 113 iterations
####################################################################################################
Final state (from wannierizer)
----------------------------------------------------------------------------------------------------
wannier centers and spreads
----------------------------------------------------------------------------------------------------
  0.403375000000    0.403375000000    0.403375000000   |     0.527015185051
  0.403375000000    1.210125000000    1.210125000000   |     0.527015185051
  1.210125000000    1.210125000000    0.403375000000   |     0.527015185051
  1.210125000000    0.403375000000    1.210125000000   |     0.527015185051
  0.403375000000    0.403375000000    0.403375000000   |     1.152496225409
  0.403375000000    1.210125000000    1.210125000000   |     1.152496225409
  1.210125000000    1.210125000000    0.403375000000   |     1.152496225409
  1.210125000000    0.403375000000    1.210125000000   |     1.152496225409
----------------------------------------------------------------------------------------------------
  6.454000000000    6.454000000000    6.454000000000   |     6.718045641841 <- sum
                                          maximal spread =   1.152496225409
standard deviation = 8.564602158844479e-11
####################################################################################################
time for creating wannierizer 0.12611007690429688
time for iterations 3.72009539604187
time for updating 3.545503854751587
total time for wannierization 3.871110200881958
saving to diamond-wannnier-bonding.chk :
setting Rvec
setting AA..
setting AA - OK
Real-space lattice:
 [[0.     1.6135 1.6135]
 [1.6135 0.     1.6135]
 [1.6135 1.6135 0.    ]]
Number of wannier functions: 8
Number of R points: 141
Recommended size of FFT grid [4 4 4]
Starting run()
Using the follwing calculators :
############################################################

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

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

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

############################################################
Calculation along a path - checking calculators for compatibility
tabulate <wannierberri.calculators.tabulate.TabulatorAll object at 0x74facf7cf890>
All calculators are compatible
Symmetrization switched off for Path
Grid is regular
The set of k points is a Path() with 140 points and labels {0: 'W', 22: 'L', 49: 'G', 80: 'X', 95: 'W', 106: 'K', 139: 'G'}
generating K_list
Done
Done, sum of weights:140.0

############################################################
Iteration 0 out of 0
processing 140 K points : in serial.
# K-points calculated  Wall time (sec)  Est. remaining (sec)   Est. total (sec)
time for processing    140 K-points in serial:     0.1252 ; per K-point          0.0009 ; proc-sec per K-point          0.0009
time1 =  0.0019028186798095703
Totally processed 140 K-points
run() finished
/home/stepan/github/wannier-berri-work/wannier-berri-soc-nscf/wannierberri/grid/path.py:163: UserWarning: symmetry is not used for a tabulation along path
  warnings.warn("symmetry is not used for a tabulation along path")
[13]:
from matplotlib import pyplot as plt
fig, ax = plt.subplots(figsize=(8,6))
bs_dft.plot(filename='bandstructure.png', show=False, emax=40.0, ax=ax, label="DFT")
bands_wannier_bonding.plot_path_fat(path=path,
                       label="wannierised-bonding",
                        # linecolor="orange",
                        axes=ax,
                        close_fig=False,
                        show_fig=False,
                        kwargs_line=dict(linestyle='--', lw=1.0),
    )
plt.show()
../../../_images/tutorials_8_GPAW_1.diamond_diamond_21_0.png

Save the system objects for later use

[14]:
system_bonding.save_npz("system-diamond-bonding")
system.save_npz("system-diamond-sp3")

# load the system later
from wannierberri.system.system_R import System_R
system_loaded = System_R().load_npz("system-diamond-sp3")
saving system of class System_w90 to system-diamond-bonding
 properties: ['num_wann', 'real_lattice', 'iRvec', 'periodic', 'is_phonon', 'wannier_centers_cart', 'pointgroup']
saving num_wann
saving num_wann to system-diamond-bonding/num_wann.npz
 - Ok!
saving real_lattice
saving real_lattice to system-diamond-bonding/real_lattice.npz
 - Ok!
saving iRvec
saving iRvec to system-diamond-bonding/iRvec.npz
 - Ok!
saving periodic
saving periodic to system-diamond-bonding/periodic.npz
 - Ok!
saving is_phonon
saving is_phonon to system-diamond-bonding/is_phonon.npz
 - Ok!
saving wannier_centers_cart
saving wannier_centers_cart to system-diamond-bonding/wannier_centers_cart.npz
 - Ok!
saving pointgroup
saving pointgroup to system-diamond-bonding/pointgroup.npz
 - Ok!
saving Ham - Ok!
saving AA - Ok!
saving system of class System_w90 to system-diamond-sp3
 properties: ['num_wann', 'real_lattice', 'iRvec', 'periodic', 'is_phonon', 'wannier_centers_cart', 'pointgroup']
saving num_wann
saving num_wann to system-diamond-sp3/num_wann.npz
 - Ok!
saving real_lattice
saving real_lattice to system-diamond-sp3/real_lattice.npz
 - Ok!
saving iRvec
saving iRvec to system-diamond-sp3/iRvec.npz
 - Ok!
saving periodic
saving periodic to system-diamond-sp3/periodic.npz
 - Ok!
saving is_phonon
saving is_phonon to system-diamond-sp3/is_phonon.npz
 - Ok!
saving wannier_centers_cart
saving wannier_centers_cart to system-diamond-sp3/wannier_centers_cart.npz
 - Ok!
saving pointgroup
saving pointgroup to system-diamond-sp3/pointgroup.npz
 - Ok!
saving Ham - Ok!
saving AA - Ok!
loading real_lattice - Ok!
loading wannier_centers_cart - Ok!
loading pointgroup - Ok!
loading iRvec - Ok!
loading periodic - Ok!
loading is_phonon - Ok!
loading num_wann - Ok!
loading R_matrix Ham - Ok!
[ ]: