Skip to content

Commit

Permalink
Edited suggested changes to chow_ring_ideal.py
Browse files Browse the repository at this point in the history
  • Loading branch information
25shriya committed Sep 23, 2024
1 parent 53ea5fc commit d631779
Showing 1 changed file with 66 additions and 74 deletions.
140 changes: 66 additions & 74 deletions src/sage/matroids/chow_ring_ideal.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,35 +53,32 @@ class ChowRingIdeal_nonaug(ChowRingIdeal):
r"""
The Chow ring ideal of a matroid `M`.
The Chow ring ideal is defined over a polynomial ring for a matroid `M`:
The *Chow ring ideal* for a matroid `M` is defined as the ideal
`(Q_M + L_M)` of the polynomial ring:
..MATH::
R[x_{F_1}, \ldots, x_{F_k}]
as `(Q_M + L_M)`
where
- `F_1, \ldots, F_k` are the non-empty proper flats of `M`,
- `F_1, \ldots, F_k` are the non-empty flats of `M`,
- `Q_M` is the ideal generated by all `x_{F_i} x_{F_j}` where
`F_i` and `F_j` are incomparable elements in the lattice of
flats, and
`F_i` and `F_j` are incomparable elements in the lattice of
flats, and
- `L_M` is the ideal generated by all linear forms
.. MATH::
.. MATH::
\sum_{i_1 \in F} x_F - \sum_{i_2 \in F} x_F
\sum_{i_1 \in F} x_F - \sum_{i_2 \in F} x_F
for all `i_1 \neq i_2 \in E`.
for all `i_1 \neq i_2 \in E`.
INPUT:
- `M` -- a matroid
- `R` -- a commutative ring
OUTPUT: Chow ring ideal of matroid `M`
REFERENCES:
- [ANR2023]_
Expand All @@ -91,11 +88,11 @@ class ChowRingIdeal_nonaug(ChowRingIdeal):
Chow ring ideal of uniform matroid of rank 3 on 6 elements::
sage: ch = matroids.Uniform(3,6).chow_ring(QQ, False)
sage: ch
sage: ch.defining_ideal()
Chow ring ideal of U(3, 6): Matroid of rank 3 on 6 elements with
circuit-closures {3: {{0, 1, 2, 3, 4, 5}}}
sage: ch = matroids.catalog.Fano().chow_ring(QQ, False)
sage: ch
sage: ch.defining_ideal()
Chow ring ideal of Fano: Binary matroid of rank 3 on 7 elements,
type (3, 0)
"""
Expand All @@ -105,7 +102,7 @@ def __init__(self, M, R):
EXAMPLES::
sage: I = matroids.catalog.Fano().chow_ring(QQ, False)
sage: I = matroids.catalog.Fano().chow_ring(QQ, False).defining_ideal()
sage: TestSuite(I).run(skip="_test_category")
"""
self._matroid = M
Expand All @@ -122,7 +119,7 @@ def __init__(self, M, R):

def _gens_constructor(self, poly_ring):
r"""
Returns the generators of the Chow ring ideal. Takes in the
Returns the generators of `self`. Takes in the
ring of Chow ring ideal as input.
EXAMPLES::
Expand Down Expand Up @@ -184,14 +181,14 @@ def _repr_(self):
EXAMPLES::
sage: ch = matroids.catalog.Fano().chow_ring(QQ, False)
sage: ch
sage: ch.defining_ideal()
Chow ring ideal of Fano: Binary matroid of rank 3 on 7 elements, type (3, 0)
"""
return "Chow ring ideal of {}".format(self._matroid)
return "Chow ring ideal of {}- non augmented".format(self._matroid)

def groebner_basis(self, algorithm='constructed'): #can you reduce it? - consider every antichain of size 2, and chains?
r"""
Returns the Groebner basis of the Chow ring ideal.
Returns the Groebner basis of `self`.
EXAMPLES::
Expand Down Expand Up @@ -281,60 +278,58 @@ def groebner_basis(self, algorithm='constructed'): #can you reduce it? - conside

