passagemath-environment 10.4.1__py3-none-any.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_environment-10.4.1.data/scripts/sage +1140 -0
- passagemath_environment-10.4.1.data/scripts/sage-env +667 -0
- passagemath_environment-10.4.1.data/scripts/sage-num-threads.py +105 -0
- passagemath_environment-10.4.1.data/scripts/sage-python +2 -0
- passagemath_environment-10.4.1.data/scripts/sage-venv-config +42 -0
- passagemath_environment-10.4.1.data/scripts/sage-version.sh +9 -0
- passagemath_environment-10.4.1.dist-info/METADATA +76 -0
- passagemath_environment-10.4.1.dist-info/RECORD +70 -0
- passagemath_environment-10.4.1.dist-info/WHEEL +5 -0
- passagemath_environment-10.4.1.dist-info/top_level.txt +1 -0
- sage/all__sagemath_environment.py +4 -0
- sage/env.py +496 -0
- sage/features/__init__.py +981 -0
- sage/features/all.py +126 -0
- sage/features/bliss.py +85 -0
- sage/features/cddlib.py +38 -0
- sage/features/coxeter3.py +45 -0
- sage/features/csdp.py +83 -0
- sage/features/cython.py +38 -0
- sage/features/databases.py +302 -0
- sage/features/dvipng.py +40 -0
- sage/features/ecm.py +42 -0
- sage/features/ffmpeg.py +119 -0
- sage/features/four_ti_2.py +55 -0
- sage/features/fricas.py +66 -0
- sage/features/gap.py +86 -0
- sage/features/gfan.py +38 -0
- sage/features/giac.py +30 -0
- sage/features/graph_generators.py +171 -0
- sage/features/graphviz.py +117 -0
- sage/features/igraph.py +44 -0
- sage/features/imagemagick.py +138 -0
- sage/features/interfaces.py +256 -0
- sage/features/internet.py +65 -0
- sage/features/jmol.py +44 -0
- sage/features/join_feature.py +146 -0
- sage/features/kenzo.py +77 -0
- sage/features/latex.py +300 -0
- sage/features/latte.py +85 -0
- sage/features/lrs.py +164 -0
- sage/features/mcqd.py +45 -0
- sage/features/meataxe.py +46 -0
- sage/features/mip_backends.py +114 -0
- sage/features/msolve.py +68 -0
- sage/features/nauty.py +70 -0
- sage/features/normaliz.py +43 -0
- sage/features/palp.py +65 -0
- sage/features/pandoc.py +42 -0
- sage/features/pdf2svg.py +41 -0
- sage/features/phitigra.py +42 -0
- sage/features/pkg_systems.py +195 -0
- sage/features/polymake.py +43 -0
- sage/features/poppler.py +58 -0
- sage/features/rubiks.py +180 -0
- sage/features/sagemath.py +1205 -0
- sage/features/sat.py +103 -0
- sage/features/singular.py +48 -0
- sage/features/sirocco.py +45 -0
- sage/features/sphinx.py +71 -0
- sage/features/standard.py +38 -0
- sage/features/symengine_py.py +44 -0
- sage/features/tdlib.py +38 -0
- sage/features/threejs.py +75 -0
- sage/features/topcom.py +67 -0
- sage/misc/all__sagemath_environment.py +2 -0
- sage/misc/package.py +570 -0
- sage/misc/package_dir.py +621 -0
- sage/misc/temporary_file.py +546 -0
- sage/misc/viewer.py +369 -0
- sage/version.py +5 -0
@@ -0,0 +1,1205 @@
|
|
1
|
+
# sage_setup: distribution = sagemath-environment
|
2
|
+
r"""
|
3
|
+
Features for testing the presence of Python modules in the Sage library
|
4
|
+
|
5
|
+
All of these features are present in a monolithic installation of the Sage library,
|
6
|
+
such as the one made by the SageMath distribution.
|
7
|
+
|
8
|
+
The features are defined for the purpose of separately testing modularized
|
9
|
+
distributions such as :ref:`sagemath-categories <spkg_sagemath_categories>`
|
10
|
+
and :ref:`sagemath-repl <spkg_sagemath_repl>`.
|
11
|
+
|
12
|
+
Often, doctests in a module of the Sage library illustrate the
|
13
|
+
interplay with a range of different objects; this is a form of integration testing.
|
14
|
+
These objects may come from modules shipped in
|
15
|
+
other distributions. For example, :mod:`sage.structure.element`
|
16
|
+
(shipped by :ref:`sagemath-objects <spkg_sagemath_objects>`,
|
17
|
+
one of the most fundamental distributions) contains the
|
18
|
+
doctest::
|
19
|
+
|
20
|
+
sage: G = SymmetricGroup(4) # needs sage.groups
|
21
|
+
sage: g = G([2, 3, 4, 1]) # needs sage.groups
|
22
|
+
sage: g.powers(4) # needs sage.groups
|
23
|
+
[(), (1,2,3,4), (1,3)(2,4), (1,4,3,2)]
|
24
|
+
|
25
|
+
This test cannot pass when the distribution :ref:`sagemath-objects <spkg_sagemath_objects>`
|
26
|
+
is tested separately (in a virtual environment): In this situation,
|
27
|
+
:class:`SymmetricGroup` is not defined anywhere (and thus not present
|
28
|
+
in the top-level namespace).
|
29
|
+
Hence, we conditionalize this doctest on the presence of the feature
|
30
|
+
:class:`sage.groups <sage__groups>`.
|
31
|
+
"""
|
32
|
+
|
33
|
+
# *****************************************************************************
|
34
|
+
# Copyright (C) 2021-2023 Matthias Koeppe
|
35
|
+
# 2021 Kwankyu Lee
|
36
|
+
#
|
37
|
+
# Distributed under the terms of the GNU General Public License (GPL)
|
38
|
+
# as published by the Free Software Foundation; either version 2 of
|
39
|
+
# the License, or (at your option) any later version.
|
40
|
+
# https://www.gnu.org/licenses/
|
41
|
+
# *****************************************************************************
|
42
|
+
|
43
|
+
from . import PythonModule, StaticFile
|
44
|
+
from .join_feature import JoinFeature
|
45
|
+
|
46
|
+
|
47
|
+
class SAGE_SRC(StaticFile):
|
48
|
+
r"""
|
49
|
+
A :class:`~sage.features.Feature` which describes the presence of the
|
50
|
+
monolithic source tree of the Sage library.
|
51
|
+
"""
|
52
|
+
def __init__(self):
|
53
|
+
r"""
|
54
|
+
TESTS::
|
55
|
+
|
56
|
+
sage: from sage.features.sagemath import SAGE_SRC
|
57
|
+
sage: isinstance(SAGE_SRC(), SAGE_SRC)
|
58
|
+
True
|
59
|
+
"""
|
60
|
+
from sage.env import SAGE_SRC
|
61
|
+
# We check the file bin/sage-src-env-config.in, which by design is:
|
62
|
+
# - never installed,
|
63
|
+
# - not included in the sagemath-standard sdist,
|
64
|
+
# - included only in one modularized sdist, of pkgs/sage-conf_pypi,
|
65
|
+
# where it appears in a subdirectory (sage_root/src/bin/)
|
66
|
+
StaticFile.__init__(self, 'SAGE_SRC',
|
67
|
+
filename='bin/sage-src-env-config.in',
|
68
|
+
search_path=(SAGE_SRC,) if SAGE_SRC else ())
|
69
|
+
|
70
|
+
|
71
|
+
class sagemath_doc_html(StaticFile):
|
72
|
+
r"""
|
73
|
+
A :class:`~sage.features.Feature` which describes the presence of the documentation
|
74
|
+
of the Sage library in HTML format.
|
75
|
+
|
76
|
+
Developers often use ``make build`` instead of ``make`` to avoid the
|
77
|
+
long time it takes to compile the documentation. Although commands
|
78
|
+
such as ``make ptest`` build the documentation before testing, other
|
79
|
+
test commands such as ``make ptestlong-nodoc`` or ``./sage -t --all``
|
80
|
+
do not.
|
81
|
+
|
82
|
+
All doctests that refer to the built documentation need to be marked
|
83
|
+
``# needs sagemath_doc_html``.
|
84
|
+
|
85
|
+
TESTS::
|
86
|
+
|
87
|
+
sage: from sage.features.sagemath import sagemath_doc_html
|
88
|
+
sage: sagemath_doc_html().is_present() # needs sagemath_doc_html
|
89
|
+
FeatureTestResult('sagemath_doc_html', True)
|
90
|
+
"""
|
91
|
+
def __init__(self):
|
92
|
+
r"""
|
93
|
+
TESTS::
|
94
|
+
|
95
|
+
sage: from sage.features.sagemath import sagemath_doc_html
|
96
|
+
sage: isinstance(sagemath_doc_html(), sagemath_doc_html)
|
97
|
+
True
|
98
|
+
"""
|
99
|
+
from sage.env import SAGE_DOC
|
100
|
+
StaticFile.__init__(self, 'sagemath_doc_html',
|
101
|
+
filename='html',
|
102
|
+
search_path=(SAGE_DOC,),
|
103
|
+
spkg='sagemath_doc_html',
|
104
|
+
type='standard')
|
105
|
+
|
106
|
+
|
107
|
+
class sage__combinat(JoinFeature):
|
108
|
+
r"""
|
109
|
+
A :class:`~sage.features.Feature` describing the presence of :mod:`sage.combinat`.
|
110
|
+
|
111
|
+
EXAMPLES:
|
112
|
+
|
113
|
+
Python modules that provide elementary combinatorial objects such as :mod:`sage.combinat.subset`,
|
114
|
+
:mod:`sage.combinat.composition`, :mod:`sage.combinat.permutation` are always available;
|
115
|
+
there is no need for an ``# optional/needs`` tag::
|
116
|
+
|
117
|
+
sage: Permutation([1,2,3]).is_even()
|
118
|
+
True
|
119
|
+
sage: Permutation([6,1,4,5,2,3]).bruhat_inversions()
|
120
|
+
[[0, 1], [0, 2], [0, 3], [2, 4], [2, 5], [3, 4], [3, 5]]
|
121
|
+
|
122
|
+
Use ``# needs sage.combinat`` for doctests that use any other Python modules
|
123
|
+
from :mod:`sage.combinat`, for example :mod:`sage.combinat.tableau_tuple`::
|
124
|
+
|
125
|
+
sage: TableauTuple([[[7,8,9]],[],[[1,2,3],[4,5],[6]]]).shape() # needs sage.combinat
|
126
|
+
([3], [], [3, 2, 1])
|
127
|
+
|
128
|
+
Doctests that use Python modules from :mod:`sage.combinat` that involve trees,
|
129
|
+
graphs, hypergraphs, posets, quivers, combinatorial designs,
|
130
|
+
finite state machines etc. should be marked ``# needs sage.combinat sage.graphs``::
|
131
|
+
|
132
|
+
sage: L = Poset({0: [1], 1: [2], 2:[3], 3:[4]}) # needs sage.combinat sage.graphs
|
133
|
+
sage: L.is_chain() # needs sage.combinat sage.graphs
|
134
|
+
True
|
135
|
+
|
136
|
+
Doctests that use combinatorial modules/algebras, or root systems should use the tag
|
137
|
+
``# needs sage.combinat sage.modules``::
|
138
|
+
|
139
|
+
sage: # needs sage.combinat sage.modules
|
140
|
+
sage: A = SchurAlgebra(QQ, 2, 3)
|
141
|
+
sage: a = A.an_element(); a
|
142
|
+
2*S((1, 1, 1), (1, 1, 1)) + 2*S((1, 1, 1), (1, 1, 2))
|
143
|
+
+ 3*S((1, 1, 1), (1, 2, 2))
|
144
|
+
sage: L = RootSystem(['A',3,1]).root_lattice()
|
145
|
+
sage: PIR = L.positive_imaginary_roots(); PIR
|
146
|
+
Positive imaginary roots of type ['A', 3, 1]
|
147
|
+
|
148
|
+
Doctests that use lattices, semilattices, or Dynkin diagrams should use the tag
|
149
|
+
``# needs sage.combinat sage.graphs sage.modules``::
|
150
|
+
|
151
|
+
sage: L = LatticePoset({0: [1,2], 1: [3], 2: [3,4], 3: [5], 4: [5]}) # needs sage.combinat sage.graphs sage.modules
|
152
|
+
sage: L.meet_irreducibles() # needs sage.combinat sage.graphs sage.modules
|
153
|
+
[1, 3, 4]
|
154
|
+
|
155
|
+
TESTS::
|
156
|
+
|
157
|
+
sage: from sage.features.sagemath import sage__combinat
|
158
|
+
sage: sage__combinat().is_present() # needs sage.combinat
|
159
|
+
FeatureTestResult('sage.combinat', True)
|
160
|
+
"""
|
161
|
+
def __init__(self):
|
162
|
+
r"""
|
163
|
+
TESTS::
|
164
|
+
|
165
|
+
sage: from sage.features.sagemath import sage__combinat
|
166
|
+
sage: isinstance(sage__combinat(), sage__combinat)
|
167
|
+
True
|
168
|
+
"""
|
169
|
+
# sage.combinat will be a namespace package.
|
170
|
+
# Testing whether sage.combinat itself can be imported is meaningless.
|
171
|
+
# Some modules providing basic combinatorics are already included in sagemath-categories.
|
172
|
+
# Hence, we test a Python module within the package.
|
173
|
+
JoinFeature.__init__(self, 'sage.combinat',
|
174
|
+
[PythonModule('sage.combinat'), # namespace package
|
175
|
+
PythonModule('sage.combinat.tableau'), # representative
|
176
|
+
],
|
177
|
+
spkg='sagemath_combinat', type='standard')
|
178
|
+
|
179
|
+
|
180
|
+
class sage__geometry__polyhedron(JoinFeature):
|
181
|
+
r"""
|
182
|
+
A :class:`~sage.features.Feature` describing the presence of :mod:`sage.geometry.polyhedron`.
|
183
|
+
|
184
|
+
EXAMPLES:
|
185
|
+
|
186
|
+
Doctests that use polyhedra, cones, geometric complexes, triangulations, etc. should use
|
187
|
+
the tag ``# needs sage.geometry.polyhedron``::
|
188
|
+
|
189
|
+
sage: co = polytopes.truncated_tetrahedron() # needs sage.geometry.polyhedron
|
190
|
+
sage: co.volume() # needs sage.geometry.polyhedron
|
191
|
+
184/3
|
192
|
+
|
193
|
+
Some constructions of polyhedra require additional tags::
|
194
|
+
|
195
|
+
sage: # needs sage.combinat sage.geometry.polyhedron sage.rings.number_field
|
196
|
+
sage: perm_a3_reg_nf = polytopes.generalized_permutahedron(
|
197
|
+
....: ['A',3], regular=True, backend='number_field'); perm_a3_reg_nf
|
198
|
+
A 3-dimensional polyhedron in AA^3 defined as the convex hull of 24 vertices
|
199
|
+
|
200
|
+
TESTS::
|
201
|
+
|
202
|
+
sage: from sage.features.sagemath import sage__geometry__polyhedron
|
203
|
+
sage: sage__geometry__polyhedron().is_present() # needs sage.geometry.polyhedron
|
204
|
+
FeatureTestResult('sage.geometry.polyhedron', True)
|
205
|
+
"""
|
206
|
+
|
207
|
+
def __init__(self):
|
208
|
+
r"""
|
209
|
+
TESTS::
|
210
|
+
|
211
|
+
sage: from sage.features.sagemath import sage__geometry__polyhedron
|
212
|
+
sage: isinstance(sage__geometry__polyhedron(), sage__geometry__polyhedron)
|
213
|
+
True
|
214
|
+
"""
|
215
|
+
JoinFeature.__init__(self, 'sage.geometry.polyhedron',
|
216
|
+
[PythonModule('sage.geometry'), # namespace package
|
217
|
+
PythonModule('sage.geometry.polyhedron'), # representative
|
218
|
+
PythonModule('sage.schemes.toric'), # namespace package
|
219
|
+
PythonModule('sage.schemes.toric.variety'), # representative
|
220
|
+
],
|
221
|
+
spkg='sagemath_polyhedra', type='standard')
|
222
|
+
|
223
|
+
|
224
|
+
class sage__graphs(JoinFeature):
|
225
|
+
r"""
|
226
|
+
A :class:`~sage.features.Feature` describing the presence of :mod:`sage.graphs`.
|
227
|
+
|
228
|
+
EXAMPLES:
|
229
|
+
|
230
|
+
Doctests that use anything from :mod:`sage.graphs` (:class:`Graph`, :class:`DiGraph`, ...)
|
231
|
+
should be marked ``# needs sage.graphs``. The same applies to any doctest that
|
232
|
+
uses a :class:`~sage.combinat.posets.posets.Poset`, cluster algebra quiver, finite
|
233
|
+
state machines, abelian sandpiles, or Dynkin diagrams::
|
234
|
+
|
235
|
+
sage: g = graphs.PetersenGraph() # needs sage.graphs
|
236
|
+
sage: r, s = g.is_weakly_chordal(certificate=True); r # needs sage.graphs
|
237
|
+
False
|
238
|
+
|
239
|
+
Also any use of tree classes defined in :mod:`sage.combinat` (:class:`BinaryTree`,
|
240
|
+
:class:`RootedTree`, ...) in doctests should be marked the same.
|
241
|
+
|
242
|
+
By way of generalization, any use of :class:`SimplicialComplex` or other abstract complexes from
|
243
|
+
:mod:`sage.topology`, hypergraphs, and combinatorial designs, should be marked
|
244
|
+
``# needs sage.graphs`` as well::
|
245
|
+
|
246
|
+
sage: X = SimplicialComplex([[0,1,2], [1,2,3]]) # needs sage.graphs
|
247
|
+
sage: X.link(Simplex([0])) # needs sage.graphs
|
248
|
+
Simplicial complex with vertex set (1, 2) and facets {(1, 2)}
|
249
|
+
|
250
|
+
sage: IncidenceStructure([[1,2,3],[1,4]]).degrees(2) # needs sage.graphs
|
251
|
+
{(1, 2): 1, (1, 3): 1, (1, 4): 1, (2, 3): 1, (2, 4): 0, (3, 4): 0}
|
252
|
+
|
253
|
+
On the other hand, matroids are not implemented as posets in Sage but are instead
|
254
|
+
closely tied to linear algebra over fields; hence use ``# needs sage.modules`` instead::
|
255
|
+
|
256
|
+
sage: # needs sage.modules
|
257
|
+
sage: M = Matroid(Matrix(QQ, [[1, 0, 0, 0, 1, 1, 1],
|
258
|
+
....: [0, 1, 0, 1, 0, 1, 1],
|
259
|
+
....: [0, 0, 1, 1, 1, 0, 1]]))
|
260
|
+
sage: N = (M / [2]).delete([3, 4])
|
261
|
+
sage: sorted(N.groundset())
|
262
|
+
[0, 1, 5, 6]
|
263
|
+
|
264
|
+
However, many constructions (and some methods) of matroids do involve graphs::
|
265
|
+
|
266
|
+
sage: # needs sage.modules
|
267
|
+
sage: W = matroids.Wheel(3) # despite the name, not created via graphs
|
268
|
+
sage: W.is_isomorphic(N) # goes through a graph isomorphism test # needs sage.graphs
|
269
|
+
False
|
270
|
+
sage: K4 = matroids.CompleteGraphic(4) # this one is created via graphs # needs sage.graphs
|
271
|
+
sage: K4.is_isomorphic(W) # needs sage.graphs
|
272
|
+
True
|
273
|
+
|
274
|
+
TESTS::
|
275
|
+
|
276
|
+
sage: from sage.features.sagemath import sage__graphs
|
277
|
+
sage: sage__graphs().is_present() # needs sage.graphs
|
278
|
+
FeatureTestResult('sage.graphs', True)
|
279
|
+
"""
|
280
|
+
def __init__(self):
|
281
|
+
r"""
|
282
|
+
TESTS::
|
283
|
+
|
284
|
+
sage: from sage.features.sagemath import sage__graphs
|
285
|
+
sage: isinstance(sage__graphs(), sage__graphs)
|
286
|
+
True
|
287
|
+
"""
|
288
|
+
JoinFeature.__init__(self, 'sage.graphs',
|
289
|
+
# These lists of modules are an (incomplete) duplication
|
290
|
+
# of information in the distribution's MANIFEST.
|
291
|
+
# But at least as long as the monolithic Sage library is
|
292
|
+
# around, we need this information here for use by
|
293
|
+
# sage-fixdoctests.
|
294
|
+
[PythonModule('sage.graphs'), # namespace package
|
295
|
+
PythonModule('sage.graphs.graph'), # representative
|
296
|
+
PythonModule('sage.combinat.designs'), # namespace package
|
297
|
+
PythonModule('sage.combinat.designs.block_design'), # representative
|
298
|
+
PythonModule('sage.combinat.posets'), # namespace package
|
299
|
+
PythonModule('sage.combinat.posets.posets'), # representative
|
300
|
+
PythonModule('sage.topology'), # namespace package
|
301
|
+
PythonModule('sage.topology.simplicial_complex'), # representative
|
302
|
+
],
|
303
|
+
spkg='sagemath_graphs', type='standard')
|
304
|
+
|
305
|
+
|
306
|
+
class sage__groups(JoinFeature):
|
307
|
+
r"""
|
308
|
+
A :class:`~sage.features.Feature` describing the presence of ``sage.groups``.
|
309
|
+
|
310
|
+
EXAMPLES:
|
311
|
+
|
312
|
+
Permutations and sets of permutations are always available, but permutation groups are
|
313
|
+
implemented in Sage using the :ref:`GAP <spkg_gap>` system and require the tag
|
314
|
+
``# needs sage.groups``::
|
315
|
+
|
316
|
+
sage: p = Permutation([2,1,4,3])
|
317
|
+
sage: p.to_permutation_group_element() # needs sage.groups
|
318
|
+
(1,2)(3,4)
|
319
|
+
|
320
|
+
TESTS::
|
321
|
+
|
322
|
+
sage: from sage.features.sagemath import sage__groups
|
323
|
+
sage: sage__groups().is_present() # needs sage.groups
|
324
|
+
FeatureTestResult('sage.groups', True)
|
325
|
+
"""
|
326
|
+
def __init__(self):
|
327
|
+
r"""
|
328
|
+
TESTS::
|
329
|
+
|
330
|
+
sage: from sage.features.sagemath import sage__groups
|
331
|
+
sage: isinstance(sage__groups(), sage__groups)
|
332
|
+
True
|
333
|
+
"""
|
334
|
+
JoinFeature.__init__(self, 'sage.groups',
|
335
|
+
[PythonModule('sage.groups.perm_gps.permgroup')],
|
336
|
+
spkg='sagemath_groups', type='standard')
|
337
|
+
|
338
|
+
|
339
|
+
class sage__libs__braiding(PythonModule):
|
340
|
+
r"""
|
341
|
+
A :class:`~sage.features.Feature` describing the presence of :mod:`sage.libs.braiding`.
|
342
|
+
|
343
|
+
EXAMPLES::
|
344
|
+
|
345
|
+
sage: from sage.features.sagemath import sage__libs__braiding
|
346
|
+
sage: sage__libs__braiding().is_present() # needs sage.libs.braiding
|
347
|
+
FeatureTestResult('sage.libs.braiding', True)
|
348
|
+
"""
|
349
|
+
|
350
|
+
def __init__(self):
|
351
|
+
r"""
|
352
|
+
TESTS::
|
353
|
+
|
354
|
+
sage: from sage.features.sagemath import sage__libs__braiding
|
355
|
+
sage: isinstance(sage__libs__braiding(), sage__libs__braiding)
|
356
|
+
True
|
357
|
+
"""
|
358
|
+
PythonModule.__init__(self, 'sage.libs.braiding',
|
359
|
+
spkg='sagemath_libbraiding', type='standard')
|
360
|
+
|
361
|
+
|
362
|
+
class sage__libs__ecl(PythonModule):
|
363
|
+
r"""
|
364
|
+
A :class:`~sage.features.Feature` describing the presence of :mod:`sage.libs.ecl`.
|
365
|
+
|
366
|
+
EXAMPLES::
|
367
|
+
|
368
|
+
sage: from sage.features.sagemath import sage__libs__ecl
|
369
|
+
sage: sage__libs__ecl().is_present() # optional - sage.libs.ecl
|
370
|
+
FeatureTestResult('sage.libs.ecl', True)
|
371
|
+
"""
|
372
|
+
|
373
|
+
def __init__(self):
|
374
|
+
r"""
|
375
|
+
TESTS::
|
376
|
+
|
377
|
+
sage: from sage.features.sagemath import sage__libs__ecl
|
378
|
+
sage: isinstance(sage__libs__ecl(), sage__libs__ecl)
|
379
|
+
True
|
380
|
+
"""
|
381
|
+
PythonModule.__init__(self, 'sage.libs.ecl',
|
382
|
+
spkg='sagemath_symbolics', type='standard')
|
383
|
+
|
384
|
+
|
385
|
+
class sage__libs__flint(JoinFeature):
|
386
|
+
r"""
|
387
|
+
A :class:`sage.features.Feature` describing the presence of :mod:`sage.libs.flint`
|
388
|
+
and other modules depending on FLINT.
|
389
|
+
|
390
|
+
In addition to the modularization purposes that this tag serves, it also provides attribution
|
391
|
+
to the upstream project.
|
392
|
+
|
393
|
+
TESTS::
|
394
|
+
|
395
|
+
sage: from sage.features.sagemath import sage__libs__flint
|
396
|
+
sage: sage__libs__flint().is_present() # needs sage.libs.flint
|
397
|
+
FeatureTestResult('sage.libs.flint', True)
|
398
|
+
"""
|
399
|
+
def __init__(self):
|
400
|
+
r"""
|
401
|
+
TESTS::
|
402
|
+
|
403
|
+
sage: from sage.features.sagemath import sage__libs__flint
|
404
|
+
sage: isinstance(sage__libs__flint(), sage__libs__flint)
|
405
|
+
True
|
406
|
+
"""
|
407
|
+
JoinFeature.__init__(self, 'sage.libs.flint',
|
408
|
+
[PythonModule('sage.libs.flint.arith_sage'),
|
409
|
+
PythonModule('sage.libs.flint.flint_sage')],
|
410
|
+
spkg='sagemath_flint', type='standard')
|
411
|
+
|
412
|
+
|
413
|
+
class sage__libs__gap(JoinFeature):
|
414
|
+
r"""
|
415
|
+
A :class:`sage.features.Feature` describing the presence of :mod:`sage.libs.gap`
|
416
|
+
(the library interface to :ref:`GAP <spkg_gap>`) and :mod:`sage.interfaces.gap` (the pexpect
|
417
|
+
interface to GAP). By design, we do not distinguish between these two, in order
|
418
|
+
to facilitate the conversion of code from the pexpect interface to the library
|
419
|
+
interface.
|
420
|
+
|
421
|
+
.. SEEALSO::
|
422
|
+
|
423
|
+
:class:`Features for GAP packages <~sage.features.gap.GapPackage>`
|
424
|
+
|
425
|
+
TESTS::
|
426
|
+
|
427
|
+
sage: from sage.features.gap import sage__libs__gap
|
428
|
+
sage: sage__libs__gap().is_present() # needs sage.libs.gap
|
429
|
+
FeatureTestResult('sage.libs.gap', True)
|
430
|
+
"""
|
431
|
+
def __init__(self):
|
432
|
+
r"""
|
433
|
+
TESTS::
|
434
|
+
|
435
|
+
sage: from sage.features.gap import sage__libs__gap
|
436
|
+
sage: isinstance(sage__libs__gap(), sage__libs__gap)
|
437
|
+
True
|
438
|
+
"""
|
439
|
+
JoinFeature.__init__(self, 'sage.libs.gap',
|
440
|
+
[PythonModule('sage.libs.gap.libgap'),
|
441
|
+
PythonModule('sage.interfaces.gap'),
|
442
|
+
PythonModule('sage.groups.matrix_gps.finitely_generated_gap'),
|
443
|
+
PythonModule('sage.groups.matrix_gps.group_element_gap'),
|
444
|
+
PythonModule('sage.groups.matrix_gps.heisenberg'),
|
445
|
+
PythonModule('sage.groups.matrix_gps.isometries'),
|
446
|
+
PythonModule('sage.groups.matrix_gps.linear_gap'),
|
447
|
+
PythonModule('sage.groups.matrix_gps.matrix_group_gap'),
|
448
|
+
PythonModule('sage.groups.matrix_gps.named_group_gap'),
|
449
|
+
PythonModule('sage.groups.matrix_gps.orthogonal_gap'),
|
450
|
+
PythonModule('sage.groups.matrix_gps.symplectic_gap'),
|
451
|
+
PythonModule('sage.groups.matrix_gps.unitary_gap'),
|
452
|
+
PythonModule('sage.matrix.matrix_gap'),
|
453
|
+
PythonModule('sage.rings.universal_cyclotomic_field')])
|
454
|
+
|
455
|
+
|
456
|
+
class sage__libs__linbox(JoinFeature):
|
457
|
+
r"""
|
458
|
+
A :class:`sage.features.Feature` describing the presence of :mod:`sage.libs.linbox`
|
459
|
+
and other modules depending on Givaro, FFLAS-FFPACK, LinBox.
|
460
|
+
|
461
|
+
In addition to the modularization purposes that this tag serves, it also provides attribution
|
462
|
+
to the upstream project.
|
463
|
+
|
464
|
+
TESTS::
|
465
|
+
|
466
|
+
sage: from sage.features.sagemath import sage__libs__linbox
|
467
|
+
sage: sage__libs__linbox().is_present() # needs sage.libs.linbox
|
468
|
+
FeatureTestResult('sage.libs.linbox', True)
|
469
|
+
"""
|
470
|
+
def __init__(self):
|
471
|
+
r"""
|
472
|
+
TESTS::
|
473
|
+
|
474
|
+
sage: from sage.features.sagemath import sage__libs__linbox
|
475
|
+
sage: isinstance(sage__libs__linbox(), sage__libs__linbox)
|
476
|
+
True
|
477
|
+
"""
|
478
|
+
JoinFeature.__init__(self, 'sage.libs.linbox',
|
479
|
+
[PythonModule('sage.rings.finite_rings.element_givaro'),
|
480
|
+
PythonModule('sage.matrix.matrix_modn_dense_float'),
|
481
|
+
PythonModule('sage.matrix.matrix_modn_dense_double')],
|
482
|
+
spkg='sagemath_linbox', type='standard')
|
483
|
+
|
484
|
+
|
485
|
+
class sage__libs__m4ri(JoinFeature):
|
486
|
+
r"""
|
487
|
+
A :class:`sage.features.Feature` describing the presence of Cython modules
|
488
|
+
depending on the M4RI and/or M4RIe libraries.
|
489
|
+
|
490
|
+
In addition to the modularization purposes that this tag serves,
|
491
|
+
it also provides attribution to the upstream project.
|
492
|
+
|
493
|
+
TESTS::
|
494
|
+
|
495
|
+
sage: from sage.features.sagemath import sage__libs__m4ri
|
496
|
+
sage: sage__libs__m4ri().is_present() # needs sage.libs.m4ri
|
497
|
+
FeatureTestResult('sage.libs.m4ri', True)
|
498
|
+
"""
|
499
|
+
def __init__(self):
|
500
|
+
r"""
|
501
|
+
TESTS::
|
502
|
+
|
503
|
+
sage: from sage.features.sagemath import sage__libs__m4ri
|
504
|
+
sage: isinstance(sage__libs__m4ri(), sage__libs__m4ri)
|
505
|
+
True
|
506
|
+
"""
|
507
|
+
JoinFeature.__init__(self, 'sage.libs.m4ri',
|
508
|
+
[PythonModule('sage.matrix.matrix_gf2e_dense'),
|
509
|
+
PythonModule('sage.matrix.matrix_mod2_dense')],
|
510
|
+
spkg='sagemath_m4ri', type='standard')
|
511
|
+
|
512
|
+
|
513
|
+
class sage__libs__ntl(JoinFeature):
|
514
|
+
r"""
|
515
|
+
A :class:`sage.features.Feature` describing the presence of :mod:`sage.libs.ntl`
|
516
|
+
and other modules depending on NTL.
|
517
|
+
|
518
|
+
In addition to the modularization purposes that this tag serves,
|
519
|
+
it also provides attribution to the upstream project.
|
520
|
+
|
521
|
+
TESTS::
|
522
|
+
|
523
|
+
sage: from sage.features.sagemath import sage__libs__ntl
|
524
|
+
sage: sage__libs__ntl().is_present() # needs sage.libs.ntl
|
525
|
+
FeatureTestResult('sage.libs.ntl', True)
|
526
|
+
"""
|
527
|
+
def __init__(self):
|
528
|
+
r"""
|
529
|
+
TESTS::
|
530
|
+
|
531
|
+
sage: from sage.features.sagemath import sage__libs__ntl
|
532
|
+
sage: isinstance(sage__libs__ntl(), sage__libs__ntl)
|
533
|
+
True
|
534
|
+
"""
|
535
|
+
JoinFeature.__init__(self, 'sage.libs.ntl',
|
536
|
+
[PythonModule('sage.libs.ntl.convert')],
|
537
|
+
spkg='sagemath_ntl', type='standard')
|
538
|
+
|
539
|
+
|
540
|
+
class sage__libs__giac(JoinFeature):
|
541
|
+
r"""
|
542
|
+
A :class:`sage.features.Feature` describing the presence of :mod:`sage.libs.giac`.
|
543
|
+
|
544
|
+
In addition to the modularization purposes that this tag serves,
|
545
|
+
it also provides attribution to the upstream project.
|
546
|
+
|
547
|
+
TESTS::
|
548
|
+
|
549
|
+
sage: from sage.features.sagemath import sage__libs__giac
|
550
|
+
sage: sage__libs__giac().is_present() # needs sage.libs.giac
|
551
|
+
FeatureTestResult('sage.libs.giac', True)
|
552
|
+
"""
|
553
|
+
def __init__(self):
|
554
|
+
r"""
|
555
|
+
TESTS::
|
556
|
+
|
557
|
+
sage: from sage.features.sagemath import sage__libs__giac
|
558
|
+
sage: isinstance(sage__libs__giac(), sage__libs__giac)
|
559
|
+
True
|
560
|
+
"""
|
561
|
+
JoinFeature.__init__(self, 'sage.libs.giac',
|
562
|
+
[PythonModule('sage.libs.giac.giac')],
|
563
|
+
spkg='sagemath_giac', type='standard')
|
564
|
+
|
565
|
+
|
566
|
+
class sage__libs__homfly(JoinFeature):
|
567
|
+
r"""
|
568
|
+
A :class:`sage.features.Feature` describing the presence of :mod:`sage.libs.homfly`.
|
569
|
+
|
570
|
+
In addition to the modularization purposes that this tag serves,
|
571
|
+
it also provides attribution to the upstream project.
|
572
|
+
|
573
|
+
TESTS::
|
574
|
+
|
575
|
+
sage: from sage.features.sagemath import sage__libs__homfly
|
576
|
+
sage: sage__libs__homfly().is_present() # needs sage.libs.homfly
|
577
|
+
FeatureTestResult('sage.libs.homfly', True)
|
578
|
+
"""
|
579
|
+
def __init__(self):
|
580
|
+
r"""
|
581
|
+
TESTS::
|
582
|
+
|
583
|
+
sage: from sage.features.sagemath import sage__libs__homfly
|
584
|
+
sage: isinstance(sage__libs__homfly(), sage__libs__homfly)
|
585
|
+
True
|
586
|
+
"""
|
587
|
+
JoinFeature.__init__(self, 'sage.libs.homfly',
|
588
|
+
[PythonModule('sage.libs.homfly')],
|
589
|
+
spkg='sagemath_homfly', type='standard')
|
590
|
+
|
591
|
+
|
592
|
+
class sage__libs__pari(JoinFeature):
|
593
|
+
r"""
|
594
|
+
A :class:`~sage.features.Feature` describing the presence of :mod:`sage.libs.pari`.
|
595
|
+
|
596
|
+
SageMath uses the :ref:`PARI <spkg_pari>` library (via :ref:`cypari2
|
597
|
+
<spkg_cypari>`) for numerous purposes. Doctests that involves such features
|
598
|
+
should be marked ``# needs sage.libs.pari``.
|
599
|
+
|
600
|
+
In addition to the modularization purposes that this tag serves, it also
|
601
|
+
provides attribution to the upstream project.
|
602
|
+
|
603
|
+
EXAMPLES::
|
604
|
+
|
605
|
+
sage: R.<a> = QQ[]
|
606
|
+
sage: S.<x> = R[]
|
607
|
+
sage: f = x^2 + a; g = x^3 + a
|
608
|
+
sage: r = f.resultant(g); r # needs sage.libs.pari
|
609
|
+
a^3 + a^2
|
610
|
+
|
611
|
+
TESTS::
|
612
|
+
|
613
|
+
sage: from sage.features.sagemath import sage__libs__pari
|
614
|
+
sage: sage__libs__pari().is_present() # needs sage.libs.pari
|
615
|
+
FeatureTestResult('sage.libs.pari', True)
|
616
|
+
"""
|
617
|
+
def __init__(self):
|
618
|
+
r"""
|
619
|
+
TESTS::
|
620
|
+
|
621
|
+
sage: from sage.features.sagemath import sage__libs__pari
|
622
|
+
sage: isinstance(sage__libs__pari(), sage__libs__pari)
|
623
|
+
True
|
624
|
+
"""
|
625
|
+
JoinFeature.__init__(self, 'sage.libs.pari',
|
626
|
+
[PythonModule('sage.libs.pari.convert_sage')],
|
627
|
+
spkg='sagemath_pari', type='standard')
|
628
|
+
|
629
|
+
|
630
|
+
class sage__libs__singular(JoinFeature):
|
631
|
+
r"""
|
632
|
+
A :class:`sage.features.Feature` describing the presence of :mod:`sage.libs.singular`
|
633
|
+
(the library interface to Singular) and :mod:`sage.interfaces.singular` (the pexpect
|
634
|
+
interface to Singular). By design, we do not distinguish between these two, in order
|
635
|
+
to facilitate the conversion of code from the pexpect interface to the library
|
636
|
+
interface.
|
637
|
+
|
638
|
+
.. SEEALSO::
|
639
|
+
|
640
|
+
:class:`Feature singular <~sage.features.singular.Singular>`
|
641
|
+
|
642
|
+
TESTS::
|
643
|
+
|
644
|
+
sage: from sage.features.singular import sage__libs__singular
|
645
|
+
sage: sage__libs__singular().is_present() # needs sage.libs.singular
|
646
|
+
FeatureTestResult('sage.libs.singular', True)
|
647
|
+
"""
|
648
|
+
def __init__(self):
|
649
|
+
r"""
|
650
|
+
TESTS::
|
651
|
+
|
652
|
+
sage: from sage.features.singular import sage__libs__singular
|
653
|
+
sage: isinstance(sage__libs__singular(), sage__libs__singular)
|
654
|
+
True
|
655
|
+
"""
|
656
|
+
JoinFeature.__init__(self, 'sage.libs.singular',
|
657
|
+
[PythonModule('sage.libs.singular.singular'),
|
658
|
+
PythonModule('sage.interfaces.singular')])
|
659
|
+
|
660
|
+
|
661
|
+
class sage__modular(JoinFeature):
|
662
|
+
r"""
|
663
|
+
A :class:`~sage.features.Feature` describing the presence of :mod:`sage.modular`.
|
664
|
+
|
665
|
+
TESTS::
|
666
|
+
|
667
|
+
sage: from sage.features.sagemath import sage__modular
|
668
|
+
sage: sage__modular().is_present() # needs sage.modular
|
669
|
+
FeatureTestResult('sage.modular', True)
|
670
|
+
"""
|
671
|
+
def __init__(self):
|
672
|
+
r"""
|
673
|
+
TESTS::
|
674
|
+
|
675
|
+
sage: from sage.features.sagemath import sage__modular
|
676
|
+
sage: isinstance(sage__modular(), sage__modular)
|
677
|
+
True
|
678
|
+
"""
|
679
|
+
JoinFeature.__init__(self, 'sage.modular',
|
680
|
+
[PythonModule('sage.modular.modform.eisenstein_submodule')],
|
681
|
+
spkg='sagemath_schemes', type='standard')
|
682
|
+
|
683
|
+
|
684
|
+
class sage__modules(JoinFeature):
|
685
|
+
r"""
|
686
|
+
A :class:`~sage.features.Feature` describing the presence of :mod:`sage.modules`.
|
687
|
+
|
688
|
+
EXAMPLES:
|
689
|
+
|
690
|
+
All uses of implementations of vector spaces / free modules in SageMath, whether
|
691
|
+
:class:`sage.modules.free_module.FreeModule`,
|
692
|
+
:class:`sage.combinat.free_module.CombinatorialFreeModule`,
|
693
|
+
:class:`sage.tensor.modules.finite_rank_free_module.FiniteRankFreeModule`, or
|
694
|
+
additive abelian groups, should be marked ``# needs sage.modules``.
|
695
|
+
|
696
|
+
The same holds for matrices, tensors, algebras, quadratic forms,
|
697
|
+
point lattices, root systems, matrix/affine/Weyl/Coxeter groups, matroids,
|
698
|
+
and ring derivations.
|
699
|
+
|
700
|
+
Likewise, all uses of :mod:`sage.coding`, :mod:`sage.crypto`, and :mod:`sage.homology`
|
701
|
+
in doctests should be marked ``# needs sage.modules``.
|
702
|
+
|
703
|
+
TESTS::
|
704
|
+
|
705
|
+
sage: from sage.features.sagemath import sage__modules
|
706
|
+
sage: sage__modules().is_present() # needs sage.modules
|
707
|
+
FeatureTestResult('sage.modules', True)
|
708
|
+
"""
|
709
|
+
def __init__(self):
|
710
|
+
r"""
|
711
|
+
TESTS::
|
712
|
+
|
713
|
+
sage: from sage.features.sagemath import sage__modules
|
714
|
+
sage: isinstance(sage__modules(), sage__modules)
|
715
|
+
True
|
716
|
+
"""
|
717
|
+
JoinFeature.__init__(self, 'sage.modules',
|
718
|
+
[PythonModule('sage.modules'), # namespace package
|
719
|
+
PythonModule('sage.modules.free_module'), # representative
|
720
|
+
PythonModule('sage.matrix'), # namespace package
|
721
|
+
PythonModule('sage.matrix.matrix2'), # representative
|
722
|
+
PythonModule('sage.combinat.free_module'),
|
723
|
+
PythonModule('sage.quadratic_forms'), # namespace package
|
724
|
+
PythonModule('sage.quadratic_forms.quadratic_form'), # representative
|
725
|
+
PythonModule('sage.groups.additive_abelian'), # namespace package
|
726
|
+
PythonModule('sage.groups.additive_abelian.qmodnz'), # representative
|
727
|
+
PythonModule('sage.groups.affine_gps'), # namespace package
|
728
|
+
PythonModule('sage.groups.affine_gps.affine_group'), # representative
|
729
|
+
PythonModule('sage.groups.matrix_gps'), # namespace package
|
730
|
+
PythonModule('sage.groups.matrix_gps.named_group'), # representative
|
731
|
+
PythonModule('sage.homology'), # namespace package
|
732
|
+
PythonModule('sage.homology.chain_complex'), # representative
|
733
|
+
PythonModule('sage.matroids'), # namespace package
|
734
|
+
PythonModule('sage.matroids.matroid'), # representative
|
735
|
+
],
|
736
|
+
spkg='sagemath_modules', type='standard')
|
737
|
+
|
738
|
+
|
739
|
+
class sage__numerical__mip(PythonModule):
|
740
|
+
r"""
|
741
|
+
A :class:`~sage.features.Feature` describing the presence of :mod:`sage.numerical.mip`.
|
742
|
+
|
743
|
+
TESTS::
|
744
|
+
|
745
|
+
sage: from sage.features.sagemath import sage__numerical__mip
|
746
|
+
sage: sage__numerical__mip().is_present() # needs sage.numerical.mip
|
747
|
+
FeatureTestResult('sage.numerical.mip', True)
|
748
|
+
"""
|
749
|
+
def __init__(self):
|
750
|
+
r"""
|
751
|
+
TESTS::
|
752
|
+
|
753
|
+
sage: from sage.features.sagemath import sage__numerical__mip
|
754
|
+
sage: isinstance(sage__numerical__mip(), sage__numerical__mip)
|
755
|
+
True
|
756
|
+
"""
|
757
|
+
PythonModule.__init__(self, 'sage.numerical.mip',
|
758
|
+
spkg='sagemath_polyhedra')
|
759
|
+
|
760
|
+
|
761
|
+
class sage__plot(JoinFeature):
|
762
|
+
r"""
|
763
|
+
A :class:`~sage.features.Feature` describing the presence of :mod:`sage.plot`.
|
764
|
+
|
765
|
+
TESTS::
|
766
|
+
|
767
|
+
sage: from sage.features.sagemath import sage__plot
|
768
|
+
sage: sage__plot().is_present() # needs sage.plot
|
769
|
+
FeatureTestResult('sage.plot', True)
|
770
|
+
"""
|
771
|
+
def __init__(self):
|
772
|
+
r"""
|
773
|
+
TESTS::
|
774
|
+
|
775
|
+
sage: from sage.features.sagemath import sage__plot
|
776
|
+
sage: isinstance(sage__plot(), sage__plot)
|
777
|
+
True
|
778
|
+
"""
|
779
|
+
JoinFeature.__init__(self, 'sage.plot',
|
780
|
+
[PythonModule('sage.plot.plot')],
|
781
|
+
spkg='sagemath_plot', type='standard')
|
782
|
+
|
783
|
+
|
784
|
+
class sage__rings__complex_double(PythonModule):
|
785
|
+
r"""
|
786
|
+
A :class:`~sage.features.Feature` describing the presence of :mod:`sage.rings.complex_double`.
|
787
|
+
|
788
|
+
TESTS::
|
789
|
+
|
790
|
+
sage: from sage.features.sagemath import sage__rings__complex_double
|
791
|
+
sage: sage__rings__complex_double().is_present() # needs sage.rings.complex_double
|
792
|
+
FeatureTestResult('sage.rings.complex_double', True)
|
793
|
+
"""
|
794
|
+
def __init__(self):
|
795
|
+
r"""
|
796
|
+
TESTS::
|
797
|
+
|
798
|
+
sage: from sage.features.sagemath import sage__rings__complex_double
|
799
|
+
sage: isinstance(sage__rings__complex_double(), sage__rings__complex_double)
|
800
|
+
True
|
801
|
+
"""
|
802
|
+
PythonModule.__init__(self, 'sage.rings.complex_double',
|
803
|
+
spkg='sagemath_modules', type='standard')
|
804
|
+
|
805
|
+
|
806
|
+
class sage__rings__finite_rings(JoinFeature):
|
807
|
+
r"""
|
808
|
+
A :class:`~sage.features.Feature` describing the presence of :mod:`sage.rings.finite_rings`;
|
809
|
+
specifically, the element implementations using the :ref:`PARI <spkg_pari>` library.
|
810
|
+
|
811
|
+
TESTS::
|
812
|
+
|
813
|
+
sage: from sage.features.sagemath import sage__rings__finite_rings
|
814
|
+
sage: sage__rings__finite_rings().is_present() # needs sage.rings.finite_rings
|
815
|
+
FeatureTestResult('sage.rings.finite_rings', True)
|
816
|
+
"""
|
817
|
+
def __init__(self):
|
818
|
+
r"""
|
819
|
+
TESTS::
|
820
|
+
|
821
|
+
sage: from sage.features.sagemath import sage__rings__finite_rings
|
822
|
+
sage: isinstance(sage__rings__finite_rings(), sage__rings__finite_rings)
|
823
|
+
True
|
824
|
+
"""
|
825
|
+
JoinFeature.__init__(self, 'sage.rings.finite_rings',
|
826
|
+
[PythonModule('sage.rings.finite_rings.element_pari_ffelt'),
|
827
|
+
PythonModule('sage.rings.algebraic_closure_finite_field'),
|
828
|
+
sage__libs__pari()],
|
829
|
+
type='standard')
|
830
|
+
|
831
|
+
|
832
|
+
class sage__rings__function_field(JoinFeature):
|
833
|
+
r"""
|
834
|
+
A :class:`~sage.features.Feature` describing the presence of :mod:`sage.rings.function_field`.
|
835
|
+
|
836
|
+
EXAMPLES:
|
837
|
+
|
838
|
+
Rational function fields are always available::
|
839
|
+
|
840
|
+
sage: K.<x> = FunctionField(QQ)
|
841
|
+
sage: K.maximal_order()
|
842
|
+
Maximal order of Rational function field in x over Rational Field
|
843
|
+
|
844
|
+
Use the tag ``# needs sage.rings.function_field`` whenever extensions
|
845
|
+
of function fields (by adjoining a root of a univariate polynomial) come into play::
|
846
|
+
|
847
|
+
sage: R.<y> = K[]
|
848
|
+
sage: L.<y> = K.extension(y^5 - (x^3 + 2*x*y + 1/x)); L # needs sage.rings.function_field
|
849
|
+
Function field in y defined by y^5 - 2*x*y + (-x^4 - 1)/x
|
850
|
+
|
851
|
+
Such extensions of function fields are implemented using Gröbner bases of polynomial rings;
|
852
|
+
Sage makes essential use of the :ref:`Singular <spkg_singular>` system for this.
|
853
|
+
(It is not necessary to use the tag ``# needs sage.libs.singular``; it is
|
854
|
+
implied by ``# needs sage.rings.function_field``.)
|
855
|
+
|
856
|
+
TESTS::
|
857
|
+
|
858
|
+
sage: from sage.features.sagemath import sage__rings__function_field
|
859
|
+
sage: sage__rings__function_field().is_present() # needs sage.rings.function_field
|
860
|
+
FeatureTestResult('sage.rings.function_field', True)
|
861
|
+
"""
|
862
|
+
def __init__(self):
|
863
|
+
r"""
|
864
|
+
TESTS::
|
865
|
+
|
866
|
+
sage: from sage.features.sagemath import sage__rings__function_field
|
867
|
+
sage: isinstance(sage__rings__function_field(), sage__rings__function_field)
|
868
|
+
True
|
869
|
+
"""
|
870
|
+
JoinFeature.__init__(self, 'sage.rings.function_field',
|
871
|
+
[PythonModule('sage.rings.function_field.function_field_polymod'),
|
872
|
+
sage__libs__singular()],
|
873
|
+
type='standard')
|
874
|
+
|
875
|
+
|
876
|
+
class sage__rings__number_field(JoinFeature):
|
877
|
+
r"""
|
878
|
+
A :class:`~sage.features.Feature` describing the presence of :mod:`sage.rings.number_field`.
|
879
|
+
|
880
|
+
Number fields are implemented in Sage using a complicated mixture of various libraries,
|
881
|
+
including :ref:`FLINT <spkg_flint>`, :ref:`GAP <spkg_gap>`,
|
882
|
+
:ref:`MPFI <spkg_mpfi>`, :ref:`NTL <spkg_ntl>`, and :ref:`PARI <spkg_pari>`.
|
883
|
+
|
884
|
+
EXAMPLES:
|
885
|
+
|
886
|
+
Rational numbers are, of course, always available::
|
887
|
+
|
888
|
+
sage: QQ in NumberFields()
|
889
|
+
True
|
890
|
+
|
891
|
+
Doctests that construct algebraic number fields should be marked ``# needs sage.rings.number_field``::
|
892
|
+
|
893
|
+
sage: # needs sage.rings.number_field
|
894
|
+
sage: K.<cuberoot2> = NumberField(x^3 - 2)
|
895
|
+
sage: L.<cuberoot3> = K.extension(x^3 - 3)
|
896
|
+
sage: S.<sqrt2> = L.extension(x^2 - 2); S
|
897
|
+
Number Field in sqrt2 with defining polynomial x^2 - 2 over its base field
|
898
|
+
|
899
|
+
sage: # needs sage.rings.number_field
|
900
|
+
sage: K.<zeta> = CyclotomicField(15)
|
901
|
+
sage: CC(zeta)
|
902
|
+
0.913545457642601 + 0.406736643075800*I
|
903
|
+
|
904
|
+
Doctests that make use of the algebraic field ``QQbar`` or the algebraic real field ``AA``
|
905
|
+
should be marked likewise::
|
906
|
+
|
907
|
+
sage: # needs sage.rings.number_field
|
908
|
+
sage: AA(-1)^(1/3)
|
909
|
+
-1
|
910
|
+
sage: QQbar(-1)^(1/3)
|
911
|
+
0.500000000000000? + 0.866025403784439?*I
|
912
|
+
|
913
|
+
Use of the universal cyclotomic field should be marked
|
914
|
+
``# needs sage.libs.gap sage.rings.number_field``.
|
915
|
+
|
916
|
+
sage: # needs sage.libs.gap sage.rings.number_field
|
917
|
+
sage: UCF = UniversalCyclotomicField(); UCF
|
918
|
+
Universal Cyclotomic Field
|
919
|
+
sage: E = UCF.gen
|
920
|
+
sage: f = E(2) + E(3); f
|
921
|
+
2*E(3) + E(3)^2
|
922
|
+
sage: f.galois_conjugates()
|
923
|
+
[2*E(3) + E(3)^2, E(3) + 2*E(3)^2]
|
924
|
+
|
925
|
+
TESTS::
|
926
|
+
|
927
|
+
sage: from sage.features.sagemath import sage__rings__number_field
|
928
|
+
sage: sage__rings__number_field().is_present() # needs sage.rings.number_field
|
929
|
+
FeatureTestResult('sage.rings.number_field', True)
|
930
|
+
"""
|
931
|
+
def __init__(self):
|
932
|
+
r"""
|
933
|
+
TESTS::
|
934
|
+
|
935
|
+
sage: from sage.features.sagemath import sage__rings__number_field
|
936
|
+
sage: isinstance(sage__rings__number_field(), sage__rings__number_field)
|
937
|
+
True
|
938
|
+
"""
|
939
|
+
JoinFeature.__init__(self, 'sage.rings.number_field',
|
940
|
+
[PythonModule('sage.rings.number_field.number_field_element'),
|
941
|
+
PythonModule('sage.rings.universal_cyclotomic_field'),
|
942
|
+
PythonModule('sage.rings.qqbar')],
|
943
|
+
type='standard')
|
944
|
+
|
945
|
+
|
946
|
+
class sage__rings__padics(JoinFeature):
|
947
|
+
r"""
|
948
|
+
A :class:`~sage.features.Feature` describing the presence of ``sage.rings.padics``.
|
949
|
+
|
950
|
+
TESTS::
|
951
|
+
|
952
|
+
sage: from sage.features.sagemath import sage__rings__padics
|
953
|
+
sage: sage__rings__padics().is_present() # needs sage.rings.padics
|
954
|
+
FeatureTestResult('sage.rings.padics', True)
|
955
|
+
"""
|
956
|
+
def __init__(self):
|
957
|
+
r"""
|
958
|
+
TESTS::
|
959
|
+
|
960
|
+
sage: from sage.features.sagemath import sage__rings__padics
|
961
|
+
sage: isinstance(sage__rings__padics(), sage__rings__padics)
|
962
|
+
True
|
963
|
+
"""
|
964
|
+
JoinFeature.__init__(self, 'sage.rings.padics',
|
965
|
+
[PythonModule('sage.rings.padics.factory')],
|
966
|
+
type='standard')
|
967
|
+
|
968
|
+
|
969
|
+
class sage__rings__polynomial__pbori(JoinFeature):
|
970
|
+
r"""
|
971
|
+
A :class:`sage.features.Feature` describing the presence of :mod:`sage.rings.polynomial.pbori`.
|
972
|
+
|
973
|
+
TESTS::
|
974
|
+
|
975
|
+
sage: from sage.features.sagemath import sage__rings__polynomial__pbori
|
976
|
+
sage: sage__rings__polynomial__pbori().is_present() # needs sage.rings.polynomial.pbori
|
977
|
+
FeatureTestResult('sage.rings.polynomial.pbori', True)
|
978
|
+
"""
|
979
|
+
def __init__(self):
|
980
|
+
r"""
|
981
|
+
TESTS::
|
982
|
+
|
983
|
+
sage: from sage.features.sagemath import sage__rings__polynomial__pbori
|
984
|
+
sage: isinstance(sage__rings__polynomial__pbori(), sage__rings__polynomial__pbori)
|
985
|
+
True
|
986
|
+
"""
|
987
|
+
JoinFeature.__init__(self, 'sage.rings.polynomial.pbori',
|
988
|
+
[PythonModule('sage.rings.polynomial.pbori.pbori')],
|
989
|
+
spkg='sagemath_brial', type='standard')
|
990
|
+
|
991
|
+
|
992
|
+
class sage__rings__real_double(PythonModule):
|
993
|
+
r"""
|
994
|
+
A :class:`~sage.features.Feature` describing the presence of :mod:`sage.rings.real_double`.
|
995
|
+
|
996
|
+
EXAMPLES:
|
997
|
+
|
998
|
+
The Real Double Field is basically always available, and no ``# optional/needs`` tag is needed::
|
999
|
+
|
1000
|
+
sage: RDF.characteristic()
|
1001
|
+
0
|
1002
|
+
|
1003
|
+
The feature exists for use in doctests of Python modules that are shipped by the
|
1004
|
+
most fundamental distributions.
|
1005
|
+
|
1006
|
+
TESTS::
|
1007
|
+
|
1008
|
+
sage: from sage.features.sagemath import sage__rings__real_double
|
1009
|
+
sage: sage__rings__real_double().is_present() # needs sage.rings.real_double
|
1010
|
+
FeatureTestResult('sage.rings.real_double', True)
|
1011
|
+
"""
|
1012
|
+
def __init__(self):
|
1013
|
+
r"""
|
1014
|
+
TESTS::
|
1015
|
+
|
1016
|
+
sage: from sage.features.sagemath import sage__rings__real_double
|
1017
|
+
sage: isinstance(sage__rings__real_double(), sage__rings__real_double)
|
1018
|
+
True
|
1019
|
+
"""
|
1020
|
+
PythonModule.__init__(self, 'sage.rings.real_double', type='standard')
|
1021
|
+
|
1022
|
+
|
1023
|
+
class sage__rings__real_mpfr(JoinFeature):
|
1024
|
+
r"""
|
1025
|
+
A :class:`~sage.features.Feature` describing the presence of :mod:`sage.rings.real_mpfr`.
|
1026
|
+
|
1027
|
+
TESTS::
|
1028
|
+
|
1029
|
+
sage: from sage.features.sagemath import sage__rings__real_mpfr
|
1030
|
+
sage: sage__rings__real_mpfr().is_present() # needs sage.rings.real_mpfr
|
1031
|
+
FeatureTestResult('sage.rings.real_mpfr', True)
|
1032
|
+
"""
|
1033
|
+
def __init__(self):
|
1034
|
+
r"""
|
1035
|
+
TESTS::
|
1036
|
+
|
1037
|
+
sage: from sage.features.sagemath import sage__rings__real_mpfr
|
1038
|
+
sage: isinstance(sage__rings__real_mpfr(), sage__rings__real_mpfr)
|
1039
|
+
True
|
1040
|
+
"""
|
1041
|
+
JoinFeature.__init__(self, 'sage.rings.real_mpfr',
|
1042
|
+
[PythonModule('sage.rings.real_mpfr'),
|
1043
|
+
PythonModule('sage.rings.complex_mpfr'),
|
1044
|
+
],
|
1045
|
+
spkg='sagemath_modules', type='standard')
|
1046
|
+
|
1047
|
+
|
1048
|
+
class sage__sat(JoinFeature):
|
1049
|
+
r"""
|
1050
|
+
A :class:`~sage.features.Feature` describing the presence of :mod:`sage.sat`.
|
1051
|
+
|
1052
|
+
TESTS::
|
1053
|
+
|
1054
|
+
sage: from sage.features.sagemath import sage__sat
|
1055
|
+
sage: sage__sat().is_present() # needs sage.sat
|
1056
|
+
FeatureTestResult('sage.sat', True)
|
1057
|
+
"""
|
1058
|
+
def __init__(self):
|
1059
|
+
r"""
|
1060
|
+
TESTS::
|
1061
|
+
|
1062
|
+
sage: from sage.features.sagemath import sage__sat
|
1063
|
+
sage: isinstance(sage__sat(), sage__sat)
|
1064
|
+
True
|
1065
|
+
"""
|
1066
|
+
JoinFeature.__init__(self, 'sage.sat',
|
1067
|
+
[PythonModule('sage.sat.expression')],
|
1068
|
+
spkg='sagemath_combinat', type='standard')
|
1069
|
+
|
1070
|
+
|
1071
|
+
class sage__schemes(JoinFeature):
|
1072
|
+
r"""
|
1073
|
+
A :class:`~sage.features.Feature` describing the presence of :mod:`sage.schemes`.
|
1074
|
+
|
1075
|
+
TESTS::
|
1076
|
+
|
1077
|
+
sage: from sage.features.sagemath import sage__schemes
|
1078
|
+
sage: sage__schemes().is_present() # needs sage.schemes
|
1079
|
+
FeatureTestResult('sage.schemes', True)
|
1080
|
+
"""
|
1081
|
+
def __init__(self):
|
1082
|
+
r"""
|
1083
|
+
TESTS::
|
1084
|
+
|
1085
|
+
sage: from sage.features.sagemath import sage__schemes
|
1086
|
+
sage: isinstance(sage__schemes(), sage__schemes)
|
1087
|
+
True
|
1088
|
+
"""
|
1089
|
+
JoinFeature.__init__(self, 'sage.schemes',
|
1090
|
+
[PythonModule('sage.schemes.elliptic_curves.ell_generic')],
|
1091
|
+
spkg='sagemath_schemes', type='standard')
|
1092
|
+
|
1093
|
+
|
1094
|
+
class sage__symbolic(JoinFeature):
|
1095
|
+
r"""
|
1096
|
+
A :class:`~sage.features.Feature` describing the presence of :mod:`sage.symbolic`.
|
1097
|
+
|
1098
|
+
EXAMPLES:
|
1099
|
+
|
1100
|
+
The symbolics subsystem of Sage will be provided by the distribution
|
1101
|
+
sagemath-symbolics, in preparation at :issue:`35095`. If it is not installed,
|
1102
|
+
Sage will be able to provide installation advice::
|
1103
|
+
|
1104
|
+
sage: from sage.features.sagemath import sage__symbolic
|
1105
|
+
sage: print(sage__symbolic().resolution()) # optional - sage_spkg, not tested
|
1106
|
+
...To install sagemath_symbolics...you can try to run...
|
1107
|
+
pip install sagemath-symbolics
|
1108
|
+
...
|
1109
|
+
|
1110
|
+
TESTS::
|
1111
|
+
|
1112
|
+
sage: from sage.features.sagemath import sage__symbolic
|
1113
|
+
sage: sage__symbolic().is_present() # needs sage.symbolic
|
1114
|
+
FeatureTestResult('sage.symbolic', True)
|
1115
|
+
"""
|
1116
|
+
def __init__(self):
|
1117
|
+
r"""
|
1118
|
+
TESTS::
|
1119
|
+
|
1120
|
+
sage: from sage.features.sagemath import sage__symbolic
|
1121
|
+
sage: isinstance(sage__symbolic(), sage__symbolic)
|
1122
|
+
True
|
1123
|
+
"""
|
1124
|
+
JoinFeature.__init__(self, 'sage.symbolic',
|
1125
|
+
[PythonModule('sage.symbolic.expression'),
|
1126
|
+
PythonModule('sage.manifolds'),
|
1127
|
+
PythonModule('sage.calculus.calculus'),
|
1128
|
+
PythonModule('sage.calculus.desolvers'),
|
1129
|
+
PythonModule('sage.calculus.predefined'),
|
1130
|
+
PythonModule('sage.calculus.tests'),
|
1131
|
+
PythonModule('sage.calculus.var'),
|
1132
|
+
PythonModule('sage.geometry.riemannian_manifolds'),
|
1133
|
+
PythonModule('sage.geometry.hyperbolic_space'),
|
1134
|
+
PythonModule('sage.dynamics.complex_dynamics'),
|
1135
|
+
PythonModule('sage.libs.ecl'),
|
1136
|
+
PythonModule('sage.interfaces.fricas'),
|
1137
|
+
PythonModule('sage.interfaces.giac'),
|
1138
|
+
PythonModule('sage.interfaces.magma'),
|
1139
|
+
PythonModule('sage.interfaces.magma_free'),
|
1140
|
+
PythonModule('sage.interfaces.maple'),
|
1141
|
+
PythonModule('sage.interfaces.mathematica'),
|
1142
|
+
PythonModule('sage.interfaces.mathics'),
|
1143
|
+
PythonModule('sage.interfaces.maxima'),
|
1144
|
+
PythonModule('sage.interfaces.maxima_abstract'),
|
1145
|
+
PythonModule('sage.interfaces.maxima_lib'),
|
1146
|
+
PythonModule('sage.interfaces.qepcad'),
|
1147
|
+
PythonModule('sage.interfaces.sympy'),
|
1148
|
+
PythonModule('sage.interfaces.sympy_wrapper'),
|
1149
|
+
], spkg='sagemath_symbolics', type='standard')
|
1150
|
+
|
1151
|
+
|
1152
|
+
def all_features():
|
1153
|
+
r"""
|
1154
|
+
Return features corresponding to parts of the Sage library.
|
1155
|
+
|
1156
|
+
These features are named after Python packages/modules (e.g., :mod:`sage.symbolic`),
|
1157
|
+
not distribution packages (**sagemath-symbolics**).
|
1158
|
+
|
1159
|
+
This design is motivated by a separation of concerns: The author of a module that depends
|
1160
|
+
on some functionality provided by a Python module usually already knows the
|
1161
|
+
name of the Python module, so we do not want to force the author to also
|
1162
|
+
know about the distribution package that provides the Python module.
|
1163
|
+
|
1164
|
+
Instead, we associate distribution packages to Python modules in
|
1165
|
+
:mod:`sage.features.sagemath` via the ``spkg`` parameter of
|
1166
|
+
:class:`~sage.features.Feature`.
|
1167
|
+
|
1168
|
+
EXAMPLES::
|
1169
|
+
|
1170
|
+
sage: from sage.features.sagemath import all_features
|
1171
|
+
sage: list(all_features())
|
1172
|
+
[...Feature('sage.combinat'), ...]
|
1173
|
+
"""
|
1174
|
+
return [SAGE_SRC(),
|
1175
|
+
sagemath_doc_html(),
|
1176
|
+
sage__combinat(),
|
1177
|
+
sage__geometry__polyhedron(),
|
1178
|
+
sage__graphs(),
|
1179
|
+
sage__groups(),
|
1180
|
+
sage__libs__braiding(),
|
1181
|
+
sage__libs__ecl(),
|
1182
|
+
sage__libs__flint(),
|
1183
|
+
sage__libs__gap(),
|
1184
|
+
sage__libs__giac(),
|
1185
|
+
sage__libs__homfly(),
|
1186
|
+
sage__libs__linbox(),
|
1187
|
+
sage__libs__m4ri(),
|
1188
|
+
sage__libs__ntl(),
|
1189
|
+
sage__libs__pari(),
|
1190
|
+
sage__libs__singular(),
|
1191
|
+
sage__modular(),
|
1192
|
+
sage__modules(),
|
1193
|
+
sage__numerical__mip(),
|
1194
|
+
sage__plot(),
|
1195
|
+
sage__rings__complex_double(),
|
1196
|
+
sage__rings__finite_rings(),
|
1197
|
+
sage__rings__function_field(),
|
1198
|
+
sage__rings__number_field(),
|
1199
|
+
sage__rings__padics(),
|
1200
|
+
sage__rings__polynomial__pbori(),
|
1201
|
+
sage__rings__real_double(),
|
1202
|
+
sage__rings__real_mpfr(),
|
1203
|
+
sage__sat(),
|
1204
|
+
sage__schemes(),
|
1205
|
+
sage__symbolic()]
|