TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
triqs::gfs::brzone

#include <triqs/mesh/brzone.hpp>

Detailed Description

Brillouin zone mesh type.

A Brillouin zone (BZ) mesh is defined by an underlying Brillouin zone and the number of mesh points in the primitive reciprocal unit cell along each of the three dimensions, \( N_1 \), \( N_2 \) and \( N_3 \). The periodic boundary conditions (PBC) in real space (see cyclic-lattice mesh) translate in reciprocal space to \( f(\mathbf{k}) = f(\mathbf{k} + \mathbf{G}^{\mathbf{m}}) \), where \( \mathbf{G}^{\mathbf{m}} = \sum_{i=1}^3 \mathbf{b}_i m_i = \mathbf{B} \mathbf{m} \) is a reciprocal lattice vector, \( \mathbf{b}_i \) is a reciprocal lattice basis vector in direction \( i \) and \( \mathbf{m} = (m_1, m_2, m_3) \) with \( m_i \in \mathbb{Z} \).

It has the following properties:

  • Each mesh point is identified by
    • a unique index in the first BZ \( \mathbf{n} = (n_1, n_2, n_3) \), where \( 0 \leq n_i < N_i \), and
    • an infinite set of indices due to the periodic boundary conditions, i.e. \( \{ \tilde{\mathbf{n}} = \mathbf{n} + \mathbf{N} \mathbf{m} : \mathbf{N} \mathbf{m} = (N_1 m_1, N_2 m_2, N_3 m_3) \in \mathbb{Z}^3 \} \).
  • The size of the mesh is \( N = N_1 \, N_2 \, N_3 \), i.e. the total number of mesh points in the BZ.
  • An index \( \mathbf{n} \) is mapped to the corresponding data index \( d \) by the function \( d(\mathbf{n}) = n_3 + N_3 (n_2 + N_2 n_1) = n_3 + n_2 N_3 + n_1 N_2 N_3 \). The inverse map is \( \mathbf{n}(d) = (\lfloor d / s_1 \rfloor, \lfloor (d \mod s_1) / s_2 \rfloor, (d \mod s_1) \mod s_2 ) \), where \( s_1 = N_2 N_3 \) and \( s_2 = N_3 \).
  • An index \( \mathbf{n} \) is mapped to the corresponding value ( \( \mathbf{k} \)-vector) \( \mathbf{k}(\mathbf{n}) \equiv \mathbf{k}^{\mathbf{n}} = \sum_{i=1}^3 \mathbf{b}_i n_i / N_i = \tilde{\mathbf{B}} \mathbf{n} \), where \( \mathbf{b}_i \) is the reciprocal lattice basis vector in direction \( i \). The inverse map is then \( \mathbf{n}(\mathbf{k}^{\mathbf{n}}) = \tilde{\mathbf{B}}^{-1} \mathbf{k}^{\mathbf{n}} = \mathbf{n} \).

Green's function containers that are based on a BZ mesh store the function values at the discrete \( \mathbf{k} \)-points \( \mathbf{k}^{\mathbf{n}} \), i.e. \( f_{\mathbf{n}} = f(\mathbf{k}^{\mathbf{n}}) \). Because of the PBC, the container only has to store values for indices with \( 0 \leq n_i < N_i \). To evaluate the function

  • at an arbitrary \( \mathbf{k} \)-vector, \( \mathbf{k} \) is first mapped to the BZ using PBC and then trilinear interpolation is performed.
  • at one of the \( \mathbf{k}^{\mathbf{n}} \), it is first mapped to the BZ using PBC and then the corresponding function value is returned.

Definition at line 104 of file brzone.hpp.

Classes

class  mesh_point_t
 Mesh point of a triqs::mesh::brzone mesh. More...

Public Types

using data_index_t = long
 Data index type.
using index_t = std::array<long, 3>
 Index type.
using value_t = brillouin_zone::value_t
 Value type.

