Python module brille

This module provides access to the C++ brille library which can be used to interact with spacegroup and pointgroup symmetry operations, to determine the first Brillouin zone for a given real space crystallographic lattice, to find an irreducible polyhedron from the first Brillouin zone and the pointgroup operations of a spacegroup, to construct polyhedron-filling connected point networks, and to perform linear-interpolation of user-provided data for any reciprocal space point at a symmetry-equivalent position within the connected point network.

class brille.AngleUnit(self: brille._brille.AngleUnit, value: int)

Bases: pybind11_object

The units of a number representing an angle

Members:

not_provided : unknown, will be inferred

radian : radian

degree : degree

pi : radian divided by pi

degree = <AngleUnit.degree: 2>
property name
not_provided = <AngleUnit.not_provided: 0>
pi = <AngleUnit.pi: 3>
radian = <AngleUnit.radian: 1>
property value
class brille.ApproxConfig(self: brille._brille.ApproxConfig, digits: int = 1000, real_space_tolerance: float = 1e-10, reciprocal_space_tolerance: float = 1e-10)

Bases: pybind11_object

property digits
property real_space_tolerance
property reciprocal_space_tolerance
class brille.BZMeshQcc(self: brille._brille.BZMeshQcc, brillouin_zone: brille._brille.BrillouinZone, max_size: float = -1.0, num_levels: int = 3, max_points: int = -1)

Bases: pybind11_object

property BrillouinZone
property bytes_per_point

Return the memory required per interpolation point result in bytes

fill(*args, **kwargs)

Overloaded function.

  1. fill(self: brille._brille.BZMeshQcc, values_data: numpy.ndarray[numpy.complex128], values_elements: numpy.ndarray[numpy.int32], vectors_data: numpy.ndarray[numpy.complex128], vectors_elements: numpy.ndarray[numpy.int32], sort: bool = False) -> None

Provide data required for interpolation to the grid without cost information.

Parameters:
  • values_data (numpy.ndarray) – The eigenvalue data to be stored in the grid. The first dimension must be equal in size to the number of grid-vertices. If two dimensional the second dimension is interpreted as all information for a single mode flattened and concatenated into (scalars, vectors, matrices) – in that order. If more than two dimensional, the second dimension indexes modes and higher dimensions will be flattened as if row ordered and must flatten into a concatenated list of (scalars, vectors, matrices). If the provided array can be interpreted as a contiguous row-ordered two dimensional array it will be used in place, otherwise a copy will be made.

  • values_elements (integer vector-like) – A multi-purpose vector containing, in order:

    • the number of scalar-like eigenvalue elements,

    • the number of vector-like eigenvalue elements (must be \(3\times N\)),

    • the number of matrix-like eigenvalue elements (must be \(9\times N\)),

    • an integer RotatesLike value denoting how the vector-like and matrix-like parts transform under application of a symmetry operation (see note below).

    • an integer LengthUnit value denoting what units the vector-like and matrix-like parts are in (see note below).

  • vectors_data (numpy.ndarray) – The eigenvector data to be stored in the grid. Same shape restrictions as values_data

  • vectors_elements – Like values_elements but for the eigenvectors

  • sort (logical (default False)) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Integer values outside of the mapped range (or missing) are replaced by 0.

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Integer values outside of the mapped range (or missing) are replaced by 3.

  1. fill(self: brille._brille.BZMeshQcc, values_data: numpy.ndarray[numpy.complex128], values_elements: numpy.ndarray[numpy.int32], values_weights: numpy.ndarray[numpy.float64], vectors_data: numpy.ndarray[numpy.complex128], vectors_elements: numpy.ndarray[numpy.int32], vectors_weights: numpy.ndarray[numpy.float64], sort: bool = False) -> None

Provide all data required for interpolation to the grid at once

Parameters:
  • values_data (numpy.ndarray) – The eigenvalue data to be stored in the grid. The first dimension must be equal in size to the number of grid-vertices. If two dimensional the second dimension is interpreted as all information for a single mode flattened and concatenated into (scalars, vectors, matrices) – in that order. If more than two dimensional, the second dimension indexes modes and higher dimensions will be flattened as if row ordered and must flatten into a concatenated list of (scalars, vectors, matrices). If the provided array can be interpreted as a contiguous row-ordered two dimensional array it will be used in place, otherwise a copy will be made.

  • values_elements (integer vector-like) – A multi-purpose vector containing, in order:

    • the number of scalar-like eigenvalue elements,

    • the number of vector-like eigenvalue elements (must be \(3\times N\)),

    • the number of matrix-like eigenvalue elements (must be \(9\times N\)),

    • an integer RotatesLike value denoting how the vector-like and matrix-like parts transform under application of a symmetry operation (see note below),

    • an integer LengthUnit value denoting what units the vector-like and matrix-like parts are in (see note below)

    • which scalar cost function should be used (see below),

    • which vector cost function should be used (see below).

    See the note below for the meaning of the last three values.

  • values_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvalue elements stored in the grid

  • vectors_data (numpy.ndarray) – The eigenvector data to be stored in the grid. Same shape restrictions as values_data

  • vectors_elements – Like values_elements but for the eigenvectors

  • vectors_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvector elements stored in the grid

  • sort (logical (default False)) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Integer values outside of the mapped range (or missing) are replaced by 3.

Mapping of integers to scalar cost function:

value

function(x,y)

0

magnitude(x-y)

Mapping of integers to vector cost function:

value

function(vec_x, vec_y)

0

sin(hermitian_angle(vec_x, vec_y))

1

vector_distance(vec_x, vec_y)

2

1 - vector_product(vec_x, vec_y)

3

vector_angle(vec_x, vec_y)

4

hermitian_angle(vec_x, vec_y)

Integer values outside of the mapped range (or missing) are replaced by 0.

static from_file(filename: str, entry: str = 'BZMeshQcc') brille._brille.BZMeshQcc

Save the object to an HDF5 file

Parameters:
  • filename (str) – The full path specification for the file to read from

  • entry (str) – The group path, e.g., “my/cool/grid”, where to read from inside the file, with a default equal to the object Class name

Return type:

clsObj

property invA
ir_interpolate_at(self: brille._brille.BZMeshQcc, Q: numpy.ndarray[numpy.float64], useparallel: bool = False, threads: int = -1, do_not_move_points: bool = False) tuple[numpy.ndarray[numpy.complex128], numpy.ndarray[numpy.complex128]]

Perform linear interpolation of the stored data at irreducible equivalent points

The irreducible first Brillouin zone is the part of reciprocal space which is invariant under application of the integer translations and the pointgroup operations of a reciprocal space lattice. This method finds points equivalent to the input within the irreducible first Brillouin zone and then interpolates pre-stored information to provide an estimate at the found positions.

Parameters:
  • Q (numpy.ndarray) – A two dimensional array with Q.shape[1] == 3 containing the positions at which an interpolated result is required, expressed in units of the reciprocal lattice.

  • useparallel (bool, optional) – Whether a serial or parallel code should be utilised

  • threads (int, optional) – How many OpenMP workers should be utilised; if this value is less than one the environment variable OMP_NUM_THREADS will be used.

  • do_not_move_points (bool, optional) – If True the provided Q points must already lie within the first Brillouin zone. No check is made to verify this requirement and if any Q lie outside of the gridded volume out-of-bounds errors may result in bad data or runtime errors.

Returns:

The interpolated eigenvalues and eigenvectors at the equivalent irreducible first Brillouin zone points. The shape of each output will depend on the shape of the data provided to the fill() method. i If the filled eigenvalues were of shape [N_grid_points, N_modes, A, ..., B], the eigenvectors were of shape [N_grid_points, N_modes, C, ..., D], and the provided points of shape [N_Q_points, 3] then the output shapes will be [N_Q_points, N_modes, A, ..., B] and [N_Q_points, N_modes, C, ..., D] for the eigenvalues and eigenvectors, respectively.

Return type:

tuple

property rlu
set_flags_weights(self: brille._brille.BZMeshQcc, values_flags: numpy.ndarray[numpy.int32], values_weights: numpy.ndarray[numpy.float64], vectors_flags: numpy.ndarray[numpy.int32], vectors_weights: numpy.ndarray[numpy.float64], sort: bool = False) None

Set RotatesLike, ~brille._brille.LengthUnit and cost functions plus relative cost weights for the values and vectors stored in the object

Parameters:
  • values_flags (integer, vector-like) – One or more values indicating the RotatesLike value for the eigenvalues stored in the object, the ~brille._brille.LengthUnit value, plus which cost function to use when comparing stored eigenvalues at neighbouring grid points for scalar- and vector-like eigenvalues.

  • values_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvalue elements stored in the grid

  • vectors_flags (integer, vector-like) – One or more values indicating the RotatesLike value for the eigenvalues stored in the object, the ~brille._brille.LengthUnit value, plus which cost function to use when comparing stored eigenvectors at neighbouring grid points for scalar- and vector-like eigenvectors.

  • vectors_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvector elements stored in the grid

  • sort (bool, optional) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Mapping of integers to scalar cost function:

value

function(x,y)

0

magnitude(x-y)

Mapping of integers to vector cost function:

value

function(vec_x, vec_y)

0

sin(hermitian_angle(vec_x, vec_y))

1

vector_distance(vec_x, vec_y)

2

1 - vector_product(vec_x, vec_y)

3

vector_angle(vec_x, vec_y)

4

hermitian_angle(vec_x, vec_y)

Integer values outside of the mapped range (or missing) are replaced by 0.

sort(self: brille._brille.BZMeshQcc) None
property tetrahedra
to_file(self: brille._brille.BZMeshQcc, filename: str, entry: str = 'BZMeshQcc', flags: str = 'ac') bool

Save the object to an HDF5 file

Parameters:
  • filename (str) – The full path specification for the file to write into

  • entry (str) – The group path, e.g., “my/cool/grid”, where to write inside the file, with a default equal to the object Class name

  • flags (str) – The HDF5 permissions to use when opening the file. Default ‘a’ writes to an existing file – if entry exists in the file it is overwritten.

Note

Possible flags are:

flags

meaning

HDF equivalent

‘r’

read

H5F_ACC_RDONLY

‘x’

write, error if exists

H5F_ACC_EXCL

‘a’

write, append to file

H5F_ACC_RDWR

‘c’

write, error if exists

H5F_ACC_CREAT

‘t’

write, replace existing

H5F_ACC_TRUNC

Returns:

Indication of writing success.

Return type:

bool

property values

Return a shared view of the stored eigenvalues

property vectors

Return a shared view of the stored eigenvectors

class brille.BZMeshQdc(self: brille._brille.BZMeshQdc, brillouin_zone: brille._brille.BrillouinZone, max_size: float = -1.0, num_levels: int = 3, max_points: int = -1)

Bases: pybind11_object

property BrillouinZone
property bytes_per_point

Return the memory required per interpolation point result in bytes

fill(*args, **kwargs)

Overloaded function.

  1. fill(self: brille._brille.BZMeshQdc, values_data: numpy.ndarray[numpy.float64], values_elements: numpy.ndarray[numpy.int32], vectors_data: numpy.ndarray[numpy.complex128], vectors_elements: numpy.ndarray[numpy.int32], sort: bool = False) -> None

Provide data required for interpolation to the grid without cost information.

Parameters:
  • values_data (numpy.ndarray) – The eigenvalue data to be stored in the grid. The first dimension must be equal in size to the number of grid-vertices. If two dimensional the second dimension is interpreted as all information for a single mode flattened and concatenated into (scalars, vectors, matrices) – in that order. If more than two dimensional, the second dimension indexes modes and higher dimensions will be flattened as if row ordered and must flatten into a concatenated list of (scalars, vectors, matrices). If the provided array can be interpreted as a contiguous row-ordered two dimensional array it will be used in place, otherwise a copy will be made.

  • values_elements (integer vector-like) – A multi-purpose vector containing, in order:

    • the number of scalar-like eigenvalue elements,

    • the number of vector-like eigenvalue elements (must be \(3\times N\)),

    • the number of matrix-like eigenvalue elements (must be \(9\times N\)),

    • an integer RotatesLike value denoting how the vector-like and matrix-like parts transform under application of a symmetry operation (see note below).

    • an integer LengthUnit value denoting what units the vector-like and matrix-like parts are in (see note below).

  • vectors_data (numpy.ndarray) – The eigenvector data to be stored in the grid. Same shape restrictions as values_data

  • vectors_elements – Like values_elements but for the eigenvectors

  • sort (logical (default False)) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Integer values outside of the mapped range (or missing) are replaced by 0.

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Integer values outside of the mapped range (or missing) are replaced by 3.

  1. fill(self: brille._brille.BZMeshQdc, values_data: numpy.ndarray[numpy.float64], values_elements: numpy.ndarray[numpy.int32], values_weights: numpy.ndarray[numpy.float64], vectors_data: numpy.ndarray[numpy.complex128], vectors_elements: numpy.ndarray[numpy.int32], vectors_weights: numpy.ndarray[numpy.float64], sort: bool = False) -> None

Provide all data required for interpolation to the grid at once

Parameters:
  • values_data (numpy.ndarray) – The eigenvalue data to be stored in the grid. The first dimension must be equal in size to the number of grid-vertices. If two dimensional the second dimension is interpreted as all information for a single mode flattened and concatenated into (scalars, vectors, matrices) – in that order. If more than two dimensional, the second dimension indexes modes and higher dimensions will be flattened as if row ordered and must flatten into a concatenated list of (scalars, vectors, matrices). If the provided array can be interpreted as a contiguous row-ordered two dimensional array it will be used in place, otherwise a copy will be made.

  • values_elements (integer vector-like) – A multi-purpose vector containing, in order:

    • the number of scalar-like eigenvalue elements,

    • the number of vector-like eigenvalue elements (must be \(3\times N\)),

    • the number of matrix-like eigenvalue elements (must be \(9\times N\)),

    • an integer RotatesLike value denoting how the vector-like and matrix-like parts transform under application of a symmetry operation (see note below),

    • an integer LengthUnit value denoting what units the vector-like and matrix-like parts are in (see note below)

    • which scalar cost function should be used (see below),

    • which vector cost function should be used (see below).

    See the note below for the meaning of the last three values.

  • values_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvalue elements stored in the grid

  • vectors_data (numpy.ndarray) – The eigenvector data to be stored in the grid. Same shape restrictions as values_data

  • vectors_elements – Like values_elements but for the eigenvectors

  • vectors_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvector elements stored in the grid

  • sort (logical (default False)) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Integer values outside of the mapped range (or missing) are replaced by 3.

Mapping of integers to scalar cost function:

value

function(x,y)

0

magnitude(x-y)

Mapping of integers to vector cost function:

value

function(vec_x, vec_y)

0

sin(hermitian_angle(vec_x, vec_y))

1

vector_distance(vec_x, vec_y)

2

1 - vector_product(vec_x, vec_y)

3

vector_angle(vec_x, vec_y)

4

hermitian_angle(vec_x, vec_y)

Integer values outside of the mapped range (or missing) are replaced by 0.

static from_file(filename: str, entry: str = 'BZMeshQdc') brille._brille.BZMeshQdc

