modules

Platforms: Unix, Linux

Module information :

Program:Module containing all the classes, functions and parameters needed by the main programs
Purpose:Prevent cluttering of the other programs
Input(s):none
Output(s):none
class modules.atom[source]

This is the class for Atoms

An atom object has the following attributes :
  • a symbol (a string) (access through *.symbol)
  • an x coordinate (a float) (access through *.x)
  • a y coordinate (a float) (access through *.y)
  • a z coordinate (a float) (access through *.z)
modules.barycenter(wannier_functions)[source]

This function takes a list of Wannier Functions and computes its barycenter.

Input(s) :a list of Wannier Function objects
Output(s) :a rank-1 numpy array containing the x, y, z coordinates of the barycenter
modules.print_wf(wf_list)[source]

A utility function that allows the user to print the information contained in each Wannier Function of a list

Input(s) :a list of Wannier Function objects
Output(s) :a string printed on the screen
modules.read_htC(matrix_file)[source]

This function reads a (conductor) Hamiltonian matrix given by the Wannier90 code.

The name of the file generally ends with *_htC.dat

The format of this file is as follows :

  • the first line contains comments
  • the second line contains the size N of the (square) N*N matrix
  • all the remaining lines are filled with numbers representing the matrix elements.

Note

the matrix elements are printed in Fortran (column major) format. This means that if the matrix has elements H(i,j) for i and j in [1,N], then the matrix elements are given in the following order

H(1,1)  H(2,1)  H(3,1)  H(4,1) ...
H(j,1)  H(j+1,1) ...
Input(s) :a string corresponding to the name of the file containing the Hamiltonian matrix
Output(s) :a rank-2 numpy array containing the Hamiltonian matrix
modules.read_lead(filename)[source]

This function extracts the H00 and H01 matrices from a *_htL.dat or *_htR.dat Wannier90 formatted file.

The H00 and H01 matrices correspond respectively to the on-site and off-diagonal matrix sub-blocks of a lead principal layer.

Input(s) :a string corresponding to the name (full path) of the file containing the principal layer matrices
Output(s) :a tuple with two rank-2 numpy arrays in the following order (H00,H01)
modules.read_tran_info(file)[source]

This function is designed to read a *_tran_info.dat file and extract its content

The format of the file is as follows:
  • first line contains the total number of Wannier Funtions in the system

  • second line contains the total number of WF in one principal layer

  • third line contains the number of lead unit cells in one principal layer

  • forth line contains the direction of conduction “x”, “y” or “z” followed by the second direction of sorting

  • the next lines contain:

    WF index i, xi, yi, zi, <wi| H |wi>

  • then comes the total number of atoms in the system

  • at last the remaining lines contain:

    Atomic symbol j, xj, yj, zj

xi is the x coordinate of the i-th WF

yj is the y coordinate of the j-th atom

wi is the i-th WF

<wi| H |wi> is the “on-site” matrix element associated with wi

Input(s) :

a string corresponding to the name of the *_tran_info.dat file

Output(s) :

an integer representing the total number of Wannier Functions in the system

an integer representing the number of Wannier Functions in one principal layer

an integer representing the number of unit cells in one principal layer

a string giving the direction of conduction (“x”, “y” or “z”)

a string giving the second direction of sorting (“x”, “y” or “z”)

a list of Wannier Function objects with the proper attributes as defined in the wannier_function class

an integer representing the total number of atoms in the system

a list of atom objects with the proper attributes as defined in the atom class

modules.read_xyz(filename)[source]

This function reads an XYZ formatted file and returns a list of atom objects. If it can find it, the size of the system is also returned.

Input(s) :a string for the name of the xyz file
Output(s) :a list of atom objects a float which represents the size of the system
modules.sort(wf_list, cond_dir, second_dir, delta)[source]

This function takes a list of Wannier Functions and sorts the atomic positions according to a scheme similar to the one in Wannier90.

The first direction of sorting is cond_dir and the second direction of sorting is second_dir.

Input(s) :

a list of Wannier Function objects

a string that gives the first direction of sorting (which corresponds to the direction of conduction)

a string that gives the second direction of sorting

a float which gives the distance threshold for grouping WF

Output(s) :

a list of Wannier Function objects properly sorted

modules.sort_positions(atomic_coordinates, cond_dir)[source]

This function takes a list of atom objects and sorts the atomic positions only in the direction of conduction

Input(s) :

the list of atom objects

a string which represents the direction of conduction (which serves as the main direction of sorting)

Output(s) :

a list of atom objects in sorted order

modules.translate_to_zero(atomic_coordinates, cond_dir)[source]

This function takes a list of atom objects and translate the coordinates in the direction of conduction in such a way that the left-most atom is set to 0

Input(s) :

the list of atom objects

a string which represents the direction of conduction

Output(s) :

a list of atom objects with the properly translated coordinates

class modules.wannier_function[source]

This is the class for Wannier Functions

A wannier_function object has the following attributes :
  • an index (an integer) (access through *.index)
  • an x coordinate (a float) (access through *.x)
  • a y coordinate (a float) (access through *.y)
  • a z coordinate (a float) (access through *.z)
  • an on-site matrix element (a float) (access through *.onsite)
modules.write_htC(file_name, matrix)[source]

This function will take a Hamiltonian matrix and write it into a file in a format usable by Wannier90.

In particular, the matrix will be written to file in column-major format (see read_htC for more detail).

Input(s) :

a string corresponding to the name of the file that will contain the Hamiltonian matrix.

a rank-2 numpy array containing the matrix

Output(s) :

a file containing the matrix

modules.write_tran_info(wf_num, wf_num_per_pl, cell_per_pl, cond_dir, second_dir, wf_list, atom_num, atom_list)[source]

This function is designed to write a *_tran_info.dat file from a list of data

The newly created file is called new_tran_info.dat

Input(s) :

an integer for the total number of Wannier Functions in the system

an integer for the number of Wannier Functions in one principal layer

an integer for the number of unit cells in one principal layer

a string giving the direction of conduction (which is also the first direction of sorting)

a string giving the second direction of sorting

a list of Wannier Function objects

an integer giving the number of atoms in the system

a list of atom objects

Output(s) :

a file in a format similar to the *_tran_info.dat files given by Wannier90

modules.write_xyz(filename, atomic_coordinates, size)[source]

This function takes a list of atom objects and prints their cartesian coordinates in a file with xyz format

Input(s) :

a string for the name of the xyz file

the list of atom objects

a float, the size of the system in Angstrom(s)

Output(s) :

a file with name filename containing the atomic positions in xyz format

Previous topic

constraints

Next topic

progressbar

This Page