Public Member Functions

 brzone ()=default
 Default constructor constructs an empty mesh.
 brzone (brillouin_zone const &bz, long n_k)
 Construct a Brillouin zone mesh with the same number of mesh points in each direction.
 brzone (brillouin_zone const &bz, nda::matrix< long > const &M)
 Construct a Brillouin zone mesh with the given periodization matrix.
 brzone (brillouin_zone const &bz, std::array< long, 3 > const &dims)
 Construct a Brillouin zone mesh with the given number of mesh points.
auto begin () const
 Get an iterator to the beginning of the mesh.
auto const & bz () const noexcept
 Get the underlying Brillouin zone.
auto cbegin () const
 Get a const iterator to the beginning of the mesh.
auto cend () const
 Get a const iterator to the end of the mesh.
template<typename V>
requires (is_k_expr<V> or std::ranges::contiguous_range<V> or nda::ArrayOfRank<V, 1>)
index_t closest_index (V const &k) const
 Map a given \( \mathbf{k} \)-vector or expression to the closest \( \mathbf{k}^{\mathbf{n}} \) in the first BZ and return its index \( \mathbf{n} \).
void deserialize (auto &ar)
 Deserialize the mesh from a generic archive.
auto const & dims () const
 Get the number of mesh points in each of the three dimensions.
auto end () const
 Get an iterator to the end of the mesh.
index_t index_modulo (index_t const &n_tilde) const
 Map an arbitrary index \( \tilde{\mathbf{n}} \) to the unique index \( \mathbf{n} \) in the first BZ.
bool is_index_valid (index_t const &n) const noexcept
 Check if an index \( \mathbf{n} \) is valid, i.e. corresponds to a \( \mathbf{k}^\mathbf{n} \) in the first BZ.
uint64_t mesh_hash () const
 Get the hash value of the mesh.
mesh_point_t operator() (index_t const &n) const
 Function call operator to access a mesh point by its index \( \mathbf{n} \).
bool operator== (brzone const &m) const
 Equal-to comparison operator compares the underlying Brillouin zone and the number of k-points in each of the three dimensions.
mesh_point_t operator[] (closest_mesh_point_t< value_t > const &cmp) const
 Subscript operator to access a mesh point by a \( \mathbf{k} \)-point \( \mathbf{k}^{\mathbf{n}} \) contained in a triqs::mesh::closest_mesh_point_t.
mesh_point_t operator[] (long d) const
 Subscript operator to access a mesh point by its data index \( d \in \{0, 1, \ldots, N-1\} \).
void serialize (auto &ar) const
 Serialize the mesh to a generic archive.
long size () const
 Get the size \( N \) of the mesh, i.e. the total number of mesh points in the first BZ.
template<typename V>
data_index_t to_data_index (closest_mesh_point_t< V > const &cmp) const
 Map a \( \mathbf{k} \)-vector \( \mathbf{k}^{\mathbf{n}} \) to its data index \(d(\mathbf{k}^{\mathbf{n}}) \).
data_index_t to_data_index (index_t const &n) const
 Map an index \( \mathbf{n} \) to its corresponding data index \( d(\mathbf{n}) \).
template<char OP, typename L, typename R>
data_index_t to_data_index (k_expr< OP, L, R > const &ex) const
 Map a binary \( \mathbf{k} \)-expression to a data index \( d \).
template<char OP, typename L>
data_index_t to_data_index (k_expr_unary< OP, L > const &ex) const
 Map an unary \( \mathbf{k} \)-expression to a data index \( d \).
template<typename V>
index_t to_index (closest_mesh_point_t< V > const &cmp) const
 Map a given \( \mathbf{k} \)-vector or expression to the closest \( \mathbf{k}^{\mathbf{n}} \) in the first BZ and return its index \( \mathbf{n} \).
index_t to_index (data_index_t d) const
 Map a data index \( d \in \{0, 1, \ldots, N-1\} \) to the corresponding index \( \mathbf{n}(d) \).
