Skip to content

Commit

Permalink
Debugged __init__() function of Chow ring class
Browse files Browse the repository at this point in the history
  • Loading branch information
25shriya committed Jun 26, 2024
1 parent 873d9a7 commit 529bb10
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions src/sage/matroids/chow_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,27 @@
from sage.categories.graded_algebras_with_basis import GradedAlgebrasWithBasis
import sage.misc.latex as latex

#chow rings class needs to be written properly
#gens of chow ring ideal must be debugged
#gb must be a poly sequence
#commented and documented
#use is_groebner()
#matroids - try all of them


class ChowRing(QuotientRing_nc):
def __init__(self, R, M):
def __init__(self, R, M, augmented):
self._matroid = M
self._ideal = ChowRingIdeal(M, R)
self.poly_ring = self._ideal.poly_ring
QuotientRing_nc.__init__(self, R=R, I=self._ideal, names=self.poly_ring.variable_names, category=GradedAlgebrasWithBasis)
self._augmented = augmented
if augmented:
self._ideal = AugmentedChowRingIdeal(M, R)
else:
self._ideal = ChowRingIdeal(M, R) #check method to get ring
QuotientRing_nc.__init__(self, R=self._ideal.poly_ring, I=self._ideal, names=self.poly_ring.variable_names(), category=GradedAlgebrasWithBasis(R))

def _repr_short(self):
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))

class AugmentedChowRing(QuotientRing_nc):
def __init__(self, R, M):
self._matroid = M
self._ideal = AugmentedChowRingIdeal(M, R)
self.poly_ring = self._ideal.poly_ring
QuotientRing_nc.__init__(self, R, self._ideal, names=self.poly_ring.variable_names, category=GradedAlgebrasWithBasis)

def _repr_short(self):
return "Chow ring of {}".format(self._matroid)

def _latex_(self):
return "%s/%s" % (latex.latex(self.poly_ring), latex.latex(self._ideal))

0 comments on commit 529bb10

Please sign in to comment.