CASM  1.1.0
A Clusters Approach to Statistical Mechanics
SymOpRepresentation.hh
Go to the documentation of this file.
1 #ifndef SYMOPREPRESENTATION_HH
2 #define SYMOPREPRESENTATION_HH
3 
4 #include <cmath>
5 #include <iostream>
6 #include <memory>
7 
10 #include "casm/global/eigen.hh"
12 
13 namespace CASM {
14 namespace xtal {
15 class UnitCellCoord;
16 }
17 class MasterSymGroup;
18 class Permutation;
19 class SymBasisPermute;
20 
29  public:
32  }
33 
34  SymOpRepresentation(const MasterSymGroup &_master_group,
35  SymGroupRepID _rep_ID, Index _op_index)
36  : SymOpRepresentation(&_master_group, _rep_ID, _op_index) {}
37 
41  virtual ~SymOpRepresentation() {} // = 0;
42 
44  virtual SymOpRepresentation *copy() const = 0;
45 
47  virtual double character() const { return NAN; }
48 
49  virtual Permutation const *permutation() const { return nullptr; }
50 
51  virtual Eigen::MatrixXd const *MatrixXd() const { return nullptr; }
52 
53  virtual SymBasisPermute const *ucc_permutation() const { return nullptr; }
54 
55  std::unique_ptr<SymOpRepresentation> inverse() const;
56 
57  SymOpRepresentation const &representation(SymGroupRepID _rep_ID) const;
58 
60  Eigen::MatrixXd const *get_matrix_rep(SymGroupRepID _rep_ID) const;
61 
63  Permutation const *get_permutation_rep(SymGroupRepID _rep_ID) const;
64 
67 
71  Array<SymGroupRepID> _rep_IDs) const;
72 
74  void set_rep(SymGroupRepID _rep_ID, const SymOpRepresentation &op_rep) const;
75 
77  void set_identifiers(const MasterSymGroup &new_group,
78  SymGroupRepID new_rep_ID);
79 
81  void set_identifiers(const MasterSymGroup &new_group,
82  SymGroupRepID new_rep_ID, Index new_op_index);
83 
85  const MasterSymGroup &master_group() const {
86  assert(m_master_group);
87  return *m_master_group;
88  }
89 
91  bool has_valid_master() const { return m_master_group != nullptr; }
92 
93  void invalidate_index() { m_op_index = -1; }
94 
97  Index index() const { return m_op_index; }
98 
100  Index master_group_index() const { return m_op_index; }
101 
104  SymGroupRepID rep_ID() const { return m_rep_ID; }
105 
108  Index ind_inverse() const;
109 
112  Index ind_prod(const SymOpRepresentation &RHS) const;
113 
114  protected:
116  SymOpRepresentation(MasterSymGroup const *_master_group_ptr,
117  SymGroupRepID _rep_ID, Index _op_index)
118  : m_master_group(_master_group_ptr),
119  m_rep_ID(_rep_ID),
120  m_op_index(_op_index) {
122  }
123 
125  throw std::runtime_error(
126  "Attempting to use unimplemented SymOpRepresentation::inverse_impl()");
127  return nullptr;
128  }
129 
130  virtual void _set_integral_tau() { return; }
131 
134 
138 
141 };
142 
145 
147  const SymOpRepresentation &B) const {
148  return A.index() < B.index();
149  }
150 };
151 
154 } // namespace CASM
155 #endif
Basic std::vector like container (deprecated)
Definition: Array.hh:45
SymBasisPermute describes how a symmetry operation permutes atoms in a basis.
Type-safe ID object for communicating and accessing Symmetry representation info.
SymOpRepresentation is the base class for anything describes a symmetry operation.
SymOpRepresentation(const MasterSymGroup &_master_group, SymGroupRepID _rep_ID, Index _op_index)
virtual SymOpRepresentation * inverse_impl() const
SymOpRepresentation(MasterSymGroup const *_master_group_ptr, SymGroupRepID _rep_ID, Index _op_index)
Protected constructor to allow internal construction of masterless symops.
SymBasisPermute const * get_basis_permute_rep(SymGroupRepID _rep_ID) const
get pointer to BasisPermute representation corresponding to _rep_ID
Array< Eigen::MatrixXd const * > get_matrix_reps(Array< SymGroupRepID > _rep_IDs) const
MasterSymGroup const * m_master_group
Pointer to the MasterSymGroup where prototype of this SymOp lives.
SymOpRepresentation const & representation(SymGroupRepID _rep_ID) const
const MasterSymGroup & master_group() const
const access of head group
Index ind_prod(const SymOpRepresentation &RHS) const
virtual SymOpRepresentation * copy() const =0
Make copy of Derived object through Base-class interface.
SymGroupRepID rep_ID() const
virtual Permutation const * permutation() const
void set_identifiers(const MasterSymGroup &new_group, SymGroupRepID new_rep_ID)
Change m_master_group and determine op_index.
void set_rep(SymGroupRepID _rep_ID, const SymOpRepresentation &op_rep) const
set representation for SymOp corresponding to _rep_ID
Eigen::MatrixXd const * get_matrix_rep(SymGroupRepID _rep_ID) const
get pointer to matrix representation corresponding to rep_ID
virtual SymBasisPermute const * ucc_permutation() const
bool has_valid_master() const
check if this representation is registered with a MasterSymGroup
Index m_op_index
Index into MasterSymGroup that specifies the operation.
Index master_group_index() const
Index of this operation within the master_group.
Permutation const * get_permutation_rep(SymGroupRepID _rep_ID) const
get pointer to permutation representation corresponding to _rep_ID
virtual Eigen::MatrixXd const * MatrixXd() const
virtual double character() const
Calculates character of the representation (if well-defined)
std::unique_ptr< SymOpRepresentation > inverse() const
Main CASM namespace.
Definition: APICommand.hh:8
Eigen::MatrixXd MatrixXd
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39
bool operator()(const SymOpRepresentation &A, const SymOpRepresentation &B) const