TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
superlattice.hpp
1#pragma once
2
3#include "./fourier_polynomial.hpp"
5
6#include <nda/nda.hpp>
7
8#include <optional>
9
10namespace triqs::experimental::lattice {
11
16
17 // --------------------------------------------------
27 nda::matrix<long> units; // Unit vector of the superlattice units[a, _] = unit vector a
28 nda::array<long, 2> cluster_points; // Cluster: set of points in original lattice coordinate
29 // NB : in d = 2, we don't use the third component.
30 nda::matrix<double> transfo_SL_L; // Transformation matrix SL -> L: = inverse(transpose(units))
31 long _dim = units.extent(0); // Dimension of the superlattice
32
33 public:
42 superlattice(nda::array<long, 2> sl_units, nda::array<long, 2> cluster_pts);
43
50 C2PY_IGNORE auto const &get_sl_units() const { return units; }
51
57 C2PY_IGNORE auto const &get_cluster_pts() const { return cluster_points; }
58
64 long dim() const { return _dim; }
65
71 long n_cluster_sites() const { return cluster_points.extent(0); }
72
80 C2PY_IGNORE std::optional<nda::vector<long>> L_to_SL(nda::vector<long> const &r_l, double epsilon = 1.e-12) const;
81 };
82
83 // --------------------------------------------------
84
93 template <int kdim> fourier_polynomial<2, kdim> fold(superlattice const &sl, fourier_polynomial<2, kdim> const &fp);
94
96
97} // namespace triqs::experimental::lattice
auto const & get_cluster_pts() const
Get the cluster points of the superlattice.
auto const & get_sl_units() const
Get the unit vectors of the superlattice.
std::optional< nda::vector< long > > L_to_SL(nda::vector< long > const &r_l, double epsilon=1.e-12) const
Transform a point from lattice coordinates to superlattice coordinates.
long dim() const
Get the dimension of the superlattice.
long n_cluster_sites() const
Get the number of cluster sites in one superlattice unit cell.
superlattice(nda::array< long, 2 > sl_units, nda::array< long, 2 > cluster_pts)
Construct a superlattice from its unit vectors and cluster points.
fourier_polynomial< 2, kdim > fold(superlattice const &sl, fourier_polynomial< 2, kdim > const &fp)
Fold a Fourier polynomial defined on a lattice onto a superlattice.
Common macros used in TRIQS.