General Classes
The classes under the conquest module are used across the library, and are often required to be initialised and passed as arguments to other classes.
- class conquest2a.conquest.Atom(species: int, coords: ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy.float64]], can_move: ~collections.abc.Sequence[str], number: int, label: str = '', forces: ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy.float64]] = <factory>, spins: ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy.float64]] = <factory>)
Class which holds Atom data.
- Parameters:
species (
int) – The integer referring to the species as defined in theConquest_inputfile.coords (REAL ARRAY) – Fractional coordinates of the atom in the interval \([0,1)\). Numbers outside this range are wrapped back into the range.
can_move (
Sequence[str]- list of ‘T’ or ‘F’.) – Whether the atom is allowed to move in each Cartesian axis.number (
int) – The atom number, i.e. its position in the coordinates file.label (
str) – The atom elementcart_coords (REAL ARRAY) – Cartesian coordinates of the atom.
forces (REAL ARRAY) – Force vector of the atom, defaults to
np.array([0.0, 0.0, 0.0]).spins (REAL ARRAY) – Spin moment on the atom, defaults to
np.array([0.0, 0.0, 0.0]).
- to_ase() Atom
Method to return an equivalent ASE
`Atom<https://ase-lib.org/ase/atom.html>`__. Thespinsfield is set to theAtom.magmomwhilst theforcesfield is set toAtom.momentum.- Returns:
ase.Atom: Equivalent ASE
Atomobject.- Return type:
ase.Atom
- class conquest2a.conquest.atom_charge(coordinates: conquest_coordinates, atom_charge_path: str)
Class to process AtomCharge.dat from CONQUEST output files.
It is assumed each row of AtomCharge.dat is arranged such that it is equivalent to the same CONQUEST input coordinates file.
In particular, make use of the conquest_coordinates class to contain the list of Atoms
- Parameters:
coordinates (
conquest_coordinates) – Theconquest_coordinatesinstance to useatom_charge_path (
str) – Path to theAtomCharge.datfile.
- assign_atom_charge() None
Assign each Atom its spin values from the AtomCharge.dat file: up - down
- open_file() None
Reads in the AtomCharge.dat Format of the file is 3 columns: total, spin up spin down CONQUEST only deals with collinear spins
- class conquest2a.conquest.block_processor
Generic class to process CONQUEST output files which are split into blocks via &
Sometimes these blocks are categorised by spins and have comments # at the start of the section
- process_block(line: str) None
Extracts blocks, which are separated by
&on its own newline, for data processing.
- process_headers(line: str) None
This function can be overridden by subclasses to process header lines starting with # Bandstructure and DOS/pDOS files have slightly different headers.
- read_file(filename: str) None
Generic method which calls
process_headers()andprocess_block().- Parameters:
filename (
str) – Path to file
- class conquest2a.conquest.conquest_coordinates(conquest_input: conquest_input)
Class which holds data about the system, including the
Atoms in the system.- Parameters:
conquest_input (
conquest_input) –conquest_inputinstance.
- assign_atom_labels() None
Assign each Atom its label. If the
conquest_inputdoes not define labels for all species, these species labels will be silently skipped.
- get_cartesian_positions() ndarray[tuple[Any, ...], dtype[float64]]
Returns the Cartesian position of all the atoms in the system and attaches to its
Atomfield.- Returns:
The 3D vector of the Cartesian position.
- Return type:
- index_to_atom_map() None
Form a dictionary with keys an element label, and values a list of all the
Atoms with that label. External file formats, such as.vasp, require a count of the number of atoms per element.
- number_of_elements() dict[str, int]
Function to get the number of atoms of each element.
- Returns:
Returns a dictionary of the number of atoms per element
- Return type:
dict[str, int]
- class conquest2a.conquest.conquest_coordinates_processor(path: str, conquest_input: conquest_input)
Class which extracts data from a CONQUEST coordinates file and populates a
conquest_coordinatesinstance.- Parameters:
path (
str) – Path of the CONQUEST coordinates file to read.conquest_input (conquest_input) –
conquest_inputinstance.
- open_file() None
This method reads a CONQUEST coordinate file.
- CONQUEST coords file split into 3 main chunks:
first 3 lines are lattice vectors
fourth line is the total number of atoms in the unit cell
- the following lines describe each atom and look like
<double> <double> <double> <int> <char> <char> <char>