tepkit.io.vasp.Poscar#

class tepkit.io.vasp.Poscar#

Bases: tepkit.io.StructuredTextFile

See: https://www.vasp.at/wiki/index.php/POSCAR

Attributes#

Attribute

Default Value

Description

default_file_name

'POSCAR'

The default name of file when use from_dir() .

comment

'POSCAR'

The first line of POSCAR.

scaling_factor

1.0

has_species_names

True

species_names

['Unknown']

ions_per_species

[1]

ion_coordinates_mode

None

has_selective_dynamics

False

selective_dynamics

None

has_lattice_velocities

False

lattice_velocities

None

has_ion_velocities

False

ion_velocities

None

md_extra

None

Properties#

unscale_lattice

ion_positions

lattice

reciprocal_lattice

n_ions

species_index_per_ion

Returns a list of species indexes for each ion.

species_name_per_ion

Returns a list of species names for each ion.

thickness_info

Returns thickness-related data.

Methods#

from_string(→ tepkit.utils.typing_tools.Self)

Parse the string to structured data.

__str__()

get_lattice(...)

get_reciprocal_lattice(...)

get_shengbte_types(→ list[int])

Returns a list of integers for ShengBTE-CONTROL-crystal-types.

get_cartesian_ion_positions(...)

Return the Cartesian coordinates of ions.

get_fractional_ion_positions(...)

Return the fractional coordinates of ions.

get_volume(→ float)

get_high_symmetry_points_2d(decimal[, with_2pi])

Get the absolute and relative coordinates of all possible high symmetry points of a 2D material.

get_interatomic_distances(...)

Return the distances between ions.

get_neighbor_distances(→ list[float])

Return the distances of the n-th neighbors.

get_atomic_numbers(→ list[int])

get_pymatgen_poscar()

to_supercell(→ tepkit.utils.typing_tools.Self)

All Members#

default_file_name = 'POSCAR'

The default name of file when use from_dir() .

comment: str = 'POSCAR'

The first line of POSCAR.

scaling_factor: float | list[float] = 1.0
has_species_names: bool = True
species_names: list[str] = ['Unknown']
ions_per_species: list[int] = [1]
ion_coordinates_mode: VaspCoordinatesMode
has_selective_dynamics: bool = False
selective_dynamics: NumpyArrayNx3[bool] | None = None
has_lattice_velocities: bool = False
lattice_velocities: NumpyArrayNx3[float] | None = None
has_ion_velocities: bool = False
ion_velocities: NumpyArrayNx3[float] | None = None
md_extra: str | None = None
property unscale_lattice: NumpyArray3x3[float]
property ion_positions: NumpyArrayNx3[float]
classmethod from_string(string: str) Self

Parse the string to structured data.

__str__()
get_lattice() NumpyArray3x3[float]
get_reciprocal_lattice(with_2pi=True) NumpyArray3x3[float]
Parameters:

with_2pi – VASP Cartesian KPOINTS use with_2pi=False

Returns:

property lattice: NumpyArray3x3[float]
property reciprocal_lattice: NumpyArray3x3[float]
property n_ions: int
property species_index_per_ion: list[int]

Returns a list of species indexes for each ion. e.g. [0, 0, 1, 1, 2] from Bi2Se2Te

get_shengbte_types() list[int]

Returns a list of integers for ShengBTE-CONTROL-crystal-types. e.g. [1, 1, 2, 2, 3] from Bi2Se2Te

property species_name_per_ion: list[str]

Returns a list of species names for each ion. e.g. [“Bi”, “Bi”, “Se”, “Se”, “Te”] from Bi2Se2Te

property thickness_info: dict

Returns thickness-related data. Such as effective thickness, van der Waals radius of edge atoms, etc.

get_cartesian_ion_positions(*, threshold: float | None = None) NumpyArrayNx3[float]

Return the Cartesian coordinates of ions.

Parameters:

threshold – The absolute values smaller than this value will be set to zero. (Recommended value: 1e-13)

get_fractional_ion_positions() NumpyArrayNx3[float]

Return the fractional coordinates of ions.

get_volume(unit: str = 'Angstrom^3') float
get_high_symmetry_points_2d(decimal, with_2pi=True)

Get the absolute and relative coordinates of all possible high symmetry points of a 2D material.

Parameters:
  • decimal

  • with_2pi – VASP Cartesian KPOINTS use with_2pi=False

Returns:

get_interatomic_distances() NumpyArrayNxN[float]

Return the distances between ions.

get_neighbor_distances(max_nth=100) list[float]

Return the distances of the n-th neighbors.

get_atomic_numbers(per_ion=False) list[int]
>>> poscar = Poscar.from_file("Bi2Te3.poscar")
>>> poscar.get_atomic_numbers() # noinspection PyDocstringTypes
[83, 52]
>>> poscar.get_atomic_numbers(per_ion=True)
[83, 83, 52, 52, 52]
get_pymatgen_poscar()
to_supercell(na: int, nb: int, nc: int) Self