Save the object to an HDF5 file

Parameters:
  • filename (str) – The full path specification for the file to read from

  • entry (str) – The group path, e.g., “my/cool/grid”, where to read from inside the file, with a default equal to the object Class name

Return type:

clsObj

property invA
ir_interpolate_at(self: brille._brille.BZMeshQdc, Q: numpy.ndarray[numpy.float64], useparallel: bool = False, threads: int = -1, do_not_move_points: bool = False) tuple[numpy.ndarray[numpy.float64], numpy.ndarray[numpy.complex128]]

Perform linear interpolation of the stored data at irreducible equivalent points

The irreducible first Brillouin zone is the part of reciprocal space which is invariant under application of the integer translations and the pointgroup operations of a reciprocal space lattice. This method finds points equivalent to the input within the irreducible first Brillouin zone and then interpolates pre-stored information to provide an estimate at the found positions.

Parameters:
  • Q (numpy.ndarray) – A two dimensional array with Q.shape[1] == 3 containing the positions at which an interpolated result is required, expressed in units of the reciprocal lattice.

  • useparallel (bool, optional) – Whether a serial or parallel code should be utilised

  • threads (int, optional) – How many OpenMP workers should be utilised; if this value is less than one the environment variable OMP_NUM_THREADS will be used.

  • do_not_move_points (bool, optional) – If True the provided Q points must already lie within the first Brillouin zone. No check is made to verify this requirement and if any Q lie outside of the gridded volume out-of-bounds errors may result in bad data or runtime errors.

Returns:

The interpolated eigenvalues and eigenvectors at the equivalent irreducible first Brillouin zone points. The shape of each output will depend on the shape of the data provided to the fill() method. i If the filled eigenvalues were of shape [N_grid_points, N_modes, A, ..., B], the eigenvectors were of shape [N_grid_points, N_modes, C, ..., D], and the provided points of shape [N_Q_points, 3] then the output shapes will be [N_Q_points, N_modes, A, ..., B] and [N_Q_points, N_modes, C, ..., D] for the eigenvalues and eigenvectors, respectively.

Return type:

tuple

property rlu
set_flags_weights(self: brille._brille.BZMeshQdc, values_flags: numpy.ndarray[numpy.int32], values_weights: numpy.ndarray[numpy.float64], vectors_flags: numpy.ndarray[numpy.int32], vectors_weights: numpy.ndarray[numpy.float64], sort: bool = False) None

Set RotatesLike, ~brille._brille.LengthUnit and cost functions plus relative cost weights for the values and vectors stored in the object

Parameters:
  • values_flags (integer, vector-like) – One or more values indicating the RotatesLike value for the eigenvalues stored in the object, the ~brille._brille.LengthUnit value, plus which cost function to use when comparing stored eigenvalues at neighbouring grid points for scalar- and vector-like eigenvalues.

  • values_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvalue elements stored in the grid

  • vectors_flags (integer, vector-like) – One or more values indicating the RotatesLike value for the eigenvalues stored in the object, the ~brille._brille.LengthUnit value, plus which cost function to use when comparing stored eigenvectors at neighbouring grid points for scalar- and vector-like eigenvectors.

  • vectors_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvector elements stored in the grid

  • sort (bool, optional) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Mapping of integers to scalar cost function:

value

function(x,y)

0

magnitude(x-y)

Mapping of integers to vector cost function:

value

function(vec_x, vec_y)

0

sin(hermitian_angle(vec_x, vec_y))

1

vector_distance(vec_x, vec_y)

2

1 - vector_product(vec_x, vec_y)

3

vector_angle(vec_x, vec_y)

4

hermitian_angle(vec_x, vec_y)

Integer values outside of the mapped range (or missing) are replaced by 0.

sort(self: brille._brille.BZMeshQdc) None
property tetrahedra
to_file(self: brille._brille.BZMeshQdc, filename: str, entry: str = 'BZMeshQdc', flags: str = 'ac') bool

Save the object to an HDF5 file

Parameters:
  • filename (str) – The full path specification for the file to write into

  • entry (str) – The group path, e.g., “my/cool/grid”, where to write inside the file, with a default equal to the object Class name

  • flags (str) – The HDF5 permissions to use when opening the file. Default ‘a’ writes to an existing file – if entry exists in the file it is overwritten.

Note

Possible flags are:

flags

meaning

HDF equivalent

‘r’

read

H5F_ACC_RDONLY

‘x’

write, error if exists

H5F_ACC_EXCL

‘a’

write, append to file

H5F_ACC_RDWR

‘c’

write, error if exists

H5F_ACC_CREAT

‘t’

write, replace existing

H5F_ACC_TRUNC

Returns:

Indication of writing success.

Return type:

bool

property values

Return a shared view of the stored eigenvalues

property vectors

Return a shared view of the stored eigenvectors

class brille.BZMeshQdd(self: brille._brille.BZMeshQdd, brillouin_zone: brille._brille.BrillouinZone, max_size: float = -1.0, num_levels: int = 3, max_points: int = -1)

Bases: pybind11_object

property BrillouinZone
property bytes_per_point

Return the memory required per interpolation point result in bytes

fill(*args, **kwargs)

Overloaded function.

  1. fill(self: brille._brille.BZMeshQdd, values_data: numpy.ndarray[numpy.float64], values_elements: numpy.ndarray[numpy.int32], vectors_data: numpy.ndarray[numpy.float64], vectors_elements: numpy.ndarray[numpy.int32], sort: bool = False) -> None

Provide data required for interpolation to the grid without cost information.

Parameters:
  • values_data (numpy.ndarray) – The eigenvalue data to be stored in the grid. The first dimension must be equal in size to the number of grid-vertices. If two dimensional the second dimension is interpreted as all information for a single mode flattened and concatenated into (scalars, vectors, matrices) – in that order. If more than two dimensional, the second dimension indexes modes and higher dimensions will be flattened as if row ordered and must flatten into a concatenated list of (scalars, vectors, matrices). If the provided array can be interpreted as a contiguous row-ordered two dimensional array it will be used in place, otherwise a copy will be made.

  • values_elements (integer vector-like) – A multi-purpose vector containing, in order:

    • the number of scalar-like eigenvalue elements,

    • the number of vector-like eigenvalue elements (must be \(3\times N\)),

    • the number of matrix-like eigenvalue elements (must be \(9\times N\)),

    • an integer RotatesLike value denoting how the vector-like and matrix-like parts transform under application of a symmetry operation (see note below).

    • an integer LengthUnit value denoting what units the vector-like and matrix-like parts are in (see note below).

  • vectors_data (numpy.ndarray) – The eigenvector data to be stored in the grid. Same shape restrictions as values_data

  • vectors_elements – Like values_elements but for the eigenvectors

  • sort (logical (default False)) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Integer values outside of the mapped range (or missing) are replaced by 0.

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Integer values outside of the mapped range (or missing) are replaced by 3.

  1. fill(self: brille._brille.BZMeshQdd, values_data: numpy.ndarray[numpy.float64], values_elements: numpy.ndarray[numpy.int32], values_weights: numpy.ndarray[numpy.float64], vectors_data: numpy.ndarray[numpy.float64], vectors_elements: numpy.ndarray[numpy.int32], vectors_weights: numpy.ndarray[numpy.float64], sort: bool = False) -> None

Provide all data required for interpolation to the grid at once

Parameters:
  • values_data (numpy.ndarray) – The eigenvalue data to be stored in the grid. The first dimension must be equal in size to the number of grid-vertices. If two dimensional the second dimension is interpreted as all information for a single mode flattened and concatenated into (scalars, vectors, matrices) – in that order. If more than two dimensional, the second dimension indexes modes and higher dimensions will be flattened as if row ordered and must flatten into a concatenated list of (scalars, vectors, matrices). If the provided array can be interpreted as a contiguous row-ordered two dimensional array it will be used in place, otherwise a copy will be made.

  • values_elements (integer vector-like) – A multi-purpose vector containing, in order:

    • the number of scalar-like eigenvalue elements,

    • the number of vector-like eigenvalue elements (must be \(3\times N\)),

    • the number of matrix-like eigenvalue elements (must be \(9\times N\)),

    • an integer RotatesLike value denoting how the vector-like and matrix-like parts transform under application of a symmetry operation (see note below),

    • an integer LengthUnit value denoting what units the vector-like and matrix-like parts are in (see note below)

    • which scalar cost function should be used (see below),

    • which vector cost function should be used (see below).

    See the note below for the meaning of the last three values.

  • values_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvalue elements stored in the grid

  • vectors_data (numpy.ndarray) – The eigenvector data to be stored in the grid. Same shape restrictions as values_data

  • vectors_elements – Like values_elements but for the eigenvectors

  • vectors_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvector elements stored in the grid

  • sort (logical (default False)) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Integer values outside of the mapped range (or missing) are replaced by 3.

Mapping of integers to scalar cost function:

value

function(x,y)

0

magnitude(x-y)

Mapping of integers to vector cost function:

value

function(vec_x, vec_y)

0

sin(hermitian_angle(vec_x, vec_y))

1

vector_distance(vec_x, vec_y)

2

1 - vector_product(vec_x, vec_y)

3

vector_angle(vec_x, vec_y)

4

hermitian_angle(vec_x, vec_y)

Integer values outside of the mapped range (or missing) are replaced by 0.

static from_file(filename: str, entry: str = 'BZMeshQdd') brille._brille.BZMeshQdd

Save the object to an HDF5 file

Parameters:
  • filename (str) – The full path specification for the file to read from

  • entry (str) – The group path, e.g., “my/cool/grid”, where to read from inside the file, with a default equal to the object Class name

Return type:

clsObj

property invA
ir_interpolate_at(self: brille._brille.BZMeshQdd, Q: numpy.ndarray[numpy.float64], useparallel: bool = False, threads: int = -1, do_not_move_points: bool = False) tuple[numpy.ndarray[numpy.float64], numpy.ndarray[numpy.float64]]

Perform linear interpolation of the stored data at irreducible equivalent points

The irreducible first Brillouin zone is the part of reciprocal space which is invariant under application of the integer translations and the pointgroup operations of a reciprocal space lattice. This method finds points equivalent to the input within the irreducible first Brillouin zone and then interpolates pre-stored information to provide an estimate at the found positions.

Parameters:
  • Q (numpy.ndarray) – A two dimensional array with Q.shape[1] == 3 containing the positions at which an interpolated result is required, expressed in units of the reciprocal lattice.

  • useparallel (bool, optional) – Whether a serial or parallel code should be utilised

  • threads (int, optional) – How many OpenMP workers should be utilised; if this value is less than one the environment variable OMP_NUM_THREADS will be used.

  • do_not_move_points (bool, optional) – If True the provided Q points must already lie within the first Brillouin zone. No check is made to verify this requirement and if any Q lie outside of the gridded volume out-of-bounds errors may result in bad data or runtime errors.

Returns:

The interpolated eigenvalues and eigenvectors at the equivalent irreducible first Brillouin zone points. The shape of each output will depend on the shape of the data provided to the fill() method. i If the filled eigenvalues were of shape [N_grid_points, N_modes, A, ..., B], the eigenvectors were of shape [N_grid_points, N_modes, C, ..., D], and the provided points of shape [N_Q_points, 3] then the output shapes will be [N_Q_points, N_modes, A, ..., B] and [N_Q_points, N_modes, C, ..., D] for the eigenvalues and eigenvectors, respectively.

Return type:

tuple

property rlu
set_flags_weights(self: brille._brille.BZMeshQdd, values_flags: numpy.ndarray[numpy.int32], values_weights: numpy.ndarray[numpy.float64], vectors_flags: numpy.ndarray[numpy.int32], vectors_weights: numpy.ndarray[numpy.float64], sort: bool = False) None

Set RotatesLike, ~brille._brille.LengthUnit and cost functions plus relative cost weights for the values and vectors stored in the object

Parameters:
  • values_flags (integer, vector-like) – One or more values indicating the RotatesLike value for the eigenvalues stored in the object, the ~brille._brille.LengthUnit value, plus which cost function to use when comparing stored eigenvalues at neighbouring grid points for scalar- and vector-like eigenvalues.

  • values_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvalue elements stored in the grid

  • vectors_flags (integer, vector-like) – One or more values indicating the RotatesLike value for the eigenvalues stored in the object, the ~brille._brille.LengthUnit value, plus which cost function to use when comparing stored eigenvectors at neighbouring grid points for scalar- and vector-like eigenvectors.

  • vectors_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvector elements stored in the grid

  • sort (bool, optional) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Mapping of integers to scalar cost function:

value

function(x,y)

0

magnitude(x-y)

Mapping of integers to vector cost function:

value

function(vec_x, vec_y)

0

sin(hermitian_angle(vec_x, vec_y))

1

vector_distance(vec_x, vec_y)

2

1 - vector_product(vec_x, vec_y)

3

vector_angle(vec_x, vec_y)

4

hermitian_angle(vec_x, vec_y)

Integer values outside of the mapped range (or missing) are replaced by 0.

sort(self: brille._brille.BZMeshQdd) None
property tetrahedra
to_file(self: brille._brille.BZMeshQdd, filename: str, entry: str = 'BZMeshQdd', flags: str = 'ac') bool

Save the object to an HDF5 file

Parameters:
  • filename (str) – The full path specification for the file to write into

  • entry (str) – The group path, e.g., “my/cool/grid”, where to write inside the file, with a default equal to the object Class name

  • flags (str) – The HDF5 permissions to use when opening the file. Default ‘a’ writes to an existing file – if entry exists in the file it is overwritten.

Note

Possible flags are:

flags

meaning

HDF equivalent

‘r’

read

H5F_ACC_RDONLY

‘x’

write, error if exists

H5F_ACC_EXCL

‘a’

write, append to file

H5F_ACC_RDWR

‘c’

write, error if exists

H5F_ACC_CREAT

‘t’

write, replace existing

H5F_ACC_TRUNC

Returns:

Indication of writing success.

Return type:

bool

property values

Return a shared view of the stored eigenvalues

property vectors

Return a shared view of the stored eigenvectors

class brille.BZNestQcc(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: brille._brille.BZNestQcc, brillouin_zone: brille._brille.BrillouinZone, max_volume: float, max_branchings: int = 5) -> None

  2. __init__(self: brille._brille.BZNestQcc, brillouin_zone: brille._brille.BrillouinZone, number_density: int, max_branchings: int = 5) -> None

property BrillouinZone
property all_invA
property all_rlu
property bytes_per_point

Return the memory required per interpolation point result in bytes

fill(*args, **kwargs)

Overloaded function.

  1. fill(self: brille._brille.BZNestQcc, values_data: numpy.ndarray[numpy.complex128], values_elements: numpy.ndarray[numpy.int32], vectors_data: numpy.ndarray[numpy.complex128], vectors_elements: numpy.ndarray[numpy.int32], sort: bool = False) -> None

Provide data required for interpolation to the grid without cost information.

