TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
triqs::lattice::bravais_lattice

#include <triqs/lattice/bravais_lattice.hpp>

Detailed Description

A Bravais lattice class.

A Bravais lattice in \( d \) dimensions is defined by

  • a set of linear independent d-dimensional basis vectors \( \{ \mathbf{a}_1, \dots, \mathbf{a}_d \} \) and
  • the positions, \( \{ \mathbf{r}_1, \dots, \mathbf{r}_m \} \), of atomic orbitals within each unit cell.

Optionally, the atomic orbitals can be named.

The infinite lattice points \( \mathbf{R}^{\mathbf{n}} \) (see bravais_lattice::point_t) are generated by

\[ \mathbf{R}^{\mathbf{n}} = \sum_{i=1}^{d} \mathbf{a}_i n_i = \mathbf{A} \mathbf{n} \; , \]

where \( \mathbf{n} = (n_1, \dots, n_d) \in \mathbb{Z}^d \) is an index vector (or more formally the vector \(\mathbf{R}^{\mathbf{n}} \) in the lattice basis) and \( \mathbf{A} = \big( \mathbf{a}_1 \cdots \mathbf{a}_d \big) \) is the matrix with the basis vectors as its columns.

Note
Although the supported dimensions are 1, 2 and 3, the index vectors are always 3-dimensional, i.e. \(\mathbf{n} = (n_1, n_2, n_3) \). Indices \( n_j \) with \( j > d \) are simply ignored when computing the corresponding lattice vector.

Definition at line 75 of file bravais_lattice.hpp.

Classes

class  point_t
 Lattice point of a Bravais lattice. More...

Public Types

using index_t = std::array<long, 3>
 Index type for lattice points on the Bravais lattice.

Public Member Functions

 bravais_lattice ()
 Construct a simple cubic lattice with lattice constant \( a = 1 \).
 bravais_lattice (matrix_t const &units, std::vector< r_t > orbital_positions=std::vector< r_t >{{0, 0, 0}}, std::vector< std::string > atom_orb_name={})
 Construct a Bravais Lattice with given basis vectors and positions of atomic orbitals with optional names.
bool contains (r_t const &) const
 Check if a given vector \( \mathbf{r} \) is part of the domain.
void deserialize (auto &ar)
 Deserialize the Bravais lattice from a generic archive.
template<typename R>
r_t lattice_to_real_coordinates (R const &v) const
 Transform a vector \( \mathbf{v} \) from the lattice basis \( \{ \mathbf{a}_1, \dots, \mathbf{a}_d \} \) to the standard basis \( \{ \mathbf{e}_1, \dots, \mathbf{e}_d \} \).
long n_orbitals () const
 Get the number of atomic orbitals in the unit cell.
int ndim () const
 Get the number of dimensions of the Bravais lattice.
bool operator== (bravais_lattice const &bl) const
 Equal-to comparison operator.
auto const & orbital_names () const
 Get the list of orbital names.
auto const & orbital_positions () const
 Get the list of atomic orbital positions \( \{\mathbf{r}_1, \dots, \mathbf{r}_m\} \).
template<typename R>
r_t real_to_lattice_coordinates (R const &v_tilde) const
 Transform a vector \( \tilde{\mathbf{v}} \) from the standard basis \( \{ \mathbf{e}_1, \dots, \mathbf{e}_d \} \) to the lattice basis \( \{ \mathbf{a}_1, \dots, \mathbf{a}_d \} \).
void serialize (auto &ar) const
 Serialize the Bravais lattice to a generic archive.
point_t to_point (index_t const &n) const
 Convert an index vector to a lattice point.
matrix_t const & units () const
 Get the matrix \( \mathbf{A}^T \) containing basis vectors as its rows.

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, bravais_lattice &bl)
 Read a triqs::lattice::bravais_lattice from HDF5.
void h5_write (h5::group g, std::string const &name, bravais_lattice const &bl)
 Write a triqs::lattice::bravais_lattice to HDF5.
std::ostream & operator<< (std::ostream &sout, bravais_lattice const &bl)
 Write a triqs::lattice::bravais_lattice to a std::ostream.

Constructor & Destructor Documentation

◆ bravais_lattice() [1/2]

triqs::lattice::bravais_lattice::bravais_lattice ( )
inline

Construct a simple cubic lattice with lattice constant \( a = 1 \).

The only atomic orbital is placed at the origin with no name.

Definition at line 193 of file bravais_lattice.hpp.

◆ bravais_lattice() [2/2]

