passagemath-standard-no-symbolics 10.6.4__cp310-cp310-macosx_14_0_arm64.whl → 10.6.6__cp310-cp310-macosx_14_0_arm64.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.
Potentially problematic release.
This version of passagemath-standard-no-symbolics might be problematic. Click here for more details.
- {passagemath_standard_no_symbolics-10.6.4.dist-info → passagemath_standard_no_symbolics-10.6.6.dist-info}/METADATA +37 -37
- {passagemath_standard_no_symbolics-10.6.4.dist-info → passagemath_standard_no_symbolics-10.6.6.dist-info}/RECORD +9 -14
- sage/databases/all.py +4 -9
- sage/interacts/library_cython.cpython-310-darwin.so +0 -0
- sage/databases/cunningham_tables.py +0 -53
- sage/databases/db_class_polynomials.py +0 -135
- sage/databases/jones.py +0 -281
- sage/databases/odlyzko.py +0 -59
- sage/databases/symbolic_data.py +0 -221
- {passagemath_standard_no_symbolics-10.6.4.data → passagemath_standard_no_symbolics-10.6.6.data}/scripts/sage-grep +0 -0
- {passagemath_standard_no_symbolics-10.6.4.data → passagemath_standard_no_symbolics-10.6.6.data}/scripts/sage-grepdoc +0 -0
- {passagemath_standard_no_symbolics-10.6.4.data → passagemath_standard_no_symbolics-10.6.6.data}/scripts/sage-list-packages +0 -0
- {passagemath_standard_no_symbolics-10.6.4.dist-info → passagemath_standard_no_symbolics-10.6.6.dist-info}/WHEEL +0 -0
- {passagemath_standard_no_symbolics-10.6.4.dist-info → passagemath_standard_no_symbolics-10.6.6.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: passagemath-standard-no-symbolics
|
|
3
|
-
Version: 10.6.
|
|
3
|
+
Version: 10.6.6
|
|
4
4
|
Summary: passagemath: Sage library without the symbolics subsystem
|
|
5
5
|
Author-email: The Sage Developers <sage-support@googlegroups.com>
|
|
6
6
|
Maintainer: Matthias Köppe, passagemath contributors
|
|
@@ -29,42 +29,42 @@ Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
|
29
29
|
Requires-Python: <3.14,>=3.10
|
|
30
30
|
Description-Content-Type: text/x-rst
|
|
31
31
|
Requires-Dist: six>=1.15.0
|
|
32
|
-
Requires-Dist: passagemath-brial~=10.6.
|
|
33
|
-
Requires-Dist: passagemath-categories~=10.6.
|
|
34
|
-
Requires-Dist: passagemath-cddlib~=10.6.
|
|
35
|
-
Requires-Dist: passagemath-combinat~=10.6.
|
|
36
|
-
Requires-Dist: passagemath-eclib~=10.6.
|
|
37
|
-
Requires-Dist: passagemath-environment~=10.6.
|
|
38
|
-
Requires-Dist: passagemath-flint~=10.6.
|
|
39
|
-
Requires-Dist: passagemath-gap~=10.6.
|
|
40
|
-
Requires-Dist: passagemath-gap-pkg-transgrp-data~=10.6.
|
|
41
|
-
Requires-Dist: passagemath-gap-pkg-ctbllib-data~=10.6.
|
|
42
|
-
Requires-Dist: passagemath-gap-pkg-tomlib-data~=10.6.
|
|
43
|
-
Requires-Dist: passagemath-gap-pkg-irredsol-data~=10.6.
|
|
44
|
-
Requires-Dist: passagemath-giac~=10.6.
|
|
45
|
-
Requires-Dist: passagemath-glpk~=10.6.
|
|
46
|
-
Requires-Dist: passagemath-graphs~=10.6.
|
|
47
|
-
Requires-Dist: passagemath-groups~=10.6.
|
|
48
|
-
Requires-Dist: passagemath-homfly~=10.6.
|
|
49
|
-
Requires-Dist: passagemath-lcalc~=10.6.
|
|
50
|
-
Requires-Dist: passagemath-libbraiding~=10.6.
|
|
51
|
-
Requires-Dist: passagemath-libecm~=10.6.
|
|
52
|
-
Requires-Dist: passagemath-linbox~=10.6.
|
|
53
|
-
Requires-Dist: passagemath-modules~=10.6.
|
|
54
|
-
Requires-Dist: passagemath-nauty~=10.6.
|
|
55
|
-
Requires-Dist: passagemath-ntl~=10.6.
|
|
56
|
-
Requires-Dist: passagemath-objects~=10.6.
|
|
57
|
-
Requires-Dist: passagemath-palp~=10.6.
|
|
58
|
-
Requires-Dist: passagemath-pari~=10.6.
|
|
59
|
-
Requires-Dist: passagemath-pari-galdata~=10.6.
|
|
60
|
-
Requires-Dist: passagemath-pari-seadata-small~=10.6.
|
|
61
|
-
Requires-Dist: passagemath-planarity~=10.6.
|
|
62
|
-
Requires-Dist: passagemath-plot~=10.6.
|
|
63
|
-
Requires-Dist: passagemath-polyhedra~=10.6.
|
|
64
|
-
Requires-Dist: passagemath-repl~=10.6.
|
|
65
|
-
Requires-Dist: passagemath-schemes~=10.6.
|
|
66
|
-
Requires-Dist: passagemath-singular~=10.6.
|
|
67
|
-
Requires-Dist: passagemath-tachyon~=10.6.
|
|
32
|
+
Requires-Dist: passagemath-brial~=10.6.6.0
|
|
33
|
+
Requires-Dist: passagemath-categories~=10.6.6.0
|
|
34
|
+
Requires-Dist: passagemath-cddlib~=10.6.6.0
|
|
35
|
+
Requires-Dist: passagemath-combinat~=10.6.6.0
|
|
36
|
+
Requires-Dist: passagemath-eclib~=10.6.6.0
|
|
37
|
+
Requires-Dist: passagemath-environment~=10.6.6.0
|
|
38
|
+
Requires-Dist: passagemath-flint~=10.6.6.0
|
|
39
|
+
Requires-Dist: passagemath-gap~=10.6.6.0
|
|
40
|
+
Requires-Dist: passagemath-gap-pkg-transgrp-data~=10.6.6.0
|
|
41
|
+
Requires-Dist: passagemath-gap-pkg-ctbllib-data~=10.6.6.0
|
|
42
|
+
Requires-Dist: passagemath-gap-pkg-tomlib-data~=10.6.6.0
|
|
43
|
+
Requires-Dist: passagemath-gap-pkg-irredsol-data~=10.6.6.0
|
|
44
|
+
Requires-Dist: passagemath-giac~=10.6.6.0
|
|
45
|
+
Requires-Dist: passagemath-glpk~=10.6.6.0
|
|
46
|
+
Requires-Dist: passagemath-graphs~=10.6.6.0
|
|
47
|
+
Requires-Dist: passagemath-groups~=10.6.6.0
|
|
48
|
+
Requires-Dist: passagemath-homfly~=10.6.6.0
|
|
49
|
+
Requires-Dist: passagemath-lcalc~=10.6.6.0
|
|
50
|
+
Requires-Dist: passagemath-libbraiding~=10.6.6.0
|
|
51
|
+
Requires-Dist: passagemath-libecm~=10.6.6.0
|
|
52
|
+
Requires-Dist: passagemath-linbox~=10.6.6.0
|
|
53
|
+
Requires-Dist: passagemath-modules~=10.6.6.0
|
|
54
|
+
Requires-Dist: passagemath-nauty~=10.6.6.0
|
|
55
|
+
Requires-Dist: passagemath-ntl~=10.6.6.0
|
|
56
|
+
Requires-Dist: passagemath-objects~=10.6.6.0
|
|
57
|
+
Requires-Dist: passagemath-palp~=10.6.6.0
|
|
58
|
+
Requires-Dist: passagemath-pari~=10.6.6.0
|
|
59
|
+
Requires-Dist: passagemath-pari-galdata~=10.6.6.0
|
|
60
|
+
Requires-Dist: passagemath-pari-seadata-small~=10.6.6.0
|
|
61
|
+
Requires-Dist: passagemath-planarity~=10.6.6.0
|
|
62
|
+
Requires-Dist: passagemath-plot~=10.6.6.0
|
|
63
|
+
Requires-Dist: passagemath-polyhedra~=10.6.6.0
|
|
64
|
+
Requires-Dist: passagemath-repl~=10.6.6.0
|
|
65
|
+
Requires-Dist: passagemath-schemes~=10.6.6.0
|
|
66
|
+
Requires-Dist: passagemath-singular~=10.6.6.0
|
|
67
|
+
Requires-Dist: passagemath-tachyon~=10.6.6.0
|
|
68
68
|
Requires-Dist: cysignals<1.12.4; sys_platform == "win32"
|
|
69
69
|
Requires-Dist: cysignals!=1.12.0,>=1.11.2
|
|
70
70
|
Requires-Dist: cython!=3.0.3,<4.0,>=3.0
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
passagemath_standard_no_symbolics-10.6.
|
|
2
|
-
passagemath_standard_no_symbolics-10.6.
|
|
3
|
-
passagemath_standard_no_symbolics-10.6.
|
|
4
|
-
passagemath_standard_no_symbolics-10.6.
|
|
5
|
-
passagemath_standard_no_symbolics-10.6.
|
|
6
|
-
passagemath_standard_no_symbolics-10.6.
|
|
7
|
-
passagemath_standard_no_symbolics-10.6.
|
|
1
|
+
passagemath_standard_no_symbolics-10.6.6.data/scripts/sage-grep,sha256=y7No1LTYggkkven17dnoZKnBiZm8TO6iw8KEJkJSRmg,119
|
|
2
|
+
passagemath_standard_no_symbolics-10.6.6.data/scripts/sage-list-packages,sha256=4vwXzr1iKz2NPJwlfd7j0uBExqkxkSyhyyIqPtqVFFM,3650
|
|
3
|
+
passagemath_standard_no_symbolics-10.6.6.data/scripts/sage-grepdoc,sha256=R855yu3m539GvfdhptwsDG3Dgwb8wvHBJQDhBIrv4jA,70
|
|
4
|
+
passagemath_standard_no_symbolics-10.6.6.dist-info/RECORD,,
|
|
5
|
+
passagemath_standard_no_symbolics-10.6.6.dist-info/WHEEL,sha256=BY2G-e9pCnwWPELNk7GCw-k-0y7AcCiRrhf_nAfhQVk,136
|
|
6
|
+
passagemath_standard_no_symbolics-10.6.6.dist-info/top_level.txt,sha256=hibFyzQHiLOMK68qL1OWsNKaXOmSXqZjeLTBem6Yy7I,5
|
|
7
|
+
passagemath_standard_no_symbolics-10.6.6.dist-info/METADATA,sha256=DIhjRmVeuEQgGnhJ8E_HhdTgDQJ0wDzCl2jB1ar12TE,7098
|
|
8
8
|
sage/all_cmdline.py,sha256=CJOAQpBYbSivmPwuVeWH-9G1tPpRuckNlEV7VXOTb7c,1252
|
|
9
9
|
sage/all.py,sha256=_7HnXjnSwDO3HYTZIpkw5-Jpmp45IzzpIoWwAQXXu7Q,6297
|
|
10
10
|
sage/misc/lazy_attribute.pyi,sha256=lEUbITjqow28vc89Nov-k82LDLrYH6D2Q86kiYbBCJ4,425
|
|
11
11
|
sage/misc/all.py,sha256=oIpAlwSBebAtKQxqIcrdHSu97Ea56FIH7CdrzwUBN7g,1372
|
|
12
12
|
sage/databases/cubic_hecke_db.py,sha256=r5L5BdjpoxcnkdtpdCLhj9XfdiU4jZNZnjzqYph_qaE,63703
|
|
13
|
-
sage/databases/
|
|
14
|
-
sage/databases/all.py,sha256=L0rd_zJydUvj8sQrgUQ5FFjF2o3owxd2SQLOWd-AVl0,2268
|
|
15
|
-
sage/databases/odlyzko.py,sha256=T141r1wjJiXsUVYlP-4EybiKLbGTKYxXKKO7vShaA0Y,1840
|
|
16
|
-
sage/databases/cunningham_tables.py,sha256=8Iebzrjx-SXJTBSQcGLvau-hVcuI5Vei7ZfkFeI_5cw,1641
|
|
17
|
-
sage/databases/symbolic_data.py,sha256=QBl9SCFU9gH_ZVLxTZUqcWTbYQLkGBkhS11ZUaIct6s,8703
|
|
18
|
-
sage/databases/jones.py,sha256=0rGati6Pse-KWJc-Mki-ZfoSrUFURdAQqTRz_IQqlpU,10960
|
|
13
|
+
sage/databases/all.py,sha256=MWbEniaWJkw2HGqLu4ruypvPQ10gVWtI8ViogmucJTs,2244
|
|
19
14
|
sage/dynamics/surface_dynamics_deprecation.py,sha256=Dxxnecz3JvFvJkehFqM-TuheZtTTWm1tvW7Ac4D68AA,1749
|
|
20
15
|
sage/dynamics/all.py,sha256=tZTKTXcMirX--xGRQgw4y5j4BA0vd_xPmcDg79_OsQs,854
|
|
21
16
|
sage/ext_data/nodoctest,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -41,7 +36,7 @@ sage/interacts/calculus.py,sha256=I1YYNg4JNrNscQDg7Uj2OhHaz8YwFcBYJbXpFWrgd-4,10
|
|
|
41
36
|
sage/interacts/fractals.py,sha256=ut5BvBl9ipTCVDdtxFx6qfDR2pwwPX4rwuHKhIlvkyg,677
|
|
42
37
|
sage/interacts/geometry.py,sha256=E5DfdtL6n41ebMn_DkYZx8cjPdNA--lvoaVlq-hFGmM,722
|
|
43
38
|
sage/interacts/statistics.py,sha256=msjkOecE0O26CBnHAXw714UbxHxFAFTFOpRZfIZ7Cow,656
|
|
44
|
-
sage/interacts/library_cython.cpython-310-darwin.so,sha256=
|
|
39
|
+
sage/interacts/library_cython.cpython-310-darwin.so,sha256=DXB8lMunR67MDNrxmXzWtcsPyE7WDKSclE0Ldp8WRKA,78184
|
|
45
40
|
sage/logic/logicparser.py,sha256=Y3saIYmF9aKJI-Ao4a0Nx0YwxA6wNWS9GKwpzOcrfiU,21269
|
|
46
41
|
sage/logic/all.py,sha256=k8iqDAtgNbd6ogkp3N2IRiuvxbEgCEkRr9oXwAJX7HM,76
|
|
47
42
|
sage/logic/propcalc.py,sha256=Ne4k0ptXC0xj6NEvs0LJ6SmH2uKqYPDeey9rE1Gv2YI,8672
|
sage/databases/all.py
CHANGED
|
@@ -51,18 +51,13 @@ from sage.databases.all__sagemath_combinat import *
|
|
|
51
51
|
from sage.databases.all__sagemath_graphs import *
|
|
52
52
|
from sage.databases.all__sagemath_pari import *
|
|
53
53
|
from sage.databases.all__sagemath_schemes import *
|
|
54
|
+
from sage.databases.all__sagemath_database_cunningham import *
|
|
55
|
+
from sage.databases.all__sagemath_database_kohel import *
|
|
56
|
+
from sage.databases.all__sagemath_database_jones_numfield import *
|
|
57
|
+
from sage.databases.all__sagemath_database_symbolic_data import *
|
|
54
58
|
|
|
55
59
|
from sage.misc.lazy_import import lazy_import
|
|
56
60
|
|
|
57
|
-
lazy_import('sage.databases.jones', 'JonesDatabase')
|
|
58
|
-
|
|
59
|
-
lazy_import('sage.databases.symbolic_data', 'SymbolicData')
|
|
60
|
-
|
|
61
61
|
lazy_import('sage.databases.odlyzko', 'zeta_zeros')
|
|
62
62
|
|
|
63
|
-
from sage.databases.db_class_polynomials import \
|
|
64
|
-
HilbertClassPolynomialDatabase
|
|
65
|
-
|
|
66
|
-
lazy_import('sage.databases.cunningham_tables', 'cunningham_prime_factors')
|
|
67
|
-
|
|
68
63
|
del lazy_import
|
|
Binary file
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
r"""
|
|
2
|
-
Cunningham tables
|
|
3
|
-
|
|
4
|
-
This module provides :func:`cunningham_prime_factors`, which lists the prime
|
|
5
|
-
numbers occurring in the factorization of numbers of type `b^n+1` or `b^n-1`
|
|
6
|
-
with `b \in \{2,3,5,6,7,10,11,12\}`. For an introduction to Cunningham prime
|
|
7
|
-
factors, see :wikipedia:`Cunningham_Project`. The data becomes available if you
|
|
8
|
-
install the optional :ref:`cunningham_tables <spkg_cunningham_tables>` package by
|
|
9
|
-
the command ::
|
|
10
|
-
|
|
11
|
-
sage -i cunningham_tables
|
|
12
|
-
|
|
13
|
-
AUTHORS:
|
|
14
|
-
|
|
15
|
-
- Yann Laigle-Chapuy (2009-10-18): initial version
|
|
16
|
-
"""
|
|
17
|
-
|
|
18
|
-
import os
|
|
19
|
-
from sage.misc.cachefunc import cached_function
|
|
20
|
-
from sage.rings.integer import Integer
|
|
21
|
-
from sage.misc.persist import load
|
|
22
|
-
from sage.env import SAGE_SHARE
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
@cached_function
|
|
26
|
-
def cunningham_prime_factors():
|
|
27
|
-
r"""
|
|
28
|
-
List of all the prime numbers occurring in the so called Cunningham table.
|
|
29
|
-
|
|
30
|
-
They occur in the factorization of numbers of type `b^n+1` or `b^n-1` with `b \in \{2,3,5,6,7,10,11,12\}`.
|
|
31
|
-
|
|
32
|
-
EXAMPLES::
|
|
33
|
-
|
|
34
|
-
sage: # optional - cunningham_tables
|
|
35
|
-
sage: from sage.databases.cunningham_tables import cunningham_prime_factors
|
|
36
|
-
sage: cunningham_prime_factors()
|
|
37
|
-
[2,
|
|
38
|
-
3,
|
|
39
|
-
5,
|
|
40
|
-
7,
|
|
41
|
-
11,
|
|
42
|
-
13,
|
|
43
|
-
17,
|
|
44
|
-
...
|
|
45
|
-
"""
|
|
46
|
-
file = os.path.join(SAGE_SHARE,'cunningham_tables','cunningham_prime_factors.sobj')
|
|
47
|
-
if os.path.exists(file):
|
|
48
|
-
return [Integer(_) for _ in load(file)]
|
|
49
|
-
else:
|
|
50
|
-
from warnings import warn
|
|
51
|
-
warn("You might consider installing the optional package for factoring Cunningham numbers"
|
|
52
|
-
" with the following command: ``sage -i cunningham_tables``")
|
|
53
|
-
return []
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Database of Hilbert polynomials
|
|
3
|
-
|
|
4
|
-
This module gives access to the database of Hilbert class polynomials. To use
|
|
5
|
-
the database, you need to install the optional :ref:`database_kohel
|
|
6
|
-
<spkg_database_kohel>` package by the Sage command ::
|
|
7
|
-
|
|
8
|
-
sage -i database_kohel
|
|
9
|
-
|
|
10
|
-
EXAMPLES::
|
|
11
|
-
|
|
12
|
-
sage: # optional - database_kohel
|
|
13
|
-
sage: db = HilbertClassPolynomialDatabase()
|
|
14
|
-
sage: db[32]
|
|
15
|
-
x^2 - 52250000*x + 12167000000
|
|
16
|
-
|
|
17
|
-
AUTHORS:
|
|
18
|
-
|
|
19
|
-
- David Kohel (2006-08-04): initial version
|
|
20
|
-
"""
|
|
21
|
-
# ****************************************************************************
|
|
22
|
-
# Copyright (C) 2006 David Kohel <kohel@maths.usyd.edu.au>
|
|
23
|
-
# Copyright (C) 2016 Vincent Delecroix <vincent.delecroix@labri.fr>
|
|
24
|
-
#
|
|
25
|
-
# Distributed under the terms of the GNU General Public License (GPL)
|
|
26
|
-
# as published by the Free Software Foundation; either version 2 of
|
|
27
|
-
# the License, or (at your option) any later version.
|
|
28
|
-
# https://www.gnu.org/licenses/
|
|
29
|
-
# ****************************************************************************
|
|
30
|
-
|
|
31
|
-
from .db_modular_polynomials import _dbz_to_integers
|
|
32
|
-
|
|
33
|
-
disc_format = "%07d" # disc_length = 7
|
|
34
|
-
level_format = "%03d" # level_length = 3
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
class ClassPolynomialDatabase:
|
|
38
|
-
def _dbpath(self, disc, level=1):
|
|
39
|
-
"""
|
|
40
|
-
TESTS::
|
|
41
|
-
|
|
42
|
-
sage: db = HilbertClassPolynomialDatabase()
|
|
43
|
-
sage: db._dbpath(5, 1)
|
|
44
|
-
'PolHeeg/Cls/0000001-0005000/pol.0000005.dbz'
|
|
45
|
-
sage: db._dbpath(15000, 1)
|
|
46
|
-
'PolHeeg/Cls/0010001-0015000/pol.0015000.dbz'
|
|
47
|
-
sage: db._dbpath(3, 2)
|
|
48
|
-
Traceback (most recent call last):
|
|
49
|
-
...
|
|
50
|
-
NotImplementedError: Level (= 2) > 1 not yet implemented
|
|
51
|
-
"""
|
|
52
|
-
if level != 1:
|
|
53
|
-
raise NotImplementedError("Level (= %s) > 1 not yet implemented" % level)
|
|
54
|
-
n1 = 5000*((abs(disc)-1)//5000)
|
|
55
|
-
s1 = disc_format % (n1+1) # _pad_int(n1+1, disc_length)
|
|
56
|
-
s2 = disc_format % (n1+5000)
|
|
57
|
-
subdir = "%s-%s" % (s1, s2)
|
|
58
|
-
discstr = disc_format % abs(disc)
|
|
59
|
-
return "PolHeeg/%s/%s/pol.%s.dbz" % (self.model, subdir, discstr)
|
|
60
|
-
|
|
61
|
-
def __getitem__(self, disc):
|
|
62
|
-
r"""
|
|
63
|
-
TESTS::
|
|
64
|
-
|
|
65
|
-
sage: # optional - database_kohel
|
|
66
|
-
sage: db = HilbertClassPolynomialDatabase()
|
|
67
|
-
sage: db[32]
|
|
68
|
-
x^2 - 52250000*x + 12167000000
|
|
69
|
-
sage: db[123913912]
|
|
70
|
-
Traceback (most recent call last):
|
|
71
|
-
...
|
|
72
|
-
ValueError: file not found in the Kohel database
|
|
73
|
-
"""
|
|
74
|
-
from sage.rings.integer_ring import ZZ
|
|
75
|
-
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
|
|
76
|
-
classpol = self._dbpath(disc)
|
|
77
|
-
coeff_list = _dbz_to_integers(classpol)
|
|
78
|
-
return PolynomialRing(ZZ, 'x')(coeff_list)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
class HilbertClassPolynomialDatabase(ClassPolynomialDatabase):
|
|
82
|
-
"""
|
|
83
|
-
The database of Hilbert class polynomials.
|
|
84
|
-
|
|
85
|
-
EXAMPLES::
|
|
86
|
-
|
|
87
|
-
sage: # optional - database_kohel
|
|
88
|
-
sage: db = HilbertClassPolynomialDatabase()
|
|
89
|
-
sage: db[-4]
|
|
90
|
-
x - 1728
|
|
91
|
-
sage: db[-7]
|
|
92
|
-
x + 3375
|
|
93
|
-
sage: f = db[-23]; f
|
|
94
|
-
x^3 + 3491750*x^2 - 5151296875*x + 12771880859375
|
|
95
|
-
sage: f.discriminant().factor()
|
|
96
|
-
-1 * 5^18 * 7^12 * 11^4 * 17^2 * 19^2 * 23
|
|
97
|
-
sage: db[-23]
|
|
98
|
-
x^3 + 3491750*x^2 - 5151296875*x + 12771880859375
|
|
99
|
-
"""
|
|
100
|
-
model = "Cls"
|
|
101
|
-
|
|
102
|
-
def __repr__(self):
|
|
103
|
-
return "Hilbert class polynomial database"
|
|
104
|
-
|
|
105
|
-
######################################################
|
|
106
|
-
# None of the following are implemented yet.
|
|
107
|
-
######################################################
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
class AtkinClassPolynomialDatabase(ClassPolynomialDatabase):
|
|
111
|
-
"""
|
|
112
|
-
The database of Atkin class polynomials.
|
|
113
|
-
"""
|
|
114
|
-
model = "Atk"
|
|
115
|
-
|
|
116
|
-
def __repr__(self):
|
|
117
|
-
return "Atkin class polynomial database"
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
class WeberClassPolynomialDatabase(ClassPolynomialDatabase):
|
|
121
|
-
"""
|
|
122
|
-
The database of Weber class polynomials.
|
|
123
|
-
"""
|
|
124
|
-
def __repr__(self):
|
|
125
|
-
return "Weber class polynomial database"
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
class DedekindEtaClassPolynomialDatabase(ClassPolynomialDatabase):
|
|
129
|
-
"""
|
|
130
|
-
The database of Dedekind eta class polynomials.
|
|
131
|
-
"""
|
|
132
|
-
model = "Eta"
|
|
133
|
-
|
|
134
|
-
def __repr__(self):
|
|
135
|
-
return "Dedekind eta class polynomial database"
|
sage/databases/jones.py
DELETED
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
r"""
|
|
2
|
-
John Jones's tables of number fields
|
|
3
|
-
|
|
4
|
-
In order to use the Jones database, the optional :ref:`database_jones_numfield
|
|
5
|
-
<spkg_database_jones_numfield>` package must be installed using the Sage command ::
|
|
6
|
-
|
|
7
|
-
sage -i database_jones_numfield
|
|
8
|
-
|
|
9
|
-
This is a table of number fields with bounded ramification and
|
|
10
|
-
degree `\leq 6`. You can query the database for all number
|
|
11
|
-
fields in Jones's tables with bounded ramification and degree.
|
|
12
|
-
|
|
13
|
-
EXAMPLES: First load the database::
|
|
14
|
-
|
|
15
|
-
sage: J = JonesDatabase()
|
|
16
|
-
sage: J
|
|
17
|
-
John Jones's table of number fields with bounded ramification and degree <= 6
|
|
18
|
-
|
|
19
|
-
List the degree and discriminant of all fields in the database that
|
|
20
|
-
have ramification at most at 2::
|
|
21
|
-
|
|
22
|
-
sage: [(k.degree(), k.disc()) for k in J.unramified_outside([2])] # optional - database_jones_numfield
|
|
23
|
-
[(1, 1), (2, -4), (2, -8), (2, 8), (4, 256), (4, 512), (4, -1024), (4, -2048), (4, 2048), (4, 2048), (4, 2048)]
|
|
24
|
-
|
|
25
|
-
List the discriminants of the fields of degree exactly 2 unramified
|
|
26
|
-
outside 2::
|
|
27
|
-
|
|
28
|
-
sage: [k.disc() for k in J.unramified_outside([2],2)] # optional - database_jones_numfield
|
|
29
|
-
[-4, -8, 8]
|
|
30
|
-
|
|
31
|
-
List the discriminants of cubic field in the database ramified
|
|
32
|
-
exactly at 3 and 5::
|
|
33
|
-
|
|
34
|
-
sage: [k.disc() for k in J.ramified_at([3,5],3)] # optional - database_jones_numfield
|
|
35
|
-
[-135, -675, -6075, -6075]
|
|
36
|
-
sage: factor(6075)
|
|
37
|
-
3^5 * 5^2
|
|
38
|
-
sage: factor(675)
|
|
39
|
-
3^3 * 5^2
|
|
40
|
-
sage: factor(135)
|
|
41
|
-
3^3 * 5
|
|
42
|
-
|
|
43
|
-
List all fields in the database ramified at 101::
|
|
44
|
-
|
|
45
|
-
sage: J.ramified_at(101) # optional - database_jones_numfield
|
|
46
|
-
[Number Field in a with defining polynomial x^2 - 101,
|
|
47
|
-
Number Field in a with defining polynomial x^4 - x^3 + 13*x^2 - 19*x + 361,
|
|
48
|
-
Number Field in a with defining polynomial x^5 + x^4 - 6*x^3 - x^2 + 18*x + 4,
|
|
49
|
-
Number Field in a with defining polynomial x^5 + 2*x^4 + 7*x^3 + 4*x^2 + 11*x - 6,
|
|
50
|
-
Number Field in a with defining polynomial x^5 - x^4 - 40*x^3 - 93*x^2 - 21*x + 17]
|
|
51
|
-
"""
|
|
52
|
-
|
|
53
|
-
# ****************************************************************************
|
|
54
|
-
# Sage: Open Source Mathematical Software
|
|
55
|
-
#
|
|
56
|
-
# Copyright (C) 2005 William Stein <wstein@gmail.com>
|
|
57
|
-
#
|
|
58
|
-
# Distributed under the terms of the GNU General Public License (GPL)
|
|
59
|
-
#
|
|
60
|
-
# This code is distributed in the hope that it will be useful,
|
|
61
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
62
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
63
|
-
# General Public License for more details.
|
|
64
|
-
#
|
|
65
|
-
# The full text of the GPL is available at:
|
|
66
|
-
#
|
|
67
|
-
# https://www.gnu.org/licenses/
|
|
68
|
-
# ****************************************************************************
|
|
69
|
-
|
|
70
|
-
import os
|
|
71
|
-
|
|
72
|
-
from sage.rings.number_field.number_field import NumberField
|
|
73
|
-
from sage.rings.rational_field import RationalField
|
|
74
|
-
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
|
|
75
|
-
from sage.combinat.subset import powerset
|
|
76
|
-
from sage.env import SAGE_SHARE
|
|
77
|
-
|
|
78
|
-
from sage.misc.persist import load, save
|
|
79
|
-
|
|
80
|
-
from sage.features.databases import DatabaseJones
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
def sortkey(K):
|
|
84
|
-
"""
|
|
85
|
-
A completely deterministic sorting key for number fields.
|
|
86
|
-
|
|
87
|
-
EXAMPLES::
|
|
88
|
-
|
|
89
|
-
sage: from sage.databases.jones import sortkey
|
|
90
|
-
sage: sortkey(QuadraticField(-3))
|
|
91
|
-
(2, 3, False, x^2 + 3)
|
|
92
|
-
"""
|
|
93
|
-
return K.degree(), abs(K.discriminant()), K.discriminant() > 0, K.polynomial()
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
class JonesDatabase:
|
|
97
|
-
def __init__(self):
|
|
98
|
-
self.root = None
|
|
99
|
-
|
|
100
|
-
def __repr__(self):
|
|
101
|
-
return "John Jones's table of number fields with bounded ramification and degree <= 6"
|
|
102
|
-
|
|
103
|
-
def _load(self, path, filename):
|
|
104
|
-
print(filename)
|
|
105
|
-
i = 0
|
|
106
|
-
while filename[i].isalpha():
|
|
107
|
-
i += 1
|
|
108
|
-
j = len(filename) - 1
|
|
109
|
-
while filename[j].isalpha() or filename[j] in [".", "_"]:
|
|
110
|
-
j -= 1
|
|
111
|
-
S = sorted([eval(z) for z in filename[i:j + 1].split("-")])
|
|
112
|
-
with open(path + "/" + filename) as f:
|
|
113
|
-
data = f.read()
|
|
114
|
-
data = data.replace("^", "**")
|
|
115
|
-
x = PolynomialRing(RationalField(), 'x').gen() # used next line
|
|
116
|
-
v = eval(data)
|
|
117
|
-
s = tuple(S)
|
|
118
|
-
if s in self.root:
|
|
119
|
-
self.root[s] += v
|
|
120
|
-
self.root[s].sort()
|
|
121
|
-
else:
|
|
122
|
-
self.root[s] = v
|
|
123
|
-
|
|
124
|
-
def _init(self, path):
|
|
125
|
-
"""
|
|
126
|
-
Create the database from scratch from the PARI files on John Jones's
|
|
127
|
-
web page, downloaded (e.g., via wget) to a local directory, which
|
|
128
|
-
is specified as path above.
|
|
129
|
-
|
|
130
|
-
INPUT:
|
|
131
|
-
|
|
132
|
-
- ``path`` -- (default: works on William Stein install)
|
|
133
|
-
path must be the path to Jones's Number_Fields directory
|
|
134
|
-
(http://hobbes.la.asu.edu/Number_Fields); these files should have
|
|
135
|
-
been downloaded using wget
|
|
136
|
-
|
|
137
|
-
EXAMPLES: This is how to create the database from scratch, assuming
|
|
138
|
-
that the number fields are in the default directory above: From a
|
|
139
|
-
cold start of Sage::
|
|
140
|
-
|
|
141
|
-
sage: J = JonesDatabase()
|
|
142
|
-
sage: J._init() # not tested
|
|
143
|
-
...
|
|
144
|
-
|
|
145
|
-
This takes about 5 seconds.
|
|
146
|
-
"""
|
|
147
|
-
x = PolynomialRing(RationalField(), 'x').gen()
|
|
148
|
-
self.root = {}
|
|
149
|
-
self.root[tuple()] = [x - 1]
|
|
150
|
-
if not os.path.exists(path):
|
|
151
|
-
raise OSError("Path %s does not exist." % path)
|
|
152
|
-
for X in os.listdir(path):
|
|
153
|
-
if X[-4:] == "solo":
|
|
154
|
-
Z = path + "/" + X
|
|
155
|
-
print(X)
|
|
156
|
-
for Y in os.listdir(Z):
|
|
157
|
-
if Y[-3:] == ".gp":
|
|
158
|
-
self._load(Z, Y)
|
|
159
|
-
|
|
160
|
-
data_dir = os.path.dirname(DatabaseJones().absolute_filename())
|
|
161
|
-
os.makedirs(data_dir, exist_ok=True)
|
|
162
|
-
save(self.root, os.path.join(data_dir, "jones.sobj"))
|
|
163
|
-
|
|
164
|
-
def unramified_outside(self, S, d=None, var='a'):
|
|
165
|
-
"""
|
|
166
|
-
Return all fields in the database of degree d unramified
|
|
167
|
-
outside S. If d is omitted, return fields of any degree up to 6.
|
|
168
|
-
The fields are ordered by degree and discriminant.
|
|
169
|
-
|
|
170
|
-
INPUT:
|
|
171
|
-
|
|
172
|
-
- ``S`` -- list or set of primes, or a single prime
|
|
173
|
-
|
|
174
|
-
- ``d`` -- ``None`` (default, in which case all fields of degree <= 6 are returned)
|
|
175
|
-
or a positive integer giving the degree of the number fields returned
|
|
176
|
-
|
|
177
|
-
- ``var`` -- the name used for the generator of the number fields (default: ``'a'``)
|
|
178
|
-
|
|
179
|
-
EXAMPLES::
|
|
180
|
-
|
|
181
|
-
sage: J = JonesDatabase() # optional - database_jones_numfield
|
|
182
|
-
sage: J.unramified_outside([101,109]) # optional - database_jones_numfield
|
|
183
|
-
[Number Field in a with defining polynomial x - 1,
|
|
184
|
-
Number Field in a with defining polynomial x^2 - 101,
|
|
185
|
-
Number Field in a with defining polynomial x^2 - 109,
|
|
186
|
-
Number Field in a with defining polynomial x^3 - x^2 - 36*x + 4,
|
|
187
|
-
Number Field in a with defining polynomial x^4 - x^3 + 13*x^2 - 19*x + 361,
|
|
188
|
-
Number Field in a with defining polynomial x^4 - x^3 + 14*x^2 + 34*x + 393,
|
|
189
|
-
Number Field in a with defining polynomial x^5 + x^4 - 6*x^3 - x^2 + 18*x + 4,
|
|
190
|
-
Number Field in a with defining polynomial x^5 + 2*x^4 + 7*x^3 + 4*x^2 + 11*x - 6,
|
|
191
|
-
Number Field in a with defining polynomial x^5 - x^4 - 40*x^3 - 93*x^2 - 21*x + 17]
|
|
192
|
-
"""
|
|
193
|
-
try:
|
|
194
|
-
S = list(S)
|
|
195
|
-
except TypeError:
|
|
196
|
-
S = [S]
|
|
197
|
-
Z = []
|
|
198
|
-
for X in powerset(S):
|
|
199
|
-
Z += self.ramified_at(X, d=d, var=var)
|
|
200
|
-
return sorted(Z, key=sortkey)
|
|
201
|
-
|
|
202
|
-
def __getitem__(self, S):
|
|
203
|
-
return self.get(S)
|
|
204
|
-
|
|
205
|
-
def get(self, S, var='a'):
|
|
206
|
-
"""
|
|
207
|
-
Return all fields in the database ramified exactly at
|
|
208
|
-
the primes in S.
|
|
209
|
-
|
|
210
|
-
INPUT:
|
|
211
|
-
|
|
212
|
-
- ``S`` -- list or set of primes, or a single prime
|
|
213
|
-
|
|
214
|
-
- ``var`` -- the name used for the generator of the number fields (default: ``'a'``)
|
|
215
|
-
|
|
216
|
-
EXAMPLES::
|
|
217
|
-
|
|
218
|
-
sage: J = JonesDatabase() # optional - database_jones_numfield
|
|
219
|
-
sage: J.get(163, var='z') # optional - database_jones_numfield
|
|
220
|
-
[Number Field in z with defining polynomial x^2 + 163,
|
|
221
|
-
Number Field in z with defining polynomial x^3 - x^2 - 54*x + 169,
|
|
222
|
-
Number Field in z with defining polynomial x^4 - x^3 - 7*x^2 + 2*x + 9]
|
|
223
|
-
sage: J.get([3, 4]) # optional - database_jones_numfield
|
|
224
|
-
Traceback (most recent call last):
|
|
225
|
-
...
|
|
226
|
-
ValueError: S must be a list of primes
|
|
227
|
-
"""
|
|
228
|
-
if self.root is None:
|
|
229
|
-
self.root = load(DatabaseJones().absolute_filename())
|
|
230
|
-
try:
|
|
231
|
-
S = list(S)
|
|
232
|
-
except TypeError:
|
|
233
|
-
S = [S]
|
|
234
|
-
if not all(p.is_prime() for p in S):
|
|
235
|
-
raise ValueError("S must be a list of primes")
|
|
236
|
-
S.sort()
|
|
237
|
-
s = tuple(S)
|
|
238
|
-
if s not in self.root:
|
|
239
|
-
return []
|
|
240
|
-
return [NumberField(f, var, check=False) for f in self.root[s]]
|
|
241
|
-
|
|
242
|
-
def ramified_at(self, S, d=None, var='a'):
|
|
243
|
-
"""
|
|
244
|
-
Return all fields in the database of degree d ramified exactly at
|
|
245
|
-
the primes in S. The fields are ordered by degree and discriminant.
|
|
246
|
-
|
|
247
|
-
INPUT:
|
|
248
|
-
|
|
249
|
-
- ``S`` -- list or set of primes
|
|
250
|
-
|
|
251
|
-
- ``d`` -- ``None`` (default, in which case all fields of degree <= 6 are returned)
|
|
252
|
-
or a positive integer giving the degree of the number fields returned
|
|
253
|
-
|
|
254
|
-
- ``var`` -- the name used for the generator of the number fields (default: ``'a'``)
|
|
255
|
-
|
|
256
|
-
EXAMPLES::
|
|
257
|
-
|
|
258
|
-
sage: # optional - database_jones_numfield
|
|
259
|
-
sage: J = JonesDatabase()
|
|
260
|
-
sage: J.ramified_at([101,109])
|
|
261
|
-
[]
|
|
262
|
-
sage: J.ramified_at([109])
|
|
263
|
-
[Number Field in a with defining polynomial x^2 - 109,
|
|
264
|
-
Number Field in a with defining polynomial x^3 - x^2 - 36*x + 4,
|
|
265
|
-
Number Field in a with defining polynomial x^4 - x^3 + 14*x^2 + 34*x + 393]
|
|
266
|
-
sage: J.ramified_at(101)
|
|
267
|
-
[Number Field in a with defining polynomial x^2 - 101,
|
|
268
|
-
Number Field in a with defining polynomial x^4 - x^3 + 13*x^2 - 19*x + 361,
|
|
269
|
-
Number Field in a with defining polynomial x^5 + x^4 - 6*x^3 - x^2 + 18*x + 4,
|
|
270
|
-
Number Field in a with defining polynomial x^5 + 2*x^4 + 7*x^3 + 4*x^2 + 11*x - 6,
|
|
271
|
-
Number Field in a with defining polynomial x^5 - x^4 - 40*x^3 - 93*x^2 - 21*x + 17]
|
|
272
|
-
sage: J.ramified_at((2, 5, 29), 3, 'c')
|
|
273
|
-
[Number Field in c with defining polynomial x^3 - x^2 - 8*x - 28,
|
|
274
|
-
Number Field in c with defining polynomial x^3 - x^2 + 10*x + 102,
|
|
275
|
-
Number Field in c with defining polynomial x^3 - x^2 - 48*x - 188,
|
|
276
|
-
Number Field in c with defining polynomial x^3 - x^2 + 97*x - 333]
|
|
277
|
-
"""
|
|
278
|
-
Z = self.get(S, var=var)
|
|
279
|
-
if d is not None:
|
|
280
|
-
Z = [k for k in Z if k.degree() == d]
|
|
281
|
-
return sorted(Z, key=sortkey)
|
sage/databases/odlyzko.py
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Database of the zeros of the Riemann zeta function
|
|
3
|
-
|
|
4
|
-
The main access function to the database of the zeros of the Riemann zeta
|
|
5
|
-
function is :func:`zeta_zeros`. In order to use ``zeta_zeros()``, you need to
|
|
6
|
-
install the optional :ref:`database_odlyzko_zeta <spkg_database_odlyzko_zeta>`
|
|
7
|
-
package::
|
|
8
|
-
|
|
9
|
-
sage -i database_odlyzko_zeta
|
|
10
|
-
|
|
11
|
-
AUTHORS:
|
|
12
|
-
|
|
13
|
-
- William Stein: initial version
|
|
14
|
-
- Jeroen Demeyer (2015-01-20): converted ``database_odlyzko_zeta`` to new-style
|
|
15
|
-
package
|
|
16
|
-
"""
|
|
17
|
-
|
|
18
|
-
# ****************************************************************************
|
|
19
|
-
# Copyright (C) 2004 William Stein <wstein@gmail.com>
|
|
20
|
-
# Copyright (C) 2015 Jeroen Demeyer <jdemeyer@cage.ugent.be>
|
|
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
|
-
# https://www.gnu.org/licenses/
|
|
27
|
-
# ****************************************************************************
|
|
28
|
-
|
|
29
|
-
import os
|
|
30
|
-
|
|
31
|
-
from sage.misc.persist import load
|
|
32
|
-
from sage.env import SAGE_SHARE
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
def zeta_zeros():
|
|
36
|
-
r"""
|
|
37
|
-
List of the imaginary parts of the first 2,001,052 zeros of the
|
|
38
|
-
Riemann zeta function, accurate to within 4e-9.
|
|
39
|
-
|
|
40
|
-
REFERENCES:
|
|
41
|
-
|
|
42
|
-
- http://www.dtc.umn.edu/~odlyzko/zeta_tables/index.html
|
|
43
|
-
|
|
44
|
-
EXAMPLES:
|
|
45
|
-
|
|
46
|
-
The following example shows the imaginary part of the 13th
|
|
47
|
-
nontrivial zero of the Riemann zeta function::
|
|
48
|
-
|
|
49
|
-
sage: # optional - database_odlyzko_zeta
|
|
50
|
-
sage: zz = zeta_zeros()
|
|
51
|
-
sage: zz[12]
|
|
52
|
-
59.347044003
|
|
53
|
-
sage: len(zz)
|
|
54
|
-
2001052
|
|
55
|
-
"""
|
|
56
|
-
from sage.misc.verbose import verbose
|
|
57
|
-
sobj = os.path.join(SAGE_SHARE, 'odlyzko', 'zeros.sobj')
|
|
58
|
-
verbose("Loading Odlyzko database from " + sobj)
|
|
59
|
-
return load(sobj)
|
sage/databases/symbolic_data.py
DELETED
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Ideals from the Symbolic Data project
|
|
3
|
-
|
|
4
|
-
This module implements a thin wrapper for the optional symbolic dataset of
|
|
5
|
-
ideals as published on http://www.symbolicdata.org. From the project website:
|
|
6
|
-
|
|
7
|
-
For different purposes, algorithms and implementations are tested
|
|
8
|
-
on certified and reliable data. The development of tools and data
|
|
9
|
-
for such tests is usually 'orthogonal' to the main
|
|
10
|
-
implementation efforts, it requires different skills and
|
|
11
|
-
technologies and is not loved by programmers. On the other hand,
|
|
12
|
-
in many cases, tools and data could easily be reused - with slight
|
|
13
|
-
modifications - across similar projects. The SymbolicData Project
|
|
14
|
-
is set out to coordinate such efforts within the Computer Algebra
|
|
15
|
-
Community. Commonly collected certified and reliable data can
|
|
16
|
-
also be used to compare otherwise incomparable approaches,
|
|
17
|
-
algorithms, and implementations. Benchmark suites and Challenges
|
|
18
|
-
for symbolic computations are not as well established as in other
|
|
19
|
-
areas of computer science. This is probably due to the fact that
|
|
20
|
-
there are not yet well agreed aims of such a
|
|
21
|
-
benchmarking. Nevertheless various (often high quality) special
|
|
22
|
-
benchmarks are scattered through the literature. During the last
|
|
23
|
-
years, efforts toward collection of test data for symbolic
|
|
24
|
-
computations were intensified. They focused mainly on the creation
|
|
25
|
-
of general benchmarks for different areas of symbolic computation
|
|
26
|
-
and the collection of such activities on different Web site. For
|
|
27
|
-
further qualification of these efforts, it would be of great
|
|
28
|
-
benefit to create a commonly available digital archive of these
|
|
29
|
-
special benchmark data scattered through the literature. This
|
|
30
|
-
would provide the community with an electronic repository of
|
|
31
|
-
certified data that could be addressed and extended during further
|
|
32
|
-
development.
|
|
33
|
-
|
|
34
|
-
In order to use this dataset, you need to install the optional
|
|
35
|
-
:ref:`database_symbolic_data <spkg_database_symbolic_data>` package by the Sage
|
|
36
|
-
command ::
|
|
37
|
-
|
|
38
|
-
sage -i database_symbolic_data
|
|
39
|
-
|
|
40
|
-
EXAMPLES::
|
|
41
|
-
|
|
42
|
-
sage: # optional - database_symbolic_data
|
|
43
|
-
sage: sd = SymbolicData(); sd
|
|
44
|
-
SymbolicData with 372 ideals
|
|
45
|
-
sage: sd.ZeroDim__example_1
|
|
46
|
-
Ideal (x1^2 + x2^2 - 10, x1^2 + x1*x2 + 2*x2^2 - 16) of Multivariate Polynomial Ring in x1, x2 over Rational Field
|
|
47
|
-
sage: sd.Katsura_3
|
|
48
|
-
Ideal (u0 + 2*u1 + 2*u2 + 2*u3 - 1,
|
|
49
|
-
u1^2 + 2*u0*u2 + 2*u1*u3 - u2,
|
|
50
|
-
2*u0*u1 + 2*u1*u2 + 2*u2*u3 - u1,
|
|
51
|
-
u0^2 + 2*u1^2 + 2*u2^2 + 2*u3^2 - u0) of Multivariate Polynomial Ring in u0, u1, u2, u3 over Rational Field
|
|
52
|
-
sage: sd.get_ideal('Katsura_3', GF(127), 'degrevlex')
|
|
53
|
-
Ideal (u0 + 2*u1 + 2*u2 + 2*u3 - 1,
|
|
54
|
-
u1^2 + 2*u0*u2 + 2*u1*u3 - u2,
|
|
55
|
-
2*u0*u1 + 2*u1*u2 + 2*u2*u3 - u1,
|
|
56
|
-
u0^2 + 2*u1^2 + 2*u2^2 + 2*u3^2 - u0) of Multivariate Polynomial Ring in u0, u1, u2, u3 over Finite Field of size 127
|
|
57
|
-
|
|
58
|
-
AUTHORS:
|
|
59
|
-
|
|
60
|
-
- Martin Albrecht (2007-02-19): initial version
|
|
61
|
-
"""
|
|
62
|
-
|
|
63
|
-
# ****************************************************************************
|
|
64
|
-
# Copyright (C) 2007 Martin Albrecht <martinralbrecht@googlemail.com>
|
|
65
|
-
#
|
|
66
|
-
# This program is free software: you can redistribute it and/or modify
|
|
67
|
-
# it under the terms of the GNU General Public License as published by
|
|
68
|
-
# the Free Software Foundation, either version 2 of the License, or
|
|
69
|
-
# (at your option) any later version.
|
|
70
|
-
# https://www.gnu.org/licenses/
|
|
71
|
-
# ****************************************************************************
|
|
72
|
-
|
|
73
|
-
import os
|
|
74
|
-
from xml.dom.minidom import parse
|
|
75
|
-
from sage.rings.rational_field import QQ
|
|
76
|
-
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
class SymbolicData:
|
|
80
|
-
"""
|
|
81
|
-
Database of ideals as distributed by The SymbolicData Project
|
|
82
|
-
(http://symbolicdata.org).
|
|
83
|
-
|
|
84
|
-
This class needs the optional ``database_symbolic_data`` package to be
|
|
85
|
-
installed.
|
|
86
|
-
"""
|
|
87
|
-
def __init__(self):
|
|
88
|
-
"""
|
|
89
|
-
EXAMPLES::
|
|
90
|
-
|
|
91
|
-
sage: sd = SymbolicData(); sd # optional - database_symbolic_data
|
|
92
|
-
SymbolicData with 372 ideals
|
|
93
|
-
"""
|
|
94
|
-
from sage.env import SAGE_SHARE
|
|
95
|
-
path = os.path.join(SAGE_SHARE, 'symbolic_data')
|
|
96
|
-
self.__intpath = path + "/Data/XMLResources/INTPS/"
|
|
97
|
-
self.__genpath = path + "/Data/XMLResources/GenPS/"
|
|
98
|
-
|
|
99
|
-
def get_ideal(self, name, base_ring=QQ, term_order='degrevlex'):
|
|
100
|
-
"""
|
|
101
|
-
Return the ideal given by 'name' over the base ring given by
|
|
102
|
-
'base_ring' in a polynomial ring with the term order given by
|
|
103
|
-
'term_order'.
|
|
104
|
-
|
|
105
|
-
INPUT:
|
|
106
|
-
|
|
107
|
-
- ``name`` -- name as on the symbolic data website
|
|
108
|
-
- ``base_ring`` -- base ring for the polynomial ring (default: ``QQ``)
|
|
109
|
-
- ``term_order`` -- term order for the polynomial ring (default: ``degrevlex``)
|
|
110
|
-
|
|
111
|
-
OUTPUT: ideal as given by ``name`` in ``PolynomialRing(base_ring,vars,term_order)``
|
|
112
|
-
|
|
113
|
-
EXAMPLES::
|
|
114
|
-
|
|
115
|
-
sage: sd = SymbolicData() # optional - database_symbolic_data
|
|
116
|
-
sage: sd.get_ideal('Katsura_3',GF(127),'degrevlex') # optional - database_symbolic_data
|
|
117
|
-
Ideal (u0 + 2*u1 + 2*u2 + 2*u3 - 1,
|
|
118
|
-
u1^2 + 2*u0*u2 + 2*u1*u3 - u2,
|
|
119
|
-
2*u0*u1 + 2*u1*u2 + 2*u2*u3 - u1,
|
|
120
|
-
u0^2 + 2*u1^2 + 2*u2^2 + 2*u3^2 - u0) of Multivariate Polynomial Ring in u0, u1, u2, u3 over Finite Field of size 127
|
|
121
|
-
"""
|
|
122
|
-
|
|
123
|
-
def _getTextFromNode(node):
|
|
124
|
-
t = ""
|
|
125
|
-
for n in node.childNodes:
|
|
126
|
-
if n.nodeType == n.TEXT_NODE:
|
|
127
|
-
t += str(n.nodeValue)
|
|
128
|
-
else:
|
|
129
|
-
raise TypeError('not a text node')
|
|
130
|
-
return t
|
|
131
|
-
|
|
132
|
-
def _dom2ideal(node):
|
|
133
|
-
l = []
|
|
134
|
-
|
|
135
|
-
if str(node.nodeName) in ['vars', 'poly']:
|
|
136
|
-
l.append(_getTextFromNode(node))
|
|
137
|
-
|
|
138
|
-
for c in node.childNodes:
|
|
139
|
-
l += _dom2ideal(c)
|
|
140
|
-
|
|
141
|
-
return l
|
|
142
|
-
|
|
143
|
-
orig_name = name
|
|
144
|
-
name = name.replace('__', '.')
|
|
145
|
-
|
|
146
|
-
try:
|
|
147
|
-
name = self.__intpath + name + ".xml"
|
|
148
|
-
open(name)
|
|
149
|
-
except OSError:
|
|
150
|
-
try:
|
|
151
|
-
name = self.__genpath + name + ".xml"
|
|
152
|
-
open(name)
|
|
153
|
-
except OSError:
|
|
154
|
-
raise AttributeError(f"no ideal matching '{orig_name}' found in database")
|
|
155
|
-
|
|
156
|
-
dom = parse(name)
|
|
157
|
-
res = _dom2ideal(dom)
|
|
158
|
-
variables, polys = res[0].replace("_", ""), [p.replace("_", "") for p in res[1:]]
|
|
159
|
-
|
|
160
|
-
P = PolynomialRing(base_ring, len(variables.split(",")), variables)
|
|
161
|
-
I = P.ideal([P(f) for f in polys])
|
|
162
|
-
return I
|
|
163
|
-
|
|
164
|
-
def __repr__(self):
|
|
165
|
-
"""
|
|
166
|
-
EXAMPLES::
|
|
167
|
-
|
|
168
|
-
sage: sd = SymbolicData(); sd # optional - database_symbolic_data
|
|
169
|
-
SymbolicData with 372 ideals
|
|
170
|
-
"""
|
|
171
|
-
try:
|
|
172
|
-
l = len(self.__dir__())
|
|
173
|
-
except AttributeError:
|
|
174
|
-
l = 0
|
|
175
|
-
return "SymbolicData with %d ideals" % l
|
|
176
|
-
|
|
177
|
-
def __getattr__(self, name):
|
|
178
|
-
"""
|
|
179
|
-
EXAMPLES::
|
|
180
|
-
|
|
181
|
-
sage: sd = SymbolicData() # optional - database_symbolic_data
|
|
182
|
-
sage: sd.Cyclic5 # optional - database_symbolic_data
|
|
183
|
-
Traceback (most recent call last):
|
|
184
|
-
...
|
|
185
|
-
AttributeError: no ideal matching 'Cyclic5' found in database...
|
|
186
|
-
|
|
187
|
-
sage: sd.Cyclic_5 # optional - database_symbolic_data
|
|
188
|
-
Ideal (v + w + x + y + z,
|
|
189
|
-
v*w + w*x + x*y + v*z + y*z,
|
|
190
|
-
v*w*x + w*x*y + v*w*z + v*y*z + x*y*z,
|
|
191
|
-
v*w*x*y + v*w*x*z + v*w*y*z + v*x*y*z + w*x*y*z,
|
|
192
|
-
v*w*x*y*z - 1) of Multivariate Polynomial Ring in v, w, x, y, z over Rational Field
|
|
193
|
-
"""
|
|
194
|
-
return self.get_ideal(name)
|
|
195
|
-
|
|
196
|
-
def __dir__(self):
|
|
197
|
-
"""
|
|
198
|
-
EXAMPLES::
|
|
199
|
-
|
|
200
|
-
sage: sd = SymbolicData() # optional - database_symbolic_data
|
|
201
|
-
sage: sorted(sd.__dir__())[:10] # optional - database_symbolic_data
|
|
202
|
-
['Bjoerk_8',
|
|
203
|
-
'Bronstein-86',
|
|
204
|
-
'Buchberger-87',
|
|
205
|
-
'Butcher',
|
|
206
|
-
'Caprasse',
|
|
207
|
-
'Cassou',
|
|
208
|
-
'Cohn_2',
|
|
209
|
-
'Curves__curve10_20',
|
|
210
|
-
'Curves__curve10_20',
|
|
211
|
-
'Curves__curve10_30']
|
|
212
|
-
"""
|
|
213
|
-
if hasattr(self, "__ideals"):
|
|
214
|
-
return self.__ideals
|
|
215
|
-
try:
|
|
216
|
-
__ideals = [s.replace('.xml', '') for s in os.listdir(self.__intpath)]
|
|
217
|
-
__ideals += [s.replace('.xml', '') for s in os.listdir(self.__genpath)]
|
|
218
|
-
self.__ideals = [s.replace('.', '__') for s in __ideals]
|
|
219
|
-
return self.__ideals
|
|
220
|
-
except OSError:
|
|
221
|
-
raise AttributeError("Could not find symbolic data, you should perhaps install the optional package")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|