Symmetric Polynomials  V3.1
A C++ library for generating symmetric polynomials with relations
Half_Idempotent.hpp
Go to the documentation of this file.
1 #pragma once
2 #include "Symmetric_Basis.hpp"
3 #include <sstream>
4 
15 
16 namespace symmp
17 {
18 
24  template <class T, size_t N = 0>
26 
34  template <class T = int64_t, class _deg = int64_t, size_t N = 0>
36  {
38 
43 
49 
50  typedef _deg deg_t;
51 
54  deg_t degree() const;
55 
60  static std::string name(int i, int num);
61 
64  size_t operator()() const;
65  };
66 
74  template <class T = int64_t, class _deg = int64_t>
75  struct TwistedChernVariables : public std::vector<T>
76  {
77  using std::vector<T>::vector;
78  typedef _deg deg_t;
79 
85 
88  size_t operator()() const;
89  };
90 
97  template <class xy_poly_t, class chern_poly_t>
98  class TwistedChernBasis : public PolynomialBasis<TwistedChernBasis<xy_poly_t, chern_poly_t>, xy_poly_t, chern_poly_t>
99  {
100  public:
105 
108  const std::vector<chern_poly_t> &relations() const;
109 
114  const xy_poly_t &generator(int s, int j) const;
115 
117  friend class PolynomialBasis<TwistedChernBasis<xy_poly_t, chern_poly_t>, xy_poly_t, chern_poly_t>;
118 
119  private:
120  typedef typename xy_poly_t::exp_t xy_t;
121  typedef typename chern_poly_t::exp_t chern_t;
125 
126  const int n; //Half the variable number
127  const int number_of_generators; //Number of c_{s,j}
128  std::vector<chern_poly_t> _relations;
129 
130  //Takes (s,j) to the index in the _generators vector
131  std::map<std::array<int, 2>, int> generator_double_index;
132  //Transforms index (s,j) of c_{s,j} into the corresponding index in the generators vector.
133  int index(int s, int j) const;
134  auto create_generator(int s, int i);
135  void set_generators();
136  void set_relations();
137  auto find_exponent(const xy_t &term) const;
138  void find_exponent_recursive(const xy_t &term, chern_t &exponent) const;
139  };
140 
149  template <class xy_poly_t, class chern_poly_t>
150  void print_half_idempotent_relations(int n, bool print = 1, bool verify = 1, bool verify_verbose = 1);
151 
152 }
153 #include "impl/Half_Idempotent.ipp"
Contains the methods and classes for generatic symmetric polynomials.
Factory class that provides the general interface of a generating basis for a subring of a polynomial...
Definition: Symmetric_Basis.hpp:82
std::vector< std::string > generator_names
The names of the generators, optionally constructed in the inheriting class.
Definition: Symmetric_Basis.hpp:118
std::vector< xy_poly_t > _generators
The generators of the polynomial basis, constructed in the inheriting class.
Definition: Symmetric_Basis.hpp:112
std::vector< typename new_poly_t::deg_t > generator_dimensions
The dimensions of the generators, optionally constructed in the inheriting class.
Definition: Symmetric_Basis.hpp:115
Class for half-idempotent symmetric polynomials.
Definition: Half_Idempotent.hpp:99
const std::vector< chern_poly_t > & relations() const
The relations are for and .
const xy_poly_t & generator(int s, int j) const
The generator .
TwistedChernBasis(int n)
Constructs the generators and the relation set given in .
The namespace which contains every method and class in the library.
Definition: General.hpp:16
void print_half_idempotent_relations(int n, bool print=1, bool verify=1, bool verify_verbose=1)
Prints the relations of .
Wrapping array and vector in the same interface.
Definition: Half_Idempotent.hpp:25
Variables with and , .
Definition: Half_Idempotent.hpp:36
_deg deg_t
Degree typedef.
Definition: Half_Idempotent.hpp:50
static std::string name(int i, int num)
Returns the names of the variables .
size_t operator()() const
Hashes monomial.
HalfIdempotentVariables operator+(const HalfIdempotentVariables &b) const
Multiplies monomials by adding their exponents.
HalfIdempotentVariables operator-(const HalfIdempotentVariables &b) const
Divides monomials by subtracting their exponents.
deg_t degree() const
Computes degree of the monomial on the with and .
The twisted Chern generators as variables .
Definition: Half_Idempotent.hpp:76
_deg deg_t
Degree typedef.
Definition: Half_Idempotent.hpp:78
size_t operator()() const
Hashes monomial.
TwistedChernVariables operator+(const TwistedChernVariables &b) const
Multiplies monomials by adding their exponents.