triqs::lattice::bravais_lattice::bravais_lattice ( matrix_t const & units,
std::vector< r_t > orbital_positions = std::vector<r_t>{{0, 0, 0}},
std::vector< std::string > atom_orb_name = {} )

Construct a Bravais Lattice with given basis vectors and positions of atomic orbitals with optional names.

The matrix \( \mathbf{A}^T \) containing the basis vectors as its rows is required to be square. The number of dimensions of the Bravais lattices is determined by the size of the matrix.

Parameters
unitsMatrix with the basis vectors \( \{ \mathbf{a}_1, \dots, \mathbf{a}_d \} \) as its rows.
orbital_positionsAtomic orbital positions \( \{ \mathbf{r}_1, \dots, \mathbf{r}_m \} \) in the unit cell.
atom_orb_nameOptional names for the atomic orbitals.

Definition at line 38 of file bravais_lattice.cpp.

Member Function Documentation

◆ deserialize()

void triqs::lattice::bravais_lattice::deserialize ( auto & ar)
inline

Deserialize the Bravais lattice from a generic archive.

Parameters
arArchive to deserialize from.

Definition at line 300 of file bravais_lattice.hpp.

◆ lattice_to_real_coordinates()

template<typename R>
r_t triqs::lattice::bravais_lattice::lattice_to_real_coordinates ( R const & v) const
inlinenodiscard

Transform a vector \( \mathbf{v} \) from the lattice basis \( \{ \mathbf{a}_1, \dots, \mathbf{a}_d \} \) to the standard basis \( \{ \mathbf{e}_1, \dots, \mathbf{e}_d \} \).

The transformed vector is given by

\[ \tilde{\mathbf{v}} = \sum_{i=1}^{d} \mathbf{a}_i v_i = A \mathbf{v} \; , \]

where \( A \) is the matrix with the lattice basis vectors as its columns.

Parameters
vVector \( \mathbf{v} \) to be transformed.
Returns
Vector \( \tilde{\mathbf{v}} \) in the standard basis.

Definition at line 239 of file bravais_lattice.hpp.

◆ operator==()

bool triqs::lattice::bravais_lattice::operator== ( bravais_lattice const & bl) const
inline

Equal-to comparison operator.

Returns
True, if the number of dimensions, unit cell basis vectors and the atomic orbital positions and names are equal.

Definition at line 270 of file bravais_lattice.hpp.

◆ real_to_lattice_coordinates()

template<typename R>
r_t triqs::lattice::bravais_lattice::real_to_lattice_coordinates ( R const & v_tilde) const
inlinenodiscard

Transform a vector \( \tilde{\mathbf{v}} \) from the standard basis \( \{ \mathbf{e}_1, \dots, \mathbf{e}_d \} \) to the lattice basis \( \{ \mathbf{a}_1, \dots, \mathbf{a}_d \} \).

This is the inverse transformation of lattice_to_real_coordinates(). The transformed vector is therefore given by \( \mathbf{v} = A^{-1} \tilde{\mathbf{v}} \).

Parameters
v_tildeVector \( \tilde{\mathbf{v}} \) in the standard basis.
Returns
Vector \( \mathbf{v} \) in the lattice basis.

Definition at line 253 of file bravais_lattice.hpp.

◆ serialize()

void triqs::lattice::bravais_lattice::serialize ( auto & ar) const
inline

Serialize the Bravais lattice to a generic archive.

Parameters
arArchive to serialize to.

Definition at line 294 of file bravais_lattice.hpp.

◆ to_point()

point_t triqs::lattice::bravais_lattice::to_point ( index_t const & n) const
inlinenodiscard

Convert an index vector to a lattice point.

Parameters
nIndex vector \( \mathbf{n} \).
Returns
bravais_lattice::point_t corresponding to the given index array.

Definition at line 263 of file bravais_lattice.hpp.

◆ h5_read

void h5_read ( h5::group g,
std::string const & name,
bravais_lattice & bl )
friend

Read a triqs::lattice::bravais_lattice from HDF5.

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

Definition at line 74 of file bravais_lattice.cpp.

◆ h5_write

void h5_write ( h5::group g,
std::string const & name,
bravais_lattice const & bl )
friend

Write a triqs::lattice::bravais_lattice to HDF5.

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

Definition at line 65 of file bravais_lattice.cpp.

◆ operator<<

std::ostream & operator<< ( std::ostream & sout,
bravais_lattice const & bl )
friend

Write a triqs::lattice::bravais_lattice to a std::ostream.

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

Definition at line 281 of file bravais_lattice.hpp.


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