Families of Manifold Objects#

The class ManifoldObjectFiniteFamily is a subclass of FiniteFamily that provides an associative container of manifold objects, indexed by their _name attributes.

ManifoldObjectFiniteFamily instances are totally ordered according to their lexicographically ordered element names.

The subclass ManifoldSubsetFiniteFamily customizes the print representation further.

AUTHORS:

  • Matthias Koeppe (2021): initial version

class sage.manifolds.family.ManifoldObjectFiniteFamily(objects=(), keys=None)#

Bases: FiniteFamily

Finite family of manifold objects, indexed by their names.

The class ManifoldObjectFiniteFamily inherits from FiniteFamily. Therefore it is an associative container.

It provides specialized __repr__ and _latex_ methods.

ManifoldObjectFiniteFamily instances are totally ordered according to their lexicographically ordered element names.

EXAMPLES:

sage: from sage.manifolds.family import ManifoldObjectFiniteFamily
sage: M = Manifold(2, 'M', structure='topological')
sage: A = M.subset('A')
sage: B = M.subset('B')
sage: C = B.subset('C')
sage: F = ManifoldObjectFiniteFamily([A, B, C]); F
Set {A, B, C} of objects of the 2-dimensional topological manifold M
sage: latex(F)
\{A, B, C\}
sage: F['B']
Subset B of the 2-dimensional topological manifold M

All objects must have the same base manifold:

sage: N = Manifold(2, 'N', structure='topological')
sage: ManifoldObjectFiniteFamily([M, N])
Traceback (most recent call last):
...
TypeError: all objects must have the same manifold
class sage.manifolds.family.ManifoldSubsetFiniteFamily(objects=(), keys=None)#

Bases: ManifoldObjectFiniteFamily

Finite family of subsets of a topological manifold, indexed by their names.

The class ManifoldSubsetFiniteFamily inherits from ManifoldObjectFiniteFamily. It provides an associative container with specialized __repr__ and _latex_ methods.

ManifoldSubsetFiniteFamily instances are totally ordered according to their lexicographically ordered element (subset) names.

EXAMPLES:

sage: from sage.manifolds.family import ManifoldSubsetFiniteFamily
sage: M = Manifold(2, 'M', structure='topological')
sage: A = M.subset('A')
sage: B = M.subset('B')
sage: C = B.subset('C')
sage: ManifoldSubsetFiniteFamily([A, B, C])
Set {A, B, C} of subsets of the 2-dimensional topological manifold M
sage: latex(_)
\{A, B, C\}

All subsets must have the same base manifold:

sage: N = Manifold(2, 'N', structure='topological')
sage: ManifoldSubsetFiniteFamily([M, N])
Traceback (most recent call last):
...
TypeError: all open subsets must have the same manifold
classmethod from_subsets_or_families(*subsets_or_families)#

Construct a ManifoldSubsetFiniteFamily from given subsets or iterables of subsets.

EXAMPLES:

sage: from sage.manifolds.family import ManifoldSubsetFiniteFamily
sage: M = Manifold(2, 'M', structure='topological')
sage: A = M.subset('A')
sage: Bs = (M.subset(f'B{i}') for i in range(5))
sage: Cs = ManifoldSubsetFiniteFamily([M.subset('C0'), M.subset('C1')])
sage: ManifoldSubsetFiniteFamily.from_subsets_or_families(A, Bs, Cs)
Set {A, B0, B1, B2, B3, B4, C0, C1} of subsets of the 2-dimensional topological manifold M