Symmetric Polynomials  V3.1
A C++ library for generating symmetric polynomials with relations
symmp Namespace Reference

The namespace which contains every method and class in the library. More...

Classes

class  FactoryGenerator
 Prototype for coroutine-like iterators that generate elements such as combinations. More...
 
class  PermutationGenerator
 Generates all permutations on a number of letters. More...
 
class  CombinationGenerator
 Generates all combinations on a number of letters making a number of choices. More...
 
struct  ArrayVectorWrapper
 Wrapping array and vector in the same interface. More...
 
struct  HalfIdempotentVariables
 Variables \(x_1,...,x_n,y_1,...,y_n\) with \(y_i^2=y_i\) and \(|x_i|=1\), \(|y_i|=0\). More...
 
struct  TwistedChernVariables
 The twisted Chern generators as variables \(\gamma_{s,j}\). More...
 
class  TwistedChernBasis
 Class for half-idempotent symmetric polynomials. More...
 
class  BaseContainer
 The base of all monomial containers. More...
 
class  DefaultContainer
 The default ordered/unordered monomial container. More...
 
class  Polynomial
 Class for polynomials in multiple variables with relations. More...
 
struct  StandardVariables
 The standard variables \(x_i\) in a polynomial, with \(|x_i|=1\) and no relations. More...
 
struct  ElementarySymmetricVariables
 Variables \(e_1,...,e_n\) of degrees \(|e_i|=i\). More...
 
class  PolynomialBasis
 Factory class that provides the general interface of a generating basis for a subring of a polynomial ring. More...
 
class  SymmetricBasis
 Class for symmetric polynomials with no relations, allowing transformation from \(x_i\) variables to \(e_i\) variables and vice-versa. More...
 

Typedefs

template<class _scl , class _exp , bool _ord = 1>
using Poly = Polynomial< std::conditional_t< _ord, DefaultContainer< _scl, _exp, std::map, 1 >, DefaultContainer< _scl, _exp, std::unordered_map, 0 > >>
 Polynomial using the default containers std::map or std::unordered_map. More...
 

Functions

template<typename T , typename hasher = boost_hash>
size_t generic_hasher (const T &v)
 A generic hashing function that calls other hashing functions. More...
 
template<typename R , typename T , typename S >
general_compute_degree (const T &exp, const S &dim)
 Degree computation given exponent and dimensions (grading). More...
 
template<class T >
std::vector< std::vector< T > > all_permutations (T n)
 Returns vector of all permutations on n letters. More...
 
template<class T >
std::vector< std::vector< T > > all_combinations (T n, T m)
 Returns vector of all combinations on n letters choosing m many. More...
 
template<class xy_poly_t , class chern_poly_t >
void print_half_idempotent_relations (int n, bool print=1, bool verify=1, bool verify_verbose=1)
 Prints the relations of \(\Big(\mathbf Z[x_1,...,x_n,y_1,...,y_n]/(y_i^2=y_i)\Big)^{\Sigma_n}\). More...
 
template<class container_t >
std::ostream & operator<< (std::ostream &os, const Polynomial< container_t > &a)
 Prints polynomial to output stream. More...
 

Detailed Description

The namespace which contains every method and class in the library.

Typedef Documentation

◆ Poly

using Poly = Polynomial<std::conditional_t<_ord, DefaultContainer<_scl, _exp, std::map, 1>, DefaultContainer<_scl, _exp, std::unordered_map, 0> >>

Polynomial using the default containers std::map or std::unordered_map.

Template Parameters
_sclThe scalar/coefficient type of the polynomial
_expThe variable/exponent type of the Polynomial eg StandardVariables or HalfIdempotentVariables
_ordIf _ord==1 then std::map is used as the container for the polynomial; otherwise std::unordered_map is used

Function Documentation

◆ generic_hasher()

size_t symmp::generic_hasher ( const T &  v)

A generic hashing function that calls other hashing functions.

Template Parameters
TThe type of element to be hashed (must have a for range loop)
hasherThe hashing algorithm. boost_hash by default. If SSE4.1 is supported you can also use crc
Parameters
vThe element to be hashed
Returns
The hash of the element

◆ general_compute_degree()

R symmp::general_compute_degree ( const T &  exp,
const S &  dim 
)

Degree computation given exponent and dimensions (grading).

Template Parameters
TThe exponent type (eg std::vector<int>)
SThe dimensions type (eg std::vector<int>)
RThe degree type (eg uint64_t)
Parameters
expThe monomial whose degree will be computed, provided via its exponent vector
dimThe dimensions of the variables in the monomial
Returns
The degree \(\sum_{i=1}^na_id_i\) where exponent= \([a_1,...,a_n]\) and dimensions= \([d_1,...,d_n]\)

◆ all_permutations()

std::vector<std::vector<T> > symmp::all_permutations ( n)

Returns vector of all permutations on n letters.

Template Parameters
TThe value type of the permutations
Parameters
nThe number of letters
Returns
Vector of vectors each of which is \([a_0,...,a_{n-1}]\) with \(0\le a_i\le n-1\) all distinct

◆ all_combinations()

std::vector<std::vector<T> > symmp::all_combinations ( n,
m 
)

Returns vector of all combinations on n letters choosing m many.

Template Parameters
TThe value type of the combinations
Parameters
nThe number of letters
mThe number of choices
Returns
Vector of vectors each of which is \([a_0,...,a_{n-1}]\) with \(0\le a_i\le n-1\) all distinct

◆ print_half_idempotent_relations()

void symmp::print_half_idempotent_relations ( int  n,
bool  print = 1,
bool  verify = 1,
bool  verify_verbose = 1 
)

Prints the relations of \(\Big(\mathbf Z[x_1,...,x_n,y_1,...,y_n]/(y_i^2=y_i)\Big)^{\Sigma_n}\).

The generators \(\alpha_i, c_i, \gamma_{s,j}\) are printed as a_i, c_i, c_{s,j} in the console.

Template Parameters
xy_poly_tThe type of polynomial on the \(x_i,y_i\) variables
chern_poly_tThe type of polynomial on the \(\gamma_{s,j}\) variables
Parameters
nHalf the number of variables (the \(n\))
printWhether we want to print the relations to the console
verifyWhether to verify the relations
verify_verboseWhether to verify and print the verification to the console

◆ operator<<()

std::ostream& symmp::operator<< ( std::ostream &  os,
const Polynomial< container_t > &  a 
)

Prints polynomial to output stream.

Template Parameters
container_tThe data store type (container) of the polynomial eg DefaultContainer
Parameters
osThe output stream
aThe polynomial to be printed
Returns
The output stream where the polynomial has been printed