CASM  1.1.0
A Clusters Approach to Statistical Mechanics
SymOpRepresentation.cc
Go to the documentation of this file.
2 
3 #include <memory>
4 
8 
9 namespace CASM {
10 //*******************************************************************************************
11 
12 std::unique_ptr<SymOpRepresentation> SymOpRepresentation::inverse() const {
15  res->m_rep_ID = m_rep_ID;
16  if (has_valid_master()) res->m_op_index = ind_inverse();
17  return std::unique_ptr<SymOpRepresentation>(res);
18 }
19 
20 //*******************************************************************************************
22  SymGroupRepID _rep_ID) const {
23  assert(has_valid_master() && !_rep_ID.empty());
24  return *(master_group().representation(_rep_ID)[index()]);
25 }
26 
27 //*******************************************************************************************
29  SymGroupRepID _rep_ID) const {
30  assert(has_valid_master() && !_rep_ID.empty());
31  return (master_group().representation(_rep_ID)[index()])->MatrixXd();
32 }
33 
34 //*******************************************************************************************
35 
37  SymGroupRepID _rep_ID) const {
38  assert(has_valid_master() && !_rep_ID.empty());
39  return (master_group().representation(_rep_ID)[index()])->ucc_permutation();
40 }
41 //*******************************************************************************************
42 
44  SymGroupRepID _rep_ID) const {
45  assert(has_valid_master() && !_rep_ID.empty());
46  return (master_group().representation(_rep_ID)[index()])->permutation();
47 }
48 
49 //*******************************************************************************************
50 
52  Array<SymGroupRepID> _rep_IDs) const {
54  for (Index i = 0; i < _rep_IDs.size(); i++) {
55  tmat.push_back(get_matrix_rep(_rep_IDs[i]));
56  }
57  return tmat;
58 }
59 
60 //**********************************************************
62  const SymOpRepresentation &op_rep) const {
63  assert(has_valid_master() && !_rep_ID.empty());
64  return master_group().set_rep(_rep_ID, op_rep, index());
65 }
66 
67 //*******************************************************************************************
68 
70  SymGroupRepID new_rep_ID) {
71  m_master_group = &new_group;
72  m_rep_ID = new_rep_ID;
73  SymGroupRep const &trep(new_group.representation(m_rep_ID));
74  Index i;
75  for (i = 0; i < trep.size(); i++) {
76  if (this == trep[i]) {
77  m_op_index = i;
78  break;
79  }
80  }
81 
82  if (i == new_group.size()) m_op_index = -1;
83 
84  return;
85 }
86 
87 //*******************************************************************************************
88 
90  SymGroupRepID new_rep_ID,
91  Index new_op_index) {
92  m_master_group = &new_group;
93  m_rep_ID = new_rep_ID;
94  m_op_index = new_op_index;
95 
96  return;
97 }
98 
99 //*******************************************************************************************
100 
102  assert(
103  has_valid_master() &&
104  "In SymOpRepresentation::ind_inverse(), head_group is uninitialized!!");
105  return master_group().ind_inverse(index());
106 }
107 
108 //*******************************************************************************************
109 
111  assert(has_valid_master() &&
112  "In SymOpRepresentation::ind_prod(), head_group is uninitialized!!");
113  return master_group().ind_prod(index(), RHS.index());
114 }
115 
116 //*******************************************************************************************
117 
118 } // namespace CASM
Basic std::vector like container (deprecated)
Definition: Array.hh:45
Index size() const
Definition: Array.hh:131
void set_rep(SymGroupRepID _rep_ID, SymOpRepresentation const &_op_rep, Index op_index) const
Definition: SymGroup.cc:479
SymGroupRep const & representation(SymGroupRepID i) const
Const access of alternate Representations of a SymGroup.
Definition: SymGroup.cc:717
SymBasisPermute describes how a symmetry operation permutes atoms in a basis.
Index ind_inverse(Index i) const
Get index of operation that is inverse of operation at(i)
Definition: SymGroup.cc:1540
Index ind_prod(Index i, Index j) const
Get index of operation that is result of multiplication of at(i)*at(j)
Definition: SymGroup.cc:1550
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.
bool empty() const
Returns true if SymGroupRepID has not been initialized with valid group_index or rep_index.
SymOpRepresentation is the base class for anything describes a symmetry operation.
virtual SymOpRepresentation * inverse_impl() const
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
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
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.
Permutation const * get_permutation_rep(SymGroupRepID _rep_ID) const
get pointer to permutation representation corresponding to _rep_ID
std::unique_ptr< SymOpRepresentation > inverse() const
void push_back(const T &toPush)
Definition: Array.hh:431
Main CASM namespace.
Definition: APICommand.hh:8
Eigen::MatrixXd MatrixXd
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39