-
-
Notifications
You must be signed in to change notification settings - Fork 480
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)) |