Parameters:
  • values_data (numpy.ndarray) – The eigenvalue data to be stored in the grid. The first dimension must be equal in size to the number of grid-vertices. If two dimensional the second dimension is interpreted as all information for a single mode flattened and concatenated into (scalars, vectors, matrices) – in that order. If more than two dimensional, the second dimension indexes modes and higher dimensions will be flattened as if row ordered and must flatten into a concatenated list of (scalars, vectors, matrices). If the provided array can be interpreted as a contiguous row-ordered two dimensional array it will be used in place, otherwise a copy will be made.

  • values_elements (integer vector-like) – A multi-purpose vector containing, in order:

    • the number of scalar-like eigenvalue elements,

    • the number of vector-like eigenvalue elements (must be \(3\times N\)),

    • the number of matrix-like eigenvalue elements (must be \(9\times N\)),

    • an integer RotatesLike value denoting how the vector-like and matrix-like parts transform under application of a symmetry operation (see note below).

    • an integer LengthUnit value denoting what units the vector-like and matrix-like parts are in (see note below).

  • vectors_data (numpy.ndarray) – The eigenvector data to be stored in the grid. Same shape restrictions as values_data

  • vectors_elements – Like values_elements but for the eigenvectors

  • sort (logical (default False)) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Integer values outside of the mapped range (or missing) are replaced by 0.

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Integer values outside of the mapped range (or missing) are replaced by 3.

  1. fill(self: brille._brille.BZNestQcc, values_data: numpy.ndarray[numpy.complex128], values_elements: numpy.ndarray[numpy.int32], values_weights: numpy.ndarray[numpy.float64], vectors_data: numpy.ndarray[numpy.complex128], vectors_elements: numpy.ndarray[numpy.int32], vectors_weights: numpy.ndarray[numpy.float64], sort: bool = False) -> None

Provide all data required for interpolation to the grid at once

Parameters:
  • values_data (numpy.ndarray) – The eigenvalue data to be stored in the grid. The first dimension must be equal in size to the number of grid-vertices. If two dimensional the second dimension is interpreted as all information for a single mode flattened and concatenated into (scalars, vectors, matrices) – in that order. If more than two dimensional, the second dimension indexes modes and higher dimensions will be flattened as if row ordered and must flatten into a concatenated list of (scalars, vectors, matrices). If the provided array can be interpreted as a contiguous row-ordered two dimensional array it will be used in place, otherwise a copy will be made.

  • values_elements (integer vector-like) – A multi-purpose vector containing, in order:

    • the number of scalar-like eigenvalue elements,

    • the number of vector-like eigenvalue elements (must be \(3\times N\)),

    • the number of matrix-like eigenvalue elements (must be \(9\times N\)),

    • an integer RotatesLike value denoting how the vector-like and matrix-like parts transform under application of a symmetry operation (see note below),

    • an integer LengthUnit value denoting what units the vector-like and matrix-like parts are in (see note below)

    • which scalar cost function should be used (see below),

    • which vector cost function should be used (see below).

    See the note below for the meaning of the last three values.

  • values_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvalue elements stored in the grid

  • vectors_data (numpy.ndarray) – The eigenvector data to be stored in the grid. Same shape restrictions as values_data

  • vectors_elements – Like values_elements but for the eigenvectors

  • vectors_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvector elements stored in the grid

  • sort (logical (default False)) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Integer values outside of the mapped range (or missing) are replaced by 3.

Mapping of integers to scalar cost function:

value

function(x,y)

0

magnitude(x-y)

Mapping of integers to vector cost function:

value

function(vec_x, vec_y)

0

sin(hermitian_angle(vec_x, vec_y))

1

vector_distance(vec_x, vec_y)

2

1 - vector_product(vec_x, vec_y)

3

vector_angle(vec_x, vec_y)

4

hermitian_angle(vec_x, vec_y)

Integer values outside of the mapped range (or missing) are replaced by 0.

static from_file(filename: str, entry: str = 'BZNestQcc') brille._brille.BZNestQcc

Save the object to an HDF5 file

Parameters:
  • filename (str) – The full path specification for the file to read from

  • entry (str) – The group path, e.g., “my/cool/grid”, where to read from inside the file, with a default equal to the object Class name

Return type:

clsObj

property invA
ir_interpolate_at(self: brille._brille.BZNestQcc, Q: numpy.ndarray[numpy.float64], useparallel: bool = False, threads: int = -1, do_not_move_points: bool = False) tuple[numpy.ndarray[numpy.complex128], numpy.ndarray[numpy.complex128]]

Perform linear interpolation of the stored data at irreducible equivalent points

The irreducible first Brillouin zone is the part of reciprocal space which is invariant under application of the integer translations and the pointgroup operations of a reciprocal space lattice. This method finds points equivalent to the input within the irreducible first Brillouin zone and then interpolates pre-stored information to provide an estimate at the found positions.

Parameters:
  • Q (numpy.ndarray) – A two dimensional array with Q.shape[1] == 3 containing the positions at which an interpolated result is required, expressed in units of the reciprocal lattice.

  • useparallel (bool, optional) – Whether a serial or parallel code should be utilised

  • threads (int, optional) – How many OpenMP workers should be utilised; if this value is less than one the environment variable OMP_NUM_THREADS will be used.

  • do_not_move_points (bool, optional) – If True the provided Q points must already lie within the first Brillouin zone. No check is made to verify this requirement and if any Q lie outside of the gridded volume out-of-bounds errors may result in bad data or runtime errors.

Returns:

The interpolated eigenvalues and eigenvectors at the equivalent irreducible first Brillouin zone points. The shape of each output will depend on the shape of the data provided to the fill() method. i If the filled eigenvalues were of shape [N_grid_points, N_modes, A, ..., B], the eigenvectors were of shape [N_grid_points, N_modes, C, ..., D], and the provided points of shape [N_Q_points, 3] then the output shapes will be [N_Q_points, N_modes, A, ..., B] and [N_Q_points, N_modes, C, ..., D] for the eigenvalues and eigenvectors, respectively.

Return type:

tuple

property rlu
set_flags_weights(self: brille._brille.BZNestQcc, values_flags: numpy.ndarray[numpy.int32], values_weights: numpy.ndarray[numpy.float64], vectors_flags: numpy.ndarray[numpy.int32], vectors_weights: numpy.ndarray[numpy.float64], sort: bool = False) None

Set RotatesLike, ~brille._brille.LengthUnit and cost functions plus relative cost weights for the values and vectors stored in the object

Parameters:
  • values_flags (integer, vector-like) – One or more values indicating the RotatesLike value for the eigenvalues stored in the object, the ~brille._brille.LengthUnit value, plus which cost function to use when comparing stored eigenvalues at neighbouring grid points for scalar- and vector-like eigenvalues.

  • values_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvalue elements stored in the grid

  • vectors_flags (integer, vector-like) – One or more values indicating the RotatesLike value for the eigenvalues stored in the object, the ~brille._brille.LengthUnit value, plus which cost function to use when comparing stored eigenvectors at neighbouring grid points for scalar- and vector-like eigenvectors.

  • vectors_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvector elements stored in the grid

  • sort (bool, optional) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Mapping of integers to scalar cost function:

value

function(x,y)

0

magnitude(x-y)

Mapping of integers to vector cost function:

value

function(vec_x, vec_y)

0

sin(hermitian_angle(vec_x, vec_y))

1

vector_distance(vec_x, vec_y)

2

1 - vector_product(vec_x, vec_y)

3

vector_angle(vec_x, vec_y)

4

hermitian_angle(vec_x, vec_y)

Integer values outside of the mapped range (or missing) are replaced by 0.

sort(self: brille._brille.BZNestQcc) None
property tetrahedra
to_file(self: brille._brille.BZNestQcc, filename: str, entry: str = 'BZNestQcc', flags: str = 'ac') bool

Save the object to an HDF5 file

Parameters:
  • filename (str) – The full path specification for the file to write into

  • entry (str) – The group path, e.g., “my/cool/grid”, where to write inside the file, with a default equal to the object Class name

  • flags (str) – The HDF5 permissions to use when opening the file. Default ‘a’ writes to an existing file – if entry exists in the file it is overwritten.

Note

Possible flags are:

flags

meaning

HDF equivalent

‘r’

read

H5F_ACC_RDONLY

‘x’

write, error if exists

H5F_ACC_EXCL

‘a’

write, append to file

H5F_ACC_RDWR

‘c’

write, error if exists

H5F_ACC_CREAT

‘t’

write, replace existing

H5F_ACC_TRUNC

Returns:

Indication of writing success.

Return type:

bool

property values

Return a shared view of the stored eigenvalues

property vectors

Return a shared view of the stored eigenvectors

class brille.BZNestQdc(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: brille._brille.BZNestQdc, brillouin_zone: brille._brille.BrillouinZone, max_volume: float, max_branchings: int = 5) -> None

  2. __init__(self: brille._brille.BZNestQdc, brillouin_zone: brille._brille.BrillouinZone, number_density: int, max_branchings: int = 5) -> None

property BrillouinZone
property all_invA
property all_rlu
property bytes_per_point

Return the memory required per interpolation point result in bytes

fill(*args, **kwargs)

Overloaded function.

  1. fill(self: brille._brille.BZNestQdc, values_data: numpy.ndarray[numpy.float64], values_elements: numpy.ndarray[numpy.int32], vectors_data: numpy.ndarray[numpy.complex128], vectors_elements: numpy.ndarray[numpy.int32], sort: bool = False) -> None

Provide data required for interpolation to the grid without cost information.

Parameters:
  • values_data (numpy.ndarray) – The eigenvalue data to be stored in the grid. The first dimension must be equal in size to the number of grid-vertices. If two dimensional the second dimension is interpreted as all information for a single mode flattened and concatenated into (scalars, vectors, matrices) – in that order. If more than two dimensional, the second dimension indexes modes and higher dimensions will be flattened as if row ordered and must flatten into a concatenated list of (scalars, vectors, matrices). If the provided array can be interpreted as a contiguous row-ordered two dimensional array it will be used in place, otherwise a copy will be made.

  • values_elements (integer vector-like) – A multi-purpose vector containing, in order:

    • the number of scalar-like eigenvalue elements,

    • the number of vector-like eigenvalue elements (must be \(3\times N\)),

    • the number of matrix-like eigenvalue elements (must be \(9\times N\)),

    • an integer RotatesLike value denoting how the vector-like and matrix-like parts transform under application of a symmetry operation (see note below).

    • an integer LengthUnit value denoting what units the vector-like and matrix-like parts are in (see note below).

  • vectors_data (numpy.ndarray) – The eigenvector data to be stored in the grid. Same shape restrictions as values_data

  • vectors_elements – Like values_elements but for the eigenvectors

  • sort (logical (default False)) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Integer values outside of the mapped range (or missing) are replaced by 0.

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Integer values outside of the mapped range (or missing) are replaced by 3.

  1. fill(self: brille._brille.BZNestQdc, values_data: numpy.ndarray[numpy.float64], values_elements: numpy.ndarray[numpy.int32], values_weights: numpy.ndarray[numpy.float64], vectors_data: numpy.ndarray[numpy.complex128], vectors_elements: numpy.ndarray[numpy.int32], vectors_weights: numpy.ndarray[numpy.float64], sort: bool = False) -> None

Provide all data required for interpolation to the grid at once

Parameters:
  • values_data (numpy.ndarray) – The eigenvalue data to be stored in the grid. The first dimension must be equal in size to the number of grid-vertices. If two dimensional the second dimension is interpreted as all information for a single mode flattened and concatenated into (scalars, vectors, matrices) – in that order. If more than two dimensional, the second dimension indexes modes and higher dimensions will be flattened as if row ordered and must flatten into a concatenated list of (scalars, vectors, matrices). If the provided array can be interpreted as a contiguous row-ordered two dimensional array it will be used in place, otherwise a copy will be made.

  • values_elements (integer vector-like) – A multi-purpose vector containing, in order:

    • the number of scalar-like eigenvalue elements,

    • the number of vector-like eigenvalue elements (must be \(3\times N\)),

    • the number of matrix-like eigenvalue elements (must be \(9\times N\)),

    • an integer RotatesLike value denoting how the vector-like and matrix-like parts transform under application of a symmetry operation (see note below),

    • an integer LengthUnit value denoting what units the vector-like and matrix-like parts are in (see note below)

    • which scalar cost function should be used (see below),

    • which vector cost function should be used (see below).

    See the note below for the meaning of the last three values.

  • values_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvalue elements stored in the grid

  • vectors_data (numpy.ndarray) – The eigenvector data to be stored in the grid. Same shape restrictions as values_data

  • vectors_elements – Like values_elements but for the eigenvectors

  • vectors_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvector elements stored in the grid

  • sort (logical (default False)) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Integer values outside of the mapped range (or missing) are replaced by 3.

Mapping of integers to scalar cost function:

value

function(x,y)

0

magnitude(x-y)

Mapping of integers to vector cost function:

value

function(vec_x, vec_y)

0

sin(hermitian_angle(vec_x, vec_y))

1

vector_distance(vec_x, vec_y)

2

1 - vector_product(vec_x, vec_y)

3

vector_angle(vec_x, vec_y)

4

hermitian_angle(vec_x, vec_y)

Integer values outside of the mapped range (or missing) are replaced by 0.

static from_file(filename: str, entry: str = 'BZNestQdc') brille._brille.BZNestQdc

Save the object to an HDF5 file

Parameters:
  • filename (str) – The full path specification for the file to read from

  • entry (str) – The group path, e.g., “my/cool/grid”, where to read from inside the file, with a default equal to the object Class name

Return type:

clsObj

property invA
ir_interpolate_at(self: brille._brille.BZNestQdc, Q: numpy.ndarray[numpy.float64], useparallel: bool = False, threads: int = -1, do_not_move_points: bool = False) tuple[numpy.ndarray[numpy.float64], numpy.ndarray[numpy.complex128]]

Perform linear interpolation of the stored data at irreducible equivalent points

The irreducible first Brillouin zone is the part of reciprocal space which is invariant under application of the integer translations and the pointgroup operations of a reciprocal space lattice. This method finds points equivalent to the input within the irreducible first Brillouin zone and then interpolates pre-stored information to provide an estimate at the found positions.

Parameters:
  • Q (numpy.ndarray) – A two dimensional array with Q.shape[1] == 3 containing the positions at which an interpolated result is required, expressed in units of the reciprocal lattice.

  • useparallel (bool, optional) – Whether a serial or parallel code should be utilised

  • threads (int, optional) – How many OpenMP workers should be utilised; if this value is less than one the environment variable OMP_NUM_THREADS will be used.

  • do_not_move_points (bool, optional) – If True the provided Q points must already lie within the first Brillouin zone. No check is made to verify this requirement and if any Q lie outside of the gridded volume out-of-bounds errors may result in bad data or runtime errors.

Returns:

The interpolated eigenvalues and eigenvectors at the equivalent irreducible first Brillouin zone points. The shape of each output will depend on the shape of the data provided to the fill() method. i If the filled eigenvalues were of shape [N_grid_points, N_modes, A, ..., B], the eigenvectors were of shape [N_grid_points, N_modes, C, ..., D], and the provided points of shape [N_Q_points, 3] then the output shapes will be [N_Q_points, N_modes, A, ..., B] and [N_Q_points, N_modes, C, ..., D] for the eigenvalues and eigenvectors, respectively.

