Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition of Kähler algebras as a category #39168

Open
wants to merge 39 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
0c375f5
Created file for Kahler Algebras category
25shriya Dec 1, 2024
6287bb8
Added poincare_pairing() method
25shriya Dec 3, 2024
880e6ef
Added methods in kahler algebras category
25shriya Dec 9, 2024
ea541dc
Modified super_categories() method
25shriya Dec 10, 2024
42cf2db
Changed chow_ring() category and modified poincare_pairing() method
25shriya Dec 12, 2024
ebc32ba
Formatted kahler_algebras.py document
25shriya Dec 12, 2024
27445df
Added doctests to methods in KahlerAlgebras category
25shriya Dec 19, 2024
66b2649
Added and formatted lefschetz_element() for ChowRing class
25shriya Dec 19, 2024
38ebe74
Formatted kahler_algebras.py
25shriya Dec 19, 2024
d36957b
Formatted kahler_algebras.py
25shriya Dec 19, 2024
3af90bd
Merge branch 'develop' into kahler_algebras
25shriya Dec 19, 2024
ce47f30
Modified index.rst for categories and corrected doctest
25shriya Dec 19, 2024
b75cffe
Edited title
25shriya Dec 19, 2024
15c5323
Formatted title
25shriya Dec 19, 2024
7a1a449
Added GPL license
25shriya Dec 19, 2024
27c70ed
Implemented poincare_pairing() in Chow rings and made it abstact in t…
25shriya Dec 19, 2024
c2720cb
Modified poincare_pairing() method
25shriya Dec 19, 2024
9423bd8
Modified flats_generator for ChowRing
25shriya Dec 19, 2024
85bc761
Modified hodge_riemann_relations()
25shriya Dec 19, 2024
e772478
Fixed linting errors
25shriya Dec 19, 2024
2e6c968
Added _top_degree() method
25shriya Dec 29, 2024
c24db6b
Added _top_degree() method in other methods
25shriya Dec 29, 2024
1e2a17d
Added definitions of properties of Kahler Algebras
25shriya Jan 2, 2025
ac74591
Fixed typo
25shriya Jan 2, 2025
65ac6ca
Corrected super_categories(), documentation and doctests
25shriya Jan 3, 2025
3b8c699
Corrected TestSuite() doctest
25shriya Jan 3, 2025
8f2e1a5
Changed top_degree() location
25shriya Jan 3, 2025
430e5a9
Edited flats_to_generator_dict() method and kahler_algebras file
25shriya Jan 4, 2025
2c3cf57
Changed top_degree() location
25shriya Jan 4, 2025
89416b9
Edited chow_ring_ideal.py
25shriya Jan 4, 2025
f3152d3
Edited chow_ring_ideal.py
25shriya Jan 4, 2025
e9efa6e
Edited chow_ring_ideal.py
25shriya Jan 4, 2025
df942f6
Corrected linting errors, doctests and added warning note
25shriya Jan 4, 2025
e1039a9
Debugged lefschetz_element()
25shriya Jan 4, 2025
43f8973
Edited doctests
25shriya Jan 4, 2025
93dd616
Corrected doctests
25shriya Jan 5, 2025
44d0d2d
Edited doctests
25shriya Jan 5, 2025
b2802fa
Merge branch 'develop' into kahler_algebras
25shriya Jan 5, 2025
0448df5
Added doctest for lefschetz_element()
25shriya Jan 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/doc/en/reference/categories/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ Individual Categories
sage/categories/integral_domains
sage/categories/j_trivial_semigroups
sage/categories/kac_moody_algebras
sage/categories/kahler_algebras
sage/categories/lambda_bracket_algebras
sage/categories/lambda_bracket_algebras_with_basis
sage/categories/lattice_posets
Expand Down
130 changes: 130 additions & 0 deletions src/sage/categories/kahler_algebras.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
r"""
Kähler Algebras

AUTHORS:

- Shriya M
"""

25shriya marked this conversation as resolved.
Show resolved Hide resolved
from sage.categories.category_types import Category_over_base_ring
from sage.categories.graded_algebras_with_basis import GradedAlgebrasWithBasis
from sage.misc.abstract_method import abstract_method
from sage.quadratic_forms.quadratic_form import QuadraticForm


