Documentation
Permutations
The grobnercrystals.Perm class is a class for permutations which includes useful methods
for working with matrix Schubert varieties:
- class grobnercrystals.Perm(perm, region=None)
A class for permutations
- Parameters:
perm (list) – The permutation in one-line notation as a list of integers
region (list, optional) – The region the permutation should be restricted to, as a list of tuples (i,j) with i,j in [0,length(perm)-1] (for working with usual instead of effective matrix Schubert varieties)
- Variables:
perm – the permutation in one-line notation as a list of integers
l – int, length of the permutation
region – parameter region if specified, else list of tuples (i,j) of integers between 0 and l-1
descents – list of the descents of the permutation (as integers)
inverse – inverse of the permutation in one-line notation as a list of integers
inverse_descents – list of the descents of the inverse of the permutation (as integers)
vexillary – bool, True if the permutation is vexillary, else False
max_row – int, largest i such that (i,j) is in region
max_col – int, largest j such that (i,j) is in region
- eff_reg(retMaxDim=False)
Calculates the effective region of the permutation, i.e. the set of all tuples (i,j) so that (i,j) is weakly northwest of the southeast most box in the Rothe diagram for the permutation.
- Parameters:
retMaxDim (bool, optional) – whether to return the largest row and column in the effective region, defaults to False
- ess_set()
Finds Fulton’s essential set.
- Returns:
Fulton’s essential set as a list of indices [(i,j)]
- Return type:
list
- filled_ess_set()
Finds Fulton’s essential set, together with the rank conditions imposed by each box in the essential set.
- Returns:
A list [[essential set box, number in that box]]
- Return type:
list
- levi_datum()
Finds the Levi datum corresponding to the largest Levi group which acts on the effective matrix Schubert variety corresponding to the permutation. If a region is specified, returns the Levi datum corresponding to the largest Levi group which acts on the matrix Schubert variety when restricted to that region.
- Returns:
A Levi datum [I,J], where I,J are lists of integers
- Return type:
list
Filtered RSK
Grobnercrystals includes a function for computing filteredRSK of a matrix with respect to a given Levi datum.
Note
This function takes numpy matrices as input.
- grobnercrystals.filtered_RSK()
Returns the result of applying filteredRSK to a matrix for a given Levi datum.
- Parameters:
M (numpy matrix) – The matrix to be filterRSK’d
I (list) – The row Levi datum
J (list) – The column Levi datum
- Returns:
A list of tableau [[row tableaux],[column tableaux]]
- Return type:
list
Crystal Operators on Matrices
Note
These functions take numpy matrices as input.
- grobnercrystals.e()
Raising matrix crystal operator.
- Parameters:
M (numpy matrix) – Matrix to apply the operator to
i (int) – row or column index
rc (str or int) – ‘r’ or 0 if row operator, ‘c’ or 1 if column operator
- Returns:
Result of applying raising crystal operator to M if possible. If the result of applying the operator to M is the empty symbol, return None.
- Return type:
numpy matrix or None
- grobnercrystals.f()
Lowering matrix crystal operator.
- Parameters:
M (numpy matrix) – Matrix to apply the operator to
i (int) – row or column index
rc (str or int) – ‘r’ or 0 if row operator, ‘c’ or 1 if column operator
- Returns:
Result of applying lowering crystal operator to M if possible. If the result of applying the operator to M is the empty symbol, return None.
- Return type:
numpy matrix or None
Polynomial Rings
Grobnercrystals includes a class for defining a polynomial ring in an m by n matrix of variables.
- class grobnercrystals.PolRing(m, n, name='z', to='GRevLex')
Class for polynomial rings in an m by n matrix of variables.
- Parameters:
m (int) – number of rows in the matrix of variables
n (int) – number of columns in the matrix of variables
name (str) – variable names, optional, default ‘z’
to (str) – Macaulay2 ring term order, optional, default ‘GRevLex’
- Variables:
R – Sage PolynomialRing in an m by n matrix of variables
Z – matrix of variables
xR – Sage PolynomialRing of m ‘x’ variables x1,…,xm
yR – Sage PolynomialRing of n ‘y’ variables y1,…,yn
X – generators of xR, output of xR.gens()
Y – generators of yR, output of yR.gens()
graded_m2_str – str containing Macaulay2 command for generating R (with multigrading)
ungraded_m2_str – str containing Macaulay2 command for generating R (no multigrading)
Ideals and Bicrystalline Tests
Ideals are constructed using the grobnercrystals.BIdeal class. Every BIdeal is an ideal of a polynomial ring in an m by n matrix of variables, implemented as a PolRing object. This class has a .bicrystalline() method for checking whether the ideal is bicrystalline
Note
The .bicrystalline() method does not check whether the ideal is stable under the given Levi group, only whether the set of its non-standard monomials is closed under all admissible bicrystal operators for that Levi group. See Group Action Checks.
- class grobnercrystals.BIdeal(gens, PR)
Class for ideals of PolRing objects.
- Parameters:
gens (polynomials in PR.R) – generators of the ideal
PR (PolRing) – ring in which the ideal lives
- Variables:
I – ideal of PR.R generated by gens
R – alias of PR.R
X – alias of PR.X
Y – alias of PR.Y
m2_ideal_str – str containing command for defining I in Macaulay2
- bicrystalline(I, J, use_to=None, detailed_output=False)
Checks whether the ideal is bicrystalline with respect to a given Levi action. Optionally, instead of checking all term orders, one can check a specific term order. This function does not check whether the ideal is stable under the action of the given Leiv group, or whether it is homogeneous.
- Parameters:
I (list) – row Levi datum
J (list) – column Levi datum
use_to (list, optional) – Macaulay2 term order to use, defaults to None
detailed_output (bool, optional) – when true, outputs details about the checks it makes to the terminal, defaults to False
- Returns:
True if the ideal is bicrystalline (assuming it is homogeneous and stable under the input Levi group), else False
- Return type:
bool
- def_m2_vars(graded=False, ideal_name='I', ring_name='R')
Define the ideal in Macaulay2. After running this command, one can run commands referencing the ideal “I” in Macaulay2.
- Parameters:
graded (bool, optional) – whether the Macaulay2 ideal should be graded, defaults to False
ideal_name (str, optional) – what the ideal should be called in Macaulay2, defaults to “I”
ring_name (str, optional) – what the ring should be called in Macaulay2, defaults to “R”
- gb(to=None)
Computes a Grobner basis for the ideal. Optionally, one may specify the term order. The default is the term order of the parent PolRing.
- Parameters:
to (str, optional) – Macaulay2 term order, defaults to None
- Returns:
list of Grobner basis generators as ring elements
- Return type:
list
- gb_lts(to=None)
Computes the lead terms of a Grobner basis for the ideal. Optionally, one may specify the term order. The default is the term order of the parent PolRing.
- Parameters:
to (str, optional) – Macaulay2 term order, defaults to None
- Returns:
list of lead terms of Grobner basis generators as ring elements
- Return type:
list
- gb_lts_mats(to=None)
Computes the lead terms of a Grobner basis for the ideal. Optionally, one may specify the term order. The default is the term order of the parent PolRing. The lead terms are output as numpy matrices.
- Parameters:
to (str, optional) – Macaulay2 term order, defaults to None
- Returns:
list of lead terms of Grobner basis generators as numpy matrices
- Return type:
list
- hilb_exp(deg)
Computes the Hilbert series expansion of I up to a given degree. The Hilbert series is output as a SplitPol.
- Parameters:
deg (int) – degree
- Returns:
Hilbert series up to a given degree
- Return type:
SplitPol
- min_test_set(op, gb=None, to=None)
Outputs the unique minimal test set for a given bicrystal operator, and optionally a given Grobner basis or term order.
- Parameters:
op (list) – bicrystal operator as a list [‘f’ or ‘e’,i,’r’ or ‘c’], e.g. [‘f’,1,’r’] for the row lowering operator f1
gb (list, optional) – lead terms of a Grobner basis for I as a list of numpy matrices, defaults to None
to (str, optional) – a Macaulay2 term order, defaults to None
- Returns:
the minimal test set for I as a list of numpy matrices
- Return type:
list
- nstd_mons(deg, gens=None, leq=False)
Returns all non-standard monomials for I up to a given degree as ring elements.
- Parameters:
deg (int) – degree
gens (list, optional) – optional list of lead terms of generators of the initial ideal as ring elements, defaults to None
leq (bool, optional) – optionally return all nonstandard monomials of at most input degree, defaults to False
- Returns:
list of all nonstandard monomials of a given degree as ring elements
- Return type:
list
- nstd_mons_mats(deg, gens=None, leq=False)
Returns all non-standard monomials for I up to a given degree as numpy matrices.
- Parameters:
deg (int) – degree
gens (list, optional) – optional list of lead terms of generators of the initial ideal as ring elements, defaults to None
leq (bool, optional) – optionally return all nonstandard monomials of at most input degree, defaults to False
- Returns:
list of all nonstandard monomials of a given degree as numpy matrices
- Return type:
list
- test_set(op, gb=None, to=None)
Outputs a test set for a given bicrystal operator, and optionally a given Grobner basis or term order.
- Parameters:
op (list) – bicrystal operator as a list [‘f’ or ‘e’,i,’r’ or ‘c’], e.g. [‘f’,1,’r’] for the row lowering operator f1
gb (list, optional) – lead terms of a Grobner basis for I as a list of numpy matrices, defaults to None
to (str, optional) – a Macaulay2 term order, defaults to None
- Returns:
a test set for I as a list of numpy matrices
- Return type:
list
Interesting Classes of Ideals
Grobnercrystals provides functions for defining several ideals of interest.
- grobnercrystals.shape_ideal()
Outputs the BIdeal I generated by all bitableaux of shape l in the polynomial ring in a matrix of m by n variables.
- grobnercrystals.classical_det_ideal()
Creates the BIdeal I of k by k minors of an m by n matrix.
- Parameters:
m (int) – number of rows in the matrix of variables
n (int) – number of columns in the matrix of variables
k (int) – size of minors
- Returns:
classical determinantal ideal
- Return type:
- grobnercrystals.msv()
Creates the BIdeal I defining the matrix Schubert variety corresponding to a permutation w.
- Parameters:
w (list) – permutation in one-line notation as a list of integers
region (list, optional) – list of tuples (i,j) defining a region in which to define the ideal, defaults to None
R (PolRing, optional) – the ring in which I is to be defined, defaults to None
- Returns:
ideal defining the matrix Schubert variety for w
- Return type:
- grobnercrystals.eff_msv()
Creates the effective matrix Schubert ideal corresponding to w. The effective matrix Schubert ideal lives in the ring of r by c matrices, where r is the largest row in which the Rothe diagram for w has a box and c is the largest column in which the Rothe diagram for w has a box. The ideal is generated by the Fulton generators, together with all variables outside the effective region (i.e. all variables zij for which (i,j) is strictly southeast of any box in the Rothe diagram for w).
- Parameters:
w (list) – permutation in one-line notation as a list of integers
- Returns:
ideal defining the effective matrix Schubert variety for w
- Return type:
- grobnercrystals.mrv()
Constructs the matrix Richardson ideal corresponding to input permutations u and v.
- Parameters:
u (list) – a permutation in one-line notation as a list of integers
v (list) – a permutation in one-line notation as a list of integers
- Returns:
the matrix Richardson ideal corresponding to u and v
- Return type:
The following function is useful for defining various determinantal ideals.
- grobnercrystals.minors()
Outputs the k by k minors of the matrix M of size k. Optionally, outputs the k by k minors of a submatrix B of M, input as [[list of rows of B],[list of columns of B]].
- Parameters:
M (Sage matrix) – matrix
k (int) – minor size
B (list, optional) – submatrix of M, input as [[list of rows of B],[list of columns of B]] (row and column numbers are 0-indexed), defaults to None
- Returns:
list of minors
- Return type:
list
Group Action Checks
- grobnercrystals.check_action()
Checks whether a given Levi group acts on a given ideal.
- Parameters:
I (BIdeal) – The ideal to be checked
L (list) – A Levi datum [I,J]
detailed_output (bool, optional) – If True, prints a pair (Gröbner basis element,Gröbner basis element after group action) which fails the check (if such a pair exists), defaults to False
- Returns:
True if the Levi group defined by L acts on I, else False
- Return type:
bool
Polynomials and Schur Expansions
Grobnercrystals includes a special class SplitPoly for polynomials in two sets of variables. This class has a .expand() method for computing split-Schur expansions of such polynomials.
- class grobnercrystals.SplitPoly(poly, xR, yR)
A class for polynomials in two sets of variables (‘x’ variables and ‘y’ variables). The rings in which the ‘x’ and ‘y’ variables live must be specified.
- Parameters:
poly (class 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular') – the polynomial as an element of a Sage MPolynomialRing
xR (class 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular') – the ring of ‘x’ variables
yR (class 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular') – the ring of ‘y’ variables
- Variables:
X – the generators of xR (output of xR.gens())
Y – the generators of yR (output of yR.gens())
x – list of strings [‘xi’] of ‘x’ variables
y – list of strings [‘yi’] of ‘y’ variables
deg – degree of the polynomial
d – dictionary for the polynomial of the form {degree : homogeneous component of the polynomial with that degree}
- expand(x=None, y=None, I=[], J=[], returnDict=False, maxIter=10000)
Expands the polynomial into a sum of products of Schur polynomials based on a given Levi datum. If no inputs are given, returns the polynomial. If the user specifies x=’m’ or y=’m’, the corresponding variables will be left as monomials. The default output is a string representing the expansion. Optionally, can output a dictionary of the form {tuple of partitions, permutations, or exponents : coefficient in the expansion}.
- Parameters:
x (str, optional) – What type of polynomial to expand the x variables in (‘s’ for Schur,’m’ for Monomial), defaults to None
y (str, optional) – What type of polynomial to expand the x variables in (‘s’ for Schur,’m’ for Monomial), defaults to None,
I (list, optional) – Row Levi datum, defaults to []
J (list, optional) – Column Levi datum, defaults to []
returnDict (bool, optional) – True to return a dictionary, False to return a string, defaults to False
maxIter (int, optional) – Maximum number of subtractions allowed per degree component, defaults to 10000
- Raises:
MemoryError – if the number of subtractions exceeds maxIter
- Returns:
A string representing the desired expansion (or, optionally, a dictionary)
- Return type:
str (optionally, dict)