Return type:

tuple

property rlu
set_flags_weights(self: brille._brille.BZNestQdc, values_flags: numpy.ndarray[numpy.int32], values_weights: numpy.ndarray[numpy.float64], vectors_flags: numpy.ndarray[numpy.int32], vectors_weights: numpy.ndarray[numpy.float64], sort: bool = False) None

Set RotatesLike, ~brille._brille.LengthUnit and cost functions plus relative cost weights for the values and vectors stored in the object

Parameters:
  • values_flags (integer, vector-like) – One or more values indicating the RotatesLike value for the eigenvalues stored in the object, the ~brille._brille.LengthUnit value, plus which cost function to use when comparing stored eigenvalues at neighbouring grid points for scalar- and vector-like eigenvalues.

  • values_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvalue elements stored in the grid

  • vectors_flags (integer, vector-like) – One or more values indicating the RotatesLike value for the eigenvalues stored in the object, the ~brille._brille.LengthUnit value, plus which cost function to use when comparing stored eigenvectors at neighbouring grid points for scalar- and vector-like eigenvectors.

  • vectors_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvector elements stored in the grid

  • sort (bool, optional) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Mapping of integers to scalar cost function:

value

function(x,y)

0

magnitude(x-y)

Mapping of integers to vector cost function:

value

function(vec_x, vec_y)

0

sin(hermitian_angle(vec_x, vec_y))

1

vector_distance(vec_x, vec_y)

2

1 - vector_product(vec_x, vec_y)

3

vector_angle(vec_x, vec_y)

4

hermitian_angle(vec_x, vec_y)

Integer values outside of the mapped range (or missing) are replaced by 0.

sort(self: brille._brille.BZNestQdc) None
property tetrahedra
to_file(self: brille._brille.BZNestQdc, filename: str, entry: str = 'BZNestQdc', flags: str = 'ac') bool

Save the object to an HDF5 file

Parameters:
  • filename (str) – The full path specification for the file to write into

  • entry (str) – The group path, e.g., “my/cool/grid”, where to write inside the file, with a default equal to the object Class name

  • flags (str) – The HDF5 permissions to use when opening the file. Default ‘a’ writes to an existing file – if entry exists in the file it is overwritten.

Note

Possible flags are:

flags

meaning

HDF equivalent

‘r’

read

H5F_ACC_RDONLY

‘x’

write, error if exists

H5F_ACC_EXCL

‘a’

write, append to file

H5F_ACC_RDWR

‘c’

write, error if exists

H5F_ACC_CREAT

‘t’

write, replace existing

H5F_ACC_TRUNC

Returns:

Indication of writing success.

Return type:

bool

property values

Return a shared view of the stored eigenvalues

property vectors

Return a shared view of the stored eigenvectors

class brille.BZNestQdd(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: brille._brille.BZNestQdd, brillouin_zone: brille._brille.BrillouinZone, max_volume: float, max_branchings: int = 5) -> None

  2. __init__(self: brille._brille.BZNestQdd, brillouin_zone: brille._brille.BrillouinZone, number_density: int, max_branchings: int = 5) -> None

property BrillouinZone
property all_invA
property all_rlu
property bytes_per_point

Return the memory required per interpolation point result in bytes

fill(*args, **kwargs)

Overloaded function.

  1. fill(self: brille._brille.BZNestQdd, values_data: numpy.ndarray[numpy.float64], values_elements: numpy.ndarray[numpy.int32], vectors_data: numpy.ndarray[numpy.float64], vectors_elements: numpy.ndarray[numpy.int32], sort: bool = False) -> None

Provide data required for interpolation to the grid without cost information.

Parameters:
  • values_data (numpy.ndarray) – The eigenvalue data to be stored in the grid. The first dimension must be equal in size to the number of grid-vertices. If two dimensional the second dimension is interpreted as all information for a single mode flattened and concatenated into (scalars, vectors, matrices) – in that order. If more than two dimensional, the second dimension indexes modes and higher dimensions will be flattened as if row ordered and must flatten into a concatenated list of (scalars, vectors, matrices). If the provided array can be interpreted as a contiguous row-ordered two dimensional array it will be used in place, otherwise a copy will be made.

  • values_elements (integer vector-like) – A multi-purpose vector containing, in order:

    • the number of scalar-like eigenvalue elements,

    • the number of vector-like eigenvalue elements (must be \(3\times N\)),

    • the number of matrix-like eigenvalue elements (must be \(9\times N\)),

    • an integer RotatesLike value denoting how the vector-like and matrix-like parts transform under application of a symmetry operation (see note below).

    • an integer LengthUnit value denoting what units the vector-like and matrix-like parts are in (see note below).

  • vectors_data (numpy.ndarray) – The eigenvector data to be stored in the grid. Same shape restrictions as values_data

  • vectors_elements – Like values_elements but for the eigenvectors

  • sort (logical (default False)) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Integer values outside of the mapped range (or missing) are replaced by 0.

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Integer values outside of the mapped range (or missing) are replaced by 3.

  1. fill(self: brille._brille.BZNestQdd, values_data: numpy.ndarray[numpy.float64], values_elements: numpy.ndarray[numpy.int32], values_weights: numpy.ndarray[numpy.float64], vectors_data: numpy.ndarray[numpy.float64], vectors_elements: numpy.ndarray[numpy.int32], vectors_weights: numpy.ndarray[numpy.float64], sort: bool = False) -> None

Provide all data required for interpolation to the grid at once

Parameters:
  • values_data (numpy.ndarray) – The eigenvalue data to be stored in the grid. The first dimension must be equal in size to the number of grid-vertices. If two dimensional the second dimension is interpreted as all information for a single mode flattened and concatenated into (scalars, vectors, matrices) – in that order. If more than two dimensional, the second dimension indexes modes and higher dimensions will be flattened as if row ordered and must flatten into a concatenated list of (scalars, vectors, matrices). If the provided array can be interpreted as a contiguous row-ordered two dimensional array it will be used in place, otherwise a copy will be made.

  • values_elements (integer vector-like) – A multi-purpose vector containing, in order:

    • the number of scalar-like eigenvalue elements,

    • the number of vector-like eigenvalue elements (must be \(3\times N\)),

    • the number of matrix-like eigenvalue elements (must be \(9\times N\)),

    • an integer RotatesLike value denoting how the vector-like and matrix-like parts transform under application of a symmetry operation (see note below),

    • an integer LengthUnit value denoting what units the vector-like and matrix-like parts are in (see note below)

    • which scalar cost function should be used (see below),

    • which vector cost function should be used (see below).

    See the note below for the meaning of the last three values.

  • values_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvalue elements stored in the grid

  • vectors_data (numpy.ndarray) – The eigenvector data to be stored in the grid. Same shape restrictions as values_data

  • vectors_elements – Like values_elements but for the eigenvectors

  • vectors_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvector elements stored in the grid

  • sort (logical (default False)) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Integer values outside of the mapped range (or missing) are replaced by 3.

Mapping of integers to scalar cost function:

value

function(x,y)

0

magnitude(x-y)

Mapping of integers to vector cost function:

value

function(vec_x, vec_y)

0

sin(hermitian_angle(vec_x, vec_y))

1

vector_distance(vec_x, vec_y)

2

1 - vector_product(vec_x, vec_y)

3

vector_angle(vec_x, vec_y)

4

hermitian_angle(vec_x, vec_y)

Integer values outside of the mapped range (or missing) are replaced by 0.

static from_file(filename: str, entry: str = 'BZNestQdd') brille._brille.BZNestQdd

Save the object to an HDF5 file

Parameters:
  • filename (str) – The full path specification for the file to read from

  • entry (str) – The group path, e.g., “my/cool/grid”, where to read from inside the file, with a default equal to the object Class name

Return type:

clsObj

property invA
ir_interpolate_at(self: brille._brille.BZNestQdd, Q: numpy.ndarray[numpy.float64], useparallel: bool = False, threads: int = -1, do_not_move_points: bool = False) tuple[numpy.ndarray[numpy.float64], numpy.ndarray[numpy.float64]]

Perform linear interpolation of the stored data at irreducible equivalent points

The irreducible first Brillouin zone is the part of reciprocal space which is invariant under application of the integer translations and the pointgroup operations of a reciprocal space lattice. This method finds points equivalent to the input within the irreducible first Brillouin zone and then interpolates pre-stored information to provide an estimate at the found positions.

Parameters:
  • Q (numpy.ndarray) – A two dimensional array with Q.shape[1] == 3 containing the positions at which an interpolated result is required, expressed in units of the reciprocal lattice.

  • useparallel (bool, optional) – Whether a serial or parallel code should be utilised

  • threads (int, optional) – How many OpenMP workers should be utilised; if this value is less than one the environment variable OMP_NUM_THREADS will be used.

  • do_not_move_points (bool, optional) – If True the provided Q points must already lie within the first Brillouin zone. No check is made to verify this requirement and if any Q lie outside of the gridded volume out-of-bounds errors may result in bad data or runtime errors.

Returns:

The interpolated eigenvalues and eigenvectors at the equivalent irreducible first Brillouin zone points. The shape of each output will depend on the shape of the data provided to the fill() method. i If the filled eigenvalues were of shape [N_grid_points, N_modes, A, ..., B], the eigenvectors were of shape [N_grid_points, N_modes, C, ..., D], and the provided points of shape [N_Q_points, 3] then the output shapes will be [N_Q_points, N_modes, A, ..., B] and [N_Q_points, N_modes, C, ..., D] for the eigenvalues and eigenvectors, respectively.

Return type:

tuple

property rlu
set_flags_weights(self: brille._brille.BZNestQdd, values_flags: numpy.ndarray[numpy.int32], values_weights: numpy.ndarray[numpy.float64], vectors_flags: numpy.ndarray[numpy.int32], vectors_weights: numpy.ndarray[numpy.float64], sort: bool = False) None

Set RotatesLike, ~brille._brille.LengthUnit and cost functions plus relative cost weights for the values and vectors stored in the object

Parameters:
  • values_flags (integer, vector-like) – One or more values indicating the RotatesLike value for the eigenvalues stored in the object, the ~brille._brille.LengthUnit value, plus which cost function to use when comparing stored eigenvalues at neighbouring grid points for scalar- and vector-like eigenvalues.

  • values_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvalue elements stored in the grid

  • vectors_flags (integer, vector-like) – One or more values indicating the RotatesLike value for the eigenvalues stored in the object, the ~brille._brille.LengthUnit value, plus which cost function to use when comparing stored eigenvectors at neighbouring grid points for scalar- and vector-like eigenvectors.

  • vectors_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvector elements stored in the grid

  • sort (bool, optional) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Mapping of integers to scalar cost function:

value

function(x,y)

0

magnitude(x-y)

Mapping of integers to vector cost function:

value

function(vec_x, vec_y)

0

sin(hermitian_angle(vec_x, vec_y))

1

vector_distance(vec_x, vec_y)

2

1 - vector_product(vec_x, vec_y)

3

vector_angle(vec_x, vec_y)

4

hermitian_angle(vec_x, vec_y)

Integer values outside of the mapped range (or missing) are replaced by 0.

sort(self: brille._brille.BZNestQdd) None
property tetrahedra
to_file(self: brille._brille.BZNestQdd, filename: str, entry: str = 'BZNestQdd', flags: str = 'ac') bool

Save the object to an HDF5 file

Parameters:
  • filename (str) – The full path specification for the file to write into

  • entry (str) – The group path, e.g., “my/cool/grid”, where to write inside the file, with a default equal to the object Class name

  • flags (str) – The HDF5 permissions to use when opening the file. Default ‘a’ writes to an existing file – if entry exists in the file it is overwritten.

Note

Possible flags are:

flags

meaning

HDF equivalent

‘r’

read

H5F_ACC_RDONLY

‘x’

write, error if exists

H5F_ACC_EXCL

‘a’

write, append to file

H5F_ACC_RDWR

‘c’

write, error if exists

H5F_ACC_CREAT

‘t’

write, replace existing

H5F_ACC_TRUNC

Returns:

Indication of writing success.

Return type:

bool

property values

Return a shared view of the stored eigenvalues

property vectors

Return a shared view of the stored eigenvectors

class brille.BZTrellisQcc(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: brille._brille.BZTrellisQcc, brillouin_zone: brille._brille.BrillouinZone, node_volume_fraction: float = 0.1, always_triangulate: bool = False) -> None

  2. __init__(self: brille._brille.BZTrellisQcc, brillouin_zone: brille._brille.BrillouinZone, node_volume_fraction: float, always_triangulate: bool, approx_config: brille::approx_float::Config) -> None

property BrillouinZone
all_node_types(self: brille._brille.BZTrellisQcc) list[brille::NodeType]
property bytes_per_point

Return the memory required per interpolation point result in bytes

fill(*args, **kwargs)

Overloaded function.

  1. fill(self: brille._brille.BZTrellisQcc, values_data: numpy.ndarray[numpy.complex128], values_elements: numpy.ndarray[numpy.int32], vectors_data: numpy.ndarray[numpy.complex128], vectors_elements: numpy.ndarray[numpy.int32], sort: bool = False) -> None

Provide data required for interpolation to the grid without cost information.

Parameters:
  • values_data (numpy.ndarray) – The eigenvalue data to be stored in the grid. The first dimension must be equal in size to the number of grid-vertices. If two dimensional the second dimension is interpreted as all information for a single mode flattened and concatenated into (scalars, vectors, matrices) – in that order. If more than two dimensional, the second dimension indexes modes and higher dimensions will be flattened as if row ordered and must flatten into a concatenated list of (scalars, vectors, matrices). If the provided array can be interpreted as a contiguous row-ordered two dimensional array it will be used in place, otherwise a copy will be made.

  • values_elements (integer vector-like) – A multi-purpose vector containing, in order:

    • the number of scalar-like eigenvalue elements,

    • the number of vector-like eigenvalue elements (must be \(3\times N\)),

    • the number of matrix-like eigenvalue elements (must be \(9\times N\)),

    • an integer RotatesLike value denoting how the vector-like and matrix-like parts transform under application of a symmetry operation (see note below).

    • an integer LengthUnit value denoting what units the vector-like and matrix-like parts are in (see note below).

  • vectors_data (numpy.ndarray) – The eigenvector data to be stored in the grid. Same shape restrictions as values_data

  • vectors_elements – Like values_elements but for the eigenvectors

  • sort (logical (default False)) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Integer values outside of the mapped range (or missing) are replaced by 0.

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Integer values outside of the mapped range (or missing) are replaced by 3.

  1. fill(self: brille._brille.BZTrellisQcc, values_data: numpy.ndarray[numpy.complex128], values_elements: numpy.ndarray[numpy.int32], values_weights: numpy.ndarray[numpy.float64], vectors_data: numpy.ndarray[numpy.complex128], vectors_elements: numpy.ndarray[numpy.int32], vectors_weights: numpy.ndarray[numpy.float64], sort: bool = False) -> None

