Skip to content

Commit 55cc69b

Browse files
committed
Add is_(sparse_)paving() and automorphism_group()
1 parent b002b63 commit 55cc69b

File tree

2 files changed

+94
-1
lines changed

2 files changed

+94
-1
lines changed

src/sage/matroids/matroid.pxd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ cdef class Matroid(SageObject):
175175
cpdef _is_3connected_CE(self, certificate=*) noexcept
176176
cpdef _is_3connected_BC(self, certificate=*) noexcept
177177
cpdef _is_3connected_BC_recursion(self, basis, fund_cocircuits) noexcept
178+
cpdef is_paving(self) noexcept
179+
cpdef is_sparse_paving(self) noexcept
178180

179181
# representability
180182
cpdef _local_binary_matroid(self, basis=*) noexcept
@@ -213,6 +215,7 @@ cdef class Matroid(SageObject):
213215
cpdef flat_cover(self, solver=*, verbose=*, integrality_tolerance=*) noexcept
214216

215217
# misc
218+
cpdef automorphism_group(self) noexcept
216219
cpdef bergman_complex(self) noexcept
217220
cpdef augmented_bergman_complex(self) noexcept
218221

src/sage/matroids/matroid.pyx

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ additional functionality (e.g. linear extensions).
109109
- :meth:`is_4connected() <sage.matroids.matroid.Matroid.is_4connected>`
110110
- :meth:`is_kconnected() <sage.matroids.matroid.Matroid.is_kconnected>`
111111
- :meth:`connectivity() <sage.matroids.matroid.Matroid.connectivity>`
112+
- :meth:`is_paving() <sage.matroids.matroid.Matroid.is_paving>`
113+
- :meth:`is_sparse_paving() <sage.matroids.matroid.Matroid.is_sparse_paving>`
112114
113115
- Representation
114116
- :meth:`binary_matroid() <sage.matroids.matroid.Matroid.binary_matroid>`
@@ -133,9 +135,10 @@ additional functionality (e.g. linear extensions).
133135
134136
- Construction
135137
- :meth:`union() <sage.matroids.matroid.Matroid.union>`
136-
- :math:`direct_sum() <sage.matroids.matroid.Matroid.direct_sum>`
138+
- :meth:`direct_sum() <sage.matroids.matroid.Matroid.direct_sum>`
137139
138140
- Misc
141+
- :meth:`automorphism_group() <sage.matroids.matroid.Matroid.automorphism_group>`
139142
- :meth:`broken_circuit_complex() <sage.matroids.matroid.Matroid.broken_circuit_complex>`
140143
- :meth:`chow_ring() <sage.matroids.matroid.Matroid.chow_ring>`
141144
- :meth:`matroid_polytope() <sage.matroids.matroid.Matroid.matroid_polytope>`
@@ -5953,6 +5956,57 @@ cdef class Matroid(SageObject):
59535956
return False
59545957
return True
59555958

5959+
cpdef is_paving(self) noexcept:
5960+
"""
5961+
Return if ``self`` is paving.
5962+
5963+
A matroid is paving if each of its circuits has size `r` or `r+1`.
5964+
5965+
OUTPUT:
5966+
5967+
a Boolean
5968+
5969+
EXAMPLES::
5970+
5971+
sage: M = matroids.named_matroids.Vamos()
5972+
sage: M.is_paving()
5973+
True
5974+
5975+
"""
5976+
for C in self.circuits():
5977+
if len(C) < self.rank():
5978+
return False
5979+
return True
5980+
5981+
cpdef is_sparse_paving(self) noexcept:
5982+
"""
5983+
Return if ``self`` is sparse-paving.
5984+
5985+
A matroid is sparse-paving if the symmetric difference of every pair
5986+
of circuits is greater than 2.
5987+
5988+
OUTPUT:
5989+
5990+
a Boolean
5991+
5992+
EXAMPLES::
5993+
5994+
sage: M = matroids.named_matroids.Vamos()
5995+
sage: M.is_sparse_paving()
5996+
False
5997+
sage: M = matroids.named_matroids.Fano()
5998+
sage: M.is_sparse_paving()
5999+
True
6000+
6001+
"""
6002+
if not self.is_paving():
6003+
return False
6004+
from itertools import combinations
6005+
for (C1, C2) in combinations(self.circuits(), 2):
6006+
if len(C1 ^ C2) <= 2:
6007+
return False
6008+
return True
6009+
59566010
# representability
59576011

59586012
cpdef _local_binary_matroid(self, basis=None) noexcept:
@@ -7916,6 +7970,42 @@ cdef class Matroid(SageObject):
79167970
from sage.topology.simplicial_complex import SimplicialComplex
79177971
return SimplicialComplex(self.no_broken_circuits_sets(ordering))
79187972

7973+
cpdef automorphism_group(self) noexcept:
7974+
r"""
7975+
Return the automorphism group of ``self``.
7976+
7977+
For a matroid `M`, an automorphism is a permutation `\sigma` of `E(M)`
7978+
(the groundset) such that `r(X) = r(\sigma(X))` for all `X \subseteq
7979+
E(M)`. The set of automorphisms of `M` forms a group under composition.
7980+
This automorphism group is transitive if, for every two elements `x`
7981+
and `y` of `M`, there is an automorphism that maps `x` to `y`.
7982+
7983+
EXAMPLES::
7984+
7985+
sage: M = matroids.named_matroids.Fano()
7986+
sage: G = M.automorphism_group()
7987+
sage: G.is_transitive()
7988+
True
7989+
sage: G.structure_description()
7990+
'PSL(3,2)'
7991+
sage: M = matroids.named_matroids.P8pp()
7992+
sage: M.automorphism_group().is_transitive()
7993+
True
7994+
sage: M = matroids.named_matroids.ExtendedTernaryGolayCode()
7995+
sage: G = M.automorphism_group()
7996+
sage: G.is_transitive()
7997+
True
7998+
sage: G.structure_description()
7999+
'M12'
8000+
8001+
REFERENCES:
8002+
8003+
[Oxl2011], p. 189.
8004+
8005+
"""
8006+
from sage.topology.simplicial_complex import SimplicialComplex
8007+
return SimplicialComplex(self.bases()).automorphism_group()
8008+
79198009
cpdef bergman_complex(self) noexcept:
79208010
r"""
79218011
Return the Bergman complex of ``self``.

0 commit comments

Comments
 (0)