diff --git a/src/sage/matroids/matroid.pxd b/src/sage/matroids/matroid.pxd index 6c385f10e32..4644daddf1b 100644 --- a/src/sage/matroids/matroid.pxd +++ b/src/sage/matroids/matroid.pxd @@ -175,6 +175,8 @@ cdef class Matroid(SageObject): cpdef _is_3connected_CE(self, certificate=*) noexcept cpdef _is_3connected_BC(self, certificate=*) noexcept cpdef _is_3connected_BC_recursion(self, basis, fund_cocircuits) noexcept + cpdef is_paving(self) noexcept + cpdef is_sparse_paving(self) noexcept # representability cpdef _local_binary_matroid(self, basis=*) noexcept @@ -213,6 +215,7 @@ cdef class Matroid(SageObject): cpdef flat_cover(self, solver=*, verbose=*, integrality_tolerance=*) noexcept # misc + cpdef automorphism_group(self) noexcept cpdef bergman_complex(self) noexcept cpdef augmented_bergman_complex(self) noexcept diff --git a/src/sage/matroids/matroid.pyx b/src/sage/matroids/matroid.pyx index ed971cb8349..245e4191a20 100644 --- a/src/sage/matroids/matroid.pyx +++ b/src/sage/matroids/matroid.pyx @@ -109,6 +109,8 @@ additional functionality (e.g. linear extensions). - :meth:`is_4connected() ` - :meth:`is_kconnected() ` - :meth:`connectivity() ` + - :meth:`is_paving() ` + - :meth:`is_sparse_paving() ` - Representation - :meth:`binary_matroid() ` @@ -133,9 +135,10 @@ additional functionality (e.g. linear extensions). - Construction - :meth:`union() ` - - :math:`direct_sum() ` + - :meth:`direct_sum() ` - Misc + - :meth:`automorphism_group() ` - :meth:`broken_circuit_complex() ` - :meth:`chow_ring() ` - :meth:`matroid_polytope() ` @@ -5953,6 +5956,55 @@ cdef class Matroid(SageObject): return False return True + cpdef is_paving(self) noexcept: + """ + Return if ``self`` is paving. + + A matroid is paving if each of its circuits has size `r` or `r+1`. + + OUTPUT: + + boolean + + EXAMPLES:: + + sage: M = matroids.named_matroids.Vamos() + sage: M.is_paving() + True + """ + for C in self.circuits(): + if len(C) < self.rank(): + return False + return True + + cpdef is_sparse_paving(self) noexcept: + """ + Return if ``self`` is sparse-paving. + + A matroid is sparse-paving if the symmetric difference of every pair + of circuits is greater than 2. + + OUTPUT: + + boolean + + EXAMPLES:: + + sage: M = matroids.named_matroids.Vamos() + sage: M.is_sparse_paving() + False + sage: M = matroids.named_matroids.Fano() + sage: M.is_sparse_paving() + True + """ + if not self.is_paving(): + return False + from itertools import combinations + for (C1, C2) in combinations(self.circuits(), 2): + if len(C1 ^ C2) <= 2: + return False + return True + # representability cpdef _local_binary_matroid(self, basis=None) noexcept: @@ -7916,6 +7968,41 @@ cdef class Matroid(SageObject): from sage.topology.simplicial_complex import SimplicialComplex return SimplicialComplex(self.no_broken_circuits_sets(ordering)) + cpdef automorphism_group(self) noexcept: + r""" + Return the automorphism group of ``self``. + + For a matroid `M`, an automorphism is a permutation `\sigma` of `E(M)` + (the groundset) such that `r(X) = r(\sigma(X))` for all `X \subseteq + E(M)`. The set of automorphisms of `M` forms a group under composition. + This automorphism group is transitive if, for every two elements `x` + and `y` of `M`, there is an automorphism that maps `x` to `y`. + + EXAMPLES:: + + sage: M = matroids.named_matroids.Fano() + sage: G = M.automorphism_group() + sage: G.is_transitive() + True + sage: G.structure_description() + 'PSL(3,2)' + sage: M = matroids.named_matroids.P8pp() + sage: M.automorphism_group().is_transitive() + True + sage: M = matroids.named_matroids.ExtendedTernaryGolayCode() + sage: G = M.automorphism_group() + sage: G.is_transitive() + True + sage: G.structure_description() + 'M12' + + REFERENCES: + + [Oxl2011]_, p. 189. + """ + from sage.topology.simplicial_complex import SimplicialComplex + return SimplicialComplex(self.bases()).automorphism_group() + cpdef bergman_complex(self) noexcept: r""" Return the Bergman complex of ``self``.