atlas  0.6
ext_block.h
Go to the documentation of this file.
1 /*
2  This is ext_block.h
3 
4  Copyright (C) 2013-2016 Marc van Leeuwen
5  part of the Atlas of Lie Groups and Representations
6 
7  For license information see the LICENSE file
8 */
9 
10 // Class definition and function declarations for class |ext_block|.
11 
12 #ifndef EXT_BLOCK_H /* guard against multiple inclusions */
13 #define EXT_BLOCK_H
14 
15 #include "../Atlas.h"
16 
17 #include <cassert>
18 #include <iostream>
19 #include <set>
20 
21 #include "blocks.h" // for the structure |ext_gen|
22 
23 namespace atlas {
24 
25 namespace ext_block {
26 
27 
28 // type defintions
29 
30 // for correspondence of enumerations and conventional codes, see |descent_code|
31 enum DescValue // every even/odd pair is one of associated ascent and descent
32 {
35  one_imaginary_single, // type 1, single Cayley image
36  one_real_pair_fixed, // type 1, twist-fixed inverse Cayley images
37  one_imaginary_pair_fixed, // type 2, twist-fixed Cayley images
38  one_real_single, // type 2, single inverse Cayley image
39  one_imaginary_pair_switched, // type 2, twist-switched Cayley images
40  one_real_pair_switched, // type 1, twist-switched inverse Cayley images
43 
44  two_complex_ascent, // distinct commuting complex ascents
45  two_complex_descent, // distinct commuting complex descents
46  two_semi_imaginary, // identical complex ascents
47  two_semi_real, // identical complex descents
48  two_imaginary_single_single, // commuting single-valued Cayleys
49  two_real_double_double, // commuting double-valued inverse Cayleys (2-valued)
50  two_imaginary_single_double, // single-valued Cayleys become double-valued
51  two_real_single_double, // single-valued inverse Cayleys become double-valued
52  two_imaginary_double_double, // commuting double-valued Cayleys (2-valued)
53  two_real_single_single, // commuting single-valued inverse Cayleys
56 
57  three_complex_ascent, // distinct non-commuting complex ascents
58  three_complex_descent, // distinct non-commuting complex descents
59  three_semi_imaginary, // non-commuting complex ascents become imaginary
60  three_real_semi, // non-commuting single-valued inverse Cayleys get complex
61  three_imaginary_semi, // non-commuting single-valued Cayleys become complex
62  three_semi_real, // non-commuting complex descents become real
65 }; // |enum DescValue|
66 
67 // function declarations
68 
69 const char* descent_code(DescValue v); // defined in |block_io|
70 inline bool is_descent(DescValue v) { return v%2!=0; }
71 bool is_complex(DescValue v);
78 bool has_defect(DescValue v);
79 bool has_quadruple(DescValue v); // 2i12/2r21 cases
80 
82 
84 
85 DescValue extended_type(const Block_base& block, BlockElt z, ext_gen p,
86  BlockElt& first_link);
87 
88 typedef Polynomial<int> Pol;
89 
91 {
92  struct elt_info // per block element information
93  {
94  BlockElt z; // index into parent |Block_base| structure
95  unsigned short length; // length for extended group
96  elt_info(BlockElt zz): z(zz),length(~0) {}
97 
98  // methods that will allow building a hashtable with |info| as pool
99  typedef std::vector<elt_info> Pooltype;
100  size_t hashCode(size_t modulus) const { return (9*z)&(modulus-1); }
101  bool operator != (const elt_info& o) const { return z!=o.z; }
102 
103  }; // |struct elt_info|
104 
105  struct block_fields // per block element and simple reflection data
106  {
108  BlockEltPair links; // one or two values, depending on |type|
109  block_fields(DescValue t) : type(t),links(UndefBlock,UndefBlock) {}
110  };
111 
112  const Block_base& parent;
113  const TwistedWeylGroup& tW; // needed for printing only
114  const DynkinDiagram folded;
115 
116  std::vector<elt_info> info; // its size defines the size of the block
117  std::vector<std::vector<block_fields> > data; // size |d_rank| * |size()|
118  BlockEltList l_start; // where elements of given length start
119 
120  std::set<BlockEltPair> flipped_edges;
121 
122  public:
123 
124 // constructors and destructors
125  extended_block(const Block_base& block,const TwistedWeylGroup& W);
126 
127 // manipulators
128 
129  void patch_signs(); // automatic correction of edge signs
130  void order_quad // make 2i12/2r21 quadruple have minus for |y|--|q| edge
131  (BlockElt x,BlockElt y, BlockElt p, BlockElt q, int s, bool verbose=true);
132  bool // return new value; true means edge was flipped to minus
133  toggle_edge(BlockElt x,BlockElt y, bool verbose=true);
134 
135 // accessors
136 
137  size_t rank() const { return data.size(); }
138  size_t size() const { return info.size(); }
139 
140  ext_gen orbit(weyl::Generator s) const { return parent.orbit(s); }
141  const DynkinDiagram& Dynkin() const { return folded; }
142 
143  BlockElt z(BlockElt n) const { assert(n<size()); return info[n].z; }
144 
145  // Look up element by its index in |parent| (if that did define an element)
146  BlockElt element(BlockElt z) const; // partial inverse of method |z|
147 
149  { assert(n<size()); assert(s<rank()); return data[s][n].type; }
150 
151  size_t length(BlockElt n) const { return info[n].length; }
152  size_t l(BlockElt y, BlockElt x) const { return length(y)-length(x); }
153  BlockElt length_first(size_t l) const { return l_start[l]; }
154 
156  BlockElt Cayley(weyl::Generator s, BlockElt n) const; // just one or none
157  BlockElt inverse_Cayley(weyl::Generator s, BlockElt n) const; // one or none
158 
161 
162  // whether link for |s| from |x| to |y| has a signe flip attached
163  int epsilon(weyl::Generator s, BlockElt x, BlockElt y) const;
164 
165  // coefficient of neighbour |sx| for $s$ in action $(T_s+1)*a_x$
166  Pol T_coef(weyl::Generator s, BlockElt sx, BlockElt x) const;
167 
168  BlockEltList down_set(BlockElt y) const;
169 
170  // an (a/de)scent of |n| in block; assumed to exist
172  // here all elements reached by a link are added to |l|, (a/de)scent first
173  void add_neighbours(BlockEltList& dst, weyl::Generator s, BlockElt n) const;
174 
175  // print whole block to stream (name chosen to avoid masking by |print|)
176  std::ostream& print_to(std::ostream& strm) const; // defined in |block_io|
177 
178 }; // |class extended_block|
179 
180 
181 } // |namespace ext_block|
182 
183 } // |namespace atlas|
184 #endif
BlockElt z
Definition: ext_block.h:94
Definition: ext_block.h:47
const TwistedWeylGroup & tW
Definition: ext_block.h:113
BlockElt z(BlockElt n) const
Definition: ext_block.h:143
bool is_like_nonparity(DescValue v)
Definition: ext_block.cpp:64
Definition: ext_block.h:41
bool is_like_type_2(DescValue v)
Definition: ext_block.cpp:91
Definition: ext_block.h:59
std::pair< BlockElt, BlockElt > BlockEltPair
Definition: Atlas.h:369
int epsilon(weyl::Generator s, BlockElt x, BlockElt y) const
Definition: ext_block.cpp:275
void add_neighbours(BlockEltList &dst, weyl::Generator s, BlockElt n) const
Definition: ext_block.cpp:236
Definition: ext_block.h:44
uA p
Definition: lists.cpp:26
bool is_like_type_1(DescValue v)
Definition: ext_block.cpp:82
BlockEltList l_start
Definition: ext_block.h:118
Definition: ext_block.h:38
Definition: ext_block.h:36
size_t hashCode(size_t modulus) const
Definition: ext_block.h:100
size_t rank() const
Definition: ext_block.h:137
std::set< BlockEltPair > flipped_edges
Definition: ext_block.h:120
Definition: ext_block.h:90
Definition: ext_block.h:60
BlockEltPair links
Definition: ext_block.h:108
const DynkinDiagram folded
Definition: ext_block.h:114
Definition: ext_block.h:58
std::vector< std::vector< block_fields > > data
Definition: ext_block.h:117
Definition: ext_block.h:42
ext_gen orbit(weyl::Generator s) const
Definition: ext_block.h:140
bool has_quadruple(DescValue v)
Definition: ext_block.cpp:100
BlockEltPair Cayleys(weyl::Generator s, BlockElt n) const
Definition: ext_block.cpp:247
Definition: ext_block.h:62
Definition: ext_block.h:46
BlockEltList down_set(BlockElt y) const
Definition: ext_block.cpp:288
Definition: ext_block.h:61
BlockElt some_scent(weyl::Generator s, BlockElt n) const
Definition: ext_block.cpp:228
bool is_proper_ascent(DescValue v)
Definition: ext_block.cpp:108
bool verbose
Definition: KLread.cpp:136
const Block_base & parent
Definition: ext_block.h:112
DescValue
Definition: ext_block.h:31
block_fields(DescValue t)
Definition: ext_block.h:109
bool has_double_image(DescValue v)
Definition: ext_block.cpp:41
Pol T_coef(weyl::Generator s, BlockElt sx, BlockElt x) const
Definition: ext_block.cpp:602
BlockElt inverse_Cayley(weyl::Generator s, BlockElt n) const
Definition: ext_block.cpp:220
std::ostream & print_to(std::ostream &strm) const
Definition: block_io.cpp:145
Definition: ext_block.h:35
extended_block(const Block_base &block, const TwistedWeylGroup &W)
Definition: ext_block.cpp:487
BlockElt length_first(size_t l) const
Definition: ext_block.h:153
Definition: ext_block.h:45
const DynkinDiagram & Dynkin() const
Definition: ext_block.h:141
size_t size() const
Definition: ext_block.h:138
bool is_descent(DescValue v)
Definition: ext_block.h:70
bool is_unique_image(DescValue v)
Definition: ext_block.cpp:51
Definition: ext_block.h:33
int generator_length(DescValue v)
Definition: ext_block.cpp:123
bool has_defect(DescValue v)
Definition: ext_block.cpp:113
unsigned short length
Definition: ext_block.h:95
BlockEltPair inverse_Cayleys(weyl::Generator s, BlockElt n) const
Definition: ext_block.cpp:261
DescValue type
Definition: ext_block.h:107
bool toggle_edge(BlockElt x, BlockElt y, bool verbose=true)
Definition: ext_block.cpp:136
DescValue extended_type(const Block_base &block, BlockElt z, ext_gen p, BlockElt &link)
Definition: ext_block.cpp:304
Definition: ext_block.h:34
unsigned long n
Definition: axis.cpp:77
size_t l(BlockElt y, BlockElt x) const
Definition: ext_block.h:152
bool is_complex(DescValue v)
Definition: ext_block.cpp:31
const char * descent_code(DescValue v)
Definition: block_io.cpp:208
Definition: Atlas.h:38
BlockElt element(BlockElt z) const
Definition: ext_block.cpp:127
Definition: ext_block.h:55
size_t length(BlockElt n) const
Definition: ext_block.h:151
const DescValue descent_type(weyl::Generator s, BlockElt n) const
Definition: ext_block.h:148
std::vector< elt_info > info
Definition: ext_block.h:116
BlockElt Cayley(weyl::Generator s, BlockElt n) const
Definition: ext_block.cpp:213
Polynomial< int > Pol
Definition: ext_block.h:88
BlockElt cross(weyl::Generator s, BlockElt n) const
Definition: ext_block.cpp:173
unsigned char Generator
Definition: Atlas.h:226
unsigned int BlockElt
Definition: Atlas.h:367
Definition: ext_block.h:54
std::vector< elt_info > Pooltype
Definition: ext_block.h:99
Definition: ext_block.h:57
Definition: ext_block.h:63
std::vector< BlockElt > BlockEltList
Definition: Atlas.h:368
bool operator!=(const elt_info &o) const
Definition: ext_block.h:101
bool is_like_compact(DescValue v)
Definition: ext_block.cpp:73
void order_quad(BlockElt x, BlockElt y, BlockElt p, BlockElt q, int s, bool verbose=true)
Definition: ext_block.cpp:154
Vertex v
Definition: graph.cpp:116
elt_info(BlockElt zz)
Definition: ext_block.h:96