class KahlerAlgebras(Category_over_base_ring):
r"""
The category of graded algebras satisfying the Kähler package.

EXAMPLES::

sage: from sage.categories.kahler_algebras import KahlerAlgebras

sage: C = KahlerAlgebras(QQ); C
Category of kahler algebras over Rational Field
sage: sorted(C.super_categories(), key=str)
[Category of graded algebras with basis over Rational Field]

TESTS::

sage: C = KahlerAlgebras(QQ)
sage: TestSuite(C).run()
"""
def super_categories(self):
return [GradedAlgebrasWithBasis(self.base_ring())]

class ParentMethods:
def poincare_pairing(self, el1, el2, r):
r"""
Return the Poincaré pairing of any two elements of the
Kähler algebra.

EXAMPLES::

sage: ch = matroids.Wheel(3).chow_ring(QQ, True, 'atom-free')
sage: A0, A1, A2, A3, A4, A5, A013, A025, A04, A124, A15, A23, A345, A012345 = ch.gens()
sage: u = ch(-1/6*A2*A012345 + 41/48*A012345^2); u
-1/6*A2*A012345 + 41/48*A012345^2
sage: v = ch(-A345^2 - 1/4*A345); v
-A345^2 - 1/4*A345
sage: ch.poincare_pairing(v, u, ch.matroid().rank())
3
"""
hom_components1 = el1.lift().homogeneous_components()
25shriya marked this conversation as resolved.
Show resolved Hide resolved
hom_components2 = el2.lift().homogeneous_components()
new_el = self.base_ring().zero()
for i in hom_components1:
for j in hom_components2:
if i == r - j:
new_el += hom_components1[i] * hom_components2[j]
# the 'else' case is new_el += self.base_ring().zero()
25shriya marked this conversation as resolved.
Show resolved Hide resolved
return new_el.degree()

@abstract_method
def lefschetz_element():
pass

Check warning on line 65 in src/sage/categories/kahler_algebras.py

View check run for this annotation

Codecov / codecov/patch

src/sage/categories/kahler_algebras.py#L65

Added line #L65 was not covered by tests

def hodge_riemann_relations(self, k, r):
tscrim marked this conversation as resolved.
Show resolved Hide resolved
r"""
Return the quadratic form for the corresponding k (< r/2) for the
Kähler algebra.

EXAMPLES::

sage: ch = matroids.Uniform(4,6).chow_ring(QQ, False)
sage: ch.hodge_riemann_relations(1, ch.matroid().rank() - 1)
Quadratic form in 36 variables over Rational Field with coefficients:
[ 3 -1 -1 3 -1 -1 -1 -1 3 -1 -1 -1 -1 -1 -1 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 3 -1 -1 -1 -1 -1 3 ]
[ * 3 -1 3 -1 -1 -1 -1 -1 3 -1 -1 -1 -1 -1 -1 -1 -1 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 3 -1 3 ]
[ * * 3 3 -1 -1 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 3 3 ]
[ * * * 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ]
[ * * * * 3 -1 3 -1 3 -1 -1 -1 -1 -1 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 3 -1 -1 -1 -1 -1 -1 3 ]
[ * * * * * 3 3 -1 -1 3 -1 -1 -1 -1 -1 -1 -1 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 3 -1 -1 3 ]
[ * * * * * * 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ]
[ * * * * * * * 3 3 3 -1 -1 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 3 ]
[ * * * * * * * * 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ]
[ * * * * * * * * * 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ]
[ * * * * * * * * * * 3 -1 3 -1 -1 3 -1 -1 3 -1 -1 -1 -1 -1 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 3 ]
[ * * * * * * * * * * * 3 3 -1 3 -1 -1 3 -1 -1 -1 -1 -1 -1 -1 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 3 ]
[ * * * * * * * * * * * * 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ]
[ * * * * * * * * * * * * * 3 3 3 -1 -1 -1 3 -1 -1 -1 -1 -1 -1 -1 3 -1 -1 -1 -1 -1 -1 -1 3 ]
[ * * * * * * * * * * * * * * 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ]
[ * * * * * * * * * * * * * * * 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ]
[ * * * * * * * * * * * * * * * * 3 3 3 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 3 -1 -1 -1 3 ]
[ * * * * * * * * * * * * * * * * * 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ]
[ * * * * * * * * * * * * * * * * * * 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ]
[ * * * * * * * * * * * * * * * * * * * 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ]
[ * * * * * * * * * * * * * * * * * * * * 3 -1 3 -1 3 -1 -1 -1 -1 3 -1 -1 -1 3 -1 3 ]
[ * * * * * * * * * * * * * * * * * * * * * 3 3 -1 -1 3 -1 -1 3 -1 -1 -1 3 -1 -1 3 ]
[ * * * * * * * * * * * * * * * * * * * * * * 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ]
[ * * * * * * * * * * * * * * * * * * * * * * * 3 3 3 -1 3 -1 -1 -1 3 -1 -1 -1 3 ]
[ * * * * * * * * * * * * * * * * * * * * * * * * 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ]
[ * * * * * * * * * * * * * * * * * * * * * * * * * 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ]
[ * * * * * * * * * * * * * * * * * * * * * * * * * * 3 3 3 3 -1 -1 -1 -1 3 3 ]
[ * * * * * * * * * * * * * * * * * * * * * * * * * * * 3 -1 -1 -1 -1 -1 -1 -1 -1 ]
[ * * * * * * * * * * * * * * * * * * * * * * * * * * * * 3 -1 -1 -1 -1 -1 -1 -1 ]
[ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 3 -1 -1 -1 -1 -1 -1 ]
[ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 3 3 3 3 3 3 ]
[ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 3 -1 -1 -1 -1 ]
[ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 3 -1 -1 -1 ]
[ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 3 -1 -1 ]
[ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 3 -1 ]
[ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 3 ]
sage: ch.hodge_riemann_relations(3, ch.matroid().rank() - 1)
Traceback (most recent call last):
...
ValueError: k must be less than r < 2
"""
if k < (r/2):
tscrim marked this conversation as resolved.
Show resolved Hide resolved
basis_k = []
lefschetz_el = self.lefschetz_element()
for b in self.basis():
if b.homogeneous_degree() == k:
basis_k.append(b)
coeff = []
for i,el in enumerate(basis_k):
for j in range(i, len(basis_k)):
coeff.append((el * (lefschetz_el ** (r-(2*k)) * basis_k[j])).degree())
return QuadraticForm(self.base_ring(), len(basis_k), coeff)
else:
raise ValueError("k must be less than r < 2")
147 changes: 145 additions & 2 deletions src/sage/matroids/chow_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from sage.matroids.chow_ring_ideal import ChowRingIdeal_nonaug, AugmentedChowRingIdeal_fy, AugmentedChowRingIdeal_atom_free
from sage.rings.quotient_ring import QuotientRing_generic
from sage.categories.graded_algebras_with_basis import GradedAlgebrasWithBasis
from sage.categories.kahler_algebras import KahlerAlgebras
from sage.categories.commutative_rings import CommutativeRings


