passagemath-symbolics 10.8.1a1__cp314-cp314t-musllinux_1_2_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- passagemath_symbolics/__init__.py +3 -0
- passagemath_symbolics-10.8.1a1.dist-info/METADATA +186 -0
- passagemath_symbolics-10.8.1a1.dist-info/RECORD +181 -0
- passagemath_symbolics-10.8.1a1.dist-info/WHEEL +5 -0
- passagemath_symbolics-10.8.1a1.dist-info/top_level.txt +3 -0
- sage/all__sagemath_symbolics.py +17 -0
- sage/calculus/all.py +14 -0
- sage/calculus/calculus.py +2838 -0
- sage/calculus/desolvers.py +1864 -0
- sage/calculus/predefined.py +51 -0
- sage/calculus/tests.py +225 -0
- sage/calculus/var.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/calculus/var.pyx +401 -0
- sage/dynamics/all__sagemath_symbolics.py +6 -0
- sage/dynamics/complex_dynamics/all.py +5 -0
- sage/dynamics/complex_dynamics/mandel_julia.py +765 -0
- sage/dynamics/complex_dynamics/mandel_julia_helper.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/dynamics/complex_dynamics/mandel_julia_helper.pyx +1034 -0
- sage/ext/all__sagemath_symbolics.py +1 -0
- sage/ext_data/kenzo/CP2.txt +45 -0
- sage/ext_data/kenzo/CP3.txt +349 -0
- sage/ext_data/kenzo/CP4.txt +4774 -0
- sage/ext_data/kenzo/README.txt +49 -0
- sage/ext_data/kenzo/S4.txt +20 -0
- sage/ext_data/magma/latex/latex.m +1021 -0
- sage/ext_data/magma/latex/latex.spec +1 -0
- sage/ext_data/magma/sage/basic.m +356 -0
- sage/ext_data/magma/sage/sage.spec +1 -0
- sage/ext_data/magma/spec +9 -0
- sage/geometry/all__sagemath_symbolics.py +8 -0
- sage/geometry/hyperbolic_space/all.py +5 -0
- sage/geometry/hyperbolic_space/hyperbolic_coercion.py +755 -0
- sage/geometry/hyperbolic_space/hyperbolic_constants.py +5 -0
- sage/geometry/hyperbolic_space/hyperbolic_geodesic.py +2419 -0
- sage/geometry/hyperbolic_space/hyperbolic_interface.py +206 -0
- sage/geometry/hyperbolic_space/hyperbolic_isometry.py +1083 -0
- sage/geometry/hyperbolic_space/hyperbolic_model.py +1502 -0
- sage/geometry/hyperbolic_space/hyperbolic_point.py +621 -0
- sage/geometry/riemannian_manifolds/all.py +7 -0
- sage/geometry/riemannian_manifolds/parametrized_surface3d.py +1632 -0
- sage/geometry/riemannian_manifolds/surface3d_generators.py +461 -0
- sage/interfaces/all__sagemath_symbolics.py +1 -0
- sage/interfaces/magma.py +2991 -0
- sage/interfaces/magma_free.py +90 -0
- sage/interfaces/maple.py +1402 -0
- sage/interfaces/mathematica.py +1345 -0
- sage/interfaces/mathics.py +1312 -0
- sage/interfaces/sympy.py +1398 -0
- sage/interfaces/sympy_wrapper.py +197 -0
- sage/interfaces/tides.py +938 -0
- sage/libs/all__sagemath_symbolics.py +6 -0
- sage/manifolds/all.py +7 -0
- sage/manifolds/calculus_method.py +553 -0
- sage/manifolds/catalog.py +437 -0
- sage/manifolds/chart.py +4010 -0
- sage/manifolds/chart_func.py +3416 -0
- sage/manifolds/continuous_map.py +2183 -0
- sage/manifolds/continuous_map_image.py +155 -0
- sage/manifolds/differentiable/affine_connection.py +2475 -0
- sage/manifolds/differentiable/all.py +1 -0
- sage/manifolds/differentiable/automorphismfield.py +1383 -0
- sage/manifolds/differentiable/automorphismfield_group.py +604 -0
- sage/manifolds/differentiable/bundle_connection.py +1445 -0
- sage/manifolds/differentiable/characteristic_cohomology_class.py +1840 -0
- sage/manifolds/differentiable/chart.py +1241 -0
- sage/manifolds/differentiable/curve.py +1028 -0
- sage/manifolds/differentiable/de_rham_cohomology.py +541 -0
- sage/manifolds/differentiable/degenerate.py +559 -0
- sage/manifolds/differentiable/degenerate_submanifold.py +1668 -0
- sage/manifolds/differentiable/diff_form.py +1660 -0
- sage/manifolds/differentiable/diff_form_module.py +1062 -0
- sage/manifolds/differentiable/diff_map.py +1315 -0
- sage/manifolds/differentiable/differentiable_submanifold.py +291 -0
- sage/manifolds/differentiable/examples/all.py +1 -0
- sage/manifolds/differentiable/examples/euclidean.py +2517 -0
- sage/manifolds/differentiable/examples/real_line.py +897 -0
- sage/manifolds/differentiable/examples/sphere.py +1186 -0
- sage/manifolds/differentiable/examples/symplectic_space.py +187 -0
- sage/manifolds/differentiable/examples/symplectic_space_test.py +40 -0
- sage/manifolds/differentiable/integrated_curve.py +4035 -0
- sage/manifolds/differentiable/levi_civita_connection.py +841 -0
- sage/manifolds/differentiable/manifold.py +4254 -0
- sage/manifolds/differentiable/manifold_homset.py +1826 -0
- sage/manifolds/differentiable/metric.py +3032 -0
- sage/manifolds/differentiable/mixed_form.py +1507 -0
- sage/manifolds/differentiable/mixed_form_algebra.py +559 -0
- sage/manifolds/differentiable/multivector_module.py +800 -0
- sage/manifolds/differentiable/multivectorfield.py +1522 -0
- sage/manifolds/differentiable/poisson_tensor.py +268 -0
- sage/manifolds/differentiable/pseudo_riemannian.py +755 -0
- sage/manifolds/differentiable/pseudo_riemannian_submanifold.py +1839 -0
- sage/manifolds/differentiable/scalarfield.py +1343 -0
- sage/manifolds/differentiable/scalarfield_algebra.py +472 -0
- sage/manifolds/differentiable/symplectic_form.py +912 -0
- sage/manifolds/differentiable/symplectic_form_test.py +220 -0
- sage/manifolds/differentiable/tangent_space.py +412 -0
- sage/manifolds/differentiable/tangent_vector.py +616 -0
- sage/manifolds/differentiable/tensorfield.py +4665 -0
- sage/manifolds/differentiable/tensorfield_module.py +963 -0
- sage/manifolds/differentiable/tensorfield_paral.py +2450 -0
- sage/manifolds/differentiable/tensorfield_paral_test.py +16 -0
- sage/manifolds/differentiable/vector_bundle.py +1725 -0
- sage/manifolds/differentiable/vectorfield.py +1717 -0
- sage/manifolds/differentiable/vectorfield_module.py +2445 -0
- sage/manifolds/differentiable/vectorframe.py +1832 -0
- sage/manifolds/family.py +270 -0
- sage/manifolds/local_frame.py +1490 -0
- sage/manifolds/manifold.py +3090 -0
- sage/manifolds/manifold_homset.py +452 -0
- sage/manifolds/operators.py +359 -0
- sage/manifolds/point.py +994 -0
- sage/manifolds/scalarfield.py +3718 -0
- sage/manifolds/scalarfield_algebra.py +629 -0
- sage/manifolds/section.py +3111 -0
- sage/manifolds/section_module.py +831 -0
- sage/manifolds/structure.py +229 -0
- sage/manifolds/subset.py +2721 -0
- sage/manifolds/subsets/all.py +1 -0
- sage/manifolds/subsets/closure.py +131 -0
- sage/manifolds/subsets/pullback.py +883 -0
- sage/manifolds/topological_submanifold.py +891 -0
- sage/manifolds/trivialization.py +733 -0
- sage/manifolds/utilities.py +1348 -0
- sage/manifolds/vector_bundle.py +1347 -0
- sage/manifolds/vector_bundle_fiber.py +332 -0
- sage/manifolds/vector_bundle_fiber_element.py +111 -0
- sage/matrix/all__sagemath_symbolics.py +1 -0
- sage/matrix/matrix_symbolic_dense.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/matrix/matrix_symbolic_dense.pxd +6 -0
- sage/matrix/matrix_symbolic_dense.pyx +1030 -0
- sage/matrix/matrix_symbolic_sparse.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/matrix/matrix_symbolic_sparse.pxd +6 -0
- sage/matrix/matrix_symbolic_sparse.pyx +1038 -0
- sage/modules/all__sagemath_symbolics.py +1 -0
- sage/modules/vector_callable_symbolic_dense.py +105 -0
- sage/modules/vector_symbolic_dense.py +116 -0
- sage/modules/vector_symbolic_sparse.py +118 -0
- sage/rings/all__sagemath_symbolics.py +4 -0
- sage/rings/asymptotic/all.py +6 -0
- sage/rings/asymptotic/asymptotic_expansion_generators.py +1485 -0
- sage/rings/asymptotic/asymptotic_ring.py +4858 -0
- sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py +4106 -0
- sage/rings/asymptotic/growth_group.py +5373 -0
- sage/rings/asymptotic/growth_group_cartesian.py +1400 -0
- sage/rings/asymptotic/term_monoid.py +5205 -0
- sage/rings/function_field/all__sagemath_symbolics.py +2 -0
- sage/rings/polynomial/all__sagemath_symbolics.py +1 -0
- sage/symbolic/all.py +15 -0
- sage/symbolic/assumptions.py +987 -0
- sage/symbolic/benchmark.py +93 -0
- sage/symbolic/callable.py +456 -0
- sage/symbolic/callable.pyi +66 -0
- sage/symbolic/comparison_impl.pyi +38 -0
- sage/symbolic/complexity_measures.py +35 -0
- sage/symbolic/constants.py +1286 -0
- sage/symbolic/constants_c_impl.pyi +10 -0
- sage/symbolic/expression_conversion_algebraic.py +310 -0
- sage/symbolic/expression_conversion_sympy.py +317 -0
- sage/symbolic/expression_conversions.py +1727 -0
- sage/symbolic/function_factory.py +355 -0
- sage/symbolic/function_factory.pyi +41 -0
- sage/symbolic/getitem_impl.pyi +24 -0
- sage/symbolic/integration/all.py +1 -0
- sage/symbolic/integration/external.py +271 -0
- sage/symbolic/integration/integral.py +1075 -0
- sage/symbolic/maxima_wrapper.py +162 -0
- sage/symbolic/operators.py +267 -0
- sage/symbolic/operators.pyi +61 -0
- sage/symbolic/pynac_constant_impl.pyi +13 -0
- sage/symbolic/pynac_function_impl.pyi +8 -0
- sage/symbolic/random_tests.py +461 -0
- sage/symbolic/relation.py +2062 -0
- sage/symbolic/ring.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/symbolic/ring.pxd +5 -0
- sage/symbolic/ring.pyi +110 -0
- sage/symbolic/ring.pyx +1393 -0
- sage/symbolic/series_impl.pyi +10 -0
- sage/symbolic/subring.py +1025 -0
- sage/symbolic/symengine.py +19 -0
- sage/symbolic/tests.py +40 -0
- sage/symbolic/units.py +1468 -0
sage/manifolds/family.py
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-symbolics
|
|
2
|
+
r"""
|
|
3
|
+
Families of Manifold Objects
|
|
4
|
+
|
|
5
|
+
The class :class:`ManifoldObjectFiniteFamily` is a subclass of :class:`FiniteFamily`
|
|
6
|
+
that provides an associative container of manifold objects, indexed by their
|
|
7
|
+
``_name`` attributes.
|
|
8
|
+
|
|
9
|
+
:class:`ManifoldObjectFiniteFamily` instances are totally ordered according
|
|
10
|
+
to their lexicographically ordered element names.
|
|
11
|
+
|
|
12
|
+
The subclass :class:`ManifoldSubsetFiniteFamily` customizes the print
|
|
13
|
+
representation further.
|
|
14
|
+
|
|
15
|
+
AUTHORS:
|
|
16
|
+
|
|
17
|
+
- Matthias Koeppe (2021): initial version
|
|
18
|
+
"""
|
|
19
|
+
# *****************************************************************************
|
|
20
|
+
# Copyright (C) 2021 Matthias Koeppe <mkoeppe@math.ucdavis.edu>
|
|
21
|
+
#
|
|
22
|
+
# This program is free software: you can redistribute it and/or modify
|
|
23
|
+
# it under the terms of the GNU General Public License as published by
|
|
24
|
+
# the Free Software Foundation, either version 2 of the License, or
|
|
25
|
+
# (at your option) any later version.
|
|
26
|
+
# http://www.gnu.org/licenses/
|
|
27
|
+
# *****************************************************************************
|
|
28
|
+
|
|
29
|
+
from functools import total_ordering
|
|
30
|
+
|
|
31
|
+
from sage.sets.family import FiniteFamily
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@total_ordering
|
|
35
|
+
class ManifoldObjectFiniteFamily(FiniteFamily):
|
|
36
|
+
r"""
|
|
37
|
+
Finite family of manifold objects, indexed by their names.
|
|
38
|
+
|
|
39
|
+
The class :class:`ManifoldObjectFiniteFamily` inherits from
|
|
40
|
+
:class:`FiniteFamily`. Therefore it is an associative container.
|
|
41
|
+
|
|
42
|
+
It provides specialized ``__repr__`` and ``_latex_`` methods.
|
|
43
|
+
|
|
44
|
+
:class:`ManifoldObjectFiniteFamily` instances are totally ordered
|
|
45
|
+
according to their lexicographically ordered element names.
|
|
46
|
+
|
|
47
|
+
EXAMPLES::
|
|
48
|
+
|
|
49
|
+
sage: from sage.manifolds.family import ManifoldObjectFiniteFamily
|
|
50
|
+
sage: M = Manifold(2, 'M', structure='topological')
|
|
51
|
+
sage: A = M.subset('A')
|
|
52
|
+
sage: B = M.subset('B')
|
|
53
|
+
sage: C = B.subset('C')
|
|
54
|
+
sage: F = ManifoldObjectFiniteFamily([A, B, C]); F
|
|
55
|
+
Set {A, B, C} of objects of the 2-dimensional topological manifold M
|
|
56
|
+
sage: latex(F)
|
|
57
|
+
\{A, B, C\}
|
|
58
|
+
sage: F['B']
|
|
59
|
+
Subset B of the 2-dimensional topological manifold M
|
|
60
|
+
|
|
61
|
+
All objects must have the same base manifold::
|
|
62
|
+
|
|
63
|
+
sage: N = Manifold(2, 'N', structure='topological')
|
|
64
|
+
sage: ManifoldObjectFiniteFamily([M, N])
|
|
65
|
+
Traceback (most recent call last):
|
|
66
|
+
...
|
|
67
|
+
TypeError: all objects must have the same manifold
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
def __init__(self, objects=(), keys=None):
|
|
71
|
+
r"""
|
|
72
|
+
Initialize a new instance of :class:`ManifoldObjectFiniteFamily`.
|
|
73
|
+
|
|
74
|
+
TESTS:
|
|
75
|
+
|
|
76
|
+
sage: from sage.manifolds.family import ManifoldObjectFiniteFamily
|
|
77
|
+
sage: M = Manifold(2, 'M', structure='topological')
|
|
78
|
+
sage: A = M.subset('A')
|
|
79
|
+
sage: B = M.subset('B')
|
|
80
|
+
sage: C = B.subset('C')
|
|
81
|
+
sage: F = ManifoldObjectFiniteFamily([A, B, C]); F
|
|
82
|
+
Set {A, B, C} of objects of the 2-dimensional topological manifold M
|
|
83
|
+
sage: TestSuite(F).run(skip='_test_elements')
|
|
84
|
+
|
|
85
|
+
Like ``frozenset``, it can be created from any iterable::
|
|
86
|
+
|
|
87
|
+
sage: from sage.manifolds.family import ManifoldSubsetFiniteFamily
|
|
88
|
+
sage: M = Manifold(2, 'M', structure='topological')
|
|
89
|
+
sage: I = M.subset('I')
|
|
90
|
+
sage: gen = (subset for subset in (M, I, M, I, M, I)); gen
|
|
91
|
+
<generator object ...>
|
|
92
|
+
sage: ManifoldSubsetFiniteFamily(gen)
|
|
93
|
+
Set {I, M} of subsets of the 2-dimensional topological manifold M
|
|
94
|
+
"""
|
|
95
|
+
if isinstance(objects, dict):
|
|
96
|
+
dictionary = objects
|
|
97
|
+
else:
|
|
98
|
+
dictionary = {object._name: object for object in objects}
|
|
99
|
+
if keys is None:
|
|
100
|
+
keys = sorted(dictionary.keys())
|
|
101
|
+
FiniteFamily.__init__(self, dictionary, keys)
|
|
102
|
+
names_and_latex_names = sorted(
|
|
103
|
+
(object._name, object._latex_name) for object in self
|
|
104
|
+
)
|
|
105
|
+
self._name = '{' + ', '.join(keys) + '}'
|
|
106
|
+
latex_names = (latex_name for name, latex_name in names_and_latex_names)
|
|
107
|
+
self._latex_name = r'\{' + ', '.join(latex_names) + r'\}'
|
|
108
|
+
try:
|
|
109
|
+
object_iter = iter(self)
|
|
110
|
+
self._manifold = next(object_iter)._manifold
|
|
111
|
+
except StopIteration:
|
|
112
|
+
self._manifold = None
|
|
113
|
+
else:
|
|
114
|
+
if not all(object._manifold == self._manifold for object in object_iter):
|
|
115
|
+
raise TypeError(
|
|
116
|
+
f'all {self._repr_object_type()} must have the same manifold'
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
def _repr_object_type(self):
|
|
120
|
+
r"""
|
|
121
|
+
String that describes the type of the elements (plural).
|
|
122
|
+
|
|
123
|
+
TESTS::
|
|
124
|
+
|
|
125
|
+
sage: from sage.manifolds.family import ManifoldObjectFiniteFamily
|
|
126
|
+
sage: M = Manifold(2, 'M', structure='topological')
|
|
127
|
+
sage: A = M.subset('A')
|
|
128
|
+
sage: B = M.subset('B')
|
|
129
|
+
sage: ManifoldObjectFiniteFamily([A, B]).__repr__() # indirect doctest
|
|
130
|
+
'Set {A, B} of objects of the 2-dimensional topological manifold M'
|
|
131
|
+
"""
|
|
132
|
+
return "objects"
|
|
133
|
+
|
|
134
|
+
def __lt__(self, other):
|
|
135
|
+
r"""
|
|
136
|
+
Implement the total order on instances of :class:`ManifoldObjectFiniteFamily`.
|
|
137
|
+
|
|
138
|
+
TESTS::
|
|
139
|
+
|
|
140
|
+
sage: from sage.manifolds.family import ManifoldSubsetFiniteFamily
|
|
141
|
+
sage: M = Manifold(2, 'M', structure='topological')
|
|
142
|
+
sage: A = M.subset('A')
|
|
143
|
+
sage: B = M.subset('B')
|
|
144
|
+
sage: sorted([ManifoldSubsetFiniteFamily([A, B]), ManifoldSubsetFiniteFamily([]),
|
|
145
|
+
....: ManifoldSubsetFiniteFamily([B]), ManifoldSubsetFiniteFamily([A])])
|
|
146
|
+
[{},
|
|
147
|
+
Set {A} of subsets of the 2-dimensional topological manifold M,
|
|
148
|
+
Set {A, B} of subsets of the 2-dimensional topological manifold M,
|
|
149
|
+
Set {B} of subsets of the 2-dimensional topological manifold M]
|
|
150
|
+
"""
|
|
151
|
+
if not isinstance(other, ManifoldSubsetFiniteFamily):
|
|
152
|
+
return NotImplemented
|
|
153
|
+
return self.keys() < other.keys()
|
|
154
|
+
|
|
155
|
+
def __repr__(self):
|
|
156
|
+
r"""
|
|
157
|
+
String representation of the object.
|
|
158
|
+
|
|
159
|
+
TESTS::
|
|
160
|
+
|
|
161
|
+
sage: from sage.manifolds.family import ManifoldObjectFiniteFamily
|
|
162
|
+
sage: ManifoldObjectFiniteFamily().__repr__()
|
|
163
|
+
'{}'
|
|
164
|
+
sage: M = Manifold(2, 'M', structure='topological')
|
|
165
|
+
sage: A = M.subset('A')
|
|
166
|
+
sage: B = M.subset('B')
|
|
167
|
+
sage: ManifoldObjectFiniteFamily([A, B]).__repr__()
|
|
168
|
+
'Set {A, B} of objects of the 2-dimensional topological manifold M'
|
|
169
|
+
"""
|
|
170
|
+
if self:
|
|
171
|
+
return "Set {} of {} of the {}".format(
|
|
172
|
+
self._name, self._repr_object_type(), self._manifold
|
|
173
|
+
)
|
|
174
|
+
else:
|
|
175
|
+
return "{}"
|
|
176
|
+
|
|
177
|
+
def _latex_(self):
|
|
178
|
+
r"""
|
|
179
|
+
LaTeX representation of ``self``.
|
|
180
|
+
|
|
181
|
+
TESTS::
|
|
182
|
+
|
|
183
|
+
sage: from sage.manifolds.family import ManifoldSubsetFiniteFamily
|
|
184
|
+
sage: M = Manifold(2, 'M', structure='topological')
|
|
185
|
+
sage: A = M.subset('A')
|
|
186
|
+
sage: B = M.subset('B')
|
|
187
|
+
sage: ManifoldSubsetFiniteFamily([B, A])._latex_()
|
|
188
|
+
'\\{A, B\\}'
|
|
189
|
+
"""
|
|
190
|
+
return self._latex_name
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
class ManifoldSubsetFiniteFamily(ManifoldObjectFiniteFamily):
|
|
194
|
+
r"""
|
|
195
|
+
Finite family of subsets of a topological manifold, indexed by their names.
|
|
196
|
+
|
|
197
|
+
The class :class:`ManifoldSubsetFiniteFamily` inherits from
|
|
198
|
+
:class:`ManifoldObjectFiniteFamily`. It provides an associative
|
|
199
|
+
container with specialized ``__repr__`` and ``_latex_`` methods.
|
|
200
|
+
|
|
201
|
+
:class:`ManifoldSubsetFiniteFamily` instances are totally ordered according
|
|
202
|
+
to their lexicographically ordered element (subset) names.
|
|
203
|
+
|
|
204
|
+
EXAMPLES::
|
|
205
|
+
|
|
206
|
+
sage: from sage.manifolds.family import ManifoldSubsetFiniteFamily
|
|
207
|
+
sage: M = Manifold(2, 'M', structure='topological')
|
|
208
|
+
sage: A = M.subset('A')
|
|
209
|
+
sage: B = M.subset('B')
|
|
210
|
+
sage: C = B.subset('C')
|
|
211
|
+
sage: ManifoldSubsetFiniteFamily([A, B, C])
|
|
212
|
+
Set {A, B, C} of subsets of the 2-dimensional topological manifold M
|
|
213
|
+
sage: latex(_)
|
|
214
|
+
\{A, B, C\}
|
|
215
|
+
|
|
216
|
+
All subsets must have the same base manifold::
|
|
217
|
+
|
|
218
|
+
sage: N = Manifold(2, 'N', structure='topological')
|
|
219
|
+
sage: ManifoldSubsetFiniteFamily([M, N])
|
|
220
|
+
Traceback (most recent call last):
|
|
221
|
+
...
|
|
222
|
+
TypeError: all open subsets must have the same manifold
|
|
223
|
+
"""
|
|
224
|
+
|
|
225
|
+
@classmethod
|
|
226
|
+
def from_subsets_or_families(cls, *subsets_or_families):
|
|
227
|
+
r"""
|
|
228
|
+
Construct a ``ManifoldSubsetFiniteFamily`` from given subsets or
|
|
229
|
+
iterables of subsets.
|
|
230
|
+
|
|
231
|
+
EXAMPLES::
|
|
232
|
+
|
|
233
|
+
sage: from sage.manifolds.family import ManifoldSubsetFiniteFamily
|
|
234
|
+
sage: M = Manifold(2, 'M', structure='topological')
|
|
235
|
+
sage: A = M.subset('A')
|
|
236
|
+
sage: Bs = (M.subset(f'B{i}') for i in range(5))
|
|
237
|
+
sage: Cs = ManifoldSubsetFiniteFamily([M.subset('C0'), M.subset('C1')])
|
|
238
|
+
sage: ManifoldSubsetFiniteFamily.from_subsets_or_families(A, Bs, Cs)
|
|
239
|
+
Set {A, B0, B1, B2, B3, B4, C0, C1} of subsets of the 2-dimensional topological manifold M
|
|
240
|
+
"""
|
|
241
|
+
|
|
242
|
+
def generate_subsets():
|
|
243
|
+
from sage.manifolds.subset import ManifoldSubset
|
|
244
|
+
|
|
245
|
+
for arg in subsets_or_families:
|
|
246
|
+
if isinstance(arg, ManifoldSubset):
|
|
247
|
+
yield arg
|
|
248
|
+
else:
|
|
249
|
+
# arg must be an iterable of ManifoldSubset instances
|
|
250
|
+
yield from arg
|
|
251
|
+
|
|
252
|
+
return cls(generate_subsets())
|
|
253
|
+
|
|
254
|
+
def _repr_object_type(self):
|
|
255
|
+
r"""
|
|
256
|
+
String that describes the type of the elements (plural).
|
|
257
|
+
|
|
258
|
+
TESTS::
|
|
259
|
+
|
|
260
|
+
sage: from sage.manifolds.family import ManifoldSubsetFiniteFamily
|
|
261
|
+
sage: M = Manifold(2, 'M', structure='topological')
|
|
262
|
+
sage: A = M.subset('A')
|
|
263
|
+
sage: B = M.subset('B')
|
|
264
|
+
sage: ManifoldSubsetFiniteFamily([A, B]).__repr__() # indirect doctest
|
|
265
|
+
'Set {A, B} of subsets of the 2-dimensional topological manifold M'
|
|
266
|
+
"""
|
|
267
|
+
if all(subset.is_open() for subset in self):
|
|
268
|
+
return "open subsets"
|
|
269
|
+
else:
|
|
270
|
+
return "subsets"
|