Skip to content

Commit

Permalink
sagemathgh-39168: Addition of Kähler algebras as a category
Browse files Browse the repository at this point in the history
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

This PR adds Kähler algebras as a category `KahlerAlgebras` as defined
in Theorem 2.28 of [this paper](https://arxiv.org/abs/2309.14312). It
changes the category of Chow rings to `KahlerAlgebras() &
CommutativeRings().Quotients()`. A method, `lefschetz_element()` is also
implemented for Chow rings which returns a Lefschetz element as provided
in Corollary 2.30 of the paper above, which is used for the Hodge-
Riemann relations computation.

@tscrim

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.
- [x] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#39168
Reported by: 25shriya
Reviewer(s): 25shriya, Travis Scrimshaw
  • Loading branch information
Release Manager committed Jan 15, 2025
2 parents f88b4e5 + 78dfd70 commit f8ce139
Show file tree
Hide file tree
Showing 7 changed files with 402 additions and 10 deletions.
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
5 changes: 3 additions & 2 deletions src/sage/categories/category_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,13 @@ def _test_category_over_bases(self, **options):
"""
tester = self._tester(**options)
from sage.categories.category_singleton import Category_singleton

from sage.categories.category_with_axiom import CategoryWithAxiom_over_base_ring
from .bimodules import Bimodules
from .schemes import Schemes
for cat in self.super_categories():
tester.assertTrue(isinstance(cat, (Category_singleton, Category_over_base,
Bimodules, Schemes)),
CategoryWithAxiom_over_base_ring,
Bimodules, Schemes)),
"The super categories of a category over base should"
" be a category over base (or the related Bimodules)"
" or a singleton category")
Expand Down
19 changes: 19 additions & 0 deletions src/sage/categories/graded_algebras_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from sage.categories.graded_modules import GradedModulesCategory
from sage.categories.signed_tensor import SignedTensorProductsCategory, tensor_signed
from sage.misc.cachefunc import cached_method
from sage.categories.category_with_axiom import CategoryWithAxiom_over_base_ring


class GradedAlgebrasWithBasis(GradedModulesCategory):
Expand Down Expand Up @@ -154,6 +155,24 @@ def formal_series_ring(self):
class ElementMethods:
pass

class FiniteDimensional(CategoryWithAxiom_over_base_ring):
class ParentMethods:
@cached_method
def top_degree(self):
r"""
Return the top degree of the finite dimensional graded algebra.
EXAMPLES::
sage: ch = matroids.Uniform(4,6).chow_ring(QQ, False)
sage: ch.top_degree()
3
sage: ch = matroids.Wheel(3).chow_ring(QQ, True, 'atom-free')
sage: ch.top_degree()
3
"""
return max(b.degree() for b in self.basis())

class SignedTensorProducts(SignedTensorProductsCategory):
"""
The category of algebras with basis constructed by signed tensor
Expand Down
200 changes: 200 additions & 0 deletions src/sage/categories/kahler_algebras.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
r"""
Kähler Algebras
AUTHORS:
- 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
from sage.categories.finite_dimensional_algebras_with_basis import FiniteDimensionalAlgebrasWithBasis
from sage.categories.filtered_modules_with_basis import FilteredModulesWithBasis
from sage.misc.abstract_method import abstract_method
from sage.quadratic_forms.quadratic_form import QuadraticForm
from sage.misc.cachefunc import cached_method


class KahlerAlgebras(Category_over_base_ring):
r"""
The category of graded algebras satisfying the Kähler package.
A finite-dimensional graded algebra `\bigoplus_{k=1}^{r}A^k` satisfies
the *Kähler package* if the following properties hold:
- Poincaré duality: There exists a perfect `\ZZ`-bilinear pairing
given by
.. MATH::
A^k \times A^{r-k} \longrightarrow \ZZ \\
(a,b) \mapsto \deg(a \cdot b).
- Hard-Lefschetz Theorem: The graded algebra contains *Lefschetz elements*
`\omega \in A^{1}_{\RR}` such that multiplication by `\omega` is
an injection from `A^k_{\RR} \longrightarrow A^{k+1}_{\RR}`
for all `k < \frac{r}{2}`.
- Hodge-Riemann-Minikowski Relations: Every Lefchetz element `\omega`,
define quadratic forms on `A^{k}_{\RR}` given by
.. MATH::
a \mapsto (-1)^k \deg(a \cdot \omega^{r-2k} \cdot a)
This quadratic form becomes positive definite upon restriction to the
kernel of the following map
.. MATH::
A^k_\RR \longrightarrow A^{r-k+1}_\RR \\
a \mapsto a \cdot \omega^{r-2k+1}.
REFERENCES:
- [ANR2023]_
TESTS::
sage: from sage.categories.kahler_algebras import KahlerAlgebras
sage: C = KahlerAlgebras(QQ)
sage: TestSuite(C).run()
"""
def super_categories(self):
r"""
Return the super categories of ``self``.
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 finite dimensional graded algebras with basis over
Rational Field]
"""
return [GradedAlgebrasWithBasis(self.base_ring()).FiniteDimensional()]

class ParentMethods:
@abstract_method
def poincare_pairing(self, a, b):
r"""
Return the Poincaré pairing of two elements of the Kähler algebra.
EXAMPLES::
sage: ch = matroids.catalog.Fano().chow_ring(QQ, True, 'fy')
sage: Ba, Bb, Bc, Bd, Be, Bf, Bg, Babf, Bace, Badg, Bbcd, Bbeg, Bcfg, Bdef, Babcdefg = ch.gens()[8:]
sage: u = ch(-Babf^2 + Bcfg^2 - 8/7*Bc*Babcdefg + 1/2*Bd*Babcdefg - Bf*Babcdefg - Bg*Babcdefg); u
-Babf^2 + Bcfg^2 - 8/7*Bc*Babcdefg + 1/2*Bd*Babcdefg - Bf*Babcdefg - Bg*Babcdefg
sage: v = ch(Bg - 2/37*Babf + Badg + Bbeg + Bcfg + Babcdefg); v
Bg - 2/37*Babf + Badg + Bbeg + Bcfg + Babcdefg
sage: ch.poincare_pairing(v, u)
3
"""

@abstract_method
def lefschetz_element(self):
r"""
Return one Lefschetz element of the given Kähler algebra.
EXAMPLES::
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
"""

def hodge_riemann_relations(self, k):
r"""
Return the quadratic form for the corresponding ``k``
(`< \frac{r}{2}`) for the Kähler algebra, where `r` is the top degree.
EXAMPLES::
sage: ch = matroids.Uniform(4, 6).chow_ring(QQ, False)
sage: ch.hodge_riemann_relations(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)
Traceback (most recent call last):
...
ValueError: k must be less than r/2 < 2
"""
r = self.top_degree()
if k > (r/2):
raise ValueError("k must be less than r/2 < 2")
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)
1 change: 1 addition & 0 deletions src/sage/categories/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ py.install_sources(
'isomorphic_objects.py',
'j_trivial_semigroups.py',
'kac_moody_algebras.py',
'kahler_algebras.py',
'l_trivial_semigroups.py',
'lambda_bracket_algebras.py',
'lambda_bracket_algebras_with_basis.py',
Expand Down
Loading

0 comments on commit f8ce139

Please sign in to comment.