template<int coeff_dim, int kdim>
class triqs::experimental::lattice::fourier_polynomial< coeff_dim, kdim >
Owning container for a Fourier-series representation of a lattice function.
A fourier_polynomial stores a list of real-space lattice vectors \( \mathbf{R} \) together with their Fourier coefficients and represents the function
\[ f(\mathbf{k}) = \sum_\mathbf{R} f(\mathbf{R}) \, e^{2 \pi i \, \mathbf{k} \cdot \mathbf{R}} \; .
\]
It provides a placeholder-aware call operator for CLEF lazy evaluation as well as batched BLAS evaluation at a list of k-points, HDF5 serialization and MPI broadcast.
- Template Parameters
-
| coeff_dim | Rank of the Fourier coefficient at each \( \mathbf{R} \) (e.g. 0 for scalar-, 2 for matrix-valued targets). |
| kdim | Dimension of the k-vectors (1, 2 or 3). |
Definition at line 188 of file fourier_polynomial.hpp.
|
|
| fourier_polynomial ()=default |
| | Default constructor: construct an empty Fourier polynomial.
|
|
| fourier_polynomial (fourier_polynomial &&) noexcept=default |
| | Move constructor.
|
|
| fourier_polynomial (fourier_polynomial const &)=default |
| | Copy constructor.
|
| | fourier_polynomial (std::vector< std::array< long, kdim > > R_list_, nda::array< dcomplex, coeff_dim+1 > coeff_arr_) |
| | Construct from a list of R-vectors and a packed coefficient array.
|
| | fourier_polynomial (std::vector< std::array< long, kdim > > R_list_, std::vector< nda::array< dcomplex, coeff_dim > > const &coeff_list_) |
| | Construct from a list of R-vectors and a matching list of coefficient arrays.
|
| auto | get_coeff_arr () |
| | Get the packed coefficient array.
|
| auto | get_coeff_arr () const |
| | Get the packed coefficient array (const overload).
|
| long | get_R_idx (std::array< long, kdim > R) const |
| | Get the storage index of a given R-vector.
|
| auto const & | get_R_list () const |
| | Get the list of real-space lattice vectors.
|
| auto const & | get_R_mat () const |
| | Get the packed matrix of lattice vectors.
|
| long | n_R () const |
| | Get the number of R-vectors.
|
| nda::array< dcomplex, coeff_dim+1 > | operator() (nda::array_const_view< double, 2 > k_list) const |
| | Evaluate the Fourier polynomial at a batch of k-points given as a matrix.
|
| auto | operator() (std::array< double, kdim > ks) const |
| | Evaluate the Fourier polynomial at a single k-point.
|
| nda::array< dcomplex, coeff_dim+1 > | operator() (std::ranges::contiguous_range auto const &k_iterator) const |
| | Evaluate the Fourier polynomial at a contiguous range of k-points.
|
template<typename... T>
requires ((std::is_same_v<T, double> or nda::clef::is_lazy<T>) and ...) |
| auto | operator() (T... ks) const |
| | Evaluate the Fourier polynomial, optionally as a lazy CLEF expression.
|
|
fourier_polynomial & | operator= (fourier_polynomial &&) noexcept=default |
| | Move assignment operator.
|
|
fourier_polynomial & | operator= (fourier_polynomial const &)=default |
| | Copy assignment operator.
|
| auto | operator[] (long i) |
| | Access the coefficient at a given storage index.
|
| auto | operator[] (long i) const |
| | Access the coefficient at a given storage index (const overload).
|
| auto | operator[] (std::array< long, kdim > R) |
| | Access the coefficient associated with a given R-vector.
|
| auto | operator[] (std::array< long, kdim > R) const |
| | Access the coefficient associated with a given R-vector (const overload).
|
template<int coeff_dim, int kdim>
template<typename... T>
requires ((std::is_same_v<T, double> or nda::clef::is_lazy<T>) and ...)
Evaluate the Fourier polynomial, optionally as a lazy CLEF expression.
The behavior depends on how many of the arguments are CLEF placeholders (or lazy expressions):
- With no placeholder, the function is evaluated directly by computing the exponentials.
- With exactly one placeholder and kdim > 1, a partially evaluated Fourier polynomial of dimension 1 is built and returned as a lazy CLEF call expression.
- In all other cases (more than one placeholder, or a single placeholder with kdim == 1), a lazy CLEF call expression is returned.
- Template Parameters
-
| T | Argument types, each either double or a CLEF placeholder / lazy expression. |
- Parameters
-
| ks | The kdim arguments at which to evaluate, mixing doubles and placeholders. |
- Returns
- The evaluated value if no placeholder is present, otherwise a lazy CLEF call expression.
Definition at line 388 of file fourier_polynomial.hpp.
template<int coeff_dim, int kdim>
| void mpi_broadcast |
( |
fourier_polynomial< coeff_dim, kdim > & | x, |
|
|
mpi::communicator | c = {}, |
|
|
int | root = 0 ) |
|
friend |
Broadcast a Fourier polynomial over an MPI communicator.
The list of R-vectors and the coefficient array are broadcast, and the packed R-matrix is recomputed locally on each rank.
- Parameters
-
| x | Fourier polynomial to broadcast (overwritten on non-root ranks). |
| c | MPI communicator. |
| root | Rank of the broadcasting process. |
Definition at line 260 of file fourier_polynomial.hpp.