value_t to_value (index_t const &n) const
 Map an index \( \mathbf{n} \) to its corresponding \( \mathbf{k} \)-point \( \mathbf{k}^{\mathbf{n}} \).
auto units () const
 Get the matrix \( \tilde{\mathbf{B}}^T \) containing the scaled reciprocal basis vectors in its rows.
auto units_inv () const
 Get the matrix \( \left( \tilde{\mathbf{B}}^T \right)^{-1} \).

Static Public Member Functions

static std::string hdf5_format ()
 Get the HDF5 format tag.

Friends

void h5_read (h5::group g, std::string const &name, brzone &m)
 Read a triqs::mesh::brzone mesh from HDF5.
void h5_write (h5::group g, std::string const &name, brzone const &m)
 Write a triqs::mesh::brzone mesh to HDF5.
std::ostream & operator<< (std::ostream &sout, brzone const &m)
 Write a triqs::mesh::brzone mesh to a std::ostream.

Constructor & Destructor Documentation

◆ brzone() [1/3]

triqs::mesh::brzone::brzone ( brillouin_zone const & bz,
std::array< long, 3 > const & dims )
inline

Construct a Brillouin zone mesh with the given number of mesh points.

Parameters
bzBrillouin zone object representing the underlying BZ.
dimsNumber of mesh points along each of the three dimensions, i.e. \( (N_1, N_2, N_3) \).

Definition at line 211 of file brzone.hpp.

◆ brzone() [2/3]

triqs::mesh::brzone::brzone ( brillouin_zone const & bz,
nda::matrix< long > const & M )
inline

Construct a Brillouin zone mesh with the given periodization matrix.

Note
At the moment, only diagonal periodization matrices are supported. They should contain the number of mesh points along each of the three dimensions on the diagonal.
Parameters
bzBrillouin zone object representing the underlying Bravais lattice.
M\( 3 \times 3 \) periodization matrix.

Definition at line 232 of file brzone.hpp.

◆ brzone() [3/3]

triqs::mesh::brzone::brzone ( brillouin_zone const & bz,
long n_k )
inline

Construct a Brillouin zone mesh with the same number of mesh points in each direction.

Parameters
bzBrillouin zone object representing the underlying Bravais lattice.
n_kNumber of mesh points along each of the three dimensions.

Definition at line 243 of file brzone.hpp.

Member Function Documentation

◆ closest_index()

template<typename V>
requires (is_k_expr<V> or std::ranges::contiguous_range<V> or nda::ArrayOfRank<V, 1>)
index_t triqs::mesh::brzone::closest_index ( V const & k) const
inlinenodiscard

Map a given \( \mathbf{k} \)-vector or expression to the closest \( \mathbf{k}^{\mathbf{n}} \) in the first BZ and return its index \( \mathbf{n} \).

Template Parameters
V\( \mathbf{k} \)-vector or expression type.
Parameters
k\( \mathbf{k} \)-vector or expression to map.
Returns
Index \( \mathbf{n} \) of the closest \( \mathbf{k}^{\mathbf{n}} \) in the first BZ.

Definition at line 412 of file brzone.hpp.

◆ deserialize()

void triqs::mesh::brzone::deserialize ( auto & ar)
inline

Deserialize the mesh from a generic archive.

Parameters
arArchive to deserialize from.

Definition at line 489 of file brzone.hpp.

◆ index_modulo()

index_t triqs::mesh::brzone::index_modulo ( index_t const & n_tilde) const
inlinenodiscard

Map an arbitrary index \( \tilde{\mathbf{n}} \) to the unique index \( \mathbf{n} \) in the first BZ.

Parameters
n_tildeIndex \( \tilde{\mathbf{n}} \) to map back to the first BZ.
Returns
Corresponding index \( \mathbf{n} \) in the first BZ such that \( \tilde{\mathbf{n}} = \mathbf{n} + \mathbf{N} \mathbf{m} \).

