CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
SymOpRepresentation.hh
Go to the documentation of this file.
1 #ifndef SYMOPREPRESENTATION_HH
2 #define SYMOPREPRESENTATION_HH
3 
4 #include <iostream>
5 #include <cmath>
6 
10 
11 namespace CASM {
12  class MasterSymGroup;
13  class Permutation;
14  class UnitCellCoord;
15  class SymBasisPermute;
16 
22  class SymOpRepresentation {
24  public:
26 
27  SymOpRepresentation(const MasterSymGroup &_master_group, SymGroupRepID _rep_ID, Index _op_index) :
28  SymOpRepresentation(&_master_group, _rep_ID, _op_index) {}
29 
32  virtual ~SymOpRepresentation() {} // = 0;
33 
35  virtual SymOpRepresentation *copy() const = 0;
36 
38  virtual double character() const {
39  return NAN;
40  }
41 
42  virtual Permutation const *get_permutation() const {
43  return nullptr;
44  }
45 
46  virtual Eigen::MatrixXd const *get_MatrixXd() const {
47  return nullptr;
48  }
49 
50  virtual SymBasisPermute const *get_ucc_permutation() const {
51  return nullptr;
52  }
53 
54 
56  Eigen::MatrixXd const *get_matrix_rep(SymGroupRepID _rep_ID) const;
57 
59  Permutation const *get_permutation_rep(SymGroupRepID _rep_ID) const;
60 
63 
66 
68  void set_rep(SymGroupRepID _rep_ID, const SymOpRepresentation &op_rep) const;
69 
71  void set_identifiers(const MasterSymGroup &new_group, SymGroupRepID new_rep_ID);
72 
74  void set_identifiers(const MasterSymGroup &new_group, SymGroupRepID new_rep_ID, Index new_op_index);
75 
77  const MasterSymGroup &master_group() const {
78  assert(m_master_group);
79  return *m_master_group;
80  }
81 
83  bool has_valid_master() const {
84  return m_master_group != nullptr;
85  }
86 
88  m_op_index = -1;
89  }
90 
92  Index index()const {
93  return m_op_index;
94  }
95 
98  return m_rep_ID;
99  }
100 
102  Index ind_inverse()const;
103 
106  Index ind_prod(const SymOpRepresentation &RHS)const;
107 
108  virtual jsonParser &to_json(jsonParser &json) const = 0;
109  virtual void from_json(const jsonParser &json) = 0;
110 
111  protected:
113  SymOpRepresentation(MasterSymGroup const *_master_group_ptr, SymGroupRepID _rep_ID, Index _op_index) :
114  m_master_group(_master_group_ptr), m_rep_ID(_rep_ID), m_op_index(_op_index) {}
115 
118 
121 
124  };
125 
127 
129 
130  bool operator()(const SymOpRepresentation &A, const SymOpRepresentation &B) const {
131  return A.index() < B.index();
132  }
133  };
134 
135  jsonParser &to_json(const SymOpRepresentation *rep, jsonParser &json);
137  void from_json(SymOpRepresentation *rep, const jsonParser &json);
138 
141 }
142 #endif
Eigen::MatrixXd MatrixXd
virtual SymOpRepresentation * copy() const =0
Make copy of Derived object through Base-class interface.
void set_rep(SymGroupRepID _rep_ID, const SymOpRepresentation &op_rep) const
set representation for SymOp corresponding to _rep_ID
virtual Eigen::MatrixXd const * get_MatrixXd() const
void from_json(ClexDescription &desc, const jsonParser &json)
Type-safe ID object for communicating and accessing Symmetry representation info. ...
bool has_valid_master() const
check if this representation is registered with a MasterSymGroup
jsonParser & to_json(const ClexDescription &desc, jsonParser &json)
MasterSymGroup const * m_master_group
Pointer to the MasterSymGroup where prototype of this SymOp lives.
SymBasisPermute describes how a symmetry operation permutes atoms in a basis.
Index index() const
Index of this operation within the master_group.
SymBasisPermute const * get_basis_permute_rep(SymGroupRepID _rep_ID) const
get pointer to BasisPermute representation corresponding to _rep_ID
Main CASM namespace.
Definition: complete.cpp:8
SymGroupRepID m_rep_ID
ID of this representation within the master_group. Default is uninitialized.
Index m_op_index
Index into MasterSymGroup that specifies the operation.
void set_identifiers(const MasterSymGroup &new_group, SymGroupRepID new_rep_ID)
Change m_master_group and determine op_index.
Permutation const * get_permutation_rep(SymGroupRepID _rep_ID) const
get pointer to permutation representation corresponding to _rep_ID
virtual double character() const
Calculates character of the representation (if well-defined)
virtual SymBasisPermute const * get_ucc_permutation() const
Eigen::MatrixXd const * get_matrix_rep(SymGroupRepID _rep_ID) const
get pointer to matrix representation corresponding to rep_ID
virtual Permutation const * get_permutation() const
virtual jsonParser & to_json(jsonParser &json) const =0
EigenIndex Index
For long integer indexing:
const MasterSymGroup & master_group() const
const access of head group
Index ind_inverse() const
Get the operation index of the inverse of this operation, using the master_group's multiplication tab...
SymOpRepresentation is the base class for anything describes a symmetry operation.
SymGroupRepID rep_ID() const
ID of representation that this operation belongs to within the master_group.
bool operator()(const SymOpRepresentation &A, const SymOpRepresentation &B) const
Index ind_prod(const SymOpRepresentation &RHS) const
Array< Eigen::MatrixXd const * > get_matrix_reps(Array< SymGroupRepID > _rep_IDs) const
get array of pointers to matrix representations for representations corresponding to _rep_IDs ...
SymOpRepresentation(MasterSymGroup const *_master_group_ptr, SymGroupRepID _rep_ID, Index _op_index)
Protected constructor to allow internal construction of masterless symops.
SymOpRepresentation(const MasterSymGroup &_master_group, SymGroupRepID _rep_ID, Index _op_index)
Basic std::vector like container (deprecated)
virtual void from_json(const jsonParser &json)=0