1 #ifndef _GLUCAT_GENERATION_IMP_H 2 #define _GLUCAT_GENERATION_IMP_H 38 namespace glucat {
namespace gen
47 template<
class Matrix_T >
48 generator_table<Matrix_T>&
55 template<
class Matrix_T >
67 return &(gen_vector(p, q)[q]);
72 return &(gen_vector(super_p, super_q)[super_q]);
77 template<
class Matrix_T >
78 const std::vector<Matrix_T>&
86 if (this->find(sig) == this->end())
92 gen_from_pp4_qm4(gen_vector(p+4, q-4), sig);
95 gen_from_pm4_qp4(gen_vector(p-4, q+4), sig);
98 std::vector<Matrix_T> result(1, matrix::unit<Matrix_T>(1));
99 this->insert(make_pair(sig, result));
103 gen_from_pm1_qm1(gen_vector(p-1, q-1), sig);
108 gen_from_pp4_qm4(gen_vector(p+4, q-4), sig);
111 gen_from_pm4_qp4(gen_vector(p-4, q+4), sig);
114 gen_from_qp1_pm1(gen_vector(q+1, p-1), sig);
124 template<
class Matrix_T >
129 typedef typename Matrix_T::size_type matrix_index_t;
141 const int new_size = old.size() + 2;
142 const matrix_index_t old_dim = old[0].size1();
143 const Matrix_T& eye = matrix::unit<Matrix_T>(old_dim);
145 std::vector<Matrix_T> result(new_size);
156 this->insert(make_pair(sig, result));
161 template<
class Matrix_T >
173 const int old_size = old.size();
174 std::vector<Matrix_T> result(old_size);
185 result[k-4] = old[k];
187 this->insert(make_pair(sig, result));
192 template<
class Matrix_T >
197 const int old_size = old.size();
198 Matrix_T h = old[old_size-1];
205 std::vector<Matrix_T> result(old_size);
215 result[k] = old[k-4];
217 this->insert(make_pair(sig, result));
222 template<
class Matrix_T >
227 const int old_size = old.size();
228 const Matrix_T& a = old[old_size-1];
229 std::vector<Matrix_T> result(old_size);
236 result[old_size-1] = a;
239 this->insert(make_pair(sig, result));
243 #endif // _GLUCAT_GENERATION_IMP_H static generator_table< Matrix_T > & generator()
Single instance of generator table.
static const index_t offset_to_super[]
Offsets between the current signature and that of the real superalgebra.
const RHS_T mono_kron(const LHS_T &lhs, const RHS_T &rhs)
Sparse Kronecker tensor product of monomial matrices.
Table of generators for specific signatures.
void gen_from_qp1_pm1(const std::vector< Matrix_T > &old, const signature_t sig)
Construct generators for p,q given generators for q+1,p-1.
void gen_from_pm4_qp4(const std::vector< Matrix_T > &old, const signature_t sig)
Construct generators for p,q given generators for p-4,q+4.
void gen_from_pp4_qm4(const std::vector< Matrix_T > &old, const signature_t sig)
Construct generators for p,q given generators for p+4,q-4.
void gen_from_pm1_qm1(const std::vector< Matrix_T > &old, const signature_t sig)
Construct generators for p,q given generators for p-1,q-1.
std::pair< index_t, index_t > signature_t
A signature is a pair of indices, p, q, with p == frame.max(), q == -frame.min()
const RHS_T::expression_type mono_prod(const ublas::matrix_expression< LHS_T > &lhs, const ublas::matrix_expression< RHS_T > &rhs)
Product of monomial matrices.
const std::vector< Matrix_T > & gen_vector(const index_t p, const index_t q)
Construct a vector of generators for a specific signature.
int index_t
Size of index_t should be enough to represent LO, HI.
LHS_T pos_mod(LHS_T lhs, RHS_T rhs)
Modulo function which works reliably for lhs < 0.
const Matrix_T * operator()(const index_t p, const index_t q)
Pointer to generators for a specific signature.