CASM  1.1.0
A Clusters Approach to Statistical Mechanics
SymRepTools.hh
Go to the documentation of this file.
1 #ifndef CASM_SymRepTools
2 #define CASM_SymRepTools
3 
4 #include <set>
5 
7 #include "casm/external/Eigen/Core"
9 
10 namespace CASM {
11 class SymGroupRep;
12 class SymGroupRepID;
13 class SymGroup;
14 
15 namespace SymRepTools {
16 
20 using Symmetrizer =
21  std::pair<Eigen::MatrixXcd, multivector<Eigen::VectorXcd>::X<2>>;
22 
25 using SymmetrizerFunction = std::function<Symmetrizer(
26  Eigen::Ref<const Eigen::MatrixXcd> const &f_subspace)>;
27 
28 struct IrrepInfo {
32  template <typename Derived>
33  static IrrepInfo make_dummy(Eigen::MatrixBase<Derived> const &_trans_mat) {
34  Eigen::VectorXcd tchar(1);
35  tchar[0] = std::complex<double>(double(_trans_mat.rows()), 0.);
36  return IrrepInfo(_trans_mat.template cast<std::complex<double>>(), tchar);
37  }
38 
41  IrrepInfo(Eigen::MatrixXcd _trans_mat, Eigen::VectorXcd _characters);
42 
44  Index irrep_dim() const { return trans_mat.rows(); }
45 
46  // Dimension of initial vector space (greater than or equal to irrep_dim())
47  Index vector_dim() const { return trans_mat.cols(); }
48 
50  bool complex;
51 
56 
60 
63  Eigen::MatrixXcd trans_mat;
64 
67  Eigen::VectorXcd characters;
68 
73  std::vector<std::vector<Eigen::VectorXd>> directions;
74 };
75 
77 struct IrrepWedge {
78  IrrepWedge(IrrepInfo _irrep_info, Eigen::MatrixXd _axes)
79  : irrep_info(std::move(_irrep_info)), axes(std::move(_axes)) {}
80 
83 
88 
90  std::vector<Index> mult;
91 
101  static IrrepWedge make_dummy(const Eigen::MatrixXd &axes);
102 };
103 
108 class SubWedge {
109  public:
110  SubWedge(std::vector<IrrepWedge> const &_iwedges)
112 
114  std::vector<IrrepWedge> const &irrep_wedges() const { return m_iwedges; }
115 
118  Eigen::MatrixXd const &trans_mat() const { return m_trans_mat; }
119 
129  static SubWedge make_dummy(Eigen::MatrixXd const &axes);
130 
131  private:
132  std::vector<IrrepWedge> m_iwedges;
134 
136  std::vector<IrrepWedge> const &_iwedges);
137 };
138 
143 std::vector<IrrepWedge> irrep_wedges(
144  SymGroup const &head_group, SymGroupRepID id,
145  Eigen::Ref<const Eigen::MatrixXd> const &_subspace);
146 
151 std::vector<IrrepWedge> irrep_wedges(
152  SymGroupRep const &_rep, SymGroup const &head_group,
153  Eigen::Ref<const Eigen::MatrixXd> const &_subspace);
154 
157 std::vector<SubWedge> symrep_subwedges(SymGroup const &_group,
158  SymGroupRepID id);
159 
164 std::vector<SubWedge> symrep_subwedges(
165  SymGroup const &_group, SymGroupRepID id,
166  Eigen::Ref<const Eigen::MatrixXd> const &_subspace);
167 
170 std::vector<SubWedge> symrep_subwedges(SymGroupRep const &_rep,
171  SymGroup const &head_group);
172 
177 std::vector<SubWedge> symrep_subwedges(
178  SymGroupRep const &_rep, SymGroup const &head_group,
179  Eigen::Ref<const Eigen::MatrixXd> const &_subspace);
180 
181 } // namespace SymRepTools
182 
188  std::vector<Eigen::MatrixXd> symgroup_rep;
189 
192  std::vector<SymRepTools::IrrepInfo> irreps;
193 
196  std::vector<SymRepTools::SubWedge> irreducible_wedge;
197 
201 
204  std::vector<std::string> axis_glossary;
205 };
206 
216  SymGroupRep const &_rep, SymGroup const &head_group,
217  Eigen::Ref<const Eigen::MatrixXd> const &_subspace,
218  bool calc_wedges = false);
219 
232  SymGroupRep const &_rep, SymGroup const &head_group,
233  double vec_compare_tol);
234 
251  SymGroupRep const &_rep, SymGroup const &head_group,
252  Eigen::Ref<const Eigen::MatrixXcd> const &_subspace, double vec_compare_tol,
253  bool all_subgroups = false);
254 
266  const SymGroup &head_group,
267  double vec_compare_tol);
268 
282  SymGroupRep const &_rep, const SymGroup &head_group,
283  Eigen::Ref<const Eigen::MatrixXcd> const &_subspace,
284  double vec_compare_tol);
285 
289 Index num_blocks(SymGroupRep const &_rep, const SymGroup &head_group);
290 
294  std::vector<SymRepTools::IrrepInfo> const &irreps);
295 
306  SymGroupRep const &_rep, const SymGroup &head_group);
307 
318 std::vector<std::vector<Eigen::MatrixXd>> special_subspaces(
319  SymGroupRep const &_rep, const SymGroup &head_group);
320 
323 std::vector<SymGroupRepID> irrep_IDs(SymGroupRep const &_rep,
324  const SymGroup &head_group);
325 
328 bool is_irrep(SymGroupRep const &_rep, const SymGroup &head_group);
329 
340  const SymGroup &head_group);
341 
354 std::pair<Eigen::MatrixXd, std::vector<Eigen::VectorXcd>>
356  SymGroupRep const &_rep, const SymGroup &head_group,
357  SymRepTools::SymmetrizerFunction symmetrizer_func);
358 
370 std::vector<SymRepTools::IrrepInfo> irrep_decomposition(
371  SymGroupRep const &_rep, SymGroup const &head_group, bool allow_complex);
372 
384 std::vector<SymRepTools::IrrepInfo> irrep_decomposition(
385  SymGroupRep const &_rep, SymGroup const &head_group,
386  Eigen::Ref<const Eigen::MatrixXd> const &_subspace, bool allow_complex);
387 
399 std::vector<SymRepTools::IrrepInfo> irrep_decomposition(
400  SymGroupRep const &_rep, SymGroup const &head_group,
401  SymRepTools::SymmetrizerFunction const &symmetrizer_func,
402  bool allow_complex);
403 
415 std::vector<SymRepTools::IrrepInfo> irrep_decomposition(
416  SymGroupRep const &_rep, SymGroup const &head_group,
417  SymRepTools::SymmetrizerFunction const &symmetrizer_func,
418  Eigen::MatrixXd subspace, bool allow_complex);
419 
420 //----- Operations involving representations without consideration of
421 //'head_group' ----
422 
429  const std::vector<std::set<Index>> &subsets);
430 
436  const SymGroupRep &permute_rep,
437  const std::vector<SymGroupRep const *> &sum_reps);
438 
441 SymGroupRep kron_rep(const SymGroupRep &LHS, const SymGroupRep &RHS);
442 
443 } // namespace CASM
444 #endif
SymGroup is a collection of symmetry operations that satisfy the group property The symmetry operatio...
Definition: SymGroup.hh:42
SymGroupRep is an alternative representation of a SymGroup for something other than real space....
Definition: SymGroupRep.hh:31
Type-safe ID object for communicating and accessing Symmetry representation info.
SubWedge is a vector of IrrepWedge, one from each irreducible subspace Together, the IrrepWedges that...
Definition: SymRepTools.hh:108
static Eigen::MatrixXd _subwedge_to_trans_mat(std::vector< IrrepWedge > const &_iwedges)
std::vector< IrrepWedge > m_iwedges
Definition: SymRepTools.hh:132
static SubWedge make_dummy(Eigen::MatrixXd const &axes)
SubWedge(std::vector< IrrepWedge > const &_iwedges)
Definition: SymRepTools.hh:110
Eigen::MatrixXd m_trans_mat
Definition: SymRepTools.hh:133
std::vector< IrrepWedge > const & irrep_wedges() const
IrrepWedges comprising the Subwedge.
Definition: SymRepTools.hh:114
Eigen::MatrixXd const & trans_mat() const
Definition: SymRepTools.hh:118
std::pair< Eigen::MatrixXcd, multivector< Eigen::VectorXcd >::X< 2 > > Symmetrizer
Definition: SymRepTools.hh:21
std::vector< IrrepWedge > irrep_wedges(SymGroup const &head_group, SymGroupRepID id, Eigen::Ref< const Eigen::MatrixXd > const &_subspace)
std::function< Symmetrizer(Eigen::Ref< const Eigen::MatrixXcd > const &f_subspace)> SymmetrizerFunction
Definition: SymRepTools.hh:26
std::vector< SubWedge > symrep_subwedges(SymGroup const &_group, SymGroupRepID id)
Main CASM namespace.
Definition: APICommand.hh:8
SymGroupRep permuted_direct_sum_rep(const SymGroupRep &permute_rep, const std::vector< SymGroupRep const * > &sum_reps)
VectorSpaceSymReport vector_space_sym_report(DoFSpace const &dof_space, SupercellSymInfo const &sym_info, std::vector< PermuteIterator > const &group, bool calc_wedges=false)
Make VectorSpaceSymReport.
Definition: DoFSpace.cc:560
Eigen::MatrixXd MatrixXd
bool is_irrep(SymGroupRep const &_rep, const SymGroup &head_group)
Returns true if _rep is irreducible wrt head_group (does not use character table information)
Definition: SymRepTools.cc:708
Eigen::MatrixXd full_trans_mat(std::vector< SymRepTools::IrrepInfo > const &irreps)
Assumes that irreps are real, and concatenates their individual trans_mats to form larger trans_mat.
Definition: SymRepTools.cc:447
SymRepTools::Symmetrizer irrep_symmetrizer(SymGroupRep const &_rep, const SymGroup &head_group, double vec_compare_tol)
Definition: SymRepTools.cc:420
std::vector< SymRepTools::IrrepInfo > irrep_decomposition(SymGroupRep const &_rep, SymGroup const &head_group, bool allow_complex)
Finds irreducible subspaces that comprise an underlying subspace It does not rely on the character ta...
Definition: SymRepTools.cc:761
SymGroupRep subset_permutation_rep(const SymGroupRep &permute_rep, const std::vector< std::set< Index >> &subsets)
std::vector< std::vector< Eigen::MatrixXd > > special_subspaces(SymGroupRep const &_rep, const SymGroup &head_group)
finds high-symmetry subspaces within vector space supporting _rep, wrt symmetry of head_group High-sy...
Definition: SymRepTools.cc:610
SymGroupRep kron_rep(const SymGroupRep &LHS, const SymGroupRep &RHS)
multivector< Eigen::VectorXd >::X< 3 > special_total_directions(SymGroupRep const &_rep, const SymGroup &head_group)
finds high-symmetry directions within vector space supporting _rep, wrt symmetry of head_group
Definition: SymRepTools.cc:467
std::vector< SymGroupRepID > irrep_IDs(SymGroupRep const &_rep, const SymGroup &head_group)
Find irrep decomposition of _rep wrt group head_group and returns it as a list of SymGroupRepIDs corr...
Eigen::MatrixXd irrep_trans_mat(SymGroupRep const &_rep, const SymGroup &head_group)
Finds the transformation matrix that block-diagonalizes this representation of head_group into irrep ...
multivector< Eigen::VectorXcd >::X< 2 > special_irrep_directions(SymGroupRep const &_rep, SymGroup const &head_group, double vec_compare_tol)
Assuming that _rep is an irrep of head_group, find high-symmetry directions throws if _rep is not an ...
Definition: SymRepTools.cc:488
std::pair< Eigen::MatrixXd, std::vector< Eigen::VectorXcd > > irrep_trans_mat_and_characters(SymGroupRep const &_rep, const SymGroup &head_group, SymRepTools::SymmetrizerFunction symmetrizer_func)
Finds the transformation matrix that block-diagonalizes this representation of head_group into irrep ...
Index num_blocks(SymGroupRep const &_rep, const SymGroup &head_group)
counts number of nonzero blocks in matrix representation of head_group as specified by _rep Reveals n...
Definition: SymRepTools.cc:402
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39
Definition: stream_io.hh:24
Eigen::VectorXcd characters
Definition: SymRepTools.hh:67
IrrepInfo(Eigen::MatrixXcd _trans_mat, Eigen::VectorXcd _characters)
Construct an IrrepInfo with transformation matrix and vector of irreducible characters.
Definition: SymRepTools.cc:391
std::vector< std::vector< Eigen::VectorXd > > directions
Definition: SymRepTools.hh:73
bool complex
true if any character has non-zero imaginary component, false otherwise
Definition: SymRepTools.hh:50
Eigen::MatrixXcd trans_mat
Definition: SymRepTools.hh:63
static IrrepInfo make_dummy(Eigen::MatrixBase< Derived > const &_trans_mat)
Named constructor to initialize an IrrepInfo with a user-specified transformtion matrix and character...
Definition: SymRepTools.hh:33
Index irrep_dim() const
Dimension of irreducible vector space (less than or equal to vector_dim())
Definition: SymRepTools.hh:44
An irreducible wedge in an irreducible vector space.
Definition: SymRepTools.hh:77
IrrepInfo irrep_info
The description of the associated irreducible vector space.
Definition: SymRepTools.hh:82
static IrrepWedge make_dummy(const Eigen::MatrixXd &axes)
IrrepWedge(IrrepInfo _irrep_info, Eigen::MatrixXd _axes)
Definition: SymRepTools.hh:78
std::vector< Index > mult
Symmetric multiplicity of each column of 'axes'.
Definition: SymRepTools.hh:90
Summary of data associated with the action of a symmetry group on a vector space.
Definition: SymRepTools.hh:185
std::vector< Eigen::MatrixXd > symgroup_rep
Matrix representation for each operation in the group – defines action of group on vector space.
Definition: SymRepTools.hh:188
std::vector< std::string > axis_glossary
Names given to individual axes in initial (un-adapted) vector space, corresponding to rows of symmetr...
Definition: SymRepTools.hh:204
Eigen::MatrixXd symmetry_adapted_dof_subspace
Symmetry-oriented subspace of the vector space (columns are the basis vectors)
Definition: SymRepTools.hh:200
std::vector< SymRepTools::SubWedge > irreducible_wedge
Irreducible wedge in the vector space encoded as a vector of symmetrically distinct SubWedges.
Definition: SymRepTools.hh:196
std::vector< SymRepTools::IrrepInfo > irreps
A list of all irreducible representation that make up the full representation.
Definition: SymRepTools.hh:192
typename multivector_impl::multivector_tmp< T, N >::type X
Definition: multivector.hh:28