PDOS

class conquest2a.pdos.pdos_l_processor(conquest_rundir: str | Path)
get_pdos(atom: int) None

Method which clears the data, calls get_pdos() on the atom, and l_map() in one go.

Parameters:

atom (int) – The atom to get the PDOS for.

Raises:

ValueError – If the chosen atom to plot does not have a pDOS file, the method will abort without doing anything.

l_map() None

Reads and stores the columns of an \(l\)-resolved PDOS file.

plot_pdos(atomno: int, ang_mom: int, x1: float | None, x2: float | None, y1: float | None, y2: float | None, filename: str) None

Plots the \(l\) pDOS for an atom.

Parameters:
  • atomno (int) – The atom number as defined in the coordinates.

  • ang_mom (int) – The angular momentum value to plot.

  • x1 (float | None) – Lower energy limit. If None, defaults to the lowest energy in the data.

  • x2 (float | None) – Upper energy limit. If None, defaults to the highest energy in the data.

  • y1 (float | None) – Lower y-limit

  • y2 (float | None) – Upper y-limit

  • filename (str) – Filename of plot.

class conquest2a.pdos.pdos_lm_processor(conquest_rundir: str | Path)
get_pdos(atom: int) None

Method which clears the data, calls get_pdos() on the atom, and lm_map() in one go.

Parameters:

atom (int) – The atom to get the PDOS for.

Raises:

ValueError – If the chosen atom to plot does not have a pDOS file, the method will abort without doing anything.

lm_map() None

Reads and stores the columns of an \(lm\)-resolved PDOS file.

  • For every \(l\), there are \(2l + 1\) columns of PDOS. These become the keys of a dictionary and will be accessed in the form ["l,m"].

  • The values of this dictionary will be a list of NumPy arrays, ordered first by spin-up and then spin-down.

plot_pdos(atomnos: list[int], orbitals: list[str], x1: float | None, x2: float | None, y1: float | None, y2: float | None, filename: str) None

Plots the \(l\) pDOS for an atom.

Parameters:
  • atomnos (int) – The atom numbers as defined in the coordinates, to plot.

  • orbitals (list[int]) – The orbitals to plot. These are a list of the keys in the dictionary.

  • x1 (float | None) – Lower energy limit. If None, defaults to the lowest energy in the data.

  • x2 (float | None) – Upper energy limit. If None, defaults to the highest energy in the data.

  • y1 (float | None) – Lower y-limit

  • y2 (float | None) – Upper y-limit

  • filename (str) – Filename of plot.

class conquest2a.pdos.pdos_processor(conquest_rundir: str | Path, lm: Literal['lm', 'l', 't'] = 't')

Initialise generic PDOS processor class.

CONQUEST can produce a DOS.dat containing the total DOS and the local DOS, which lm="t" will process. To process \(l\) and \(lm\)-resolved PDOS files, initialise an instance of pdos_l_processor and pdos_lm_processor respectively.

Parameters:
  • conquest_rundir (string | Path) – String or Path to the directory containing the PDOS files generated from CONQUEST’s PostProcessing tool.

  • lm (Literal["lm", "l", "t"], optional) – Determines the file-processing mode. Defaults to "t".

get_pdos(atom: int) None

Reads in the PDOS data of a file corresponding to an atom.

CONQUEST outputs pdos filenames pf the form AtomNNNNNNNDOS_lm.dat or AtomNNNNNNNDOS_l.dat where NNNNNNN is a zero-padded atom number (as ordered in the coordinates file). This method is modified by the children pdos_l_processor and pdos_lm_processor for their purposes.

Parameters:

atom (int) – The atom to find and read in the PDOS for.

Raises:

ValueError – If the atom chosen does not have a PDOS file associated to it.

locate_pdos_files() list[str]

Gets the paths to all PDOS files of the right type and stores it in a list.

Returns:

List of all paths to PDOS files.

Return type:

list[str]

plot_pdos(*args, **kwargs) None

Method which plots the PDOS and LDOS inside DOS.dat.

process_block(line: str) None

Extracts blocks, which are separated by & on its own newline, for data processing.

process_headers(line: str) None

Processes lines in PDOS output files starting with #

Parameters:

line (str) – line

resolve_path() Path

Checks whether the directory containing files exists.

Raises:

FileNotFoundError – Raises error if directory does not exist

Returns:

Path to the directory

Return type:

Path