30 const std::array<std::size_t, 2>
pair;
38 std::size_t _operation,
57 double _symprec = 1e-5);
60 return this->translations.size();
64 return this->sg_number;
68 return this->sg_symbol;
78 return this->equivalences;
93 bool cartesian =
false) const
94 -> Eigen::Matrix<typename T::Scalar, Eigen::Dynamic, Eigen::Dynamic> {
95 if (index >= this->translations.size())
99 return this->crotations[index] * vector +
100 this->ctranslations[index];
102 return this->rotations[index] * vector + this->translations[index];
114 template <
typename T>
117 bool cartesian =
false) const
118 -> Eigen::Matrix<typename T::Scalar, Eigen::Dynamic, Eigen::Dynamic> {
119 if (index >= this->translations.size())
123 return this->crotations[index] * vector;
125 return this->rotations[index] * vector;
137 template <
typename T>
139 const Eigen::Ref<
const Eigen::Matrix<T, 3, 3>>& matrix,
141 bool cartesian =
false)
const {
142 if (index >= this->translations.size())
146 return this->crotations[index] * matrix *
147 this->crotations[index].transpose();
149 return this->rotations[index] * matrix *
150 this->rotations[index].transpose();
162 template <
typename T>
164 const Eigen::Ref<
const Eigen::Matrix<T, 3, 3>>& matrix,
166 bool cartesian =
false)
const {
167 if (index >= this->translations.size())
171 return this->crotations[index].transpose() * matrix *
172 this->crotations[index];
174 return this->rotations[index].transpose() * matrix *
175 this->rotations[index];
185 std::size_t
map_atom(std::size_t original, std::size_t index)
const {
186 if (original >= this->symmetry_map.size())
189 if (index >= this->translations.size())
191 return this->symmetry_map[original][index];
201 return this->determinants[index] < 0.;
211 template <
typename T>
212 auto rotate_q(
const Eigen::MatrixBase<T>& vector, std::size_t index)
const 213 -> Eigen::Matrix<typename T::Scalar, Eigen::Dynamic, Eigen::Dynamic> {
214 if (index >= this->translations.size())
216 return this->qrotations[index] * vector;
225 template <
typename T>
227 const Eigen::Ref<
const Eigen::Matrix<T, 3, 3>>& matrix,
228 bool cartesian =
false)
const {
229 Eigen::Matrix<T, 3, 3> nruter;
231 const std::vector<Eigen::MatrixXd>* rots;
233 rots = &this->crotations;
236 rots = &this->rotations;
238 for (
const auto& r : *rots) {
239 nruter += r.transpose() * matrix * r;
241 nruter /= rots->size();
250 std::vector<std::vector<Transformed_pair>> get_pair_classes()
const;
254 std::vector<Eigen::VectorXd> translations;
256 std::vector<Eigen::VectorXd> ctranslations;
258 std::vector<Eigen::MatrixXd> rotations;
260 std::vector<Eigen::MatrixXd> crotations;
262 std::vector<Eigen::MatrixXd> qrotations;
264 std::vector<double> determinants;
267 std::vector<Eigen::MatrixXd> displacements;
271 std::string sg_symbol;
276 std::vector<int> equivalences;
278 std::vector<std::vector<std::size_t>> symmetry_map;
int get_spacegroup_number() const
Definition: symmetry.hpp:63
Definition: analytic1d.hpp:26
auto rotate_v(const Eigen::MatrixBase< T > &vector, std::size_t index, bool cartesian=false) const -> Eigen::Matrix< typename T::Scalar, Eigen::Dynamic, Eigen::Dynamic >
Rotate (but do not translate) a vector according to one of the symmetry operations.
Definition: symmetry.hpp:115
std::size_t map_atom(std::size_t original, std::size_t index) const
Get the atom index that an atom is mapped to through a symmetry operation.
Definition: symmetry.hpp:185
std::string get_wyckoff() const
Definition: symmetry.hpp:73
Exception related to the parameters passed to a function.
Definition: exceptions.hpp:33
Eigen::Matrix< T, 3, 3 > symmetrize_m(const Eigen::Ref< const Eigen::Matrix< T, 3, 3 >> &matrix, bool cartesian=false) const
Symmetrize a 3x3 matrix using all the operations in the group.
Definition: symmetry.hpp:226
Eigen::Matrix< T, 3, 3 > rotate_m(const Eigen::Ref< const Eigen::Matrix< T, 3, 3 >> &matrix, std::size_t index, bool cartesian=false) const
Rotate a 3 x 3 matrix according to one of the symmetry operations.
Definition: symmetry.hpp:138
std::size_t get_nsym() const
Definition: symmetry.hpp:59
bool is_inversion(std::size_t index) const
Find out if a symmetry operation involves an inversion.
Definition: symmetry.hpp:200
Definitions of the basic data-handling classes in ALMA.
Objects of this class hold a subset of the information provided by spg_get_dataset().
Definition: symmetry.hpp:47
const double symprec
Tolerance for the symmetry search.
Definition: symmetry.hpp:50
auto transform_v(const Eigen::MatrixBase< T > &vector, std::size_t index, bool cartesian=false) const -> Eigen::Matrix< typename T::Scalar, Eigen::Dynamic, Eigen::Dynamic >
Transform a vector according to one of the symmetry operations.
Definition: symmetry.hpp:91
Hold information about a crystal structure.
Definition: structures.hpp:51
std::vector< int > get_equivalences() const
Definition: symmetry.hpp:77
Eigen::Matrix< T, 3, 3 > unrotate_m(const Eigen::Ref< const Eigen::Matrix< T, 3, 3 >> &matrix, std::size_t index, bool cartesian=false) const
Rotate a 3 x 3 matrix according to the inverse of one of the symmetry operations. ...
Definition: symmetry.hpp:163
auto rotate_q(const Eigen::MatrixBase< T > &vector, std::size_t index) const -> Eigen::Matrix< typename T::Scalar, Eigen::Dynamic, Eigen::Dynamic >
Rotate a vector expressed in direct reciprocal coordinates according to one of the symmetry operation...
Definition: symmetry.hpp:212
std::string get_spacegroup_symbol() const
Definition: symmetry.hpp:67