Provide all data required for interpolation to the grid at once

Parameters:
  • values_data (numpy.ndarray) – The eigenvalue data to be stored in the grid. The first dimension must be equal in size to the number of grid-vertices. If two dimensional the second dimension is interpreted as all information for a single mode flattened and concatenated into (scalars, vectors, matrices) – in that order. If more than two dimensional, the second dimension indexes modes and higher dimensions will be flattened as if row ordered and must flatten into a concatenated list of (scalars, vectors, matrices). If the provided array can be interpreted as a contiguous row-ordered two dimensional array it will be used in place, otherwise a copy will be made.

  • values_elements (integer vector-like) – A multi-purpose vector containing, in order:

    • the number of scalar-like eigenvalue elements,

    • the number of vector-like eigenvalue elements (must be \(3\times N\)),

    • the number of matrix-like eigenvalue elements (must be \(9\times N\)),

    • an integer RotatesLike value denoting how the vector-like and matrix-like parts transform under application of a symmetry operation (see note below),

    • an integer LengthUnit value denoting what units the vector-like and matrix-like parts are in (see note below)

    • which scalar cost function should be used (see below),

    • which vector cost function should be used (see below).

    See the note below for the meaning of the last three values.

  • values_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvalue elements stored in the grid

  • vectors_data (numpy.ndarray) – The eigenvector data to be stored in the grid. Same shape restrictions as values_data

  • vectors_elements – Like values_elements but for the eigenvectors

  • vectors_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvector elements stored in the grid

  • sort (logical (default False)) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Integer values outside of the mapped range (or missing) are replaced by 3.

Mapping of integers to scalar cost function:

value

function(x,y)

0

magnitude(x-y)

Mapping of integers to vector cost function:

value

function(vec_x, vec_y)

0

sin(hermitian_angle(vec_x, vec_y))

1

vector_distance(vec_x, vec_y)

2

1 - vector_product(vec_x, vec_y)

3

vector_angle(vec_x, vec_y)

4

hermitian_angle(vec_x, vec_y)

Integer values outside of the mapped range (or missing) are replaced by 0.

static from_file(filename: str, entry: str = 'BZTrellisQcc') brille._brille.BZTrellisQcc

Save the object to an HDF5 file

Parameters:
  • filename (str) – The full path specification for the file to read from

  • entry (str) – The group path, e.g., “my/cool/grid”, where to read from inside the file, with a default equal to the object Class name

Return type:

clsObj

property inner_invA
property inner_rlu
interpolate_at(self: brille._brille.BZTrellisQcc, Q: numpy.ndarray[numpy.float64], useparallel: bool = False, threads: int = -1, do_not_move_points: bool = False) tuple[numpy.ndarray[numpy.complex128], numpy.ndarray[numpy.complex128]]

Perform linear interpolation of the stored data at equivalent points

The first Brillouin zone is the part of reciprocal space which is invariant under application of the integer translations of a reciprocal space lattice. This method finds points equivalent to the input within the first Brillouin zone and then interpolates pre-stored information to provide an estimate at the found positions.

Parameters:
  • Q (numpy.ndarray) – A two dimensional array with Q.shape[1] == 3 containing the positions at which an interpolated result is required, expressed in units of the reciprocal lattice.

  • useparallel (bool, optional) – Whether a serial or parallel code should be utilised

  • threads (int, optional) – How many OpenMP workers should be utilised; if this value is less than one the environment variable OMP_NUM_THREADS will be used.

  • do_not_move_points (bool, optional) – If True the provided Q points must already lie within the first Brillouin zone. No check is made to verify this requirement and if any Q lie outside of the gridded volume out-of-bounds errors may result in bad data or runtime errors.

Returns:

The interpolated eigenvalues and eigenvectors at the equivalent first Brillouin zone points. The shape of each output will depend on the shape of the data provided to the fill() method. If the filled eigenvalues were of shape [N_grid_points, N_modes, A, ..., B], the eigenvectors were of shape [N_grid_points, N_modes, C, ..., D], and the provided points of shape [N_Q_points, 3] then the output shapes will be [N_Q_points, N_modes, A, ..., B] and [N_Q_points, N_modes, C, ..., D] for the eigenvalues and eigenvectors, respectively.

Return type:

tuple

property invA
ir_interpolate_at(self: brille._brille.BZTrellisQcc, Q: numpy.ndarray[numpy.float64], useparallel: bool = False, threads: int = -1, do_not_move_points: bool = False) tuple[numpy.ndarray[numpy.complex128], numpy.ndarray[numpy.complex128]]

Perform linear interpolation of the stored data at irreducible equivalent points

The irreducible first Brillouin zone is the part of reciprocal space which is invariant under application of the integer translations and the pointgroup operations of a reciprocal space lattice. This method finds points equivalent to the input within the irreducible first Brillouin zone and then interpolates pre-stored information to provide an estimate at the found positions.

Parameters:
  • Q (numpy.ndarray) – A two dimensional array with Q.shape[1] == 3 containing the positions at which an interpolated result is required, expressed in units of the reciprocal lattice.

  • useparallel (bool, optional) – Whether a serial or parallel code should be utilised

  • threads (int, optional) – How many OpenMP workers should be utilised; if this value is less than one the environment variable OMP_NUM_THREADS will be used.

  • do_not_move_points (bool, optional) – If True the provided Q points must already lie within the first Brillouin zone. No check is made to verify this requirement and if any Q lie outside of the gridded volume out-of-bounds errors may result in bad data or runtime errors.

Returns:

The interpolated eigenvalues and eigenvectors at the equivalent irreducible first Brillouin zone points. The shape of each output will depend on the shape of the data provided to the fill() method. i If the filled eigenvalues were of shape [N_grid_points, N_modes, A, ..., B], the eigenvectors were of shape [N_grid_points, N_modes, C, ..., D], and the provided points of shape [N_Q_points, 3] then the output shapes will be [N_Q_points, N_modes, A, ..., B] and [N_Q_points, N_modes, C, ..., D] for the eigenvalues and eigenvectors, respectively.

Return type:

tuple

node_at(self: brille._brille.BZTrellisQcc, subscript: Annotated[list[int], FixedSize(3)]) brille::polyhedron::Poly<double, brille::Array2>
node_at_type(self: brille._brille.BZTrellisQcc, subscript: Annotated[list[int], FixedSize(3)]) brille::NodeType
node_containing(self: brille._brille.BZTrellisQcc, Q: numpy.ndarray[numpy.float64]) brille::polyhedron::Poly<double, brille::Array2>
node_containing_type(self: brille._brille.BZTrellisQcc, Q: numpy.ndarray[numpy.float64]) brille::NodeType
property outer_invA
property outer_rlu
property rlu
set_flags_weights(self: brille._brille.BZTrellisQcc, values_flags: numpy.ndarray[numpy.int32], values_weights: numpy.ndarray[numpy.float64], vectors_flags: numpy.ndarray[numpy.int32], vectors_weights: numpy.ndarray[numpy.float64], sort: bool = False) None

Set RotatesLike, ~brille._brille.LengthUnit and cost functions plus relative cost weights for the values and vectors stored in the object

Parameters:
  • values_flags (integer, vector-like) – One or more values indicating the RotatesLike value for the eigenvalues stored in the object, the ~brille._brille.LengthUnit value, plus which cost function to use when comparing stored eigenvalues at neighbouring grid points for scalar- and vector-like eigenvalues.

  • values_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvalue elements stored in the grid

  • vectors_flags (integer, vector-like) – One or more values indicating the RotatesLike value for the eigenvalues stored in the object, the ~brille._brille.LengthUnit value, plus which cost function to use when comparing stored eigenvectors at neighbouring grid points for scalar- and vector-like eigenvectors.

  • vectors_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvector elements stored in the grid

  • sort (bool, optional) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Mapping of integers to scalar cost function:

value

function(x,y)

0

magnitude(x-y)

Mapping of integers to vector cost function:

value

function(vec_x, vec_y)

0

sin(hermitian_angle(vec_x, vec_y))

1

vector_distance(vec_x, vec_y)

2

1 - vector_product(vec_x, vec_y)

3

vector_angle(vec_x, vec_y)

4

hermitian_angle(vec_x, vec_y)

Integer values outside of the mapped range (or missing) are replaced by 0.

sort(self: brille._brille.BZTrellisQcc) None
property tetrahedra
to_file(self: brille._brille.BZTrellisQcc, filename: str, entry: str = 'BZTrellisQcc', flags: str = 'ac') bool

Save the object to an HDF5 file

Parameters:
  • filename (str) – The full path specification for the file to write into

  • entry (str) – The group path, e.g., “my/cool/grid”, where to write inside the file, with a default equal to the object Class name

  • flags (str) – The HDF5 permissions to use when opening the file. Default ‘a’ writes to an existing file – if entry exists in the file it is overwritten.

Note

Possible flags are:

flags

meaning

HDF equivalent

‘r’

read

H5F_ACC_RDONLY

‘x’

write, error if exists

H5F_ACC_EXCL

‘a’

write, append to file

H5F_ACC_RDWR

‘c’

write, error if exists

H5F_ACC_CREAT

‘t’

write, replace existing

H5F_ACC_TRUNC

Returns:

Indication of writing success.

Return type:

bool

property values

Return a shared view of the stored eigenvalues

property vectors

Return a shared view of the stored eigenvectors

class brille.BZTrellisQdc(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: brille._brille.BZTrellisQdc, brillouin_zone: brille._brille.BrillouinZone, node_volume_fraction: float = 0.1, always_triangulate: bool = False) -> None

  2. __init__(self: brille._brille.BZTrellisQdc, brillouin_zone: brille._brille.BrillouinZone, node_volume_fraction: float, always_triangulate: bool, approx_config: brille::approx_float::Config) -> None

property BrillouinZone
all_node_types(self: brille._brille.BZTrellisQdc) list[brille::NodeType]
property bytes_per_point

Return the memory required per interpolation point result in bytes

fill(*args, **kwargs)

Overloaded function.

  1. fill(self: brille._brille.BZTrellisQdc, values_data: numpy.ndarray[numpy.float64], values_elements: numpy.ndarray[numpy.int32], vectors_data: numpy.ndarray[numpy.complex128], vectors_elements: numpy.ndarray[numpy.int32], sort: bool = False) -> None

Provide data required for interpolation to the grid without cost information.

Parameters:
  • values_data (numpy.ndarray) – The eigenvalue data to be stored in the grid. The first dimension must be equal in size to the number of grid-vertices. If two dimensional the second dimension is interpreted as all information for a single mode flattened and concatenated into (scalars, vectors, matrices) – in that order. If more than two dimensional, the second dimension indexes modes and higher dimensions will be flattened as if row ordered and must flatten into a concatenated list of (scalars, vectors, matrices). If the provided array can be interpreted as a contiguous row-ordered two dimensional array it will be used in place, otherwise a copy will be made.

  • values_elements (integer vector-like) – A multi-purpose vector containing, in order:

    • the number of scalar-like eigenvalue elements,

    • the number of vector-like eigenvalue elements (must be \(3\times N\)),

    • the number of matrix-like eigenvalue elements (must be \(9\times N\)),

    • an integer RotatesLike value denoting how the vector-like and matrix-like parts transform under application of a symmetry operation (see note below).

    • an integer LengthUnit value denoting what units the vector-like and matrix-like parts are in (see note below).

  • vectors_data (numpy.ndarray) – The eigenvector data to be stored in the grid. Same shape restrictions as values_data

  • vectors_elements – Like values_elements but for the eigenvectors

  • sort (logical (default False)) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Integer values outside of the mapped range (or missing) are replaced by 0.

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Integer values outside of the mapped range (or missing) are replaced by 3.

  1. fill(self: brille._brille.BZTrellisQdc, values_data: numpy.ndarray[numpy.float64], values_elements: numpy.ndarray[numpy.int32], values_weights: numpy.ndarray[numpy.float64], vectors_data: numpy.ndarray[numpy.complex128], vectors_elements: numpy.ndarray[numpy.int32], vectors_weights: numpy.ndarray[numpy.float64], sort: bool = False) -> None

Provide all data required for interpolation to the grid at once

Parameters:
  • values_data (numpy.ndarray) – The eigenvalue data to be stored in the grid. The first dimension must be equal in size to the number of grid-vertices. If two dimensional the second dimension is interpreted as all information for a single mode flattened and concatenated into (scalars, vectors, matrices) – in that order. If more than two dimensional, the second dimension indexes modes and higher dimensions will be flattened as if row ordered and must flatten into a concatenated list of (scalars, vectors, matrices). If the provided array can be interpreted as a contiguous row-ordered two dimensional array it will be used in place, otherwise a copy will be made.

  • values_elements (integer vector-like) – A multi-purpose vector containing, in order:

    • the number of scalar-like eigenvalue elements,

    • the number of vector-like eigenvalue elements (must be \(3\times N\)),

    • the number of matrix-like eigenvalue elements (must be \(9\times N\)),

    • an integer RotatesLike value denoting how the vector-like and matrix-like parts transform under application of a symmetry operation (see note below),

    • an integer LengthUnit value denoting what units the vector-like and matrix-like parts are in (see note below)

    • which scalar cost function should be used (see below),

    • which vector cost function should be used (see below).

    See the note below for the meaning of the last three values.

  • values_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvalue elements stored in the grid

  • vectors_data (numpy.ndarray) – The eigenvector data to be stored in the grid. Same shape restrictions as values_data

  • vectors_elements – Like values_elements but for the eigenvectors

  • vectors_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvector elements stored in the grid

  • sort (logical (default False)) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Integer values outside of the mapped range (or missing) are replaced by 3.

Mapping of integers to scalar cost function:

value

function(x,y)

0

magnitude(x-y)

Mapping of integers to vector cost function:

value

function(vec_x, vec_y)

0

sin(hermitian_angle(vec_x, vec_y))

1

vector_distance(vec_x, vec_y)

2

1 - vector_product(vec_x, vec_y)

3

vector_angle(vec_x, vec_y)

4

hermitian_angle(vec_x, vec_y)

Integer values outside of the mapped range (or missing) are replaced by 0.

static from_file(filename: str, entry: str = 'BZTrellisQdc') brille._brille.BZTrellisQdc

Save the object to an HDF5 file

Parameters:
  • filename (str) – The full path specification for the file to read from

  • entry (str) – The group path, e.g., “my/cool/grid”, where to read from inside the file, with a default equal to the object Class name

Return type:

clsObj

property inner_invA
property inner_rlu
interpolate_at(self: brille._brille.BZTrellisQdc, Q: numpy.ndarray[numpy.float64], useparallel: bool = False, threads: int = -1, do_not_move_points: bool = False) tuple[numpy.ndarray[numpy.float64], numpy.ndarray[numpy.complex128]]

Perform linear interpolation of the stored data at equivalent points

The first Brillouin zone is the part of reciprocal space which is invariant under application of the integer translations of a reciprocal space lattice. This method finds points equivalent to the input within the first Brillouin zone and then interpolates pre-stored information to provide an estimate at the found positions.