class AugmentedChowRingIdeal_fy(ChowRingIdeal):
r"""
The augmented Chow ring ideal of matroid `M` over ring `R` in
Feitchner-Yuzvinsky presentation.
The augmented Chow ring ideal of Feitchner-Yuzvinsky presentation
is defined over the following polynomial ring:
The augmented Chow ring ideal of matroid `M` over ring `R` in
Feitchner-Yuzvinsky presentation.
..MATH::
The augmented Chow ring ideal in the Feitchner-Yuzvinsky presentation
for a matroid `M` is defined as the ideal
`(I_M + J_M)` of the following polynomial ring:
R[y_{e_1}, \ldots, y_{e_n}, x_{F_1}, \ldots, x_{F_k}]
..MATH::
as `(I_M + J_M)` where
R[y_{e_1}, \ldots, y_{e_n}, x_{F_1}, \ldots, x_{F_k}]
- `F_1, \ldots, F_k` are the non-empty proper flats of `M`,
- `e_1 \ldots, e_n` are `n` elements of groundset of `M`,
- `J_M` is the ideal generated by all quadratic forms `x_{F_i} x_{F_j}`
where `F_i` and `F_j` are incomparable elements in the lattice of
flats, and `y_{i} x_F` for every `i \in E` and `i \notin F`, and
- `I_M` is the ideal generated by all linear forms
as
..MATH::
- `F_1, \ldots, F_k` are the non-empty proper flats of `M`,
- `e_1 \ldots, e_n` are `n` elements of groundset of `M`,
- `J_M` is the ideal generated by all quadratic forms `x_{F_i} x_{F_j}`
where `F_i` and `F_j` are incomparable elements in the lattice of
flats, and `y_{i} x_F` for every `i \in E` and `i \notin F`, and
- `I_M` is the ideal generated by all linear forms
y_i - \sum_{i \notin F} x_F
..MATH::
for all `i \in E`.
REFERENCES:
y_i - \sum_{i \notin F} x_F
- [MM2022]_
for all `i \in E`.
INPUT:
REFERENCES:
- [MM2022]_
- `M` -- a matroid
- `R` -- a commutative ring
INPUT:
OUTPUT: augmented Chow ring ideal of matroid `M` of Feitchner-Yuzvinsky
presentation
EXAMPLES::
- `M` -- a matroid
- `R` -- a commutative ring
Augmented Chow ring ideal of Wheel matroid of rank 3::
EXAMPLES::
sage: ch = matroids.Wheel(3).chow_ring(QQ, True, 'fy')
sage: ch
Augmented Chow ring ideal of Wheel(3): Regular matroid of rank 3 on
6 elements with 16 bases of Feitchner-Yuzvinsky presentation
"""
Augmented Chow ring ideal of Wheel matroid of rank 3::
sage: ch = matroids.Wheel(3).chow_ring(QQ, True, 'fy')
sage: ch.defining_ideal()
Augmented Chow ring ideal of Wheel(3): Regular matroid of rank 3 on
6 elements with 16 bases of Feitchner-Yuzvinsky presentation
"""
def __init__(self, M, R):
r"""
Initialize ``self``.
EXAMPLES::
sage: I = matroids.Wheel(3).chow_ring(QQ, True, 'fy')
sage: I = matroids.Wheel(3).chow_ring(QQ, True, 'fy').defining_ideal()
sage: TestSuite(I).run(skip="_test_category")
"""
self._matroid = M
Expand All @@ -357,14 +352,13 @@ def __init__(self, M, R):

def _gens_constructor(self, poly_ring):
r"""
Return the generators of augmented Chow ring ideal of
Feitchner-Yuzvinsky presentation. Takes in the ring of
Return the generators of `self`. Takes in the ring of
that augmented Chow ring ideal as input.
EXAMPLES::
sage: ch = matroids.Wheel(3).chow_ring(QQ, True, 'fy')
sage: ch._gens_constructor(ch.ring())
sage: ch.defining_ideal()._gens_constructor(ch.ring())
[B0^2, B0*B1, B0*B2, B0*B3, B0*B4, B0*B5, B0*B124, B0*B15, B0*B23,
B0*B345, B0*B1, B1^2, B1*B2, B1*B3, B1*B4, B1*B5, B1*B025, B1*B04,
B1*B23, B1*B345, B0*B2, B1*B2, B2^2, B2*B3, B2*B4, B2*B5, B2*B013,
Expand Down Expand Up @@ -416,15 +410,15 @@ def _repr_(self):
EXAMPLES::
sage: ch = matroids.Wheel(3).chow_ring(QQ, True, 'fy')
sage: ch
sage: ch.defining_ideal()
Augmented Chow ring ideal of Wheel(3): Regular matroid of rank 3 on
6 elements with 16 bases of Feitchner-Yuzvinsky presentation
"""
return "Augmented Chow ring ideal of {} of Feitchner-Yuzvinsky presentation".format(self._matroid)

def groebner_basis(self, algorithm='constructed'):
r"""
Returns the Groebner basis of the augmented Chow ring ideal.
Returns the Groebner basis of `self`.
EXAMPLES::
Expand Down Expand Up @@ -472,22 +466,23 @@ def groebner_basis(self, algorithm='constructed'):

class AugmentedChowRingIdeal_atom_free(ChowRingIdeal):
r"""
The augmented Chow ring ideal of matroid `M` over ring `R` in the atom-free
presentation.
The augmented Chow ring ideal for a matroid `M` over ring `R` in the
atom-free presentation.
The augmented Chow ring ideal for the atom-free presentation is defined
over the polynomial ring:
The augmented Chow ring ideal in the atom-free presentation for a matroid
`M` is defined as the ideal
`I_{af}(M)` of the polynomial ring:
..MATH::
R[x_{F_1}, \ldots, x_{F_k}]
as `I_{af}(M)` where
as
- `F_1, \ldots, F_k` are the non-empty proper flats of `M`,
- `I_{af }M` is the ideal generated by all quadratic forms `x_{F_i} x_{F_j}`
where `F_i` and `F_j` are incomparable elements in the lattice of
flats,
where `F_i` and `F_j` are incomparable elements in the lattice of
flats,
..MATH::
Expand All @@ -510,14 +505,12 @@ class AugmentedChowRingIdeal_atom_free(ChowRingIdeal):
- ``M`` -- a matroid
- ``R`` -- a commutative ring
OUTPUT: augmented Chow ring ideal of matroid `M` of atom-free presentation
EXAMPLES:
Augmented Chow ring ideal of Wheel matroid of rank 3::
sage: ch = matroids.Wheel(3).chow_ring(QQ, True, 'atom-free')
sage: ch
sage: ch.defining_ideal()
Augmented Chow ring ideal of Wheel(3): Regular matroid of rank 3 on
6 elements with 16 bases of atom-free presentation
"""
Expand All @@ -527,7 +520,7 @@ def __init__(self, M, R):
EXAMPLES::
sage: I = matroids.Wheel(3).chow_ring(QQ, True, 'atom-free')
sage: I = matroids.Wheel(3).chow_ring(QQ, True, 'atom-free').defining_ideal()
sage: TestSuite(I).run(skip="_test_category")
"""
self._matroid = M
Expand All @@ -554,8 +547,7 @@ def __init__(self, M, R):

def _gens_constructor(self, poly_ring):
r"""
Return the generators of augmented Chow ring ideal of
atom-free presentation. Takes in the ring of the augmented
Return the generators of `self`. Takes in the ring of the augmented
Chow ring ideal as input.
EXAMPLES::
Expand All @@ -564,7 +556,7 @@ def _gens_constructor(self, poly_ring):
sage: M1 = GraphicMatroid(graphs.CycleGraph(3))
sage: ch = M1.chow_ring(QQ, True, 'atom-free')
sage: ch._gens_constructor(ch.ring())
sage: ch.defining_ideal()._gens_constructor(ch.ring())
[A0^2, A0^2, A1^2, A0*A1, A2^2, A0*A2, A0*A1, A0^2, A1^2, A0*A1,
A2^2, A0*A2, A0*A2, A0^2, A1^2, A0*A1, A2^2, A0*A2, A0*A1, A0^2,
A0*A1, A1^2, A2^2, A1*A2, A1^2, A0^2, A0*A1, A1^2, A2^2, A1*A2,
Expand Down Expand Up @@ -602,15 +594,15 @@ def _repr_(self):
EXAMPLE::
sage: ch = matroids.Wheel(3).chow_ring(QQ, True, 'atom-free')
sage: ch
sage: ch.defining_ideal()
Augmented Chow ring ideal of Wheel(3): Regular matroid of rank 3 on
6 elements with 16 bases of atom-free presentation
"""
return "Augmented Chow ring ideal of {} of atom-free presentation".format(self._matroid)
return "Augmented Chow ring ideal of {} in the atom-free presentation".format(self._matroid)

def groebner_basis(self, algorithm='constructed'):
"""
Returns the Groebner basis of the augmented Chow ring ideal.
Returns the Groebner basis of `self`.
EXAMPLES::
Expand Down

0 comments on commit d631779

Please sign in to comment.