Expand Down Expand Up @@ -96,7 +96,7 @@
self._ideal = AugmentedChowRingIdeal_atom_free(M, R)
else:
self._ideal = ChowRingIdeal_nonaug(M, R)
C = CommutativeRings().Quotients() & GradedAlgebrasWithBasis(R).FiniteDimensional()
C = CommutativeRings().Quotients() & KahlerAlgebras(R).FiniteDimensional()
QuotientRing_generic.__init__(self, R=self._ideal.ring(),
I=self._ideal,
names=self._ideal.ring().variable_names(),
Expand Down Expand Up @@ -197,6 +197,149 @@
monomial_basis = self._ideal.normal_basis()
return Family([self.element_class(self, mon, reduce=False) for mon in monomial_basis])

def flats_generator(self):
r"""
Return the corresponding generators of flats of the Chow ring.
25shriya marked this conversation as resolved.
Show resolved Hide resolved

EXAMPLES::

sage: ch = matroids.catalog.NonFano().chow_ring(ZZ, True, 'atom-free')
sage: ch.flats_generator()
{frozenset({'a'}): Aa,
frozenset({'b'}): Ab,
frozenset({'c'}): Ac,
frozenset({'d'}): Ad,
frozenset({'e'}): Ae,
frozenset({'f'}): Af,
frozenset({'g'}): Ag,
frozenset({'a', 'b', 'f'}): Aabf,
frozenset({'a', 'c', 'e'}): Aace,
frozenset({'a', 'd', 'g'}): Aadg,
frozenset({'b', 'c', 'd'}): Abcd,
frozenset({'b', 'e', 'g'}): Abeg,
frozenset({'c', 'f', 'g'}): Acfg,
frozenset({'d', 'e'}): Ade,
frozenset({'d', 'f'}): Adf,
frozenset({'e', 'f'}): Aef,
frozenset({'a', 'b', 'c', 'd', 'e', 'f', 'g'}): Aabcdefg}
"""
flats = [X for i in range(1, self._matroid.rank() + 1)
for X in self._matroid.flats(i)]
gens = self.gens()
if self._augmented & (self._presentation == 'fy'):
flats_gen = {}
E = list(self.matroid().groundset())
for i,F in enumerate(flats):
flats_gen[F] = gens[len(E) + i]
return flats_gen

Check warning on line 234 in src/sage/matroids/chow_ring.py

View check run for this annotation

Codecov / codecov/patch

src/sage/matroids/chow_ring.py#L230-L234

Added lines #L230 - L234 were not covered by tests
else:
return dict(zip(flats, gens))
25shriya marked this conversation as resolved.
Show resolved Hide resolved

def lefschetz_element(self):
r"""
Return one Lefschetz element of the given Chow ring.

EXAMPLES::

sage: ch = matroids.catalog.P8pp().chow_ring(QQ, False)
sage: ch.lefschetz_element()
-2*Aab - 2*Aac - 2*Aad - 2*Aae - 2*Aaf - 2*Aag - 2*Aah - 2*Abc
- 2*Abd - 2*Abe - 2*Abf - 2*Abg - 2*Abh - 2*Acd - 2*Ace - 2*Acf
- 2*Acg - 2*Ach - 2*Ade - 2*Adf - 2*Adg - 2*Adh - 2*Aef - 2*Aeg
- 2*Aeh - 2*Afg - 2*Afh - 2*Agh - 6*Aabc - 6*Aabd - 6*Aabe
- 12*Aabfh - 6*Aabg - 6*Aacd - 12*Aacef - 12*Aacgh - 12*Aadeg
- 6*Aadf - 6*Aadh - 6*Aaeh - 6*Aafg - 6*Abcd - 12*Abceg
- 6*Abcf - 6*Abch - 12*Abdeh - 12*Abdfg - 6*Abef - 6*Abgh
- 6*Acde - 12*Acdfh - 6*Acdg - 6*Aceh - 6*Acfg - 6*Adef
- 6*Adgh - 6*Aefg - 6*Aefh - 6*Aegh - 6*Afgh - 56*Aabcdefgh

The following example finds the Lefschetz element of the Chow ring
of the uniform matroid of rank 4 on 5 elements (non-augmented).
It is then multiplied with the elements of FY-monomial bases of
different degrees::

sage: ch = matroids.Uniform(4,5).chow_ring(QQ, False)
sage: basis_deg = {}
sage: for b in ch.basis():
....: deg = b.homogeneous_degree()
....: if deg not in basis_deg:
....: basis_deg[deg] = []
....: basis_deg[deg].append(b)
....:
sage: basis_deg
{0: [1], 1: [A02, A12, A01, A012, A03, A13, A013, A23, A023,
A123, A04, A14, A014, A24, A024, A124, A34, A034, A134, A234,
A01234], 2: [A02*A01234, A12*A01234, A01*A01234, A012^2,
A03*A01234, A13*A01234, A013^2, A23*A01234, A023^2, A123^2,
A04*A01234, A14*A01234, A014^2, A24*A01234, A024^2, A124^2,
A34*A01234, A034^2, A134^2, A234^2, A01234^2], 3: [A01234^3]}
sage: g_eq_maps = {}
sage: lefschetz_el = ch.lefschetz_element(); lefschetz_el
-2*A01 - 2*A02 - 2*A03 - 2*A04 - 2*A12 - 2*A13 - 2*A14 - 2*A23
- 2*A24 - 2*A34 - 6*A012 - 6*A013 - 6*A014 - 6*A023 - 6*A024
- 6*A034 - 6*A123 - 6*A124 - 6*A134 - 6*A234 - 20*A01234
sage: for deg in basis_deg:
....: if deg not in g_eq_maps:
....: g_eq_maps[deg] = []
....: g_eq_maps[deg].extend([i*lefschetz_el for i in basis_deg[deg]])
....:
sage: g_eq_maps
{0: [-2*A01 - 2*A02 - 2*A03 - 2*A04 - 2*A12 - 2*A13 - 2*A14
- 2*A23 - 2*A24 - 2*A34 - 6*A012 - 6*A013 - 6*A014 - 6*A023
- 6*A024 - 6*A034 - 6*A123 - 6*A124 - 6*A134 - 6*A234
- 20*A01234], 1: [2*A012^2 + 2*A023^2 + 2*A024^2
- 10*A02*A01234 + 2*A01234^2, 2*A012^2 + 2*A123^2 + 2*A124^2
- 10*A12*A01234 + 2*A01234^2, 2*A012^2 + 2*A013^2 + 2*A014^2
- 10*A01*A01234 + 2*A01234^2, -6*A012^2 + 2*A01*A01234
+ 2*A02*A01234 + 2*A12*A01234, 2*A013^2 + 2*A023^2 + 2*A034^2
- 10*A03*A01234 + 2*A01234^2, 2*A013^2 + 2*A123^2 + 2*A134^2
- 10*A13*A01234 + 2*A01234^2, -6*A013^2 + 2*A01*A01234
+ 2*A03*A01234 + 2*A13*A01234, 2*A023^2 + 2*A123^2 + 2*A234^2
- 10*A23*A01234 + 2*A01234^2, -6*A023^2 + 2*A02*A01234
+ 2*A03*A01234 + 2*A23*A01234, -6*A123^2 + 2*A12*A01234
+ 2*A13*A01234 + 2*A23*A01234, 2*A014^2 + 2*A024^2 + 2*A034^2
- 10*A04*A01234 + 2*A01234^2, 2*A014^2 + 2*A124^2 + 2*A134^2
- 10*A14*A01234 + 2*A01234^2, -6*A014^2 + 2*A01*A01234
+ 2*A04*A01234 + 2*A14*A01234, 2*A024^2 + 2*A124^2 + 2*A234^2
- 10*A24*A01234 + 2*A01234^2, -6*A024^2 + 2*A02*A01234
+ 2*A04*A01234 + 2*A24*A01234, -6*A124^2 + 2*A12*A01234
+ 2*A14*A01234 + 2*A24*A01234, 2*A034^2 + 2*A134^2 + 2*A234^2
- 10*A34*A01234 + 2*A01234^2, -6*A034^2 + 2*A03*A01234
+ 2*A04*A01234 + 2*A34*A01234, -6*A134^2 + 2*A13*A01234
+ 2*A14*A01234 + 2*A34*A01234, -6*A234^2 + 2*A23*A01234
+ 2*A24*A01234 + 2*A34*A01234, -2*A01*A01234 - 2*A02*A01234
- 2*A03*A01234 - 2*A04*A01234 - 2*A12*A01234 - 2*A13*A01234
- 2*A14*A01234 - 2*A23*A01234 - 2*A24*A01234 - 2*A34*A01234
- 20*A01234^2], 2: [2*A01234^3, 2*A01234^3, 2*A01234^3,
6*A01234^3, 2*A01234^3, 2*A01234^3, 6*A01234^3, 2*A01234^3,
6*A01234^3, 6*A01234^3, 2*A01234^3, 2*A01234^3, 6*A01234^3,
2*A01234^3, 6*A01234^3, 6*A01234^3, 2*A01234^3, 6*A01234^3,
6*A01234^3, 6*A01234^3, -20*A01234^3], 3: [0]}

TESTS::

sage: U46 = matroids.Uniform(4,6)
sage: C = U46.chow_ring(QQ, False)
sage: w = C.lefschetz_element(); w
-2*A01 - 2*A02 - 2*A03 - 2*A04 - 2*A05 - 2*A12 - 2*A13 - 2*A14 - 2*A15 - 2*A23 - 2*A24 - 2*A25 - 2*A34 - 2*A35 - 2*A45 - 6*A012 - 6*A013 - 6*A014 - 6*A015 - 6*A023 - 6*A024 - 6*A025 - 6*A034 - 6*A035 - 6*A045 - 6*A123 - 6*A124 - 6*A125 - 6*A134 - 6*A135 - 6*A145 - 6*A234 - 6*A235 - 6*A245 - 6*A345 - 30*A012345
sage: basis_deg = {}
sage: for b in C.basis():
....: deg = b.homogeneous_degree()
....: if deg not in basis_deg:
....: basis_deg[deg] = []
....: basis_deg[deg].append(b)
sage: m = max(basis_deg); m
3
sage: len(basis_deg[1]) == len(basis_deg[2])
True
sage: matrix([(w*b).to_vector() for b in basis_deg[1]]).rank()
36
sage: len(basis_deg[2])
36
"""
w = sum(len(F) * (len(self.matroid().groundset()) - len(F)) * gen for F, gen in self.flats_generator().items())
return w

class Element(QuotientRing_generic.Element):
def to_vector(self, order=None):
r"""
Expand Down
Loading