Parameters:
  • Q (numpy.ndarray) – A two dimensional array with Q.shape[1] == 3 containing the positions at which an interpolated result is required, expressed in units of the reciprocal lattice.

  • useparallel (bool, optional) – Whether a serial or parallel code should be utilised

  • threads (int, optional) – How many OpenMP workers should be utilised; if this value is less than one the environment variable OMP_NUM_THREADS will be used.

  • do_not_move_points (bool, optional) – If True the provided Q points must already lie within the first Brillouin zone. No check is made to verify this requirement and if any Q lie outside of the gridded volume out-of-bounds errors may result in bad data or runtime errors.

Returns:

The interpolated eigenvalues and eigenvectors at the equivalent first Brillouin zone points. The shape of each output will depend on the shape of the data provided to the fill() method. If the filled eigenvalues were of shape [N_grid_points, N_modes, A, ..., B], the eigenvectors were of shape [N_grid_points, N_modes, C, ..., D], and the provided points of shape [N_Q_points, 3] then the output shapes will be [N_Q_points, N_modes, A, ..., B] and [N_Q_points, N_modes, C, ..., D] for the eigenvalues and eigenvectors, respectively.

Return type:

tuple

property invA
ir_interpolate_at(self: brille._brille.BZTrellisQdc, Q: numpy.ndarray[numpy.float64], useparallel: bool = False, threads: int = -1, do_not_move_points: bool = False) tuple[numpy.ndarray[numpy.float64], numpy.ndarray[numpy.complex128]]

Perform linear interpolation of the stored data at irreducible equivalent points

The irreducible first Brillouin zone is the part of reciprocal space which is invariant under application of the integer translations and the pointgroup operations of a reciprocal space lattice. This method finds points equivalent to the input within the irreducible first Brillouin zone and then interpolates pre-stored information to provide an estimate at the found positions.

Parameters:
  • Q (numpy.ndarray) – A two dimensional array with Q.shape[1] == 3 containing the positions at which an interpolated result is required, expressed in units of the reciprocal lattice.

  • useparallel (bool, optional) – Whether a serial or parallel code should be utilised

  • threads (int, optional) – How many OpenMP workers should be utilised; if this value is less than one the environment variable OMP_NUM_THREADS will be used.

  • do_not_move_points (bool, optional) – If True the provided Q points must already lie within the first Brillouin zone. No check is made to verify this requirement and if any Q lie outside of the gridded volume out-of-bounds errors may result in bad data or runtime errors.

Returns:

The interpolated eigenvalues and eigenvectors at the equivalent irreducible first Brillouin zone points. The shape of each output will depend on the shape of the data provided to the fill() method. i If the filled eigenvalues were of shape [N_grid_points, N_modes, A, ..., B], the eigenvectors were of shape [N_grid_points, N_modes, C, ..., D], and the provided points of shape [N_Q_points, 3] then the output shapes will be [N_Q_points, N_modes, A, ..., B] and [N_Q_points, N_modes, C, ..., D] for the eigenvalues and eigenvectors, respectively.

Return type:

tuple

node_at(self: brille._brille.BZTrellisQdc, subscript: Annotated[list[int], FixedSize(3)]) brille::polyhedron::Poly<double, brille::Array2>
node_at_type(self: brille._brille.BZTrellisQdc, subscript: Annotated[list[int], FixedSize(3)]) brille::NodeType
node_containing(self: brille._brille.BZTrellisQdc, Q: numpy.ndarray[numpy.float64]) brille::polyhedron::Poly<double, brille::Array2>
node_containing_type(self: brille._brille.BZTrellisQdc, Q: numpy.ndarray[numpy.float64]) brille::NodeType
property outer_invA
property outer_rlu
property rlu
set_flags_weights(self: brille._brille.BZTrellisQdc, values_flags: numpy.ndarray[numpy.int32], values_weights: numpy.ndarray[numpy.float64], vectors_flags: numpy.ndarray[numpy.int32], vectors_weights: numpy.ndarray[numpy.float64], sort: bool = False) None

Set RotatesLike, ~brille._brille.LengthUnit and cost functions plus relative cost weights for the values and vectors stored in the object

Parameters:
  • values_flags (integer, vector-like) – One or more values indicating the RotatesLike value for the eigenvalues stored in the object, the ~brille._brille.LengthUnit value, plus which cost function to use when comparing stored eigenvalues at neighbouring grid points for scalar- and vector-like eigenvalues.

  • values_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvalue elements stored in the grid

  • vectors_flags (integer, vector-like) – One or more values indicating the RotatesLike value for the eigenvalues stored in the object, the ~brille._brille.LengthUnit value, plus which cost function to use when comparing stored eigenvectors at neighbouring grid points for scalar- and vector-like eigenvectors.

  • vectors_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvector elements stored in the grid

  • sort (bool, optional) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Mapping of integers to scalar cost function:

value

function(x,y)

0

magnitude(x-y)

Mapping of integers to vector cost function:

value

function(vec_x, vec_y)

0

sin(hermitian_angle(vec_x, vec_y))

1

vector_distance(vec_x, vec_y)

2

1 - vector_product(vec_x, vec_y)

3

vector_angle(vec_x, vec_y)

4

hermitian_angle(vec_x, vec_y)

Integer values outside of the mapped range (or missing) are replaced by 0.

sort(self: brille._brille.BZTrellisQdc) None
property tetrahedra
to_file(self: brille._brille.BZTrellisQdc, filename: str, entry: str = 'BZTrellisQdc', flags: str = 'ac') bool

Save the object to an HDF5 file

Parameters:
  • filename (str) – The full path specification for the file to write into

  • entry (str) – The group path, e.g., “my/cool/grid”, where to write inside the file, with a default equal to the object Class name

  • flags (str) – The HDF5 permissions to use when opening the file. Default ‘a’ writes to an existing file – if entry exists in the file it is overwritten.

Note

Possible flags are:

flags

meaning

HDF equivalent

‘r’

read

H5F_ACC_RDONLY

‘x’

write, error if exists

H5F_ACC_EXCL

‘a’

write, append to file

H5F_ACC_RDWR

‘c’

write, error if exists

H5F_ACC_CREAT

‘t’

write, replace existing

H5F_ACC_TRUNC

Returns:

Indication of writing success.

Return type:

bool

property values

Return a shared view of the stored eigenvalues

property vectors

Return a shared view of the stored eigenvectors

class brille.BZTrellisQdd(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: brille._brille.BZTrellisQdd, brillouin_zone: brille._brille.BrillouinZone, node_volume_fraction: float = 0.1, always_triangulate: bool = False) -> None

  2. __init__(self: brille._brille.BZTrellisQdd, brillouin_zone: brille._brille.BrillouinZone, node_volume_fraction: float, always_triangulate: bool, approx_config: brille::approx_float::Config) -> None

property BrillouinZone
all_node_types(self: brille._brille.BZTrellisQdd) list[brille::NodeType]
property bytes_per_point

Return the memory required per interpolation point result in bytes

fill(*args, **kwargs)

Overloaded function.

  1. fill(self: brille._brille.BZTrellisQdd, values_data: numpy.ndarray[numpy.float64], values_elements: numpy.ndarray[numpy.int32], vectors_data: numpy.ndarray[numpy.float64], vectors_elements: numpy.ndarray[numpy.int32], sort: bool = False) -> None

Provide data required for interpolation to the grid without cost information.

Parameters:
  • values_data (numpy.ndarray) – The eigenvalue data to be stored in the grid. The first dimension must be equal in size to the number of grid-vertices. If two dimensional the second dimension is interpreted as all information for a single mode flattened and concatenated into (scalars, vectors, matrices) – in that order. If more than two dimensional, the second dimension indexes modes and higher dimensions will be flattened as if row ordered and must flatten into a concatenated list of (scalars, vectors, matrices). If the provided array can be interpreted as a contiguous row-ordered two dimensional array it will be used in place, otherwise a copy will be made.

  • values_elements (integer vector-like) – A multi-purpose vector containing, in order:

    • the number of scalar-like eigenvalue elements,

    • the number of vector-like eigenvalue elements (must be \(3\times N\)),

    • the number of matrix-like eigenvalue elements (must be \(9\times N\)),

    • an integer RotatesLike value denoting how the vector-like and matrix-like parts transform under application of a symmetry operation (see note below).

    • an integer LengthUnit value denoting what units the vector-like and matrix-like parts are in (see note below).

  • vectors_data (numpy.ndarray) – The eigenvector data to be stored in the grid. Same shape restrictions as values_data

  • vectors_elements – Like values_elements but for the eigenvectors

  • sort (logical (default False)) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Integer values outside of the mapped range (or missing) are replaced by 0.

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Integer values outside of the mapped range (or missing) are replaced by 3.

  1. fill(self: brille._brille.BZTrellisQdd, values_data: numpy.ndarray[numpy.float64], values_elements: numpy.ndarray[numpy.int32], values_weights: numpy.ndarray[numpy.float64], vectors_data: numpy.ndarray[numpy.float64], vectors_elements: numpy.ndarray[numpy.int32], vectors_weights: numpy.ndarray[numpy.float64], sort: bool = False) -> None

Provide all data required for interpolation to the grid at once

Parameters:
  • values_data (numpy.ndarray) – The eigenvalue data to be stored in the grid. The first dimension must be equal in size to the number of grid-vertices. If two dimensional the second dimension is interpreted as all information for a single mode flattened and concatenated into (scalars, vectors, matrices) – in that order. If more than two dimensional, the second dimension indexes modes and higher dimensions will be flattened as if row ordered and must flatten into a concatenated list of (scalars, vectors, matrices). If the provided array can be interpreted as a contiguous row-ordered two dimensional array it will be used in place, otherwise a copy will be made.

  • values_elements (integer vector-like) – A multi-purpose vector containing, in order:

    • the number of scalar-like eigenvalue elements,

    • the number of vector-like eigenvalue elements (must be \(3\times N\)),

    • the number of matrix-like eigenvalue elements (must be \(9\times N\)),

    • an integer RotatesLike value denoting how the vector-like and matrix-like parts transform under application of a symmetry operation (see note below),

    • an integer LengthUnit value denoting what units the vector-like and matrix-like parts are in (see note below)

    • which scalar cost function should be used (see below),

    • which vector cost function should be used (see below).

    See the note below for the meaning of the last three values.

  • values_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvalue elements stored in the grid

  • vectors_data (numpy.ndarray) – The eigenvector data to be stored in the grid. Same shape restrictions as values_data

  • vectors_elements – Like values_elements but for the eigenvectors

  • vectors_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvector elements stored in the grid

  • sort (logical (default False)) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Integer values outside of the mapped range (or missing) are replaced by 3.

Mapping of integers to scalar cost function:

value

function(x,y)

0

magnitude(x-y)

Mapping of integers to vector cost function:

value

function(vec_x, vec_y)

0

sin(hermitian_angle(vec_x, vec_y))

1

vector_distance(vec_x, vec_y)

2

1 - vector_product(vec_x, vec_y)

3

vector_angle(vec_x, vec_y)

4

hermitian_angle(vec_x, vec_y)

Integer values outside of the mapped range (or missing) are replaced by 0.

static from_file(filename: str, entry: str = 'BZTrellisQdd') brille._brille.BZTrellisQdd

Save the object to an HDF5 file

Parameters:
  • filename (str) – The full path specification for the file to read from

  • entry (str) – The group path, e.g., “my/cool/grid”, where to read from inside the file, with a default equal to the object Class name

Return type:

clsObj

property inner_invA
property inner_rlu
interpolate_at(self: brille._brille.BZTrellisQdd, Q: numpy.ndarray[numpy.float64], useparallel: bool = False, threads: int = -1, do_not_move_points: bool = False) tuple[numpy.ndarray[numpy.float64], numpy.ndarray[numpy.float64]]

Perform linear interpolation of the stored data at equivalent points

The first Brillouin zone is the part of reciprocal space which is invariant under application of the integer translations of a reciprocal space lattice. This method finds points equivalent to the input within the first Brillouin zone and then interpolates pre-stored information to provide an estimate at the found positions.

Parameters:
  • Q (numpy.ndarray) – A two dimensional array with Q.shape[1] == 3 containing the positions at which an interpolated result is required, expressed in units of the reciprocal lattice.

  • useparallel (bool, optional) – Whether a serial or parallel code should be utilised

  • threads (int, optional) – How many OpenMP workers should be utilised; if this value is less than one the environment variable OMP_NUM_THREADS will be used.

  • do_not_move_points (bool, optional) – If True the provided Q points must already lie within the first Brillouin zone. No check is made to verify this requirement and if any Q lie outside of the gridded volume out-of-bounds errors may result in bad data or runtime errors.

Returns:

The interpolated eigenvalues and eigenvectors at the equivalent first Brillouin zone points. The shape of each output will depend on the shape of the data provided to the fill() method. If the filled eigenvalues were of shape [N_grid_points, N_modes, A, ..., B], the eigenvectors were of shape [N_grid_points, N_modes, C, ..., D], and the provided points of shape [N_Q_points, 3] then the output shapes will be [N_Q_points, N_modes, A, ..., B] and [N_Q_points, N_modes, C, ..., D] for the eigenvalues and eigenvectors, respectively.

Return type:

tuple

property invA
ir_interpolate_at(self: brille._brille.BZTrellisQdd, Q: numpy.ndarray[numpy.float64], useparallel: bool = False, threads: int = -1, do_not_move_points: bool = False) tuple[numpy.ndarray[numpy.float64], numpy.ndarray[numpy.float64]]

Perform linear interpolation of the stored data at irreducible equivalent points

The irreducible first Brillouin zone is the part of reciprocal space which is invariant under application of the integer translations and the pointgroup operations of a reciprocal space lattice. This method finds points equivalent to the input within the irreducible first Brillouin zone and then interpolates pre-stored information to provide an estimate at the found positions.

Parameters:
  • Q (numpy.ndarray) – A two dimensional array with Q.shape[1] == 3 containing the positions at which an interpolated result is required, expressed in units of the reciprocal lattice.

  • useparallel (bool, optional) – Whether a serial or parallel code should be utilised

  • threads (int, optional) – How many OpenMP workers should be utilised; if this value is less than one the environment variable OMP_NUM_THREADS will be used.

  • do_not_move_points (bool, optional) – If True the provided Q points must already lie within the first Brillouin zone. No check is made to verify this requirement and if any Q lie outside of the gridded volume out-of-bounds errors may result in bad data or runtime errors.

Returns:

The interpolated eigenvalues and eigenvectors at the equivalent irreducible first Brillouin zone points. The shape of each output will depend on the shape of the data provided to the fill() method. i If the filled eigenvalues were of shape [N_grid_points, N_modes, A, ..., B], the eigenvectors were of shape [N_grid_points, N_modes, C, ..., D], and the provided points of shape [N_Q_points, 3] then the output shapes will be [N_Q_points, N_modes, A, ..., B] and [N_Q_points, N_modes, C, ..., D] for the eigenvalues and eigenvectors, respectively.

Return type:

tuple

