Wiki

Clone wiki

Wannier linear response / Home

Linres

Code for calculating linear response properties based on tight-binding Hamiltonians. It is mainly used with tight-binding Hamiltonians obtained from wannier90 or from the FPLO DFT code but any tight-binding can be used. A python program for generating sd models that is also interfaced to the linear response code is also included.

The code utilizes Kubo formula with constant Gamma approximation to calculate conductivity and the Anomalous Hall effect, spin Hall effect and the current induced spin-polarization, which gives rise to the spin-orbit torque. Other response quantities can be easily implemented.

The program can now calculate also second-order respose using a second order Boltzmann formula, however, this is still largely experimental and not properly documented.

The code is written in modern Fortran and is written in a general way, which allows for easily interfacing the code to different tight-binding models or implement new Kubo formulas.

Note

A new version of the code has been released, which has new input format.

Warning

This software is provided with no warranty. The code is still in active development and you should use it with care. We have tested the code extensively, but there can nevertheless be bugs and not all aspects of the code are documented. Contact us if you need help with using the code or with making sure that the results are correct.

How to use the code

Compilation

See here for description on how to compile the code. Currently, the intel compilers are needed. It should be possible to compile with gfortran and the MKL library from intel, but this has not been tested for the new version. Note that in such a case you would need to compile the fortran95 blas and lapack interfaces.

Input

The input for the code is written in json format and is described in detail here. In addition, the tight-binding hamiltonian is needed. This is in most cases either the 'wann_prefix'_hr.dat generated by wannier90 or +hamdata generated by FPLO.

Example of the input:

{
  "calculation" : {
      "calc" : "cisp",
      "nk" : 100,
      "gammas" : [0.1, 0.5],
      "fermi": [-0.5, -1.0, -1.5],
      "formulas" : [1,2],
      "epsilon" : 0.01,
      "projections" : [0,1,2]
  },
"model": {
    "model_type": "fplo",
    "fplo": {
      "quantization_axis": [ 0, 0, 1 ],
      "hamiltonian_file": "+hamdata"
    }

}

See here for a description of the implemented Kubo formulas.

Implemented models

The code is mainly intended to be used with tight-binding (Wannier) Hamiltonians produced by wannier90 or FPLO. In addition two other models are implemented:

  1. A simple tight-binding model. Note that this may not work in the new versions of the code.
  2. A simple ferromagnetic model with parabollic bands and Rashba and Dresselhaus spin-orbit coupling.

If you want to use a different tight-binding model, you can either output the Hamiltonian in the format of either Wannier90 or FPLO. These formats are straightforward and should be easy to use. Alternatively, it is easy to implement the model directly in the code as the code has a modular structure. You would have to create a module with functions that return the Hamiltonian, velocity operator and possibly also a spin operator at an arbitrary k-point.

Run

Run the code by:

linres.x -i input.json

where input.json is the name of the input file. The output is written to stdout, you can redirect it with >:

linres.x -i input.json > output_file

The code is parallelized with MPI over the k-points, which is very efficient and thus you can use essentially unlimited number of processes (as long as the number of processes is much smaller than the number of k-points). Run with mpirun:

mpirun -n n_proc linres.x -i input.json

here n_proc is the number of processes.

Read results

The output should be largely self-explanatory. You can use the analyze_res script to read the output in python:

from analyze_res import read_result
X = read_result(dire,filename)

This returns the calculated response tensor for all the parameters in the xarray format data format.

k-resolved mode

It is now also possible to output the result at a grid of k-points, instead of the integrated result, see here for details.

Tests and examples

There are tests in the tests/ directory. These are intended mainly for development, but they can also server as examples of how the code is used. The input files are located in tests/files/ and the output files in tests/out_ref_v... You can run the tests by the scripts tests/run_tests. You should specify the number of processes used by mpirun at the beggining of the script and you can modify other parameters, such as the output directory. The default output directory is tests/test_run. There is a simple python script to check the output of the tests in tests/check_output. You can run it with

python2 check_results.py ../test_run/ ../out_ref_0.4.15/

You can also specify higher verbosity using -v 1. Sometimes the tests fail, simply due to rounding errors, check with -v 1 if that happens.

License

This code is distributed under the MPL 2.0 license. If the code is used in any research that leads to a publication, we would appreciate if you cite the code.

Contact

If you have any issues or questions, you can contant me by email at jakub.zelezny@gmail.com or create issue here on bitbucket.

Updated