Definition at line 398 of file brzone.hpp.

◆ is_index_valid()

bool triqs::mesh::brzone::is_index_valid ( index_t const & n) const
inlinenodiscardnoexcept

Check if an index \( \mathbf{n} \) is valid, i.e. corresponds to a \( \mathbf{k}^\mathbf{n} \) in the first BZ.

Parameters
nIndex \( \mathbf{n} \) to check.
Returns
True if \( 0 \leq n_i < N_i \; \forall i \), false otherwise.

Definition at line 252 of file brzone.hpp.

◆ operator()()

mesh_point_t triqs::mesh::brzone::operator() ( index_t const & n) const
inlinenodiscard

Function call operator to access a mesh point by its index \( \mathbf{n} \).

Parameters
nIndex \( \mathbf{n} \) of the mesh point.
Returns
mesh_point_t with the index \( \mathbf{n} \), data index \( d(\mathbf{n}) = d(\mathbf{n}) = n_3 + N_3 (n_2 + N_2 n_1) \) and a pointer to the current mesh.

Definition at line 359 of file brzone.hpp.

◆ operator[]() [1/2]

mesh_point_t triqs::mesh::brzone::operator[] ( closest_mesh_point_t< value_t > const & cmp) const
inlinenodiscard

Subscript operator to access a mesh point by a \( \mathbf{k} \)-point \( \mathbf{k}^{\mathbf{n}} \) contained in a triqs::mesh::closest_mesh_point_t.

Parameters
cmptriqs::mesh::closest_mesh_point_t containing the \( \mathbf{k} \)-point.
Returns
mesh_point_t with the index \( \mathbf{n} \), data index \( d(\mathbf{n}) = d(\mathbf{n}) = n_3 + N_3 (n_2 + N_2 n_1) \) and a pointer to the current mesh.

Definition at line 350 of file brzone.hpp.

◆ operator[]() [2/2]

mesh_point_t triqs::mesh::brzone::operator[] ( long d) const
inlinenodiscard

Subscript operator to access a mesh point by its data index \( d \in \{0, 1, \ldots, N-1\} \).

Parameters
dData index \( d \) of the mesh point.
Returns
mesh_point_t with the index \( \mathbf{n}(d) = (\lfloor d / s_1 \rfloor, \lfloor (d \mod s_1) / s_2 \rfloor, (d \mod s_1) \mod s_2 ) \), data index \( d \) and a pointer to the current mesh.

Definition at line 340 of file brzone.hpp.

◆ serialize()

void triqs::mesh::brzone::serialize ( auto & ar) const
inline

Serialize the mesh to a generic archive.

Parameters
arArchive to serialize to.

Definition at line 483 of file brzone.hpp.

◆ to_data_index() [1/4]

template<typename V>
data_index_t triqs::mesh::brzone::to_data_index ( closest_mesh_point_t< V > const & cmp) const
inlinenodiscard

Map a \( \mathbf{k} \)-vector \( \mathbf{k}^{\mathbf{n}} \) to its data index \(d(\mathbf{k}^{\mathbf{n}}) \).

Template Parameters
V\( \mathbf{k} \)-vector or expression type.
Parameters
cmptriqs::mesh::closest_mesh_point_t containing \( \mathbf{k}^{\mathbf{n}} \).
Returns
Data index \( d(\mathbf{k}^{\mathbf{n}}) = n_3 + N_3 (n_2 + N_2 n_1) \).

Definition at line 277 of file brzone.hpp.

◆ to_data_index() [2/4]

data_index_t triqs::mesh::brzone::to_data_index ( index_t const & n) const
inlinenodiscard

Map an index \( \mathbf{n} \) to its corresponding data index \( d(\mathbf{n}) \).

