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

Merged
merged 46 commits into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 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
7a2ae3f
Edited documentation
25shriya Jan 9, 2025
cccf433
Edited documentation
25shriya Jan 9, 2025
6937925
Edited top_degree() methd
25shriya Jan 9, 2025
7a23525
Formatted documentation
25shriya Jan 9, 2025
cac2378
Edited doctest
25shriya Jan 9, 2025
5413804
Edited meson.build
25shriya Jan 11, 2025
78dfd70
Edited meson.build
25shriya Jan 12, 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
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/
# ****************************************************************************

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.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
Loading