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)[source]¶
Bases:
FiniteFamily
Finite family of manifold objects, indexed by their names.
The class
ManifoldObjectFiniteFamily
inherits fromFiniteFamily
. 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
>>> from sage.all import * >>> from sage.manifolds.family import ManifoldObjectFiniteFamily >>> M = Manifold(Integer(2), 'M', structure='topological') >>> A = M.subset('A') >>> B = M.subset('B') >>> C = B.subset('C') >>> F = ManifoldObjectFiniteFamily([A, B, C]); F Set {A, B, C} of objects of the 2-dimensional topological manifold M >>> latex(F) \{A, B, C\} >>> 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
>>> from sage.all import * >>> N = Manifold(Integer(2), 'N', structure='topological') >>> ManifoldObjectFiniteFamily([M, N]) Traceback (most recent call last): ... TypeError: all objects must have the same manifold
- class sage.manifolds.family.ManifoldSubsetFiniteFamily(objects=(), keys=None)[source]¶
Bases:
ManifoldObjectFiniteFamily
Finite family of subsets of a topological manifold, indexed by their names.
The class
ManifoldSubsetFiniteFamily
inherits fromManifoldObjectFiniteFamily
. 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\}
>>> from sage.all import * >>> from sage.manifolds.family import ManifoldSubsetFiniteFamily >>> M = Manifold(Integer(2), 'M', structure='topological') >>> A = M.subset('A') >>> B = M.subset('B') >>> C = B.subset('C') >>> ManifoldSubsetFiniteFamily([A, B, C]) Set {A, B, C} of subsets of the 2-dimensional topological manifold M >>> 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
>>> from sage.all import * >>> N = Manifold(Integer(2), 'N', structure='topological') >>> 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)[source]¶
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
>>> from sage.all import * >>> from sage.manifolds.family import ManifoldSubsetFiniteFamily >>> M = Manifold(Integer(2), 'M', structure='topological') >>> A = M.subset('A') >>> Bs = (M.subset(f'B{i}') for i in range(Integer(5))) >>> Cs = ManifoldSubsetFiniteFamily([M.subset('C0'), M.subset('C1')]) >>> 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