Parameters
nIndex \( \mathbf{n} \) to map.
Returns
Data index \( d(\mathbf{n}) = n_3 + N_3 (n_2 + N_2 n_1) \).

Definition at line 264 of file brzone.hpp.

◆ to_data_index() [3/4]

template<char OP, typename L, typename R>
data_index_t triqs::mesh::brzone::to_data_index ( k_expr< OP, L, R > const & ex) const
inlinenodiscard

Map a binary \( \mathbf{k} \)-expression to a data index \( d \).

Template Parameters
OPOperator tag.
LLeft operand type.
RRight operand type.
Parameters
extriqs::mesh::k_expr object.
Returns
Data index corresponding to the \( \mathbf{k} \)-point after evaluating the expression and mapping it back to the first BZ.

Definition at line 305 of file brzone.hpp.

◆ to_data_index() [4/4]

template<char OP, typename L>
data_index_t triqs::mesh::brzone::to_data_index ( k_expr_unary< OP, L > const & ex) const
inlinenodiscard

Map an unary \( \mathbf{k} \)-expression to a data index \( d \).

Template Parameters
OPOperator tag.
LOperand type.
Parameters
extriqs::mesh::k_expr_unary object.
Returns
Data index corresponding to the \( \mathbf{k} \)-point after evaluating the expression and mapping it back to the first BZ.

Definition at line 290 of file brzone.hpp.

◆ to_index() [1/2]

template<typename V>
index_t triqs::mesh::brzone::to_index ( closest_mesh_point_t< V > const & cmp) const
inlinenodiscard

Map a given \( \mathbf{k} \)-vector or expression to the closest \( \mathbf{k}^{\mathbf{n}} \) in the first BZ and return its index \( \mathbf{n} \).

Template Parameters
V\( \mathbf{k} \)-vector or expression type.
Parameters
cmptriqs::mesh::closest_mesh_point_t containing the \( \mathbf{k} \)-vector or expression.
Returns
Index \( \mathbf{n} \).

Definition at line 331 of file brzone.hpp.

◆ to_index() [2/2]

Map a data index \( d \in \{0, 1, \ldots, N-1\} \) to the corresponding index \( \mathbf{n}(d) \).

Parameters
dData index \( d \) to map.
Returns
Index \( \mathbf{n}(d) = (\lfloor d / s_1 \rfloor, \lfloor (d \mod s_1) / s_2 \rfloor, (d \mod s_1) \mod s_2 ) \).

Definition at line 317 of file brzone.hpp.

◆ to_value()

value_t triqs::mesh::brzone::to_value ( index_t const & n) const
inlinenodiscard

Map an index \( \mathbf{n} \) to its corresponding \( \mathbf{k} \)-point \( \mathbf{k}^{\mathbf{n}} \).

Parameters
nIndex \( \mathbf{n} \) to map.
Returns
\( \mathbf{k} \)-point \( \mathbf{k}^{\mathbf{n}} \).

Definition at line 368 of file brzone.hpp.

◆ h5_read

void h5_read ( h5::group g,
std::string const & name,
brzone & m )
friend

Read a triqs::mesh::brzone mesh from HDF5.

Parameters
gh5::group to be read from.
nameName of the subgroup.
mMesh object to be read into.

Definition at line 515 of file brzone.hpp.

◆ h5_write

void h5_write ( h5::group g,
std::string const & name,
brzone const & m )
friend

Write a triqs::mesh::brzone mesh to HDF5.

Parameters
gh5::group to be written to.
nameName of the subgroup.
mMesh object to be written.

Definition at line 501 of file brzone.hpp.

◆ operator<<

std::ostream & operator<< ( std::ostream & sout,
brzone const & m )
friend

Write a triqs::mesh::brzone mesh to a std::ostream.

Parameters
soutstd::ostream object.
mMesh to be written.
Returns
Reference to std::ostream object.

Definition at line 475 of file brzone.hpp.


The documentation for this class was generated from the following file: