From 462ce6c0c25d916a85dba2e54963c4bb0dc30ca6 Mon Sep 17 00:00:00 2001 From: Shriya M <25shriya@gmail.com> Date: Sun, 23 Jun 2024 14:47:36 +0530 Subject: [PATCH] Created Chow Ring class --- src/sage/matroids/chow_ring.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/sage/matroids/chow_ring.py diff --git a/src/sage/matroids/chow_ring.py b/src/sage/matroids/chow_ring.py new file mode 100644 index 00000000000..0498307f491 --- /dev/null +++ b/src/sage/matroids/chow_ring.py @@ -0,0 +1,18 @@ +from sage.matroids.chow_ring_ideal import * +from sage.rings.quotient_ring import QuotientRing_nc +from sage.rings.quotient_ring_element import QuotientRingElement +from sage.categories.graded_algebras_with_basis import GradedAlgebrasWithBasis +import sage.misc.latex as latex + +class ChowRing(QuotientRing_nc, category=GradedAlgebrasWithBasis): + def __init__(self, R, M): + self._matroid = M + self._ideal = ChowRingIdeal(M, R) + self.poly_ring = self._ideal.poly_ring + QuotientRing_nc.__init__(R, self._ideal, names=self.poly_ring.variable_names, category=GradedAlgebrasWithBasis) + + def _repr_(self): + return "Chow ring of {}".format(self._matroid) + + def _latex_(self): + return "%s/%s" % (latex.latex(self.poly_ring), latex.latex(self._ideal)) \ No newline at end of file