Skip to content

Commit b2c3894

Browse files
author
Release Manager
committed
gh-37930: Work on `CircuitsMatroid` Various class-specific improvements. Implementation of enumerators (e.g. `in/dependent_r_sets`) and `_closure`. (The methods `bases`, `nonbases`, `circuit_closures`, `flats`, etc., are now much faster.) The changes in `matroid.pyx` are mostly for consistency's sake (enumerators returning a `SetSystem`). URL: #37930 Reported by: gmou3 Reviewer(s): gmou3, Travis Scrimshaw
2 parents 0da8273 + 02a4fc3 commit b2c3894

File tree

5 files changed

+391
-168
lines changed

5 files changed

+391
-168
lines changed

src/sage/algebras/orlik_solomon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def __init__(self, R, M, ordering=None):
132132
self._broken_circuits[frozenset(L[1:])] = L[0]
133133

134134
cat = Algebras(R).FiniteDimensional().WithBasis().Graded()
135-
CombinatorialFreeModule.__init__(self, R, M.no_broken_circuits_sets(ordering),
135+
CombinatorialFreeModule.__init__(self, R, list(M.no_broken_circuits_sets(ordering)),
136136
prefix='OS', bracket='{',
137137
sorting_key=self._sort_key,
138138
category=cat)

src/sage/algebras/orlik_terao.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class OrlikTeraoAlgebra(CombinatorialFreeModule):
2525
r"""
2626
An Orlik-Terao algebra.
2727
28-
Let `R` be a commutative ring. Let `M` be a matroid with ground set
28+
Let `R` be a commutative ring. Let `M` be a matroid with groundset
2929
`X` with some fixed ordering and representation `A = (a_x)_{x \in X}`
3030
(so `a_x` is a (column) vector). Let `C(M)` denote the set of circuits
3131
of `M`. Let `P` denote the quotient algebra `R[e_x \mid x \in X] /
@@ -65,7 +65,7 @@ class OrlikTeraoAlgebra(CombinatorialFreeModule):
6565
6666
- ``R`` -- the base ring
6767
- ``M`` -- the defining matroid
68-
- ``ordering`` -- (optional) an ordering of the ground set
68+
- ``ordering`` -- (optional) an ordering of the groundset
6969
7070
EXAMPLES:
7171
@@ -164,7 +164,7 @@ def __init__(self, R, M, ordering=None):
164164
self._broken_circuits[frozenset(L[1:])] = L[0]
165165

166166
cat = Algebras(R).FiniteDimensional().Commutative().WithBasis().Graded()
167-
CombinatorialFreeModule.__init__(self, R, M.no_broken_circuits_sets(ordering),
167+
CombinatorialFreeModule.__init__(self, R, list(M.no_broken_circuits_sets(ordering)),
168168
prefix='OT', bracket='{',
169169
sorting_key=self._sort_key,
170170
category=cat)
@@ -252,7 +252,7 @@ def algebra_generators(self):
252252
r"""
253253
Return the algebra generators of ``self``.
254254
255-
These form a family indexed by the ground set `X` of `M`. For
255+
These form a family indexed by the groundset `X` of `M`. For
256256
each `x \in X`, the `x`-th element is `e_x`.
257257
258258
EXAMPLES::
@@ -323,7 +323,7 @@ def product_on_basis(self, a, b):
323323
TESTS:
324324
325325
Let us check that `e_{s_1} e_{s_2} \cdots e_{s_k} = e_S` for any
326-
subset `S = \{ s_1 < s_2 < \cdots < s_k \}` of the ground set::
326+
subset `S = \{ s_1 < s_2 < \cdots < s_k \}` of the groundset::
327327
328328
sage: # needs sage.graphs
329329
sage: G = Graph([[1,2],[1,2],[2,3],[3,4],[4,2]], multiedges=True)
@@ -355,11 +355,11 @@ def product_on_basis(self, a, b):
355355
def subset_image(self, S):
356356
r"""
357357
Return the element `e_S` of ``self`` corresponding to a
358-
subset ``S`` of the ground set of the defining matroid.
358+
subset ``S`` of the groundset of the defining matroid.
359359
360360
INPUT:
361361
362-
- ``S`` -- a frozenset which is a subset of the ground set of `M`
362+
- ``S`` -- a frozenset which is a subset of the groundset of `M`
363363
364364
EXAMPLES::
365365

src/sage/matroids/circuits_matroid.pxd

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,30 @@ from sage.matroids.matroid cimport Matroid
22
from sage.matroids.set_system cimport SetSystem
33

44
cdef class CircuitsMatroid(Matroid):
5-
cdef frozenset _groundset # _E
6-
cdef int _matroid_rank # _R
7-
cdef SetSystem _C # circuits
5+
cdef frozenset _groundset
6+
cdef int _matroid_rank
7+
cdef set _C # circuits
88
cdef dict _k_C # k-circuits (k=len)
9+
cdef list _sorted_C_lens
910
cdef bint _nsc_defined
1011
cpdef groundset(self)
1112
cpdef _rank(self, X)
1213
cpdef full_rank(self)
13-
cpdef _is_independent(self, F)
14-
cpdef _max_independent(self, F)
15-
cpdef _circuit(self, F)
14+
cpdef _is_independent(self, X)
15+
cpdef _max_independent(self, X)
16+
cpdef _circuit(self, X)
17+
cpdef _closure(self, X)
1618

1719
# enumeration
1820
cpdef bases(self)
21+
cpdef nonbases(self)
22+
cpdef independent_r_sets(self, long r)
23+
cpdef dependent_r_sets(self, long r)
1924
cpdef circuits(self, k=*)
2025
cpdef nonspanning_circuits(self)
21-
cpdef no_broken_circuits_sets(self, ordering=*)
26+
cpdef no_broken_circuits_facets(self, ordering=*, reduced=*)
27+
cpdef no_broken_circuits_sets(self, ordering=*, reduced=*)
28+
cpdef broken_circuit_complex(self, ordering=*, reduced=*)
2229

2330
# properties
2431
cpdef girth(self)

0 commit comments

Comments
 (0)