tsgfSileSiesta¶
-
class
sisl.io.siesta.
tsgfSileSiesta
(filename, mode='r', *args, **kwargs)¶ Surface Green function file containing, Hamiltonian, overlap matrix and self-energies
Do not mix read and write statements when using this code. Complete one or the other before doing the other thing. Fortran does not allow the same file opened twice, if this is needed you are recommended to make a symlink to the file and thus open two different files.
This small snippet reads/writes the GF file
>>> with sisl.io.tsgfSileSiesta('hello.GF') as f: ... nspin, no, k, E = f.read_header() ... for ispin, new_k, k, E in f: ... if new_k: ... H, S = f.read_hamiltonian() ... SeHSE = f.read_self_energy()
To write a file do:
>>> with sisl.io.tsgfSileSiesta('hello.GF') as f: ... f.write_header(sisl.MonkhorstPack(...), E) ... for ispin, new_k, k, E in f: ... if new_k: ... f.write_hamiltonian(H, S) ... f.write_self_energy(SeHSE)
Attributes
File of the current Sile
File of the current Sile
Methods
__init__
(self, filename[, mode])Initialize self.
dir_file
(self[, filename])File of the current Sile
disk_usage
(self)Calculate the estimated size of the resulting file
exist
(self)Query whether the file exists
read
(self, \*args, \*\*kwargs)Generic read method which should be overloaded in child-classes
read_hamiltonian
(self)Return current Hamiltonian and overlap matrix from the GF file
read_header
(self)Read the header of the file and open it for reading subsequently
read_self_energy
(self)Read the currently reached bulk self-energy
write
(self, \*args, \*\*kwargs)Generic write method which should be overloaded in child-classes
write_hamiltonian
(self, H[, S])Write the current energy, k-point and H and S to the file
write_header
(self, bz, E[, mu, obj])Write to the binary file the header of the file
write_self_energy
(self, SE)Write the current self energy, k-point and H and S to the file
-
property
base_file
¶ File of the current Sile
-
dir_file
(self, filename=None)¶ File of the current Sile
-
disk_usage
(self)¶ Calculate the estimated size of the resulting file
- Returns
- estimated disk-space used in GB
-
exist
(self)¶ Query whether the file exists
-
property
file
¶ File of the current Sile
-
read
(self, *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_hamiltonian
(self)¶ Return current Hamiltonian and overlap matrix from the GF file
- Returns
- complex128Hamiltonian matrix
- complex128Overlap matrix
-
read_header
(self)¶ Read the header of the file and open it for reading subsequently
NOTES: this method may change in the future
- Returns
- nspinnumber of spin-components stored (1 or 2)
- no_usize of the matrices returned
- kk points in the GF file
- Eenergy points in the GF file
-
read_self_energy
(self)¶ Read the currently reached bulk self-energy
The returned self-energy is:
\[\boldsymbol \Sigma_{\mathrm{bulk}}(E) = \mathbf S E - \mathbf H - \boldsymbol \Sigma(E)\]- Returns
- complex128Self-energy matrix
-
write
(self, *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_hamiltonian
(self, H, S=None)¶ Write the current energy, k-point and H and S to the file
- Parameters
- Hmatrix
a square matrix corresponding to the Hamiltonian
- Smatrix, optional
a square matrix corresponding to the overlap, for efficiency reasons it may be advantageous to specify this argument for orthogonal cells.
-
write_header
(self, bz, E, mu=0.0, obj=None)¶ Write to the binary file the header of the file
- Parameters
- bzBrillouinZone
contains the k-points, the weights and possibly the parent Hamiltonian (if obj is None)s
- Earray_like of cmplx or float
the energy points. If obj is an instance of SelfEnergy where an associated
eta
is defined then E may be float, otherwise it has to be a complex array.- mufloat, optional
chemical potential in the file
- obj…, optional
an object that contains the Hamiltonian definitions, defaults to
bz.parent
-
write_self_energy
(self, SE)¶ Write the current self energy, k-point and H and S to the file
The self-energy must correspond to the bulk self-energy
\[\boldsymbol \Sigma_{\mathrm{bulk}}(E) = \mathbf S E - \mathbf H - \boldsymbol \Sigma(E)\]- Parameters
- SEmatrix
a square matrix corresponding to the self-energy (Green function)
-
property