aiida_vasp.parsers.content_parsers.chgcar#
The CHGCAR parser interface.
Contains the parsing interfaces to parsevasp used to parse CHGCAR content.
Module Contents#
Classes#
The parser interface that enables parsing of |
API#
- class aiida_vasp.parsers.content_parsers.chgcar.ChgcarParser(*, handler: TextIO | BinaryIO | None = None, data: aiida.orm.Data | None = None, settings: dict[str, Any] | None = None, options: dict[str, Any] | None = None, raise_errors: bool = False)[source]#
Bases:
aiida_vasp.parsers.content_parsers.base.BaseFileParserThe parser interface that enables parsing of
CHGCARcontent.The parser is triggered by using the
charge_densityand/ormagnetization_densityquantity key.Initialization
- DEFAULT_SETTINGS = None#
- PARSABLE_QUANTITIES = None#
- _init_from_handler(handler: TextIO) None[source]#
Initialize a
parsevaspobject ofChgcarusing a file like handler.- Parameters:
handler (file-like object) – A file like object that provides the necessary
CHGCARcontent to be parsed.
- property charge_density#
Return the charge density.
- Returns:
A NumPy array containing the charge density in the unit cell in C order.
- Return type:
ndarray
- property magnetization_density#
Return the magnetization density.
- Returns:
If collinear spin calculations have been performed, a NumPy array containing the magnetization density in the unit cell in C order is returned. If however a non-collinear spin calculation have been performed, a dictionary is returned with keys x, y and z, each containing the same NumPy array, but for each direction.
- Return type:
dict or ndarray