Skip to content

Commit

Permalink
Formatted documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
25shriya committed Jan 9, 2025
1 parent 6937925 commit 7a23525
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 35 deletions.
20 changes: 10 additions & 10 deletions src/sage/categories/kahler_algebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
- Shriya M
"""
# ****************************************************************************
# Copyright (C) 2024 Shriya M <25shriya at gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# https://www.gnu.org/licenses/
# ****************************************************************************

from sage.categories.category_types import Category_over_base_ring
from sage.categories.graded_algebras_with_basis import GradedAlgebrasWithBasis
Expand All @@ -15,15 +24,6 @@
from sage.misc.cachefunc import cached_method


# ****************************************************************************
# Copyright (C) 2024 Shriya M <25shriya at gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# https://www.gnu.org/licenses/
# ****************************************************************************
class KahlerAlgebras(Category_over_base_ring):
r"""
The category of graded algebras satisfying the Kähler package.
Expand Down Expand Up @@ -134,7 +134,7 @@ def lefschetz_element(self):

def hodge_riemann_relations(self, k):
r"""
Return the quadratic form for the corresponding ``k``
Return the quadratic form for the corresponding ``k``
(`< \frac{r}{2}`) for the Kähler algebra, where `r` is the top degree.
EXAMPLES::
Expand Down
34 changes: 9 additions & 25 deletions src/sage/matroids/chow_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
- Shriya M
"""
# ****************************************************************************
# Copyright (C) 2024 Shriya M <25shriya at gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# https://www.gnu.org/licenses/
# ****************************************************************************

from sage.matroids.chow_ring_ideal import ChowRingIdeal_nonaug, AugmentedChowRingIdeal_fy, AugmentedChowRingIdeal_atom_free
from sage.rings.quotient_ring import QuotientRing_generic
Expand Down Expand Up @@ -284,31 +293,6 @@ def lefschetz_element(self):
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.defining_ideal().flats_to_generator_dict().items())
Expand Down
9 changes: 9 additions & 0 deletions src/sage/matroids/chow_ring_ideal.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
- Shriya M
"""
# ****************************************************************************
# Copyright (C) 2024 Shriya M <25shriya at gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# https://www.gnu.org/licenses/
# ****************************************************************************

from sage.rings.polynomial.multi_polynomial_ideal import MPolynomialIdeal
from sage.matroids.utilities import cmp_elements_key
Expand Down

0 comments on commit 7a23525

Please sign in to comment.