|
TRIQS/nda 1.3.0
Multi-dimensional array library for C++
|
#include <nda/sym_grp.hpp>
Class representing a symmetry group.
A symmetry group detects and stores all different symmetry classes associated with a given nda::Array object.
A symmetry class is simply a set of all the elements of the array that are related to each other by some symmetry. The elements in a symmetry class have all the same values except for a possible sign flip or complex conjugation, i.e. an nda::operation. The symmetry classes form a partition of all the elements of the array.
| F | nda::NdaSymmetry type. |
| A | nda::Array type. |
Definition at line 135 of file sym_grp.hpp.
Public Types | |
| using | arr_idx_t = std::array<long, static_cast<std::size_t>(ndims)> |
| Multi-dimensional index type. | |
| using | sym_class_t = std::span<sym_idx_t> |
| Symmetry class type. | |
| using | sym_idx_t = std::pair<long, operation> |
| Element type of a symmetry class. | |
Public Member Functions | |
| sym_grp ()=default | |
| Default constructor for a symmetry group. | |
| sym_grp (A const &a, std::vector< F > const &sym_list, long const max_length=0) | |
| Construct a symmetry group for a given array and a list of its symmetries. | |
| std::vector< get_value_t< A > > | get_representative_data (A const &a) const |
| Reduce an nda::Array to its representative data using symmetries. | |
| std::vector< sym_class_t > const & | get_sym_classes () const |
| Get the symmetry classes. | |
| template<typename H> | |
| void | init (A &a, H const &init_func, bool parallel=false) const |
| Initialize an nda::Array using an nda::NdaInitFunc. | |
| template<typename V> | |
| void | init_from_representative_data (A &a, V const &vec) const |
| Initialize a multi-dimensional array from its representative data using symmetries. | |
| long | num_classes () const |
| Get the number of symmetry classes. | |
| std::pair< double, arr_idx_t > | symmetrize (A &a) const |
| Symmetrize an array and return the maximum symmetry violation and its corresponding array index. | |
Static Public Attributes | |
| static constexpr int | ndims = get_rank<A> |
| Rank of the input array. | |
|
inline |
Construct a symmetry group for a given array and a list of its symmetries.
It uses nda::for_each to loop over all possible multi-dimensional indices of the given array and applies the symmetries to each index to generate the different symmetry classes.
| a | nda::Array object. |
| sym_list | List of symmetries containing nda::NdaSymmetry objects. |
| max_length | Maximum recursion depth for out-of-bounds projection. Default is 0. |
Definition at line 286 of file sym_grp.hpp.
|
inlinenodiscard |
Reduce an nda::Array to its representative data using symmetries.
| a | nda::Array object. |
Definition at line 252 of file sym_grp.hpp.
|
inlinenodiscard |
Get the symmetry classes.
Definition at line 161 of file sym_grp.hpp.
|
inline |
Initialize an nda::Array using an nda::NdaInitFunc.
The nda::NdaInitFunc object is evaluated only once per symmetry class. The result is then assigned to all elements in the symmetry class after applying the nda::operation.
| H | Callable type of nda::NdaInitFunc. |
| a | nda::Array object to be initialized. |
| init_func | Callable that is used to initialize the array. |
| parallel | Parallelize using OpenMP, MPI, or both. |
Definition at line 182 of file sym_grp.hpp.
|
inline |
Initialize a multi-dimensional array from its representative data using symmetries.
| a | nda::Array object to be initialized. |
| vec | std::vector of data values for the representative elements of each symmetry class. |
Definition at line 266 of file sym_grp.hpp.
|
inlinenodiscard |
Get the number of symmetry classes.
Definition at line 167 of file sym_grp.hpp.
|
inline |
Symmetrize an array and return the maximum symmetry violation and its corresponding array index.
| a | nda::Array object to be symmetrized. |
Definition at line 217 of file sym_grp.hpp.