26 #ifndef TILEDARRAY_SYMM_PERMUTATION_GROUP_H__INCLUDED 27 #define TILEDARRAY_SYMM_PERMUTATION_GROUP_H__INCLUDED 124 std::vector<Permutation>::const_iterator
begin()
const {
131 std::vector<Permutation>::const_iterator
cbegin()
const {
138 std::vector<Permutation>::const_iterator
end()
const {
145 std::vector<Permutation>::const_iterator
cend()
const {
155 template <
typename Set>
160 const auto e_domain = e.domain<Set>();
161 result.insert(e_domain.begin(), e_domain.end());
175 std::vector<Permutation>&
elements) {
195 for(
unsigned int g = 1u; g <
elements.size(); ++g) {
199 elements.emplace_back(std::move(e));
236 return std::lexicographical_compare(p1.
cbegin(), p1.
cend(),
283 template <
typename InputIterator,
284 typename std::enable_if< ::TiledArray::detail::is_input_iterator<InputIterator>::value>::type* =
nullptr>
288 for(
auto iter=
begin; iter!=
end; ++iter) {
292 const auto degree = domain_.size();
296 for(
unsigned int i = 0u; i <
degree; ++i) {
298 unsigned int i1 = (i + 1u) %
degree;
313 template <
typename Integer,
314 typename std::enable_if<std::is_integral<Integer>::value>::type* =
nullptr>
324 unsigned int degree()
const {
return domain_.size(); }
327 std::vector<index_type> domain_;
330 static std::vector<index_type> iota_vector(
size_t n) {
331 std::vector<index_type> result(n);
332 std::iota(result.begin(), result.end(), 0);
352 template <
typename MultiIndex>
355 const auto idx_size = idx.size();
356 for(
const auto& p: pg) {
357 for(
size_t i=0; i!=idx_size; ++i) {
359 auto idx_p_i = idx[p[i]];
382 std::vector<PermutationGroup::Permutation> conjugate_generators;
383 const auto h_inv = h.
inv();
385 conjugate_generators.emplace_back(h * generator * h_inv);
396 std::vector<PermutationGroup::Permutation> intersect_elements;
397 std::set_intersection(G1.
begin(), G1.
end(),
399 std::back_inserter(intersect_elements));
409 template <
typename Set>
410 inline PermutationGroup
412 std::vector<PermutationGroup::Permutation> stabilizer_generators;
414 bool fixes_set =
true;
415 for (
const auto& i: f) {
416 if (generator.is_in_domain(i)) {
422 stabilizer_generators.push_back(generator);
432 #endif // TILEDARRAY_SYMM_PERMUTATION_GROUP_H__INCLUDED
TiledArray::symmetry::Permutation Permutation
unsigned int order() const
Group order accessor.
SymmetricGroup(std::initializer_list< Integer > list)
Construct symmetric group using domain as an initializer list.
static void init(std::vector< Permutation > &generators, std::vector< Permutation > &elements)
PermutationGroup conjugate(const PermutationGroup &G, const PermutationGroup::Permutation &h)
Computes conjugate permutation group obtained by the action of a permutation.
PermutationGroup intersect(const PermutationGroup &G1, const PermutationGroup &G2)
Permutation::index_type index_type
Permutation inv() const
Construct the inverse of this permutation.
bool is_lexicographically_smallest(const MultiIndex &idx, const PermutationGroup &pg)
static Permutation identity()
Idenity element accessor.
std::vector< Permutation >::const_iterator begin() const
forward iterator over the group elements pointing to the first element
const std::vector< Permutation > & elements() const
Elements vector accessor.
std::vector< Permutation > generators_
Group generators.
std::vector< Permutation >::const_iterator end() const
forward iterator over the group elements pointing past the last element
PermutationGroup & operator=(const PermutationGroup &)=default
SymmetricGroup(unsigned int degree)
PermutationGroup(std::vector< Permutation > generators)
General constructor.
bool operator!=(const Permutation &p1, const Permutation &p2)
Permutation inequality operator.
std::vector< Permutation > elements_
Group elements.
std::ostream & operator<<(std::ostream &output, const Permutation &p)
Add permutation to an output stream.
SymmetricGroup & operator=(const SymmetricGroup &)=default
PermutationGroup stabilizer(const PermutationGroup &G, const Set &f)
Computes the largest subgroup of a permutation group that leaves the given set of indices fixed...
bool operator==(const Permutation &p1, const Permutation &p2)
Permutation equality operator.
std::vector< Permutation >::const_iterator cend() const
forward iterator over the group elements pointing past the last element
unsigned int degree() const
Degree accessor.
SymmetricGroup(InputIterator begin, InputIterator end)
const Permutation & operator[](unsigned int i) const
Group element accessor.
std::vector< Permutation >::const_iterator cbegin() const
forward iterator over the group elements pointing to the first element
bool operator<(const Permutation &p1, const Permutation &p2)
Permutation less-than operator.
const std::vector< Permutation > & generators() const
Generators vector accessor.
Permutation of a sequence of objects indexed by base-0 indices.
std::map< index_type, index_type > Map
Set domain() const
Computes the domain of this group.