node_at(self: brille._brille.BZTrellisQdd, subscript: Annotated[list[int], FixedSize(3)]) brille::polyhedron::Poly<double, brille::Array2>
node_at_type(self: brille._brille.BZTrellisQdd, subscript: Annotated[list[int], FixedSize(3)]) brille::NodeType
node_containing(self: brille._brille.BZTrellisQdd, Q: numpy.ndarray[numpy.float64]) brille::polyhedron::Poly<double, brille::Array2>
node_containing_type(self: brille._brille.BZTrellisQdd, Q: numpy.ndarray[numpy.float64]) brille::NodeType
property outer_invA
property outer_rlu
property rlu
set_flags_weights(self: brille._brille.BZTrellisQdd, values_flags: numpy.ndarray[numpy.int32], values_weights: numpy.ndarray[numpy.float64], vectors_flags: numpy.ndarray[numpy.int32], vectors_weights: numpy.ndarray[numpy.float64], sort: bool = False) None

Set RotatesLike, ~brille._brille.LengthUnit and cost functions plus relative cost weights for the values and vectors stored in the object

Parameters:
  • values_flags (integer, vector-like) – One or more values indicating the RotatesLike value for the eigenvalues stored in the object, the ~brille._brille.LengthUnit value, plus which cost function to use when comparing stored eigenvalues at neighbouring grid points for scalar- and vector-like eigenvalues.

  • values_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvalue elements stored in the grid

  • vectors_flags (integer, vector-like) – One or more values indicating the RotatesLike value for the eigenvalues stored in the object, the ~brille._brille.LengthUnit value, plus which cost function to use when comparing stored eigenvectors at neighbouring grid points for scalar- and vector-like eigenvectors.

  • vectors_weights (float, vector-like) – The relative cost weights between scalar-, vector-, and matrix- like eigenvector elements stored in the grid

  • sort (bool, optional) – Whether the equivalent-mode permutations should be (re)determined following the update to the flags and weights.

Note

Mapping of integers to RotatesLike values:

value

RotatesLike

0

vector

1

pseudovector

2

Gamma

Mapping of integers to LengthUnit values:

value

LengthUnit

0

none

1

angstrom

2

inverse_angstrom

3

real_lattice

4

reciprocal_lattice

Mapping of integers to scalar cost function:

value

function(x,y)

0

magnitude(x-y)

Mapping of integers to vector cost function:

value

function(vec_x, vec_y)

0

sin(hermitian_angle(vec_x, vec_y))

1

vector_distance(vec_x, vec_y)

2

1 - vector_product(vec_x, vec_y)

3

vector_angle(vec_x, vec_y)

4

hermitian_angle(vec_x, vec_y)

Integer values outside of the mapped range (or missing) are replaced by 0.

sort(self: brille._brille.BZTrellisQdd) None
property tetrahedra
to_file(self: brille._brille.BZTrellisQdd, filename: str, entry: str = 'BZTrellisQdd', flags: str = 'ac') bool

Save the object to an HDF5 file

Parameters:
  • filename (str) – The full path specification for the file to write into

  • entry (str) – The group path, e.g., “my/cool/grid”, where to write inside the file, with a default equal to the object Class name

  • flags (str) – The HDF5 permissions to use when opening the file. Default ‘a’ writes to an existing file – if entry exists in the file it is overwritten.

Note

Possible flags are:

flags

meaning

HDF equivalent

‘r’

read

H5F_ACC_RDONLY

‘x’

write, error if exists

H5F_ACC_EXCL

‘a’

write, append to file

H5F_ACC_RDWR

‘c’

write, error if exists

H5F_ACC_CREAT

‘t’

write, replace existing

H5F_ACC_TRUNC

Returns:

Indication of writing success.

Return type:

bool

property values

Return a shared view of the stored eigenvalues

property vectors

Return a shared view of the stored eigenvectors

class brille.Basis(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: brille._brille.Basis, arg0: numpy.ndarray[numpy.float64]) -> None

  2. __init__(self: brille._brille.Basis, arg0: numpy.ndarray[numpy.float64], arg1: list[int]) -> None

property positions
property size
property types
class brille.Bravais(self: brille._brille.Bravais, value: int)

Bases: pybind11_object

A Bravais letter indicating the centering of a lattice

When the unit cell does not reflect the symmetry of the lattice, it is usual to refer to a ‘conventional’ crystallographic basis, \((\mathbf{a}_s\,\mathbf{b}_s\,\mathbf{c}_s)\), instead of a primitive basis, \((\mathbf{a}_p\,\mathbf{b}_p\,\mathbf{c}_p)\). Such a conventional basis has ‘extra’ lattice points added at the centre of the unit cell, the centre of a face, or the centre of three faces. The ‘extra’ nodes in the conventional basis are displaced from the origin of the unit cell by ‘centring vectors’. As with any space-spanning basis, any whole-number linear combination of the conventional basis vectors is a lattice point but in addition there exist linear combinations \(x\mathbf{a}_s+y\mathbf{b}_s+z\mathbf{c}_s\) with at least two fractional coefficients \((x,y,z)\) that are lattice points as well.

Each conventional basis is ascribed a Bravais letter, which forms part of the Hermann-Mauguin symbol of a space group. A subset of the 10 possible Bravais letters is used herein:

Bravais letter

Centring

Centring vectors

P

primitive

\(\mathbf{0}\)

A

A-face centred

\(\frac{\mathbf{b}_s+\mathbf{c}_s}{2}\)

B

B-face centred

\(\frac{\mathbf{c}_s+\mathbf{a}_s}{2}\)

C

C-face centred

\(\frac{\mathbf{a}_s+\mathbf{b}_s}{2}\)

I

body centred (Innenzentriert)

\(\frac{\mathbf{a}_s+\mathbf{b}_s+\mathbf{c}_s}{2}\)

F

all-face centred

\(\frac{\mathbf{b}_s+\mathbf{c}_s}{2}\), \(\frac{\mathbf{c}_s+\mathbf{a}_s}{2}\), \(\frac{\mathbf{a}_s+\mathbf{b}_s}{2}\)

R

rhombohedrally centred (hexagonal axes)

\(\frac{2\mathbf{a}_s+\mathbf{b}_s+\mathbf{c}_s}{3}\) \(\frac{\mathbf{a}_s+2\mathbf{b}_s+2\mathbf{c}_s}{3}\)

For further details, see the IUCr Online Dictionary of Crystallography.

Members:

invalid

P : primitive

A : A-face centred

B : B-face centred

C : C-face centred

I : body-centred

F : face centred

R : rhombohedrally centred

A = <Bravais.A: 2>
B = <Bravais.B: 3>
C = <Bravais.C: 4>
F = <Bravais.F: 6>
I = <Bravais.I: 5>
P = <Bravais.P: 1>
R = <Bravais.R: 7>
invalid = <Bravais.invalid: 0>
property name
property value
class brille.BrillouinZone(*args, **kwargs)

Bases: pybind11_object

Construct and hold a first Brillouin zone and, optionally and by default, an irreducible Brillouin zone.

The region closer to a given lattice point than to any other is the Wigner-Seitz cell of that lattice. The same construction is one possible first Brillouin zone of a reciprocal lattice and is used within brille. For example, a two-dimensional hexagonal lattice has a first Brillouin zone which is a hexagon:

Figure made with TikZ

Since all physical properties of a crystal must have the same periodicity as its lattice, the powerful feature of the first Brillouin zone is that it encompasses a region of reciprocal space which must fully represent all of reciprocal space.

Most crystals contain rotational or rotoinversion symmetries in addition to the translational ones which give rise to the first Brillouin zone. These symmetries are the pointgroup of the lattice and enforce that the properties of the crystal also have the same symmetry. The first Brillouin zone, therefore, typically contains redundant information.

An irreducible Brillouin zone is a subsection of the first Brillouin zone which contains the minimal part required to have only unique crystal properties. This class can find an irreducible Brillouin zone for any crystal lattice. In the example of the hexagonal lattice there are six equivalent irreducible Brillouin zones one of which is:

Figure made with TikZ

Parameters:
  • lattice (brille._brille.Reciprocal) – The reciprocal space lattice for which a Brillouin zone will be found

  • use_primitive (bool) – If the provided brille._brille.Reciprocal lattice is a conventional Bravais lattice, this parameter controls whether the equivalent primitive Bravais lattice should be used to find the first Brillouin zone. This is True by default and should only be modified for testing purposes.

  • search_length (int) – The Wigner-Seitz construction of the first Brillouin zone finds the volume of space closer to a chosen reciprocal lattice point than any other reciprocal lattice point. This is accomplished by successively dividing the space by planes halfway between the chosen point and a subset of all other planes. The subset used is controlled by search_length and is every unique \((\pm s_i\,0\,0)\), \((0\,\pm s_j\,0)\), \((0\,0\,\pm s_k)\), \((\pm s_i\,\pm s_j\,0)\), \((\pm s_i\,0\,\pm s_k)\), \((0\,\pm s_j\,\pm s_k)\), \((\pm s_i\,\pm s_j\,\pm s_k)\) for \(1 \le s_\alpha \le\) search_length. If the reciprocal lattice is primitive then the default search_length of 1 should always give the correct first Brillouin zone. For extra assurance that the correct first Brillouin zone is found, the procedure is internally repeated with search_length incremented by one and an error is raised if the two constructed polyhedra have different volumes.

  • time_reversal_symmetry (bool) – Controls whether time reversal symmetry should be added to pointgroups lacking space inversion. This affects the found irreducible Brillouin zone for such systems. To avoid inadvertently adding time reversal symmetry when it is not appropriate, this is False by default.

  • wedge_search (bool) – Controls whether an irreducible Brillouin zone should be found. With this set to False the returned brille._brille.BrillouinZone will only contain the first Brillouin zone. If True the pointgroup symmetry operations will be used to identify an irreducible Brillouin zone as well. If the provided lattice’s parameters do not match the symmetry of the pointgroup (e.g., a lattice which should be tetragonal like \(I4/mmm\) but constructed with \(\gamma=120^\circ\)) the algorithm will fail to find an appropriate irreducible Brillouin zone and an error will be raised. (Set to True by default).

Overloaded function.

  1. __init__(self: brille._brille.BrillouinZone, lattice: brille._brille.Lattice, use_primitive: bool = True, search_length: int = 1, time_reversal_symmetry: bool = False, wedge_search: bool = True, divide_primitive: bool = True) -> None

  2. __init__(self: brille._brille.BrillouinZone, lattice: brille._brille.Lattice, approx_config: brille::approx_float::Config, use_primitive: bool = True, search_length: int = 1, time_reversal_symmetry: bool = False, wedge_search: bool = True, divide_primitive: bool = True) -> None

property faces_per_vertex

Return the first Brillouin zone face indices for each unique face corner

static from_file(filename: str, entry: str = 'BrillouinZone') brille._brille.BrillouinZone

Save the object to an HDF5 file

Parameters:
  • filename (str) – The full path specification for the file to read from

  • entry (str) – The group path, e.g., “my/cool/bz”, where to read from inside the file, with a default equal to the object Class name

Return type:

clsObj

property half_edge_points

Return the first Brillouin zone face edge centres in rlu

property half_edge_points_invA

Return the first Brillouin zone face edge centres in inverse ångstrom

property ir_faces_per_vertex

Return the irreducible Brillouin zone face index per unique face corner

ir_moveinto(self: brille._brille.BrillouinZone, Q: numpy.ndarray[numpy.float64], threads: int = 0) tuple

Find points equivalent to those provided within the irreducible Brillouin zone.

The BrillouinZone object defines a volume of reciprocal space which contains an irreducible part of the full reciprocal-space. This method will find points equivalent under the operations of the lattice which fall within this irreducible volume.

Parameters:
  • Q (numpy.ndarray) – A 2 dimensional array of three-vectors (Q.shape[1]==3) expressed in units of the reciprocal lattice.

  • threads (integer, optional) – The number of parallel threads that should be used. If this value is less than one the maximum number of OpenMP threads will be used – this value can be controlled by the environment variable OMP_NUM_THREADS and is typically the number of logical cores if not explicitly set.

Returns:

  • Qir (numpy.ndarray) – The array of equivalent irreducible \(\mathbf{q}_\text{ir}\) points for all \(\mathbf{Q}\);

  • tau (numpy.ndarray) – the closest reciprocal lattice vector, \(\boldsymbol{\tau}\), to each \(\mathbf{Q}\);

  • R (numpy.ndarray) – the pointgroup symmetry operation \(R\)

  • Rinv (numpy.ndarray) – the inverse point group symmetry operation which obey \(\mathbf{Q} = R^{-1} \mathbf{q}_\text{ir} + \boldsymbol{\tau}\).

ir_moveinto_wedge(self: brille._brille.BrillouinZone, Q: numpy.ndarray[numpy.float64], threads: int = 0) tuple

Find points equivalent to those provided within the irreducible wedge.

The BrillouinZone object defines a wedge of reciprocal space which contains an irreducible part of the full-space 4π steradian solid angle. This method will find points equivalent under the pointgroup operations of the lattice which fall within this irreducible solid angle and maintain their absolute magnitude.

Parameters:
  • Q (numpy.ndarray) – A 2 dimensional array of three-vectors (Q.shape[1]==3) expressed in units of the reciprocal lattice.

  • threads (integer, optional (default 0)) – The number of parallel threads that should be used. If this value is less than one the maximum number of OpenMP threads will be used – this value can be controlled by the environment variable OMP_NUM_THREADS and is typically the number of logical cores if not explicitly set.

Returns:

The array of equivalent in-wedge \(\mathbf{Q}_\text{ir}\) points for all \(\mathbf{Q}\), and the pointgroup operation fulfilling \(\mathbf{Q}_\text{ir} = R \mathbf{Q}\).

Return type:

numpy.ndarray, numpy.ndarray

property ir_normals

Return the irreducible Brillouin zone face normals in rlu

property ir_normals_invA

Return the irreducible Brillouin zone face normals in inverse ångstrom

property ir_normals_primitive

Return the irreducible Brillouin zone face normals in primitive-lattice rlu

property ir_points

Return the irreducible Brillouin zone face centres in rlu

property ir_points_invA

Return the irreducible Brillouin zone face centres in inverse ångstrom

property ir_points_primitive

Return the irreducible Brillouin zone face centres in primitive-lattice rlu

property ir_polyhedron

Returns the irreducible Brillouin zone brille._brille.Polyhedron

Returns:

If no irreducible Brillouin zone was requested at construction, the returned polyhedron is that of the first Brillouin zone instead.

Return type:

brille._brille.Polyhedron

property ir_polyhedron_generated

Returns the found irreducible Brillouin zone brille._brille.Polyhedron

If the lattice pointgroup does not contain the space inversion operator the internally held ‘irreducible’ polyhedron is only half of the real irreducible polyhedron. This method gives access to the polyhedron found by the algorithm before being doubled for output.

property ir_vertices

Return the irreducible Brillouin zone unique face corners in rlu

property ir_vertices_invA

Return the irreducible Brillouin zone unique face corners in inverse ångstrom

property ir_vertices_per_face

Return the irreducible Brillouin zone unique face corners per face

