winSileWannier90

class sisl.io.wannier90.winSileWannier90(filename, mode='r', comment='#')[source]

Wannier seedname input file object

This Sile enables easy interaction with the Wannier90 code.

A seedname is the basis of reading all Wannier90 output because every file in Wannier90 is based of the name of the seed.

Hence, if the correct flags are present in the seedname.win file, and the corresponding files are created, then the corresponding quantity may be read.

For instance to read the Wannier-centres you must have this in your seedname.win:

write_xyz = true

while if you want to read the Wannier Hamiltonian you should have this:

write_xyz = true plot_hr = true

Examples

>>> wan90 = get_sile('seedname.win') 
>>> H = wan90.read_hamiltonian() 
>>> H = wan90.read_hamiltonian(dtype=numpy.float64) 
>>> H = wan90.read_hamiltonian(cutoff=0.00001) 

Attributes

file File of the current Sile

Methods

__init__(filename[, mode, comment])
exist() Query whether the file exists
is_keys(keys) Returns true if isinstance(keys,(list,np.ndarray))
key2case(key, case) Converts str/list of keywords to proper case
keys2case(keys, case) Converts str/list of keywords to proper case
line_has_key(line, key[, case])
line_has_keys(line, keys[, case])
read(*args, **kwargs) Generic read method which should be overloaded in child-classes
read_geometry(*args, **kwargs) Reads a Geometry and creates the Wannier90 cell
read_hamiltonian(*args, **kwargs) Read the electronic structure of the Wannier90 output
read_supercell() Reads a SuperCell and creates the Wannier90 cell
readline([comment]) Reads the next line of the file
step_either(keywords[, case]) Steps the file-handle until the keyword is found in the input
step_to(keywords[, case, reread]) Steps the file-handle until the keyword is found in the input
write(*args, **kwargs) Generic write method which should be overloaded in child-classes
write_geometry(geom[, fmt]) Writes the geometry to the contained file
write_supercell(sc[, fmt]) Writes the supercel to the contained file
exist()

Query whether the file exists

file

File of the current Sile

is_keys(keys)

Returns true if isinstance(keys,(list,np.ndarray))

key2case(key, case)

Converts str/list of keywords to proper case

keys2case(keys, case)

Converts str/list of keywords to proper case

line_has_key(line, key, case=True)
line_has_keys(line, keys, case=True)
read(*args, **kwargs)

Generic read method which should be overloaded in child-classes

Parameters:

**kwargs :

keyword arguments will try and search for the attribute read_<> and call it with the remaining **kwargs as arguments.

read_geometry(*args, **kwargs)[source]

Reads a Geometry and creates the Wannier90 cell

read_hamiltonian(*args, **kwargs)[source]

Read the electronic structure of the Wannier90 output

Parameters:

cutoff: float, optional

the cutoff value for the zero Hamiltonian elements, default to 0.00001 eV.

read_supercell()[source]

Reads a SuperCell and creates the Wannier90 cell

readline(comment=False)

Reads the next line of the file

step_either(keywords, case=True)

Steps the file-handle until the keyword is found in the input

step_to(keywords, case=True, reread=True)

Steps the file-handle until the keyword is found in the input

write(*args, **kwargs)

Generic write method which should be overloaded in child-classes

Parameters:

**kwargs :

keyword arguments will try and search for the attribute write_ and call it with the remaining **kwargs as arguments.

write_geometry(geom, fmt='.8f', *args, **kwargs)[source]

Writes the geometry to the contained file

write_supercell(sc, fmt='.8f', *args, **kwargs)[source]

Writes the supercel to the contained file