property ir_vertices_primitive

Return the irreducible Brillouin zone unique face corners in primitive-lattice rlu

isinside(self: brille._brille.BrillouinZone, points: numpy.ndarray[numpy.float64]) list[bool]

Determine whether each of the provided reciprocal lattice points is located within the first Brillouin zone

Parameters:

Q (numpy.ndarray) – A 2 dimensional array of three-vectors (Q.shape[1]==3) expressed in units of the reciprocal lattice.

Returns:

One dimensional logical array with True indicating ‘inside’

Return type:

numpy.ndarray

property lattice

Returns the defining brille._brille.Lattice lattice

moveinto(self: brille._brille.BrillouinZone, Q: numpy.ndarray[numpy.float64], threads: int = 0) tuple

Find points equivalent to those provided within the first Brillouin zone.

Parameters:
  • Q (numpy.ndarray) – A 2 dimensional array of three-vectors (Q.shape[1]==3) expressed in units of the reciprocal lattice.

  • threads (integer, optional) – The number of parallel threads that should be used. If this value is less than one the maximum number of OpenMP threads will be used – this value can be controlled by the environment variable OMP_NUM_THREADS and is typically the number of logical cores if not explicitly set.

Returns:

The floating point array of equivalent reduced \(\mathbf{q}\) points for all \(\mathbf{Q}\), and an integer array filled with \(\boldsymbol{\tau} = \mathbf{Q}-\mathbf{q}\).

Return type:

numpy.ndarray, numpy.ndarray

property normals

Return the first Brillouin zone face normals in rlu

property normals_invA

Return the first Brillouin zone face normals in inverse ångstrom

property normals_primitive

Return the first Brillouin zone face normals in primitive-lattice rlu

property points

Return the first Brillouin zone face centres in rlu

property points_invA

Return the first Brillouin zone face centres in inverse ångstrom

property points_primitive

Return the first Brillouin zone face centres in primitive-lattice rlu

property polyhedron

Returns the first Brillouin zone brille._brille.Polyhedron

to_file(self: brille._brille.BrillouinZone, filename: str, entry: str = 'BrillouinZone', flags: str = 'ac') bool

Save the object to an HDF5 file

Parameters:
  • filename (str) – The full path specification for the file to write into

  • entry (str) – The group path, e.g., “my/cool/bz”, where to write inside the file, with a default equal to BrillouinZone name

  • flags (str) – The HDF5 permissions to use when opening the file. Default ‘a’ writes to an existing file – if entry exists in the file it is overwritten.

Note

Possible flags are:

flags

meaning

HDF equivalent

‘r’

read

H5F_ACC_RDONLY

‘x’

write, error if exists

H5F_ACC_EXCL

‘a’

write, append to file

H5F_ACC_RDWR

‘c’

write, error if exists

H5F_ACC_CREAT

‘t’

write, replace existing

H5F_ACC_TRUNC

Returns:

Indication of writing success.

Return type:

bool

property vertices

Return the first Brillouin zone unique face corners in rlu

property vertices_invA

Return the first Brillouin zone unique face corners in inverse ångstrom

property vertices_per_face

Return the first Brillouin zone face corner indices for each face

property vertices_primitive

Return the first Brillouin zone unique face corners in primitive-lattice rlu

property wedge_normals

Return the normals of the irreducible wedge rlu

property wedge_normals_invA

Return the normals of the irreducible wedge inverse ångstrom

property wedge_normals_primitive

Return the normals of the irreducible wedge primitive-lattice rlu

class brille.HallSymbol(self: brille._brille.HallSymbol, Hall_symbol: str)

Bases: pybind11_object

A crystallographic spacegroup’s symmetries encoded in Hall’s notation

Hall proposed a compact unambiguous notation for the representation of the generators of a spacegroup. Within his notation each motion is comprised of a character with one or more subscripts and superscripts which describe its order, unique axis, and translation. The notation specifies that, depending on the position of a motion and details of any preceding motion, some or all of the sub- and superscripts can be omitted. The HallSymbol has been written to handle the logic necessary to decode a Hall symbol into its equivalent motions. An added complication arises when the Hall symbol is encoded as an ASCII string. Namely, there are no sub- or superscript glyphs and some scheme must be enacted to represent them.

property generators
class brille.LPolyhedron

Bases: pybind11_object

property centre
property faces
intersection(self: brille._brille.LPolyhedron, arg0: brille._brille.LPolyhedron) brille._brille.LPolyhedron
property mirror
property normals
property points
rotate(self: brille._brille.LPolyhedron, arg0: brille._brille.PointSymmetry, arg1: int) brille._brille.LPolyhedron
to_Cartesian(self: brille._brille.LPolyhedron) brille._brille.Polyhedron
property vertices
property volume
brille.Lattice(values, spacegroup=None, symmetry=None, basis=None, **kwargs)

Construct a space-spanning lattice in three dimensions

A space-spanning lattice in \(N\) dimensions has \(N\) basis vectors which can be described fully by their \(N\) lengths and the \(\frac{1}{2} N (N-1)\) angles between each set of basis vectors, or \(\frac{1}{2}N(N+1)\) scalars in total. This class stores the basis vectors of the lattice described in an orthonormal space, plus the metric of the space, and the equivalent information for the dual of the lattice.

Examples

>>> from brille import Lattice
>>> a, c = 3.95, 12.9
>>> avec, bvec, cvec = [a, 0, 0], [0, a, 0], [0, 0, c]
>>> basis = ([[0, 0, 0], [0.5, 0.5, 0.5], [0.25, 0.25, 0.3]], [0, 0, 1]))
>>> symmetry = (rotations, translations)
>>> lat = Lattice(([a, a, c], [90, 90, 90]), spacegroup='I4/mmm', basis=basis)
>>> lat = Lattice(([avec, bvec, cvec],), symmetry=symmetry, basis=basis)
>>> lat = Lattice([avec, bvec, cvec], spacegroup='I4/mmm', basis=basis)

Note

The parameters packed into values are position-based and should be either (lengths, angles) or (vectors,) [which also requires setting row_vectors=False if the matrix represents column vectors]. The lengths or vector components are interpreted in angstrom or inverse angstrom for real or reciprocal lattice parameters, respectively, and are assumed to be angstrom if the keyword real_space is missing or True.

Parameters:
  • values ((lengths, angles), vectors) – See the note above and the documenation for lengths, angles, and vectors below.

  • lengths (list, tuple, numpy.ndarray) – The three basis vector lengths in angstrom for real lattice, or inverse angstrom for reciprocal lattices

  • angles (list, tuple, numpy.ndarray) – The three angles between the basis vectors in degrees or radians. The angles are interpreted as radians if none are greater than pi and are otherwise assumed to be degrees.

  • vectors (list[list,…], tuple(tuple,…), numpy.ndarray) – The basis vectors in angstrom for real lattices, or inverse angstrom for reciprocal lattices, expressed in an orthorhombic coordinate system. An optional keyword argument, row_vectors, identifies if the provided basis vectors are row vectors [row_vectors=True, default] or column vectors [row_vectors=False].

  • spacegroup (str, tuple(str, str)) – The International Tables name, Hermann-Mauguin symbol with optional choice, or Hall symbol for the spacegroup of the lattice. The spacegroup may be provided as positional argument(s) or by keyword. If present, the symmetry keyword must not be used. Valid syntax for (Hermann-Mauguin, choice) input depends on the spacegroup but is generally one of:

    • a single letter (‘a’, ‘b’, or ‘c’) with possible prepended ‘-’, denoting unique-axis choice

    • a single digit (‘1’, ‘2’, or ‘3’), denoting origin choice

    • a letter and digit, denoting unique-axis and origin choice

    • a permutation of ‘abc’ with possible ‘-’ before one of the letters, denoting axis permutation

    • or ‘R’ or ‘H’ for trigonal systems with Rhombohedral or Hexagonal lattice settings, respectively.

    Acceptable values are contained in the C++ source code in the seventh column of this table with each line representing one spacegroup with values, in order, defined by the class signature These values come from spglib, which likely obtained them from Seto’s Home Page.

  • symmetry (brille.Symmetry, tuple(matrices, vectors), str) – The spacegroup symmetry operations as an object, a tuple of the (pseudo)rotation matrices and translation vectors, or a CIF xyz encoded string. The symmetry information must be provided by keyword. If present, the ‘spacegroup’ positional argument(s) or keyword must not be used.

  • basis (brille.Basis, tuple(positions, types)) – The atom basis information of the lattice, expressed in units of the real space basis vectors. The types must be integer and are used only to identify equivalent atoms – they should probably be contiguous from zero to 1-N where N is the number of unique atoms in the atom basis. If present, either spacegroup or symmetry information must be provided.

  • kwargs – Keyword arguments are passed to the brille._brille.Lattice constructor, see its documentation for details.

class brille.LengthUnit(self: brille._brille.LengthUnit, value: int)

Bases: pybind11_object

The units of a number representing a length

Members:

none

angstrom : 10⁻¹⁰ meter

inverse_angstrom : 1 / angstrom

real_lattice : fractional coordinates of real lattice

reciprocal_lattice : fractional coordinates of reciprocal lattice

angstrom = <LengthUnit.angstrom: 1>
inverse_angstrom = <LengthUnit.inverse_angstrom: 2>
property name
none = <LengthUnit.none: 0>
real_lattice = <LengthUnit.real_lattice: 3>
reciprocal_lattice = <LengthUnit.reciprocal_lattice: 4>
property value
class brille.NodeType(self: brille._brille.NodeType, value: int)

Bases: pybind11_object

The units of a number representing a length

Members:

assumed_null : Indicates a node which should be null but no explicit check was performed

found_null : A node which an explicit check found to be null

null : A null node

cube : A cube shaped node

polygon : A convex polygon shaped node

assumed_null = <NodeType.assumed_null: 0>
cube = <NodeType.cube: 3>
found_null = <NodeType.found_null: 1>
property name
null = <NodeType.null: 2>
polygon = <NodeType.polygon: 4>
property value
class brille.PointSymmetry(*args, **kwargs)

Bases: pybind11_object

Holds the \(3 \times 3\) rotation matrices \(R\) which comprise a point group symmetry.

A point group describes the local symmetry of a lattice point. It contains all of the generalised rotations of a Symmetry with none of its translations.

Overloaded function.

  1. __init__(self: brille._brille.PointSymmetry, Hall_number: int, time_reversal: int = 0) -> None

  2. __init__(self: brille._brille.PointSymmetry, Symmetry: brille._brille.Symmetry) -> None

property W
property axis
property generate
property generators
property isometry
nfolds(self: brille._brille.PointSymmetry, arg0: int) brille._brille.PointSymmetry
property order
property size
class brille.Pointgroup(self: brille._brille.Pointgroup, Pointgroup number: int)

Bases: pybind11_object

property holohedry
property laue
property number
property symbol
class brille.Polyhedron(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: brille._brille.Polyhedron, vertices: numpy.ndarray[numpy.float64]) -> None

  2. __init__(self: brille._brille.Polyhedron, vertices: numpy.ndarray[numpy.float64], faces: list[list[int]]) -> None

property centre
property faces
intersection(self: brille._brille.Polyhedron, arg0: brille._brille.Polyhedron) brille._brille.Polyhedron
property mirror
property normals
property points
property vertices
property volume
class brille.PrimitiveTransform(self: brille._brille.PrimitiveTransform, Hall number: int)

Bases: pybind11_object

property P
property Pt
property does_anything
property invP
property invPt
property is_primitive
class brille.RotatesLike(self: brille._brille.RotatesLike, value: int)

Bases: pybind11_object

Enumeration indicating how vector and matrix values transform

Members:

vector : Rotates like a vector

pseudovector : Rotates like a pseudovector

Gamma : Rotates like a (real space) phonon eigenvector

Gamma = <RotatesLike.Gamma: 2>
property name
pseudovector = <RotatesLike.pseudovector: 1>
property value
vector = <RotatesLike.vector: 0>
class brille.SortingStatus(self: brille._brille.SortingStatus, sorted: bool, locked: bool, visits: int)

Bases: pybind11_object

An object representing the status of a single object under sorting.

Internally may be represented as a single unsigned integer where two or more bits are reserved for various flags, or as a set of boolean values and an integer.

property locked

Return the locked flag

property sorted

Return the sorted flag

property visits

Return the visit count

class brille.Spacegroup(self: brille._brille.Spacegroup, Hall number: int)

Bases: pybind11_object

property choice
property hall_number
property hall_symbol
property international_table_full
property international_table_number
property international_table_short
property international_table_symbol
property pointgroup_number
property schoenflies_symbol
class brille.Symmetry(*args, **kwargs)

Bases: pybind11_object

One or more symmetry operations of a space group.

A symmetry operation is the combination of a generalised rotation, \(W\), and translation, \(\mathbf{w}\). For any position in space, \(\mathbf{x}\), the operation transforms \(\mathbf{x}\) to another equivalent position

\[\mathbf{x}' = W \mathbf{x} + \mathbf{w} \]

and can equivalently be expressed as \(\mathbf{x}' = \mathscr{M}\mathbf{x}\).

Crystallographic symmetry operations have an order, \(o\), for which \(\mathscr{M}^o = \mathscr{E}\) i.e. \(o\) repeated applications of the operation is equivalent to the identity operator.

A set of symmetry operations can form a group, \(\mathbb{G}\), with the property that \(\mathscr{M}_k = \mathscr{M}_i \mathscr{M}_j\) with \(\mathscr{M}_i,\mathscr{M}_j,\mathscr{M}_k \in \mathbb{G}\).

This class can be used to hold any number of related symmetry operators, and to generate all spacegroup operators from those stored.

Parameters:
  • hall (int) – The integer Hall number for the desired space group operations [[deprecated]].

  • W (arraylike, int) – The generalised rotation (matrix) part of the symmetry operator(s)

  • w (arraylike, float) – The translation (vector) part of the symmetry operator(s)

  • cifxyz (str) – The symmetry operator(s) encoded in CIF xyz format

Note

The overloaded forms of __init__ take one of hall, (W, w), or cifxyz.

Overloaded function.

  1. __init__(self: brille._brille.Symmetry, Hall number: int) -> None

  2. __init__(self: brille._brille.Symmetry, W: numpy.ndarray[numpy.int32], w: numpy.ndarray[numpy.float64]) -> None

  3. __init__(self: brille._brille.Symmetry, CIF xyz string: str) -> None

property W
property centring
generate(self: brille._brille.Symmetry) brille._brille.Symmetry
generators(self: brille._brille.Symmetry) brille._brille.Symmetry
property size
property w
brille.real_space_tolerance(*args, **kwargs)

Overloaded function.

  1. real_space_tolerance() -> float

  2. real_space_tolerance(arg0: float) -> None

brille.reciprocal_space_tolerance(*args, **kwargs)

Overloaded function.

  1. reciprocal_space_tolerance() -> float

  2. reciprocal_space_tolerance(arg0: float) -> None

Documented thus far:

The pybind-wrapped objects fully documented (in C++ doc strings) thus far are

Bravais Lattice