sagemath: update to 9.7.

Closes: #39876 [via git-merge-pr]
This commit is contained in:
Gonzalo Tornaría 2022-10-10 00:49:01 -03:00 committed by Andrew J. Hesford
parent a6a9a6b067
commit 950170e4f9
33 changed files with 3002 additions and 1457 deletions

View File

@ -0,0 +1,6 @@
# configure PATH using sage script location
export PATH="$(dirname $SELF):$PATH"
# if SAGE_VENV is set, the script sage-env will prepend
# "$SAGE_VENV/bin" to the PATH, which is undesired
unset SAGE_VENV

View File

@ -0,0 +1,3 @@
# configuration for sage on void linux
SAGE_SHARE = "/usr/share/sagemath"
GAP_ROOT_DIR = "/usr/share/gap"

View File

@ -109,7 +109,7 @@
"sage.combinat.symmetric_group_algebra": {"walltime": 16},
"sage.combinat.tableau": {"walltime": 32},
"sage.combinat.tableau_tuple": {"walltime": 32},
"sage.combinat.tiling": {"walltime": 256},
"sage.combinat.tiling": {"walltime": 16},
"sage.combinat.tutorial": {"walltime": 16},
"sage.combinat.words.paths": {"walltime": 64},
"sage.crypto.block_cipher.des": {"walltime": 16},
@ -193,10 +193,10 @@
"sage.manifolds.differentiable.automorphismfield": {"walltime": 32},
"sage.manifolds.differentiable.automorphismfield_group": {"walltime": 8},
"sage.manifolds.differentiable.bundle_connection": {"walltime": 8},
"sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 256},
"sage.manifolds.differentiable.characteristic_cohomology_class": {"walltime": 64},
"sage.manifolds.differentiable.curve": {"walltime": 16},
"sage.manifolds.differentiable.degenerate": {"walltime": 32},
"sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 256},
"sage.manifolds.differentiable.degenerate_submanifold": {"walltime": 16},
"sage.manifolds.differentiable.diff_form": {"walltime": 64},
"sage.manifolds.differentiable.diff_map": {"walltime": 8},
"sage.manifolds.differentiable.examples.euclidean": {"walltime": 32},
@ -270,7 +270,7 @@
"sage.modules.free_quadratic_module_integer_symmetric": {"walltime": 8},
"sage.modules.torsion_quadratic_module": {"walltime": 16},
"sage.parallel.map_reduce": {"walltime": 8},
"sage.plot.animate": {"walltime": 128},
"sage.plot.animate": {"walltime": 16},
"sage.plot.arrow": {"walltime": 8},
"sage.plot.circle": {"walltime": 8},
"sage.plot.complex_plot": {"walltime": 8},
@ -308,7 +308,7 @@
"sage.rings.function_field.function_field_valuation": {"walltime": 64},
"sage.rings.function_field.ideal": {"walltime": 8},
"sage.rings.function_field.place": {"walltime": 8},
"sage.rings.integer": {"walltime": 128},
"sage.rings.integer": {"walltime": 64},
"sage.rings.invariants.invariant_theory": {"walltime": 8},
"sage.rings.number_field.bdd_height": {"walltime": 8},
"sage.rings.number_field.number_field": {"walltime": 64},

View File

@ -1,10 +0,0 @@
- do not link ratpoints where it's not used
--- a/src/sage/schemes/elliptic_curves/descent_two_isogeny.pyx
+++ b/src/sage/schemes/elliptic_curves/descent_two_isogeny.pyx
@@ -1,5 +1,3 @@
-# distutils: libraries = ratpoints
-
r"""
Descent on elliptic curves over `\QQ` with a 2-isogeny
"""

View File

@ -1,13 +0,0 @@
- fix _get_shared_lib_path() so we don't need to configure GAP_SO
--- a/src/sage/env.py
+++ b/src/sage/env.py
@@ -293,7 +293,7 @@ def _get_shared_lib_path(*libnames: str) -> Optional[str]:
if sys.platform == 'darwin':
ext = 'dylib'
else:
- ext = 'so'
+ ext = 'so*'
if SAGE_LOCAL:
search_directories.append(Path(SAGE_LOCAL) / 'lib')

View File

@ -1,20 +0,0 @@
- we don't know `SAGE_VENV/bin` contains `sage`, but `sys.argv[0]` should
be the full path to `sage-ipython` and the same directory should have `sage`
--- a/src/sage/misc/sage_ostools.pyx
+++ b/src/sage/misc/sage_ostools.pyx
@@ -32,12 +32,11 @@ def have_program(program, path=None):
True
sage: have_program('there_is_not_a_program_with_this_name')
False
- sage: from sage.env import SAGE_VENV
- sage: have_program('sage', os.path.join(SAGE_VENV, 'bin'))
+ sage: have_program('sage', os.path.dirname(sys.argv[0]))
True
sage: have_program('sage', '/there_is_not_a_path_with_this_name')
False
- sage: have_program('there_is_not_a_program_with_this_name', os.path.join(SAGE_VENV, 'bin'))
+ sage: have_program('there_is_not_a_program_with_this_name', "/bin")
False
"""
if path is None:

View File

@ -1,22 +0,0 @@
- add one doctest for coverage
--- a/src/sage/misc/sageinspect.py
+++ b/src/sage/misc/sageinspect.py
@@ -1341,10 +1342,12 @@ def sage_getfile(obj):
EXAMPLES::
sage: from sage.misc.sageinspect import sage_getfile
- sage: sage_getfile(sage.rings.rational)[-23:]
- 'sage/rings/rational.pyx'
- sage: sage_getfile(Sq)[-42:]
- 'sage/algebras/steenrod/steenrod_algebra.py'
+ sage: sage_getfile(sage.rings.rational)
+ '...sage/rings/rational.pyx'
+ sage: sage_getfile(Sq)
+ '...sage/algebras/steenrod/steenrod_algebra.py'
+ sage: sage_getfile(x)
+ '...sage/symbolic/expression.pyx'
The following tests against some bugs fixed in :trac:`9976`::

View File

@ -1,16 +0,0 @@
- fix sage_getfile() by checking all possible EXTENSION_SUFFIXES
--- a/src/sage/misc/sageinspect.py
+++ b/src/sage/misc/sageinspect.py
@@ -1400,8 +1403,9 @@ def sage_getfile(obj):
sourcefile = inspect.getabsfile(obj)
except TypeError: # this happens for Python builtins
return ''
- if sourcefile.endswith(loadable_module_extension()):
- return sourcefile[:-len(loadable_module_extension())]+os.path.extsep+'pyx'
+ for suffix in import_machinery.EXTENSION_SUFFIXES:
+ if sourcefile.endswith(suffix):
+ return sourcefile[:-len(suffix)]+os.path.extsep+'pyx'
return sourcefile

View File

@ -1,15 +0,0 @@
- this ignores a warning caused by old notebook
--- a/src/sage/all.py
+++ b/src/sage/all.py
@@ -100,6 +100,9 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
message='The distutils(.sysconfig module| package) is deprecated',
module='Cython|distutils|numpy|sage.env|sage.features')
+warnings.filterwarnings('ignore', category=DeprecationWarning,
+ message=r"invalid escape sequence '\\s'")
+
################ end setup warnings ###############################

View File

@ -1,27 +0,0 @@
- using pytest is broken, see #31924
--- a/src/bin/sage-runtests
+++ b/src/bin/sage-runtests
@@ -154,21 +154,4 @@ if __name__ == "__main__":
DC = DocTestController(args, args.filenames)
err = DC.run()
- try:
- exit_code_pytest = 0
- import pytest
- pytest_options = ["--import-mode", "importlib"]
- if args.verbose:
- pytest_options.append("-v")
- exit_code_pytest = pytest.main(pytest_options + args.filenames)
- if exit_code_pytest == 5:
- # Exit code 5 means there were no test files, pass in this case
- exit_code_pytest = 0
-
- except ModuleNotFoundError:
- print("Pytest is not installed, skip checking tests that rely on it.")
-
- if err == 0:
- sys.exit(exit_code_pytest)
- else:
- sys.exit(err)
+ sys.exit(err)

View File

@ -1,14 +0,0 @@
--- a/src/sage/rings/polynomial/polynomial_zmod_flint.pyx
+++ b/src/sage/rings/polynomial/polynomial_zmod_flint.pyx
@@ -237,8 +237,9 @@ cdef class Polynomial_zmod_flint(Polynomial_template):
sage: a = ZZ['x'](range(100000))
sage: R = Integers(3)['x']
- sage: R(a) # long time (7s on sage.math, 2013)
- 2*x^99998 + ... + x
+ sage: p = R(a)
+ sage: p.truncate(10) # testing the whole poly is VERY SLOW
+ 2*x^8 + x^7 + 2*x^5 + x^4 + 2*x^2 + x
"""
sig_on()
fmpz_poly_get_nmod_poly(&self.x, x)

View File

@ -1,106 +0,0 @@
diff --git a/src/sage/schemes/elliptic_curves/isogeny_small_degree.py b/src/sage/schemes/elliptic_curves/isogeny_small_degree.py
index 43727346269..9d3ccd475cd 100644
--- a/src/sage/schemes/elliptic_curves/isogeny_small_degree.py
+++ b/src/sage/schemes/elliptic_curves/isogeny_small_degree.py
@@ -186,7 +186,7 @@ def Psi(l, use_stored=True):
sage: assert Psi(3, use_stored=True) == Psi(3, use_stored=False)
sage: assert Psi(5, use_stored=True) == Psi(5, use_stored=False)
sage: assert Psi(7, use_stored=True) == Psi(7, use_stored=False)
- sage: assert Psi(13, use_stored=True) == Psi(13, use_stored=False) # not tested (very long time)
+ sage: assert Psi(13, use_stored=True) == Psi(13, use_stored=False) # long time (2s)
"""
if l not in [2, 3, 5, 7, 13]:
raise ValueError("Genus zero primes are 2, 3, 5, 7 or 13.")
@@ -1207,7 +1207,7 @@ def isogenies_13_0(E, minimal_models=True):
sage: K.<a> = NumberField(f)
sage: E = EllipticCurve(j=K(0)); E.ainvs()
(0, 0, 0, 0, 1)
- sage: [phi.codomain().ainvs() for phi in isogenies_13_0(E)]
+ sage: [phi.codomain().ainvs() for phi in isogenies_13_0(E)] # long time (4s)
[(0,
0,
20360599/165164973653422080*a^11 - 3643073/41291243413355520*a^10 - 101/8789110986240*a^9 + 5557619461/573489491852160*a^8 - 82824971/11947697746920*a^7 - 19487/21127670640*a^6 - 475752603733/29409717530880*a^5 + 87205112531/7352429382720*a^4 + 8349/521670880*a^3 + 5858744881/12764634345*a^2 - 1858703809/2836585410*a + 58759402/48906645,
@@ -1325,7 +1325,7 @@ def isogenies_13_1728(E, minimal_models=True):
sage: f = x^12 + 1092*x^10 - 432432*x^8 + 6641024*x^6 - 282896640*x^4 - 149879808*x^2 - 349360128
sage: K.<a> = NumberField(f)
sage: E = EllipticCurve(K, [1,0])
- sage: [phi.codomain().ainvs() for phi in isogenies_13_1728(E)]
+ sage: [phi.codomain().ainvs() for phi in isogenies_13_1728(E)] # long time (3s)
[(0,
0,
0,
@@ -1550,8 +1550,11 @@ def Psi2(l):
sage: from sage.schemes.elliptic_curves.isogeny_small_degree import Psi2
sage: Psi2(11)
x^5 - 55*x^4*u + 994*x^3*u^2 - 8774*x^2*u^3 + 41453*x*u^4 - 928945/11*u^5 + 33*x^4 + 276*x^3*u - 7794*x^2*u^2 + 4452*x*u^3 + 1319331/11*u^4 + 216*x^3*v - 4536*x^2*u*v + 31752*x*u^2*v - 842616/11*u^3*v + 162*x^3 + 38718*x^2*u - 610578*x*u^2 + 33434694/11*u^3 - 4536*x^2*v + 73872*x*u*v - 2745576/11*u^2*v - 16470*x^2 + 580068*x*u - 67821354/11*u^2 - 185976*x*v + 14143896/11*u*v + 7533*x - 20437029/11*u - 12389112/11*v + 19964151/11
- sage: Psi2(71) # long time (1 second)
- -2209380711722505179506258739515288584116147237393815266468076436521/71*u^210 + ... - 14790739586438315394567393301990769678157425619440464678252277649/71
+ sage: f = Psi2(71)
+ sage: f.coefficient([0, 210, 0])
+ -2209380711722505179506258739515288584116147237393815266468076436521/71
+ sage: f.coefficient([0, 0, 0])
+ -14790739586438315394567393301990769678157425619440464678252277649/71
TESTS::
@@ -1665,17 +1668,17 @@ def isogenies_prime_degree_genus_plus_0(E, l=None, minimal_models=True):
sage: K = QuadraticField(5,'a')
sage: a = K.gen()
sage: E = EllipticCurve_from_j(184068066743177379840*a - 411588709724712960000)
- sage: isogenies_prime_degree_genus_plus_0(E, 47) # long time (4.3s)
+ sage: isogenies_prime_degree_genus_plus_0(E, 47) # long time (2s)
[Isogeny of degree 47 from Elliptic Curve defined by y^2 = x^3 + (454562028554080355857852049849975895490560*a-1016431595837124114668689286176511361024000)*x + (-249456798429896080881440540950393713303830363999480904280965120*a+557802358738710443451273320227578156598454035482869042774016000) over Number Field in a with defining polynomial x^2 - 5 with a = 2.236067977499790? to Elliptic Curve defined by y^2 = x^3 + (39533118442361013730577638493616965245992960*a-88398740199669828340617478832005245173760000)*x + (214030321479466610282320528611562368963830105830555363061803253760*a-478586348074220699687616322532666163722004497458452316582576128000) over Number Field in a with defining polynomial x^2 - 5 with a = 2.236067977499790?]
sage: K = QuadraticField(-66827,'a')
sage: a = K.gen()
sage: E = EllipticCurve_from_j(-98669236224000*a + 4401720074240000)
- sage: isogenies_prime_degree_genus_plus_0(E, 59) # long time (25s, 2012)
+ sage: isogenies_prime_degree_genus_plus_0(E, 59) # long time (5s)
[Isogeny of degree 59 from Elliptic Curve defined by y^2 = x^3 + (2605886146782144762297974784000*a+1893681048912773634944634716160000)*x + (-116918454256410782232296183198067568744071168000*a+17012043538294664027185882358514011304812871680000) over Number Field in a with defining polynomial x^2 + 66827 with a = 258.5091874576221?*I to Elliptic Curve defined by y^2 = x^3 + (-19387084027159786821400775098368000*a-4882059104868154225052787156713472000)*x + (-25659862010101415428713331477227179429538847260672000*a-2596038148441293485938798119003462972840818381946880000) over Number Field in a with defining polynomial x^2 + 66827 with a = 258.5091874576221?*I]
sage: E = EllipticCurve_from_j(GF(13)(5))
- sage: isogenies_prime_degree_genus_plus_0(E, 71) # long time
+ sage: isogenies_prime_degree_genus_plus_0(E, 71)
[Isogeny of degree 71 from Elliptic Curve defined by y^2 = x^3 + x + 4 over Finite Field of size 13 to Elliptic Curve defined by y^2 = x^3 + 10*x + 7 over Finite Field of size 13, Isogeny of degree 71 from Elliptic Curve defined by y^2 = x^3 + x + 4 over Finite Field of size 13 to Elliptic Curve defined by y^2 = x^3 + 10*x + 7 over Finite Field of size 13]
sage: E = EllipticCurve(GF(13),[0,1,1,1,0])
@@ -2117,11 +2120,11 @@ def isogenies_prime_degree_general(E, l, minimal_models=True):
sage: isogenies_prime_degree_general(E, 19)
[Isogeny of degree 19 from Elliptic Curve defined by y^2 + y = x^3 - 1862*x - 30956 over Rational Field to Elliptic Curve defined by y^2 + y = x^3 - 672182*x + 212325489 over Rational Field]
sage: E = EllipticCurve([0, -1, 0, -6288, 211072])
- sage: isogenies_prime_degree_general(E, 37) # long time (10s)
+ sage: isogenies_prime_degree_general(E, 37) # long time (2s)
[Isogeny of degree 37 from Elliptic Curve defined by y^2 = x^3 - x^2 - 6288*x + 211072 over Rational Field to Elliptic Curve defined by y^2 = x^3 - x^2 - 163137088*x - 801950801728 over Rational Field]
sage: E = EllipticCurve([-3440, 77658])
- sage: isogenies_prime_degree_general(E, 43) # long time (16s)
+ sage: isogenies_prime_degree_general(E, 43) # long time (2s)
[Isogeny of degree 43 from Elliptic Curve defined by y^2 = x^3 - 3440*x + 77658 over Rational Field to Elliptic Curve defined by y^2 = x^3 - 6360560*x - 6174354606 over Rational Field]
Isogenies of degree equal to the characteristic are computed (but
@@ -2175,7 +2178,7 @@ def isogenies_prime_degree_general(E, l, minimal_models=True):
sage: K.<i> = QuadraticField(-1)
sage: E = EllipticCurve(K,[0,0,0,1,0])
- sage: [phi.codomain().ainvs() for phi in E.isogenies_prime_degree(37)] # long time
+ sage: [phi.codomain().ainvs() for phi in E.isogenies_prime_degree(37)] # long time (6s)
[(0, 0, 0, -840*i + 1081, 0), (0, 0, 0, 840*i + 1081, 0)]
"""
if not l.is_prime():
@@ -2329,14 +2332,14 @@ def isogenies_prime_degree(E, l, minimal_models=True):
sage: E = EllipticCurve(GF(101), [-3440, 77658])
sage: E.isogenies_prime_degree(71) # fast
[]
- sage: E.isogenies_prime_degree(73) # slower (2s)
+ sage: E.isogenies_prime_degree(73) # long time (2s)
[]
Test that :trac:`32269` is fixed::
sage: K = QuadraticField(-11)
sage: E = EllipticCurve(K, [0,1,0,-117,-541])
- sage: E.isogenies_prime_degree(37)
+ sage: E.isogenies_prime_degree(37) # long time (9s)
[Isogeny of degree 37 from Elliptic Curve defined by y^2 = x^3 + x^2 + (-117)*x + (-541) over Number Field in a with defining polynomial x^2 + 11 with a = 3.316624790355400?*I to Elliptic Curve defined by y^2 = x^3 + x^2 + (30800*a+123963)*x + (3931312*a-21805005) over Number Field in a with defining polynomial x^2 + 11 with a = 3.316624790355400?*I,
Isogeny of degree 37 from Elliptic Curve defined by y^2 = x^3 + x^2 + (-117)*x + (-541) over Number Field in a with defining polynomial x^2 + 11 with a = 3.316624790355400?*I to Elliptic Curve defined by y^2 = x^3 + x^2 + (-30800*a+123963)*x + (-3931312*a-21805005) over Number Field in a with defining polynomial x^2 + 11 with a = 3.316624790355400?*I]

View File

@ -1,97 +0,0 @@
--- a/src/sage/rings/function_field/function_field.py
+++ b/src/sage/rings/function_field/function_field.py
@@ -111,22 +111,21 @@ Function fields over the algebraic field are supported::
sage: m = L.completion(pl, prec=5)
sage: m(x)
I + s + O(s^5)
- sage: m(y)
+ sage: m(y) # long time (4s)
-2*s + (-4 - I)*s^2 + (-15 - 4*I)*s^3 + (-75 - 23*I)*s^4 + (-413 - 154*I)*s^5 + O(s^6)
- sage: m(y)^2 + m(y) + m(x) + 1/m(x)
+ sage: m(y)^2 + m(y) + m(x) + 1/m(x) # long time (8s)
O(s^5)
TESTS::
sage: TestSuite(J).run()
- sage: TestSuite(K).run(max_runs=1024) # long time (5s)
- sage: TestSuite(L).run(max_runs=64) # long time (10s)
- sage: TestSuite(M).run(max_runs=32) # long time (30s)
- sage: TestSuite(N).run(max_runs=64, skip = '_test_derivation') # long time (8s)
- sage: TestSuite(O).run(max_runs=128, skip = '_test_derivation') # long time (8s)
-
+ sage: TestSuite(K).run(max_runs=256) # long time (10s)
+ sage: TestSuite(L).run(max_runs=8) # long time (25s)
+ sage: TestSuite(M).run(max_runs=8) # long time (35s)
+ sage: TestSuite(N).run(max_runs=8, skip = '_test_derivation') # long time (15s)
+ sage: TestSuite(O).run()
sage: TestSuite(R).run()
- sage: TestSuite(S).run() # long time (3s)
+ sage: TestSuite(S).run() # long time (4s)
Global function fields
----------------------
@@ -287,7 +286,7 @@ class FunctionField(Field):
TESTS::
sage: K.<x> = FunctionField(QQ)
- sage: TestSuite(K).run()
+ sage: TestSuite(K).run() # long time (3s)
"""
Field.__init__(self, base_field, names=names, category=category)
@@ -729,7 +728,7 @@ class FunctionField(Field):
EXAMPLES::
sage: K.<x> = FunctionField(QQ)
- sage: TestSuite(K).run() # indirect doctest
+ sage: TestSuite(K).run() # indirect doctest, long time (3s)
"""
tester = self._tester(**options)
S = tester.some_elements()
@@ -1209,7 +1208,7 @@ class FunctionField_polymod(FunctionField):
sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L = K.extension(y^5 - x^3 - 3*x + x*y); L
Function field in y defined by y^5 + x*y - x^3 - 3*x
- sage: TestSuite(L).run() # long time
+ sage: TestSuite(L).run(max_runs=512) # long time (15s)
We can set the variable name, which doesn't have to be y::
@@ -2888,7 +2887,8 @@ class FunctionField_simple(FunctionField_polymod):
sage: F.<y> = K.extension(Y^3 - x^2*(x^2 + x + 1)^2)
sage: O = K.maximal_order()
sage: pls = [O.ideal(x-QQbar(sqrt(c))).place() for c in [-2, -1, 0, 1, 2]]
- sage: all(q.place_below() == p for p in pls for q in F.places_above(p))
+ sage: all(q.place_below() == p # long time (4s)
+ ....: for p in pls for q in F.places_above(p))
True
"""
R = self.base_field()
@@ -3091,7 +3091,7 @@ class FunctionField_global(FunctionField_simple):
sage: K.<x> = FunctionField(GF(4)); _.<Y> = K[]
sage: L.<y> = K.extension((1 - x)*Y^7 - x^3)
- sage: L.gaps()
+ sage: L.gaps() # long time (6s)
[1, 2, 3]
or may define a trivial extension::
@@ -3111,7 +3111,7 @@ class FunctionField_global(FunctionField_simple):
sage: K.<x> = FunctionField(GF(5)); _.<Y> = K[]
sage: L.<y> = K.extension(Y^3 - (x^3 - 1)/(x^3 - 2))
- sage: TestSuite(L).run()
+ sage: TestSuite(L).run() # long time (7s)
"""
FunctionField_polymod.__init__(self, polynomial, names)
@@ -3807,7 +3807,7 @@ class RationalFunctionField(FunctionField):
sage: K.<t> = FunctionField(CC); K
Rational function field in t over Complex Field with 53 bits of precision
- sage: TestSuite(K).run()
+ sage: TestSuite(K).run() # long time (5s)
sage: FunctionField(QQ[I], 'alpha')
Rational function field in alpha over Number Field in I with defining polynomial x^2 + 1 with I = 1*I

View File

@ -1,670 +0,0 @@
As produced by `git diff 9.5 9.6.beta3 -- src/sage/libs/lrcalc`
diff --git a/src/sage/libs/lrcalc/lrcalc.pxd b/src/sage/libs/lrcalc/lrcalc.pxd
deleted file mode 100644
index 10b88db93f2..00000000000
--- a/src/sage/libs/lrcalc/lrcalc.pxd
+++ /dev/null
@@ -1,77 +0,0 @@
-# distutils: libraries = lrcalc
-
-cdef extern from "lrcalc/hashtab.h":
- ctypedef struct hashtab:
- pass
-
- ctypedef struct hash_itr:
- pass
-
- ctypedef unsigned long hashkey_t
- ctypedef int (*cmp_t) (void* a, void* b)
- ctypedef hashkey_t (*hash_t) (void* a)
-
- hashtab* hash_new(cmp_t cm, hash_t hsh)
- void hash_free(hashtab *ht)
-
- void* hash_lookup(hashtab *ht, void *key)
- void* hash_insert(hashtab *ht, void *key, void *value)
-
- bint hash_good(hash_itr)
- void hash_first(hashtab* s, hash_itr itr)
- void hash_next(hash_itr itr)
- void* hash_key(hash_itr itr)
- void* hash_value(hash_itr itr)
- int hash_intvalue(hash_itr itr)
-
-cdef extern from "lrcalc/vector.h":
- ctypedef struct vector:
- size_t length
- int* array
-
- vector* v_new(int length)
- void v_free(vector* v)
- void v_print(vector *v)
- int v_length(vector* v)
- int v_elem(vector* v, int i)
-
- ctypedef struct vecpair:
- vector *first
- vector *second
-
- vector* vp_first(vecpair* vp)
- vector* vp_second(vecpair* vp)
-
-cdef extern from "lrcalc/list.h":
- cdef struct _list:
- void **array
- size_t allocated
- size_t length
- void l_free(_list *lst)
-
-cdef extern from "lrcalc/symfcn.h":
- long long lrcoef_c "lrcoef"(vector* outer, vector* inner1, vector* inner2)
- hashtab* mult_c "mult"(vector *sh1, vector *sh2, int maxrows)
- hashtab* skew_c "skew"(vector *outer, vector *inner, int maxrows)
- hashtab* coprod_c "coprod"(vector *part, int all)
- void fusion_reduce_c "fusion_reduce"(hashtab* ht, int rows, int cols, int opt_zero)
- _list *quantum_reduce_c "quantum_reduce"(hashtab* ht, int rows, int col)
-
- ctypedef struct skewtab:
- vector *outer
- vector *inner
- vector *conts
- int maxrows
- vector *conjugate
- int rows
- int cols
- int matrix[1]
-
- skewtab *st_new(vector *outer, vector *inner, vector *conts, int maxrows)
- int st_next(skewtab *st)
- void st_print(skewtab *st)
- void st_free(skewtab *st)
-
-
-cdef extern from "lrcalc/schublib.h":
- hashtab* mult_schubert_c "mult_schubert"(vector *sh1, vector *sh2, int rank)
diff --git a/src/sage/libs/lrcalc/lrcalc.pyx b/src/sage/libs/lrcalc/lrcalc.py
similarity index 60%
rename from src/sage/libs/lrcalc/lrcalc.pyx
rename to src/sage/libs/lrcalc/lrcalc.py
index b591081ec4c..b541bfacd89 100644
--- a/src/sage/libs/lrcalc/lrcalc.pyx
+++ b/src/sage/libs/lrcalc/lrcalc.py
@@ -10,7 +10,8 @@ fusion products. All of the above are achieved by counting LR
appropriate shape and content by iterating through them.
Additionally, ``lrcalc`` handles products of Schubert polynomials.
-The web page of ``lrcalc`` is `<http://sites.math.rutgers.edu/~asbuch/lrcalc/>`_.
+The web page of ``lrcalc`` is
+`<http://sites.math.rutgers.edu/~asbuch/lrcalc/>`_.
The following describes the Sage interface to this library.
@@ -36,12 +37,13 @@ Schur expansion::
[4, 2]: 1}
Same product, but include only partitions with at most 3 rows. This
-corresponds to computing in the representation ring of gl(3)::
+corresponds to computing in the representation ring of `\mathfrak{gl}(3)`::
sage: lrcalc.mult([2,1], [2,1], 3)
{[2, 2, 2]: 1, [3, 2, 1]: 2, [3, 3]: 1, [4, 1, 1]: 1, [4, 2]: 1}
-We can also compute the fusion product, here for sl(3) and level 2::
+We can also compute the fusion product, here for `\mathfrak{sl}(3)`
+and level 2::
sage: lrcalc.mult([3,2,1], [3,2,1], 3,2)
{[4, 4, 4]: 1, [5, 4, 3]: 1}
@@ -77,42 +79,38 @@ Multiply two Schubert polynomials::
[6, 2, 1, 4, 3, 5]: 1}
Same product, but include only permutations of 5 elements in the result.
-This corresponds to computing in the cohomology ring of Fl(5)::
+This corresponds to computing in the cohomology ring of `Fl(5)`::
sage: lrcalc.mult_schubert([4,2,1,3], [1,4,2,5,3], 5)
{[4, 5, 1, 3, 2]: 1, [5, 3, 1, 4, 2]: 1, [5, 4, 1, 2, 3]: 1}
List all Littlewood-Richardson tableaux of skew shape `\mu/\nu`; in
this example `\mu=[3,2,1]` and `\nu=[2,1]`. Specifying a third entry
-`maxrows` restricts the alphabet to `\{1,2,\ldots,maxrows\}`::
+`M' = ``maxrows`` restricts the alphabet to `\{1,2,\ldots,M\}`::
sage: list(lrcalc.lrskew([3,2,1],[2,1]))
[[[None, None, 1], [None, 1], [1]], [[None, None, 1], [None, 1], [2]],
[[None, None, 1], [None, 2], [1]], [[None, None, 1], [None, 2], [3]]]
sage: list(lrcalc.lrskew([3,2,1],[2,1],maxrows=2))
- [[[None, None, 1], [None, 1], [1]], [[None, None, 1], [None, 1], [2]], [[None, None, 1], [None, 2], [1]]]
+ [[[None, None, 1], [None, 1], [1]], [[None, None, 1], [None, 1], [2]],
+ [[None, None, 1], [None, 2], [1]]]
.. TODO::
- use this library in the :class:`SymmetricFunctions` code, to
+ Use this library in the :class:`SymmetricFunctions` code, to
make it easy to apply it to linear combinations of Schur functions.
.. SEEALSO::
- :func:`lrcoef`
-
- :func:`mult`
-
- :func:`coprod`
-
- :func:`skew`
-
- :func:`lrskew`
-
- :func:`mult_schubert`
-.. rubric:: Underlying algorithmic in lrcalc
+.. RUBRIC:: Underlying algorithmic in lrcalc
Here is some additional information regarding the main low-level
C-functions in `lrcalc`. Given two partitions ``outer`` and ``inner``
@@ -187,180 +185,24 @@ AUTHORS:
# https://www.gnu.org/licenses/
# ****************************************************************************
-from sage.rings.integer cimport Integer
-from sage.structure.parent cimport Parent
from sage.combinat.partition import _Partitions
from sage.combinat.permutation import Permutation
-from sage.combinat.skew_tableau import SkewTableau
-
-
-cdef vector* iterable_to_vector(it):
- """
- Return an lrcalc vector (which is a list of integers) from a Python iterable.
-
- TESTS::
-
- sage: from sage.libs.lrcalc.lrcalc import test_iterable_to_vector
- sage: x = test_iterable_to_vector(Partition([3,2,1])); x #indirect doctest
- [3, 2, 1]
- """
- cdef vector* v
- cdef list itr = list(it)
- cdef int n = len(itr)
- cdef int i
- v = v_new(n)
- for i in range(n):
- v.array[i] = int(itr[i])
- return v
-
-
-cdef list vector_to_list(vector *v):
- """
- Converts a lrcalc vector to Python list.
-
- TESTS::
-
- sage: from sage.libs.lrcalc.lrcalc import test_iterable_to_vector
- sage: x = test_iterable_to_vector([]); x #indirect doctest
- []
- """
- cdef int i, n
- n = v_length(v)
- cdef list result = [None]*n
- for i in range(n):
- result[i] = Integer(v_elem(v, i))
- return result
-
-
-def test_iterable_to_vector(it):
- """
- A wrapper function for the cdef function ``iterable_to_vector``
- and ``vector_to_list``, to test that they are working correctly.
+from sage.combinat.skew_tableau import SemistandardSkewTableaux
+from sage.combinat.skew_partition import SkewPartition
+from sage.rings.integer import Integer
+import lrcalc
- EXAMPLES::
-
- sage: from sage.libs.lrcalc.lrcalc import test_iterable_to_vector
- sage: x = test_iterable_to_vector([3,2,1]); x
- [3, 2, 1]
- """
- cdef vector *v = iterable_to_vector(it)
- result = vector_to_list(v)
- v_free(v)
- return result
-
-
-cdef skewtab_to_SkewTableau(skewtab *st):
- """
- A wrapper function which transforms the data set ``st`` used in
- ``lrcalc`` to a ``SkewTableau`` in Sage.
+def _lrcalc_dict_to_sage(result):
+ r"""
+ Translate from lrcalc output format to Sage expected format.
TESTS::
- sage: from sage.libs.lrcalc.lrcalc import test_skewtab_to_SkewTableau
- sage: test_skewtab_to_SkewTableau([],[])
- []
- """
- inner = vector_to_list(st.inner)
- outer = vector_to_list(st.outer)
- return SkewTableau(expr=[[inner[y] for y in range(len(outer))],
- [[st.matrix[x + y * st.cols] + 1
- for x in range(inner[y], outer[y])]
- for y in range(len(outer) - 1, -1, -1)]])
-
-
-def test_skewtab_to_SkewTableau(outer, inner):
- """
- A wrapper function for the cdef function ``skewtab_to_SkewTableau``
- for testing purposes.
-
- It constructs the first LR skew tableau of shape ``outer/inner``
- as an ``lrcalc`` ``skewtab``, and converts it to a
- :class:`SkewTableau`.
-
- EXAMPLES::
-
- sage: from sage.libs.lrcalc.lrcalc import test_skewtab_to_SkewTableau
- sage: test_skewtab_to_SkewTableau([3,2,1],[])
- [[1, 1, 1], [2, 2], [3]]
- sage: test_skewtab_to_SkewTableau([4,3,2,1],[1,1]).pp()
- . 1 1 1
- . 2 2
- 1 3
- 2
- """
- cdef vector* o = iterable_to_vector(outer)
- cdef vector* i = iterable_to_vector(inner+[0]*(len(outer)-len(inner)))
- cdef skewtab* st = st_new(o, i, NULL, 0)
- return skewtab_to_SkewTableau(st)
-
-
-cdef dict sf_hashtab_to_dict(hashtab *ht):
- """
- Return a dictionary representing a Schur function. The keys are
- partitions and the values are integers <class 'sage.rings.integer.Integer'>.
-
- EXAMPLES::
-
sage: from sage.libs.lrcalc.lrcalc import mult
- sage: sorted(mult([1],[1]).items()) #indirect doctest
- [([1, 1], 1), ([2], 1)]
- sage: assert isinstance(mult([1],[1]),dict)#indirect doctest
- """
- cdef hash_itr itr
- cdef dict result = {}
- cdef list p
- hash_first(ht, itr)
- while hash_good(itr):
- p = vector_to_list(<vector*> hash_key(itr))
- result[_Partitions(p)] = Integer(hash_intvalue(itr))
- hash_next(itr)
- return result
-
-
-cdef dict schubert_hashtab_to_dict(hashtab *ht):
- """
- Return a dictionary corresponding to a Schubert polynomial whose keys
- are permutations and whose values are integers <class 'sage.rings.integer.Integer'>.
-
- EXAMPLES::
-
- sage: from sage.libs.lrcalc.lrcalc import mult_schubert
- sage: mult_schubert([3,2,1], [1,2,3]) #indirect doctest
- {[3, 2, 1]: 1}
- """
- cdef hash_itr itr
- cdef dict result = {}
- hash_first(ht, itr)
- while hash_good(itr):
- p = vector_to_list(<vector*> hash_key(itr))
- result[Permutation(p)] = Integer(hash_intvalue(itr))
- hash_next(itr)
- return result
-
-
-cdef dict vp_hashtab_to_dict(hashtab *ht):
- """
- Return a dictionary corresponding to the coproduct of a Schur function whose keys are
- pairs of partitions and whose values are integers <class 'sage.rings.integer.Integer'>.
-
- EXAMPLES::
-
- sage: from sage.libs.lrcalc.lrcalc import coprod
- sage: coprod([1]) #indirect doctest
- {([1], []): 1}
+ sage: mult([2,1],[3,2,1],3) # indirect doctest
+ {[3, 3, 3]: 1, [4, 3, 2]: 2, [4, 4, 1]: 1, [5, 2, 2]: 1, [5, 3, 1]: 1}
"""
- cdef hash_itr itr
- cdef vecpair* vp
- cdef dict result = {}
- hash_first(ht, itr)
- while hash_good(itr):
- vp = <vecpair*> hash_key(itr)
- p1 = _Partitions(vector_to_list(vp_first(vp)))
- p2 = _Partitions(vector_to_list(vp_second(vp)))
- result[(p1, p2)] = Integer(hash_intvalue(itr))
- hash_next(itr)
- return result
-
+ return {_Partitions(la): Integer(k) for la, k in result.items()}
def lrcoef_unsafe(outer, inner1, inner2):
r"""
@@ -371,13 +213,11 @@ def lrcoef_unsafe(outer, inner1, inner2):
INPUT:
- - ``outer`` -- a partition (weakly decreasing list of non-negative integers).
-
- - ``inner1`` -- a partition.
+ - ``outer`` -- a partition (weakly decreasing list of non-negative integers)
+ - ``inner1`` -- a partition
+ - ``inner2`` -- a partition
- - ``inner2`` -- a partition.
-
- .. warning::
+ .. WARNING::
This function does not do any check on its input. If you want
to use a safer version, use :func:`lrcoef`.
@@ -392,18 +232,7 @@ def lrcoef_unsafe(outer, inner1, inner2):
sage: lrcoef_unsafe([2,1,1,1,1], [2,1], [2,1])
0
"""
- cdef long long result
- cdef vector *o
- cdef vector *i1
- cdef vector *i2
- o = iterable_to_vector(outer)
- i1 = iterable_to_vector(inner1)
- i2 = iterable_to_vector(inner2)
- result = lrcoef_c(o, i1, i2)
- v_free(o)
- v_free(i1)
- v_free(i2)
- return Integer(result)
+ return Integer(lrcalc.lrcoef(outer, inner1, inner2))
def lrcoef(outer, inner1, inner2):
@@ -415,11 +244,9 @@ def lrcoef(outer, inner1, inner2):
INPUT:
- - ``outer`` -- a partition (weakly decreasing list of non-negative integers).
-
- - ``inner1`` -- a partition.
-
- - ``inner2`` -- a partition.
+ - ``outer`` -- a partition (weakly decreasing list of non-negative integers)
+ - ``inner1`` -- a partition
+ - ``inner2`` -- a partition
.. NOTE::
@@ -436,7 +263,6 @@ def lrcoef(outer, inner1, inner2):
1
sage: lrcoef([2,1,1,1,1], [2,1], [2,1])
0
-
"""
return lrcoef_unsafe(_Partitions(outer), _Partitions(inner1), _Partitions(inner2))
@@ -451,13 +277,9 @@ def mult(part1, part2, maxrows=None, level=None, quantum=None):
INPUT:
- ``part1`` -- a partition
-
- ``part2`` -- a partition
-
- ``maxrows`` -- (optional) an integer
-
- ``level`` -- (optional) an integer
-
- ``quantum`` -- (optional) an element of a ring
If ``maxrows`` is specified, then only partitions with at most
@@ -479,7 +301,8 @@ def mult(part1, part2, maxrows=None, level=None, quantum=None):
sage: sorted(mult([2],[2]).items())
[([2, 2], 1), ([3, 1], 1), ([4], 1)]
sage: sorted(mult([2,1],[2,1]).items())
- [([2, 2, 1, 1], 1), ([2, 2, 2], 1), ([3, 1, 1, 1], 1), ([3, 2, 1], 2), ([3, 3], 1), ([4, 1, 1], 1), ([4, 2], 1)]
+ [([2, 2, 1, 1], 1), ([2, 2, 2], 1), ([3, 1, 1, 1], 1),
+ ([3, 2, 1], 2), ([3, 3], 1), ([4, 1, 1], 1), ([4, 2], 1)]
sage: sorted(mult([2,1],[2,1],maxrows=2).items())
[([3, 3], 1), ([4, 2], 1)]
sage: mult([2,1],[3,2,1],3)
@@ -510,44 +333,24 @@ def mult(part1, part2, maxrows=None, level=None, quantum=None):
if quantum is not None and (level is None or maxrows is None):
raise ValueError('missing parameters maxrows or level')
- cdef vector* v1 = iterable_to_vector(part1)
- cdef vector* v2 = iterable_to_vector(part2)
- if maxrows is None:
- maxrows = 0
- cdef hashtab* ht = mult_c(v1, v2, int(maxrows))
- cdef hashtab* tab
- cdef dict result
-
if quantum is None:
if level is not None:
- fusion_reduce_c(ht, int(maxrows), int(level), int(0))
- result = sf_hashtab_to_dict(ht)
- v_free(v1)
- v_free(v2)
- hash_free(ht)
- return result
+ return _lrcalc_dict_to_sage(lrcalc.mult_fusion(part1, part2, maxrows, level))
+ if maxrows is None:
+ maxrows = -1
+ return _lrcalc_dict_to_sage(lrcalc.mult(part1, part2, maxrows))
# Otherwise do quantum multiplication
- cdef _list *qlist
- cdef dict temp
- qlist = quantum_reduce_c(ht, int(maxrows), int(level))
- # The above call frees the memory associated with ht
- v_free(v1)
- v_free(v2)
-
- cdef Parent P = quantum.parent()
- result = {}
- for i in range(qlist.length):
- tab = <hashtab*>(qlist.array[i])
- temp = sf_hashtab_to_dict(tab)
- for k in temp:
- result[k] = result.get(k, P.zero()) + quantum**i * temp[k]
- hash_free(tab)
- l_free(qlist)
- return result
-
-
-def skew(outer, inner, maxrows=0):
+ result = lrcalc.mult_quantum(part1, part2, maxrows, level, degrees=True)
+ P = quantum.parent()
+ output = {}
+ for i,k in result.items():
+ la = _Partitions(i[0])
+ output[la] = output.get(la, P.zero()) + k * quantum**(i[1])
+ return output
+
+
+def skew(outer, inner, maxrows=-1):
"""
Compute the Schur expansion of a skew Schur function.
@@ -557,11 +360,9 @@ def skew(outer, inner, maxrows=0):
INPUT:
- - ``outer`` -- a partition.
-
- - ``inner`` -- a partition.
-
- - ``maxrows`` -- an integer or ``None``.
+ - ``outer`` -- a partition
+ - ``inner`` -- a partition
+ - ``maxrows`` -- an integer or ``None``
If ``maxrows`` is specified, then only partitions with at most
this number of rows are included in the result.
@@ -572,14 +373,7 @@ def skew(outer, inner, maxrows=0):
sage: sorted(skew([2,1],[1]).items())
[([1, 1], 1), ([2], 1)]
"""
- cdef vector* v1 = iterable_to_vector(outer)
- cdef vector* v2 = iterable_to_vector(inner)
- cdef hashtab* ht = skew_c(v1, v2, int(maxrows))
- result = sf_hashtab_to_dict(ht)
- v_free(v1)
- v_free(v2)
- hash_free(ht)
- return result
+ return _lrcalc_dict_to_sage(lrcalc.skew(outer, inner, maxrows))
def coprod(part, all=0):
@@ -592,9 +386,8 @@ def coprod(part, all=0):
INPUT:
- - ``part`` -- a partition.
-
- - ``all`` -- an integer.
+ - ``part`` -- a partition
+ - ``all`` -- an integer
If ``all`` is non-zero then all terms are included in the result.
If ``all`` is zero, then only pairs of partitions ``(part1,
@@ -609,12 +402,9 @@ def coprod(part, all=0):
sage: sorted(coprod([2,1]).items())
[(([1, 1], [1]), 1), (([2], [1]), 1), (([2, 1], []), 1)]
"""
- cdef vector* v1 = iterable_to_vector(part)
- cdef hashtab* ht = coprod_c(v1, int(all))
- result = vp_hashtab_to_dict(ht)
- v_free(v1)
- hash_free(ht)
- return result
+ result = lrcalc.coprod(part, all)
+ return {tuple([_Partitions(mu) for mu in la]): Integer(k)
+ for la, k in result.items()}
def mult_schubert(w1, w2, rank=0):
@@ -627,11 +417,9 @@ def mult_schubert(w1, w2, rank=0):
INPUT:
- - ``w1`` -- a permutation.
-
- - ``w2`` -- a permutation.
-
- - ``rank`` -- an integer.
+ - ``w1`` -- a permutation
+ - ``w2`` -- a permutation
+ - ``rank`` -- an integer
If ``rank`` is non-zero, then only permutations from the symmetric
group `S(\mathrm{rank})` are included in the result.
@@ -646,33 +434,24 @@ def mult_schubert(w1, w2, rank=0):
([6, 4, 3, 1, 2, 5], 1), ([6, 5, 2, 1, 3, 4], 1),
([7, 3, 4, 1, 2, 5, 6], 1), ([7, 4, 2, 1, 3, 5, 6], 1)]
"""
- cdef vector* v1 = iterable_to_vector(w1)
- cdef vector* v2 = iterable_to_vector(w2)
- cdef hashtab* ht = mult_schubert_c(v1, v2, int(rank))
- result = schubert_hashtab_to_dict(ht)
- v_free(v1)
- v_free(v2)
- hash_free(ht)
- return result
+ result = lrcalc.schubmult(w1, w2, rank)
+ return {Permutation(list(la)):Integer(k) for la,k in result.items()}
-def lrskew(outer, inner, weight=None, maxrows=0):
+def lrskew(outer, inner, weight=None, maxrows=-1):
r"""
Iterate over the skew LR tableaux of shape ``outer / inner``.
INPUT:
- ``outer`` -- a partition
-
- ``inner`` -- a partition
-
- ``weight`` -- a partition (optional)
-
- - ``maxrows`` -- an integer (optional)
+ - ``maxrows`` -- a positive integer (optional)
OUTPUT: an iterator of :class:`SkewTableau`
- Specifying ``maxrows`` restricts the alphabet to `\{1,2,\ldots,maxrows\}`.
+ Specifying ``maxrows`` = `M` restricts the alphabet to `\{1,2,\ldots,M\}`.
Specifying ``weight`` returns only those tableaux of given content/weight.
@@ -702,22 +481,40 @@ def lrskew(outer, inner, weight=None, maxrows=0):
sage: list(lrskew([3,2,1],[2], weight=[3,1]))
[[[None, None, 1], [1, 1], [2]]]
+
+ TESTS::
+
+ sage: from sage.libs.lrcalc.lrcalc import lrskew
+ sage: list(lrskew([3,2,1],[2], weight=[]))
+ []
+ sage: list(lrskew([3,2,1],[2], weight=[0]))
+ []
+ sage: list(lrskew([3,2,1],[3,2,1], weight=[]))
+ [[[None, None, None], [None, None], [None]]]
+ sage: list(lrskew([3,2,1],[3,2,1], weight=[0]))
+ [[[None, None, None], [None, None], [None]]]
+ sage: list(lrskew([3,2,1],[3,2,1], weight=[1]))
+ []
"""
- cdef vector* o = iterable_to_vector(outer)
- cdef vector* i = iterable_to_vector(inner + [0]*(len(outer) - len(inner)))
- cdef skewtab* st = st_new(o, i, NULL, int(maxrows))
+ iterator = lrcalc.lr_iterator(outer, inner, maxrows)
+ shape = SkewPartition([outer, inner])
if weight is None:
- yield skewtab_to_SkewTableau(st)
- while st_next(st):
- yield skewtab_to_SkewTableau(st)
+ ST = SemistandardSkewTableaux(shape)
+ for data in iterator:
+ yield ST.from_shape_and_word(shape, [i+1 for i in data])
else:
wt = _Partitions(weight)
- r = skewtab_to_SkewTableau(st)
- if r.weight() == wt:
- yield r
- while st_next(st):
- r = skewtab_to_SkewTableau(st)
- if r.weight() == wt:
- yield r
- st_free(st)
+ ST = SemistandardSkewTableaux(shape, wt)
+ m = len(wt)
+ for data in iterator:
+ w = [0] * m
+ for j in data:
+ if j >= m:
+ # We know they are not equal, so make the check below quick
+ w = None
+ break
+ w[j] += 1
+ if w == wt:
+ yield ST.from_shape_and_word(shape, [i+1 for i in data])
+

View File

@ -1,40 +0,0 @@
As produced by `git diff a90a3146{^^,}`
diff --git a/src/sage/repl/interface_magic.py b/src/sage/repl/interface_magic.py
index 8a455b69b0e..a93e1c9e04c 100644
--- a/src/sage/repl/interface_magic.py
+++ b/src/sage/repl/interface_magic.py
@@ -260,7 +260,7 @@ class InterfaceMagic(object):
2
120
sage: shell.run_cell('%%gap foo\n1+1;\n')
- ...File "<string>", line unknown
+ ...File...<string>...
SyntaxError: Interface magics have no options, got "foo"
<BLANKLINE>
sage: shell.run_cell('%%gap?')
diff --git a/src/sage/repl/interpreter.py b/src/sage/repl/interpreter.py
index 7468afe52d7..06c47b7374a 100644
--- a/src/sage/repl/interpreter.py
+++ b/src/sage/repl/interpreter.py
@@ -78,9 +78,9 @@ Check that Cython source code appears in tracebacks::
dummy line
...
ZeroDivisionError...Traceback (most recent call last)
- <ipython-input-...> in <module>...
+ ...in <module>...
----> 1 Integer(1)/Integer(0)
- .../sage/rings/integer.pyx in sage.rings.integer.Integer...div...
+ .../sage/rings/integer.pyx... in sage.rings.integer.Integer...div...
...
-> ... raise ZeroDivisionError("rational division by zero")
....: x = <Rational> Rational.__new__(Rational)
@@ -423,7 +423,7 @@ def SagePreparseTransformer(lines):
sage: from sage.repl.interpreter import get_test_shell
sage: shell = get_test_shell()
sage: shell.run_cell(bad_syntax)
- File "<string>", line unknown
+ File...<string>...
SyntaxError: Mismatched ']'
<BLANKLINE>
sage: shell.quit()

View File

@ -1,13 +0,0 @@
Fix for ipython 8.1
--- a/src/sage/repl/interpreter.py
+++ b/src/sage/repl/interpreter.py
@@ -78,7 +78,7 @@ Check that Cython source code appears in tracebacks::
dummy line
...
ZeroDivisionError...Traceback (most recent call last)
- ...in <module>...
+ ...
----> 1 Integer(1)/Integer(0)
.../sage/rings/integer.pyx... in sage.rings.integer.Integer...div...
...

View File

@ -1,126 +0,0 @@
From 24cc94b1988a90f3bd22a2368ec30c086283af13 Mon Sep 17 00:00:00 2001
From: Antonio Rojas <arojas@archlinux.org>
Date: Sun, 16 Jan 2022 11:55:04 +0100
Subject: Add abs tol to some arb tests
---
src/sage/functions/error.py | 2 +-
src/sage/rings/complex_arb.pyx | 6 +++---
src/sage/rings/real_arb.pyx | 10 +++++-----
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/sage/functions/error.py b/src/sage/functions/error.py
index f48d04f..06f0b24 100644
--- a/src/sage/functions/error.py
+++ b/src/sage/functions/error.py
@@ -267,7 +267,7 @@ class Function_erf(BuiltinFunction):
Check that real ball evaluation is fixed :trac:`28061`::
- sage: RealBallField(128)(erf(5))
+ sage: RealBallField(128)(erf(5)) # abs tol 1e-38
[0.99999999999846254020557196514981165651 +/- 7.33e-39]
"""
R = parent or s_parent(x)
diff --git a/src/sage/rings/complex_arb.pyx b/src/sage/rings/complex_arb.pyx
index f986970..93ff565 100644
--- a/src/sage/rings/complex_arb.pyx
+++ b/src/sage/rings/complex_arb.pyx
@@ -3974,8 +3974,8 @@ cdef class ComplexBall(RingElement):
EXAMPLES::
- sage: CBF(20).erfc()
- [5.39586561160790e-176 +/- ...e-191]
+ sage: CBF(20).erfc() # abs tol 1e-190
+ [5.39586561160790e-176 +/- 6.73e-191]
sage: CBF(100, 100).erfc()
[0.00065234366376858 +/- ...e-18] + [-0.00393572636292141 +/- ...e-18]*I
"""
@@ -4280,7 +4280,7 @@ cdef class ComplexBall(RingElement):
TESTS:
- sage: CBF(Shi(I))
+ sage: CBF(Shi(I)) # abs tol 1e-15
[0.946083070367183 +/- 9.22e-16]*I
"""
cdef ComplexBall result = self._new()
diff --git a/src/sage/rings/real_arb.pyx b/src/sage/rings/real_arb.pyx
index 4a81784..292bfea 100644
--- a/src/sage/rings/real_arb.pyx
+++ b/src/sage/rings/real_arb.pyx
@@ -3506,7 +3506,7 @@ cdef class RealBall(RingElement):
EXAMPLES::
- sage: RBF(1/2).erf()
+ sage: RBF(1/2).erf() # abs tol 1e-16
[0.520499877813047 +/- 6.10e-16]
"""
cdef RealBall res = self._new()
@@ -3556,12 +3556,12 @@ cdef class RealBall(RingElement):
EXAMPLES::
- sage: RBF(1).Si()
+ sage: RBF(1).Si() # abs tol 1e-15
[0.946083070367183 +/- 9.22e-16]
TESTS::
- sage: RBF(Si(1))
+ sage: RBF(Si(1)) # abs tol 1e-15
[0.946083070367183 +/- 9.22e-16]
"""
cdef RealBall res = self._new()
@@ -3578,12 +3578,12 @@ cdef class RealBall(RingElement):
EXAMPLES::
- sage: RBF(1).Ci() # abs tol 1e-16
+ sage: RBF(1).Ci() # abs tol 1e-15
[0.337403922900968 +/- 3.25e-16]
TESTS::
- sage: RBF(Ci(1)) # abs tol 1e-16
+ sage: RBF(Ci(1)) # abs tol 1e-15
[0.337403922900968 +/- 3.25e-16]
"""
cdef RealBall res = self._new()
--
cgit v1.0-1-gd88e
From 53532ddd4e2dc92469c1590ebf0c40f8f69bf579 Mon Sep 17 00:00:00 2001
From: Antonio Rojas <arojas@archlinux.org>
Date: Sun, 16 Jan 2022 14:16:53 +0100
Subject: Decrease abs tol
---
src/sage/rings/real_arb.pyx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/sage/rings/real_arb.pyx b/src/sage/rings/real_arb.pyx
index 292bfea..eb30f7f 100644
--- a/src/sage/rings/real_arb.pyx
+++ b/src/sage/rings/real_arb.pyx
@@ -3578,12 +3578,12 @@ cdef class RealBall(RingElement):
EXAMPLES::
- sage: RBF(1).Ci() # abs tol 1e-15
+ sage: RBF(1).Ci() # abs tol 5e-16
[0.337403922900968 +/- 3.25e-16]
TESTS::
- sage: RBF(Ci(1)) # abs tol 1e-15
+ sage: RBF(Ci(1)) # abs tol 5e-16
[0.337403922900968 +/- 3.25e-16]
"""
cdef RealBall res = self._new()
--
cgit v1.0-1-gd88e

View File

@ -1,40 +0,0 @@
From 33ea2adf01e9e2ce9f1e33779f0b1ac0d9d1989c Mon Sep 17 00:00:00 2001
From: Michael Orlitzky <michael@orlitzky.com>
Date: Mon, 24 Jan 2022 09:03:29 -0500
Subject: Trac #33226: update doctests for giac-1.7.0.45.
We have two failing doctests with giac-1.7.0.45: one is a trivial
tolerance issue, but the other is a symbolic integration result for
which giac is no longer willing to return a symbolic answer. We add
"abs tol" to the numeric test, and drop the symbolic one entirely.
---
src/sage/functions/min_max.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/sage/functions/min_max.py b/src/sage/functions/min_max.py
index fc18373..9b7d6d9 100644
--- a/src/sage/functions/min_max.py
+++ b/src/sage/functions/min_max.py
@@ -228,15 +228,15 @@ class MaxSymbolic(MinMax_base):
...
TypeError: cannot evaluate symbolic expression numerically
- ::
+ We can usually integrate these expressions, but can't
+ guarantee a symbolic answer in closed form::
sage: f = max_symbolic(sin(x), cos(x))
sage: r = integral(f, x, 0, 1)
...
- sage: r
- sqrt(2) - cos(1)
- sage: r.n()
+ sage: r.n() # abs tol 1e-8
0.873911256504955
+
"""
return max_symbolic(args)
--
cgit v1.0-1-gd88e

View File

@ -1,19 +0,0 @@
commit 9c8235e44ffb509efa8a3ca6cdb55154e2b5066d
Author: Antonio Rojas <arojas@archlinux.org>
Date: Sun Feb 13 19:53:14 2022 +0100
Fix deprecation warning with scipy 1.8
diff --git a/src/sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py b/src/sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py
index e9b60dae5ec..7932167b41d 100644
--- a/src/sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py
+++ b/src/sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py
@@ -356,7 +356,7 @@ Sage example in ./linsolve.tex, line 2230::
Sage example in ./linsolve.tex, line 2609::
- sage: from scipy.sparse.linalg.dsolve import *
+ sage: from scipy.sparse.linalg import factorized
sage: from scipy.sparse import lil_matrix
sage: from numpy import array
sage: n = 200

View File

@ -0,0 +1,53 @@
From 6330cee1a69229b2f5d8ac4a09a73d8152f5e14d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 28 Feb 2022 23:15:16 -0300
Subject: trac 33360: avoid factoring in is_prime()
In the added TEST, the ideal norm is product of two primes but factoring
this product takes about half an hour, so factoring the ideal is slow.
To fix the issue, we only factor the ideal if the norm is a prime power.
---
src/sage/rings/number_field/number_field_ideal.py | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
index f785f22..10d1f88 100644
--- a/src/sage/rings/number_field/number_field_ideal.py
+++ b/src/sage/rings/number_field/number_field_ideal.py
@@ -995,10 +995,32 @@ class NumberFieldIdeal(Ideal_generic):
False
sage: K.ideal(17).is_prime() # ramified
False
+
+ TESTS::
+
+ Check that we do not factor the norm of the ideal, this used
+ to take half an hour, see :trac:`33360`
+
+ sage: K.<a,b,c> = NumberField([x^2-2,x^2-3,x^2-5])
+ sage: t = (((-2611940*c + 1925290/7653)*b - 1537130/7653*c
+ ....: + 10130950)*a + (1343014/7653*c - 8349770)*b
+ ....: + 6477058*c - 2801449990/4002519)
+ sage: t.is_prime()
+ False
+
"""
try:
return self._pari_prime is not None
except AttributeError:
+ K = self.number_field().pari_nf()
+ I = self.pari_hnf()
+ # This would be better, but it is broken in pari 2.13.3.
+ # self._pari_prime = K.idealismaximal(I) or None
+ # Instead we factor I, but only if the norm is a prime power
+ n = K.idealnorm(I)
+ if n.denominator() > 1 or not n.isprimepower():
+ self._pari_prime = None
+ return False
F = self.factor() # factorization with caching
if len(F) != 1 or F[0][1] != 1:
self._pari_prime = None
--
cgit v1.0-1-gd88e

View File

@ -1,99 +0,0 @@
From 609dd9deaeaa6380ab2f0d50276d911233c00a04 Mon Sep 17 00:00:00 2001
From: Matthias Koeppe <mkoeppe@math.ucdavis.edu>
Date: Fri, 4 Mar 2022 16:07:09 -0800
Subject: sage.manifolds: Update doctests for SymPy 1.10
---
src/sage/manifolds/continuous_map.py | 3 +--
src/sage/manifolds/differentiable/diff_form.py | 4 ++--
src/sage/manifolds/differentiable/tensorfield.py | 8 ++++----
src/sage/manifolds/vector_bundle_fiber_element.py | 2 +-
4 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/src/sage/manifolds/continuous_map.py b/src/sage/manifolds/continuous_map.py
index a6356e7..f6f9b6d 100644
--- a/src/sage/manifolds/continuous_map.py
+++ b/src/sage/manifolds/continuous_map.py
@@ -1357,8 +1357,7 @@ class ContinuousMap(Morphism):
sage: Phi.coord_functions(c_uv, c_xyz)
Coordinate functions (u*v, u/v, u + v) on the Chart (M, (u, v))
sage: Phi.coord_functions(c_UV, c_xyz)
- Coordinate functions (-U**2/4 + V**2/4, -(U + V)/(U - V), V)
- on the Chart (M, (U, V))
+ Coordinate functions (-U**2/4 + V**2/4, (-U - V)/(U - V), V) on the Chart (M, (U, V))
sage: Phi.coord_functions(c_UV, c_XYZ)
Coordinate functions ((-U**3 + U**2*V + U*V**2 + 2*U*V + 6*U - V**3
- 2*V**2 + 6*V)/(2*(U - V)), (U**3/4 - U**2*V/4 - U*V**2/4 + U*V
diff --git a/src/sage/manifolds/differentiable/diff_form.py b/src/sage/manifolds/differentiable/diff_form.py
index 70dd8fb..0aa3469 100644
--- a/src/sage/manifolds/differentiable/diff_form.py
+++ b/src/sage/manifolds/differentiable/diff_form.py
@@ -266,7 +266,7 @@ class DiffForm(TensorField):
sage: s = a.wedge(b)
sage: s.display(eU)
- a∧b = -x*(2*x*y + 1) dx∧dy
+ a∧b = x*(-2*x*y - 1) dx∧dy
sage: s.display(eV)
a∧b = (u**3/8 + u**2*v/8 - u*v**2/8 + u/4 - v**3/8 + v/4) du∧dv
@@ -275,7 +275,7 @@ class DiffForm(TensorField):
sage: f = M.scalar_field({c_xy: (x+y)^2, c_uv: u^2}, name='f')
sage: s = f*a
sage: s.display(eU)
- f*a = -y*(x**2 + 2*x*y + y**2) dx + x*(x**2 + 2*x*y + y**2) dy
+ f*a = y*(-x**2 - 2*x*y - y**2) dx + x*(x**2 + 2*x*y + y**2) dy
sage: s.display(eV)
f*a = u**2*v/2 du - u**3/2 dv
diff --git a/src/sage/manifolds/differentiable/tensorfield.py b/src/sage/manifolds/differentiable/tensorfield.py
index 2775be9..6bc5c50 100644
--- a/src/sage/manifolds/differentiable/tensorfield.py
+++ b/src/sage/manifolds/differentiable/tensorfield.py
@@ -334,7 +334,7 @@ class TensorField(ModuleElementWithMutability):
sage: f.display() # long time
t(a,b): S^2 →
on U: (x, y) ↦ -2*x*y - 3*x - y**2
- on V: (u, v) ↦ -(3*u**3 + 3*u*v**2 + 2*u*v + v**2)/(u**4 + 2*u**2*v**2 + v**4)
+ on V: (u, v) ↦ (-3*u**3 - 3*u*v**2 - 2*u*v - v**2)/(u**4 + 2*u**2*v**2 + v**4)
The vectors can be defined only on subsets of `S^2`, the domain of the
result is then the common subset::
@@ -343,12 +343,12 @@ class TensorField(ModuleElementWithMutability):
sage: s.display() # long time
t(a,b): U →
(x, y) ↦ -2*x*y - 3*x - y**2
- on W: (u, v) ↦ -(3*u**3 + 3*u*v**2 + 2*u*v + v**2)/(u**4 + 2*u**2*v**2 + v**4)
+ on W: (u, v) ↦ (-3*u**3 - 3*u*v**2 - 2*u*v - v**2)/(u**4 + 2*u**2*v**2 + v**4)
sage: s = t(a.restrict(U), b.restrict(W)) # long time
sage: s.display() # long time
t(a,b): W →
(x, y) ↦ -2*x*y - 3*x - y**2
- (u, v) ↦ -(3*u**3 + 3*u*v**2 + 2*u*v + v**2)/(u**4 + 2*u**2*v**2 + v**4)
+ (u, v) ↦ (-3*u**3 - 3*u*v**2 - 2*u*v - v**2)/(u**4 + 2*u**2*v**2 + v**4)
The tensor itself can be defined only on some open subset of `S^2`,
yielding a result whose domain is this subset::
@@ -356,7 +356,7 @@ class TensorField(ModuleElementWithMutability):
sage: s = t.restrict(V)(a,b) # long time
sage: s.display() # long time
t(a,b): V →
- (u, v) ↦ -(3*u**3 + 3*u*v**2 + 2*u*v + v**2)/(u**4 + 2*u**2*v**2 + v**4)
+ (u, v) ↦ (-3*u**3 - 3*u*v**2 - 2*u*v - v**2)/(u**4 + 2*u**2*v**2 + v**4)
on W: (x, y) ↦ -2*x*y - 3*x - y**2
Tests regarding the multiplication by a scalar field::
diff --git a/src/sage/manifolds/vector_bundle_fiber_element.py b/src/sage/manifolds/vector_bundle_fiber_element.py
index 29ee81d..048275a 100644
--- a/src/sage/manifolds/vector_bundle_fiber_element.py
+++ b/src/sage/manifolds/vector_bundle_fiber_element.py
@@ -110,4 +110,4 @@ class VectorBundleFiberElement(FiniteRankFreeModuleElement):
desc += str(self._name) + " "
desc += "in the fiber of {} at {}".format(self._vbundle._name,
self._point)
- return desc
\ No newline at end of file
+ return desc
--
cgit v1.0-1-gd88e

View File

@ -1,29 +0,0 @@
From c49eff347454ac7f07e5918470b20e97b8f2357e Mon Sep 17 00:00:00 2001
From: Matthias Koeppe <mkoeppe@math.ucdavis.edu>
Date: Fri, 4 Mar 2022 15:14:43 -0800
Subject: src/sage/calculus/calculus.py: Update laplace doctest for sympy 1.10
---
src/sage/calculus/calculus.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
index 9c2f226..b335093 100644
--- a/src/sage/calculus/calculus.py
+++ b/src/sage/calculus/calculus.py
@@ -1639,9 +1639,9 @@ def laplace(ex, t, s, algorithm='maxima'):
sage: laplace(dirac_delta(t), t, s)
1
sage: F, a, cond = laplace(dirac_delta(t), t, s, algorithm='sympy')
- sage: a, cond
- (-oo, True)
- sage: F # random - sympy <1.9 includes undefined heaviside(0) in answer
+ sage: a, cond # random - sympy <1.10 gives (-oo, True)
+ (0, True)
+ sage: F # random - sympy <1.9 includes undefined heaviside(0) in answer
1
sage: laplace(dirac_delta(t), t, s, algorithm='giac')
1
--
cgit v1.0-1-gd88e

View File

@ -0,0 +1,427 @@
From 9feec282d039ca25bbefa50710f8217b775ce111 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 3 Mar 2022 14:47:00 -0300
Subject: gap: do not directly dlopen() the gap library
This needs the soname (as in sage.env.GAP_SO) which has issues for
system gap as explained in #33446.
Instead we dlopen() the extension module sage.libs.gap.util which,
having a link time dependency to libgap, will indirectly dlopen() it.
For the record: by the time we run dlopen() the libgap should be already
loaded. The purpose of doing it is to change mode to RTLD_GLOBAL so that
symbols in libgap are placed in the global symbol table. This is
required to compiled load gap packages.
An easy test that this is working ok is:
sage: libgap.LoadPackage("io")
true
This requires optional spkg `gap_packages` to be installed.
---
src/sage/libs/gap/util.pyx | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/sage/libs/gap/util.pyx b/src/sage/libs/gap/util.pyx
index 344ab88..aff604b 100644
--- a/src/sage/libs/gap/util.pyx
+++ b/src/sage/libs/gap/util.pyx
@@ -13,7 +13,7 @@ Utility functions for GAP
#*****************************************************************************
from libc.signal cimport signal, SIGCHLD, SIG_DFL
-from posix.dlfcn cimport dlopen, dlclose, RTLD_NOW, RTLD_GLOBAL
+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
from cpython.exc cimport PyErr_Fetch, PyErr_Restore
from cpython.object cimport Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE
@@ -232,12 +232,12 @@ cdef initialize():
# this isn't portable
cdef void* handle
- libgapname = str_to_bytes(sage.env.GAP_SO)
- handle = dlopen(libgapname, RTLD_NOW | RTLD_GLOBAL)
+ # reload the current module to force reload of libgap (see #33446)
+ lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
+ handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
if handle is NULL:
- raise RuntimeError(
- "Could not dlopen() libgap even though it should already "
- "be loaded!")
+ err = dlerror()
+ raise RuntimeError(f"Could not reload gap library with RTLD_GLOBAL ({err})")
dlclose(handle)
# Define argv variable, which we will pass in to
--
cgit v1.0-1-gd88e
From 704a7953b97ab726e2af610724726aa562bc8bf8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 3 Mar 2022 23:00:07 -0300
Subject: singular: do not directly dlopen() the singular library
Same as for gap in the previous commit. Instead of requiring the soname
(as in sage.env.LIBSINGULAR_PATH) we dlopen() the extension module
sage.libs.singular.singular which will indirectly dlopen() libSingular.
---
src/sage/libs/singular/singular.pyx | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
index d8ea7b0..4beb177 100644
--- a/src/sage/libs/singular/singular.pyx
+++ b/src/sage/libs/singular/singular.pyx
@@ -1705,14 +1705,7 @@ cdef object si2sa_intvec(intvec *v):
cdef extern from *: # hack to get at cython macro
int unlikely(int)
-cdef extern from "dlfcn.h":
- void *dlopen(char *, long)
- char *dlerror()
- void dlclose(void *handle)
-
-cdef extern from "dlfcn.h":
- cdef long RTLD_LAZY
- cdef long RTLD_GLOBAL
+from posix.dlfcn cimport dlopen, dlclose, dlerror, RTLD_LAZY, RTLD_GLOBAL
cdef int overflow_check(unsigned long e, ring *_ring) except -1:
"""
@@ -1762,8 +1755,6 @@ cdef init_libsingular():
cdef void *handle = NULL
- from sage.env import LIBSINGULAR_PATH
- lib = str_to_bytes(LIBSINGULAR_PATH, FS_ENCODING, "surrogateescape")
# This is a workaround for https://github.com/Singular/Singular/issues/1113
# and can be removed once that fix makes it into release of Singular that
@@ -1780,10 +1771,12 @@ cdef init_libsingular():
import platform
if not platform.system().startswith("CYGWIN"):
+ # reload the current module to force reload of libSingular (see #33446)
+ lib = str_to_bytes(__loader__.path, FS_ENCODING, "surrogateescape")
handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
if not handle:
err = dlerror()
- raise ImportError(f"cannot load Singular library from {LIBSINGULAR_PATH} ({err})")
+ raise RuntimeError(f"Could not reload Singular library with RTLD_GLOBAL ({err})")
# load SINGULAR
siInit(lib)
--
cgit v1.0-1-gd88e
From d7145c14ef58acfbe00d8f941d2802e96ad4ba15 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Fri, 4 Mar 2022 16:37:34 -0300
Subject: singular: remove LIBSINGULAR_PATH, no longer needed
---
build/pkgs/singular/spkg-configure.m4 | 63 +----------------------------------
pkgs/sage-conf/_sage_conf/_conf.py.in | 3 --
src/sage/env.py | 6 ----
3 files changed, 1 insertion(+), 71 deletions(-)
diff --git a/build/pkgs/singular/spkg-configure.m4 b/build/pkgs/singular/spkg-configure.m4
index af2eb85..6d3d3da 100644
--- a/build/pkgs/singular/spkg-configure.m4
+++ b/build/pkgs/singular/spkg-configure.m4
@@ -9,52 +9,7 @@ SAGE_SPKG_CONFIGURE([singular], [
AC_MSG_CHECKING([that Singular's help is working])
AS_IF([test x`printf "system(\"--browser\", \"builtin\"); \n help;" | Singular 2>&1 | grep "error\ occurred"` = x], [
AC_MSG_RESULT(yes)
- dnl We have Singular. Now determine the shared library path on
- dnl platforms on which sage.libs.singular needs to reload the library with RTLD_GLOBAL.
- AS_CASE([$host_os],
- [cygwin*], [dnl Nothing to do
- ],
- [dnl Use pkg-config to get singular's libdir while we're at it. As a
- dnl moral compromise for using pkg-config, this ultimately allows us
- dnl to pass an absolute path to dlopen(), which is the only approach
- dnl that POSIX guarantees will work.
- PKG_CHECK_VAR([SINGULAR_LIB_DIR], [Singular], [libdir])
- dnl The acl_shlibext variable is set in the top-level configure.ac.
- AC_LANG_PUSH(C)
- ORIG_LIBS="${LIBS}"
- LIBS="${LIBS} -ldl"
- AC_MSG_CHECKING([if we can dlopen($LIBSINGULAR_PATH)])
- LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libSingular.${acl_shlibext}"
-
- dnl if we can dlopen() it, substitute the name for sage_conf;
- dnl otherwise, fall back to using the SPKG.
- AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <dlfcn.h>]],
- [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
- if (h == 0) { return 1; } else { return dlclose(h); }]]
- )], [
- AC_MSG_RESULT(yes)
- ], [
- dnl try Debian-specific name
- LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libsingular-Singular.${acl_shlibext}"
- AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <dlfcn.h>]],
- [[void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
- if (h == 0) { return 1; } else { return dlclose(h); }]]
- )], [
- AC_MSG_RESULT(yes)
- ], [
- AC_MSG_RESULT(no)
- sage_spkg_install_singular=yes
- ], [AC_MSG_RESULT(yes)])
- ], [AC_MSG_RESULT(yes)])
-
- AC_LANG_POP()
- LIBS="${ORIG_LIBS}"
- ]
- )], [
+ ], [
AC_MSG_RESULT(no)
sage_spkg_install_singular=yes
]
@@ -64,20 +19,4 @@ SAGE_SPKG_CONFIGURE([singular], [
])
])
])
-],[],[],[
- dnl Post-check phase
- dnl We make the sage_conf substitutions here, because the "default"
- dnl substitution needs to be made even if we skipped the system-Singular
- dnl checks themselves.
- AS_IF([test "x${sage_spkg_install_singular}" = "xyes"], [
- AS_CASE([$host_os],
- [cygwin*], [dnl Nothing to do
- ],
- [dnl Set shared library path, needed for reloading the library with RTLD_GLOBAL
- LIBSINGULAR_PATH="\$SAGE_LOCAL/lib/libSingular.${acl_shlibext}"
- ]
- )
- ])
-
- AC_SUBST(LIBSINGULAR_PATH, "${LIBSINGULAR_PATH}")
])
diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in
index 6cd28f5..d66bdb3 100644
--- a/pkgs/sage-conf/_sage_conf/_conf.py.in
+++ b/pkgs/sage-conf/_sage_conf/_conf.py.in
@@ -55,9 +55,6 @@ THREEJS_DIR = SAGE_LOCAL + "/share/threejs-sage"
OPENMP_CFLAGS = "@OPENMP_CFLAGS@"
OPENMP_CXXFLAGS = "@OPENMP_CXXFLAGS@"
-# The full absolute path to the main Singular library.
-LIBSINGULAR_PATH = "@LIBSINGULAR_PATH@".replace('$SAGE_LOCAL', SAGE_LOCAL)
-
# Installation location of wheels. This is determined at configuration time
# and does not depend on the installation location of sage-conf.
SAGE_SPKG_WHEELS = "@SAGE_VENV@".replace('${SAGE_LOCAL}', SAGE_LOCAL) + "/var/lib/sage/wheels"
diff --git a/src/sage/env.py b/src/sage/env.py
index 911f34b..93f79de 100644
--- a/src/sage/env.py
+++ b/src/sage/env.py
@@ -229,12 +229,6 @@ NTL_LIBDIR = var("NTL_LIBDIR")
LIE_INFO_DIR = var("LIE_INFO_DIR", join(SAGE_LOCAL, "lib", "LiE"))
SINGULAR_BIN = var("SINGULAR_BIN") or "Singular"
-# The path to libSingular, to be passed to dlopen(). This will
-# typically be set to an absolute path in sage_conf, but the relative
-# fallback path here works on systems where dlopen() searches the
-# system's library locations.
-LIBSINGULAR_PATH = var("LIBSINGULAR_PATH", "libSingular.so")
-
# OpenMP
OPENMP_CFLAGS = var("OPENMP_CFLAGS", "")
OPENMP_CXXFLAGS = var("OPENMP_CXXFLAGS", "")
--
cgit v1.0-1-gd88e
From 92e5a211c792f86f5325d601abfddf667da6a776 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Fri, 4 Mar 2022 15:49:26 -0300
Subject: Revert "src/sage/interfaces/gap_workspace.py: Use hash of GAP_SO to
disambiguate the workspace file, not SAGE_LOCAL"
This reverts commit a801e6d85bd420b60ea75b1671856eb43ac6b18b.
See #33446.
---
src/sage/interfaces/gap_workspace.py | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/sage/interfaces/gap_workspace.py b/src/sage/interfaces/gap_workspace.py
index 33a87dd..953dc85 100644
--- a/src/sage/interfaces/gap_workspace.py
+++ b/src/sage/interfaces/gap_workspace.py
@@ -16,7 +16,7 @@ Support for (lib)GAP workspace files
import os
import time
import hashlib
-from sage.env import DOT_SAGE, GAP_SO
+from sage.env import DOT_SAGE, SAGE_LOCAL
def gap_workspace_file(system="gap", name="workspace", dir=None):
@@ -59,10 +59,7 @@ def gap_workspace_file(system="gap", name="workspace", dir=None):
if dir is None:
dir = os.path.join(DOT_SAGE, 'gap')
- if GAP_SO:
- h = hashlib.sha1(GAP_SO.encode('utf-8')).hexdigest()
- else:
- h = 'unknown'
+ h = hashlib.sha1(SAGE_LOCAL.encode('utf-8')).hexdigest()
return os.path.join(dir, '%s-%s-%s' % (system, name, h))
--
cgit v1.0-1-gd88e
From b45e555b5711ae10d369b568333940c2aa771053 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Fri, 4 Mar 2022 16:38:49 -0300
Subject: gap: remove GAP_SO, no longer needed
---
src/sage/env.py | 75 ---------------------------------------------------------
1 file changed, 75 deletions(-)
diff --git a/src/sage/env.py b/src/sage/env.py
index 93f79de..c16a094 100644
--- a/src/sage/env.py
+++ b/src/sage/env.py
@@ -249,81 +249,6 @@ if SAGE_GAP_MEMORY is not None:
SAGE_GAP_COMMAND = var('SAGE_GAP_COMMAND', _gap_cmd)
-def _get_shared_lib_path(*libnames: str) -> Optional[str]:
- """
- Return the full path to a shared library file installed in
- ``$SAGE_LOCAL/lib`` or the directories associated with the
- Python sysconfig.
-
- This can also be passed more than one library name (e.g. for cases where
- some library may have multiple names depending on the platform) in which
- case the first one found is returned.
-
- This supports most *NIX variants (in which ``lib<libname>.so`` is found
- under ``$SAGE_LOCAL/lib``), macOS (same, but with the ``.dylib``
- extension), and Cygwin (under ``$SAGE_LOCAL/bin/cyg<libname>.dll``,
- or ``$SAGE_LOCAL/bin/cyg<libname>-*.dll`` for versioned DLLs).
-
- For distributions like Debian that use a multiarch layout, we also try the
- multiarch lib paths (i.e. ``/usr/lib/<arch>/``).
-
- This returns ``None`` if no matching library file could be found.
-
- EXAMPLES::
-
- sage: from sage.env import _get_shared_lib_path
- sage: "gap" in _get_shared_lib_path("gap")
- True
- sage: _get_shared_lib_path("an_absurd_lib") is None
- True
-
- """
-
- for libname in libnames:
- search_directories: List[Path] = []
- patterns: List[str] = []
- if sys.platform == 'cygwin':
- # Later down we take the first matching DLL found, so search
- # SAGE_LOCAL first so that it takes precedence
- if SAGE_LOCAL:
- search_directories.append(Path(SAGE_LOCAL) / 'bin')
- search_directories.append(Path(sysconfig.get_config_var('BINDIR')))
- # Note: The following is not very robust, since if there are multible
- # versions for the same library this just selects one more or less
- # at arbitrary. However, practically speaking, on Cygwin, there
- # will only ever be one version
- patterns = [f'cyg{libname}.dll', f'cyg{libname}-*.dll']
- else:
- if sys.platform == 'darwin':
- ext = 'dylib'
- else:
- ext = 'so'
-
- if SAGE_LOCAL:
- search_directories.append(Path(SAGE_LOCAL) / 'lib')
- libdir = sysconfig.get_config_var('LIBDIR')
- if libdir is not None:
- libdir = Path(libdir)
- search_directories.append(libdir)
-
- multiarchlib = sysconfig.get_config_var('MULTIARCH')
- if multiarchlib is not None:
- search_directories.append(libdir / multiarchlib),
-
- patterns = [f'lib{libname}.{ext}']
-
- for directory in search_directories:
- for pattern in patterns:
- path = next(directory.glob(pattern), None)
- if path is not None:
- return str(path.resolve())
-
- # Just return None if no files were found
- return None
-
-# locate libgap shared object
-GAP_SO = var("GAP_SO", _get_shared_lib_path("gap", ""))
-
# post process
if DOT_SAGE is not None and ' ' in DOT_SAGE:
if UNAME[:6] == 'CYGWIN':
--
cgit v1.0-1-gd88e
From 31e3fc4ec8b8687bccd22d2e3161c86cf5553e06 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 6 Mar 2022 12:10:37 -0300
Subject: gap_workspace_file: include hostname and gap version
---
src/sage/interfaces/gap_workspace.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/sage/interfaces/gap_workspace.py b/src/sage/interfaces/gap_workspace.py
index 953dc85..8c03b6b 100644
--- a/src/sage/interfaces/gap_workspace.py
+++ b/src/sage/interfaces/gap_workspace.py
@@ -16,7 +16,8 @@ Support for (lib)GAP workspace files
import os
import time
import hashlib
-from sage.env import DOT_SAGE, SAGE_LOCAL
+import subprocess
+from sage.env import DOT_SAGE, SAGE_LOCAL, HOSTNAME, GAP_ROOT_DIR
def gap_workspace_file(system="gap", name="workspace", dir=None):
@@ -59,8 +60,12 @@ def gap_workspace_file(system="gap", name="workspace", dir=None):
if dir is None:
dir = os.path.join(DOT_SAGE, 'gap')
- h = hashlib.sha1(SAGE_LOCAL.encode('utf-8')).hexdigest()
- return os.path.join(dir, '%s-%s-%s' % (system, name, h))
+ data = SAGE_LOCAL
+ sysinfo = os.path.join(GAP_ROOT_DIR, "sysinfo.gap")
+ if os.path.exists(sysinfo):
+ data += subprocess.getoutput(f'. "{sysinfo}" && echo ":$GAP_VERSION:$GAParch"')
+ h = hashlib.sha1(data.encode('utf-8')).hexdigest()
+ return os.path.join(dir, '%s-%s-%s-%s' % (system, name, HOSTNAME, h))
def prepare_workspace_dir(dir=None):
--
cgit v1.0-1-gd88e

View File

@ -1,26 +0,0 @@
From a04a0a0b14f67f4804e7113c3db41bbcf8a58296 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 28 Mar 2022 20:39:59 -0300
Subject: Trac #33585: fix doctest when dochtml is missing...
...but sphinx is available in PYTHONPATH.
---
src/sage/misc/sagedoc.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sage/misc/sagedoc.py b/src/sage/misc/sagedoc.py
index 4b3853f..08c4225 100644
--- a/src/sage/misc/sagedoc.py
+++ b/src/sage/misc/sagedoc.py
@@ -1401,7 +1401,7 @@ class _sage_doc:
"...**File:**...**Type:**...**Definition:** identity_matrix..."
sage: identity_matrix.__doc__ in browse_sage_doc(identity_matrix, 'rst')
True
- sage: browse_sage_doc(identity_matrix, 'html', False) # optional - sphinx
+ sage: browse_sage_doc(identity_matrix, 'html', False) # optional - sphinx sagemath_doc_html
'...div...File:...Type:...Definition:...identity_matrix...'
In the 'text' version, double colons have been replaced with
--
cgit v1.0-1-gd88e

View File

@ -0,0 +1,45 @@
--- a/src/sage/cpython/cython_metaclass.h
+++ b/src/sage/cpython/cython_metaclass.h
@@ -66,7 +66,7 @@
}
/* Now, set t.__class__ to metaclass */
- Py_TYPE(t) = metaclass;
+ Py_SET_TYPE(t, metaclass);
PyType_Modified(t);
}
else
--- a/src/sage/symbolic/ginac/numeric.cpp
+++ b/src/sage/symbolic/ginac/numeric.cpp
@@ -52,7 +52,6 @@
#define register
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include <longintrepr.h>
#include "flint/fmpz.h"
#include "flint/fmpz_factor.h"
--- a/src/sage/libs/gmp/pylong.pyx
+++ b/src/sage/libs/gmp/pylong.pyx
@@ -32,7 +32,7 @@
from .mpz cimport *
cdef extern from *:
- Py_ssize_t* Py_SIZE_PTR "&Py_SIZE"(object)
+ void Py_SET_SIZE(object, Py_ssize_t)
int hash_bits """
#ifdef _PyHASH_BITS
_PyHASH_BITS /* Python 3 */
@@ -57,10 +57,8 @@
mpz_export(L.ob_digit, NULL,
-1, sizeof(digit), 0, PyLong_nails, z)
if mpz_sgn(z) < 0:
- # Set correct size (use a pointer to hack around Cython's
- # non-support for lvalues).
- sizeptr = Py_SIZE_PTR(L)
- sizeptr[0] = -pylong_size
+ # Set correct size
+ Py_SET_SIZE(L, -pylong_size)
return L

View File

@ -0,0 +1,42 @@
commit 5db5d4e56243c609f44afc1f21c112b026f9e1fe
Author: Oscar Benjamin <oscar.j.benjamin@gmail.com>
Date: Mon Jul 11 21:24:01 2022 +0100
Update doctests for SymPy 1.11
Doctests related to SymPy's rsolve function are updated in:
src/sage/calculus/test_sympy.py
src/sage/tests/books/computational-mathematics-with-sagemath/recequadiff_doctest.py
The form of the output from SymPy has changed since
https://github.com/sympy/sympy/pull/23567
diff --git a/src/sage/calculus/test_sympy.py b/src/sage/calculus/test_sympy.py
index 7cf7f3f6bfd..927e6ee4fb6 100644
--- a/src/sage/calculus/test_sympy.py
+++ b/src/sage/calculus/test_sympy.py
@@ -193,7 +193,7 @@ This was fixed in Sympy, see :trac:`14437`::
sage: u = Function('u')
sage: n = Symbol('n', integer=True)
sage: f = u(n+2) - u(n+1) + u(n)/4
- sage: 2**n * rsolve(f,u(n))
- C1*n + C0
+ sage: expand(2**n * rsolve(f,u(n)))
+ 2*C1*n + C0
"""
diff --git a/src/sage/tests/books/computational-mathematics-with-sagemath/recequadiff_doctest.py b/src/sage/tests/books/computational-mathematics-with-sagemath/recequadiff_doctest.py
index 1062f4f7e8c..f53f813d793 100644
--- a/src/sage/tests/books/computational-mathematics-with-sagemath/recequadiff_doctest.py
+++ b/src/sage/tests/books/computational-mathematics-with-sagemath/recequadiff_doctest.py
@@ -382,7 +382,7 @@ Sage example in ./recequadiff.tex, line 1798::
sage: from sympy import rsolve_hyper
sage: from sympy.abc import n
sage: rsolve_hyper([-2,1],2**(n+2),n)
- 2**n*C0 + 2**(n + 2)*(C0 + n/2)
+ 2**n*C0 + 2**(n + 1)*n
"""

View File

@ -0,0 +1,526 @@
From aeff992d53a65a705dca5cd5216bcb97c218dce7 Mon Sep 17 00:00:00 2001
From: Antonio Rojas <arojas@archlinux.org>
Date: Mon, 29 Aug 2022 23:14:03 +0200
Subject: Adapt to API changes in OpenOutputStream and CloseOutput
---
src/sage/libs/gap/element.pyx | 5 +++--
src/sage/libs/gap/gap_includes.pxd | 6 ++++--
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx
index be43c4c..e268116 100644
--- a/src/sage/libs/gap/element.pyx
+++ b/src/sage/libs/gap/element.pyx
@@ -130,6 +130,7 @@ cdef char *capture_stdout(Obj func, Obj obj):
"""
cdef Obj s, stream, output_text_string
cdef UInt res
+ cdef TypOutputFile output
# The only way to get a string representation of an object that is truly
# consistent with how it would be represented at the GAP REPL is to call
# ViewObj on it. Unfortunately, ViewObj *prints* to the output stream,
@@ -145,12 +146,12 @@ cdef char *capture_stdout(Obj func, Obj obj):
output_text_string = GAP_ValueGlobalVariable("OutputTextString")
stream = CALL_2ARGS(output_text_string, s, GAP_True)
- if not OpenOutputStream(stream):
+ if not OpenOutputStream(&output, stream):
raise GAPError("failed to open output capture stream for "
"representing GAP object")
CALL_1ARGS(func, obj)
- CloseOutput()
+ CloseOutput(&output)
return CSTR_STRING(s)
finally:
GAP_Leave()
diff --git a/src/sage/libs/gap/gap_includes.pxd b/src/sage/libs/gap/gap_includes.pxd
index 5a9ab48..34035fe 100644
--- a/src/sage/libs/gap/gap_includes.pxd
+++ b/src/sage/libs/gap/gap_includes.pxd
@@ -76,8 +76,10 @@ cdef extern from "gap/intobj.h" nogil:
cdef extern from "gap/io.h" nogil:
- UInt OpenOutputStream(Obj stream)
- UInt CloseOutput()
+ ctypedef struct TypOutputFile:
+ pass
+ UInt OpenOutputStream(TypOutputFile* output, Obj stream)
+ UInt CloseOutput(TypOutputFile* output)
cdef extern from "gap/libgap-api.h" nogil:
--
cgit v1.0-1-gd88e
From c3367b4290981e5e93b7a30c48b02f1ae3770dc8 Mon Sep 17 00:00:00 2001
From: Antonio Rojas <arojas@archlinux.org>
Date: Mon, 29 Aug 2022 23:14:53 +0200
Subject: Disable colored prompt as it breaks the pexpect interface
---
src/sage/interfaces/gap.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/sage/interfaces/gap.py b/src/sage/interfaces/gap.py
index c34fe53..569caa2 100644
--- a/src/sage/interfaces/gap.py
+++ b/src/sage/interfaces/gap.py
@@ -1512,6 +1512,8 @@ def gap_reset_workspace(max_workspace_size=None, verbose=False):
"""
# Create new workspace with filename WORKSPACE
g = Gap(use_workspace_cache=False, max_workspace_size=None)
+ g.eval('ColorPrompt(false)')
+ g.eval('SetUserPreference("UseColorPrompt", false)')
g.eval('SetUserPreference("HistoryMaxLines", 30)')
from sage.tests.gap_packages import all_installed_packages
for pkg in all_installed_packages(gap=g):
--
cgit v1.0-1-gd88e
From 3b63e998e4d6118fc86b13b940c8f3d3b8307a50 Mon Sep 17 00:00:00 2001
From: Antonio Rojas <arojas@archlinux.org>
Date: Mon, 29 Aug 2022 23:16:03 +0200
Subject: Port NaturalHomomorphism uses
---
src/sage/groups/abelian_gps/abelian_group_gap.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/sage/groups/abelian_gps/abelian_group_gap.py b/src/sage/groups/abelian_gps/abelian_group_gap.py
index a4b0471..86090b4 100644
--- a/src/sage/groups/abelian_gps/abelian_group_gap.py
+++ b/src/sage/groups/abelian_gps/abelian_group_gap.py
@@ -338,7 +338,7 @@ class AbelianGroup_gap(UniqueRepresentation, GroupMixinLibGAP, ParentLibGAP, Abe
if isinstance(x, AbelianGroupElement_gap):
try:
if x in self._cover:
- x = self.gap().NaturalHomomorphism().Image(x.gap())
+ x = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations).Image(x.gap())
else:
x = x.gap()
except AttributeError:
@@ -1043,7 +1043,7 @@ class AbelianGroupQuotient_gap(AbelianGroup_gap):
From: Abelian group with gap, generator orders (4,)
To: Quotient abelian group with generator orders (2,)
"""
- phi = self.gap().NaturalHomomorphism()
+ phi = self._cover.gap().NaturalHomomorphismByNormalSubgroup(self._relations)
Hom = self._cover.Hom(self)
return Hom(phi)
--
cgit v1.0-1-gd88e
From bc40764be044653e06f2da3497e1e05da08251f7 Mon Sep 17 00:00:00 2001
From: Antonio Rojas <arojas@archlinux.org>
Date: Mon, 29 Aug 2022 23:17:36 +0200
Subject: Fix tests with GAP 4.12
---
src/doc/en/thematic_tutorials/lie/weyl_groups.rst | 12 ++++++------
src/sage/coding/codecan/autgroup_can_label.pyx | 2 +-
src/sage/coding/linear_code.py | 22 +++++++++++-----------
.../root_system/hecke_algebra_representation.py | 2 +-
src/sage/combinat/symmetric_group_algebra.py | 2 +-
src/sage/groups/finitely_presented.py | 6 +++---
src/sage/groups/fqf_orthogonal.py | 2 +-
src/sage/groups/libgap_wrapper.pyx | 6 +++---
.../perm_gps/partn_ref2/refinement_generic.pyx | 2 +-
src/sage/groups/perm_gps/permgroup.py | 8 ++++----
src/sage/libs/gap/libgap.pyx | 2 +-
src/sage/libs/gap/util.pyx | 8 +-------
src/sage/tests/gap_packages.py | 2 +-
13 files changed, 35 insertions(+), 41 deletions(-)
diff --git a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
index c917338..182e74a 100644
--- a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
+++ b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst
@@ -139,12 +139,12 @@ string, which you can print::
X.1 1 1 1 1 1 1 1 1 1 1 1 1 1
X.2 1 -1 1 1 -1 1 1 -1 -1 -1 1 1 1
X.3 2 . 2 -1 . 2 2 . . . -1 2 2
- X.4 3 -1 -1 . 1 -1 3 -1 1 -1 . -1 3
- X.5 3 -1 -1 . 1 3 -1 -1 -1 1 . -1 3
- X.6 3 1 -1 . -1 -1 3 1 -1 1 . -1 3
- X.7 3 1 -1 . -1 3 -1 1 1 -1 . -1 3
- X.8 3 -1 3 . -1 -1 -1 -1 1 1 . -1 3
- X.9 3 1 3 . 1 -1 -1 1 -1 -1 . -1 3
+ X.4 3 -1 -1 . 1 3 -1 -1 -1 1 . -1 3
+ X.5 3 1 -1 . -1 3 -1 1 1 -1 . -1 3
+ X.6 3 -1 3 . -1 -1 -1 -1 1 1 . -1 3
+ X.7 3 -1 -1 . 1 -1 3 -1 1 -1 . -1 3
+ X.8 3 1 3 . 1 -1 -1 1 -1 -1 . -1 3
+ X.9 3 1 -1 . -1 -1 3 1 -1 1 . -1 3
X.10 4 -2 . -1 . . . 2 . . 1 . -4
X.11 4 2 . -1 . . . -2 . . 1 . -4
X.12 6 . -2 . . -2 -2 . . . . 2 6
diff --git a/src/sage/coding/codecan/autgroup_can_label.pyx b/src/sage/coding/codecan/autgroup_can_label.pyx
index de5db98..c83b926 100644
--- a/src/sage/coding/codecan/autgroup_can_label.pyx
+++ b/src/sage/coding/codecan/autgroup_can_label.pyx
@@ -76,7 +76,7 @@ columns do share the same coloring::
((1,),
(2,),
(3, 5, 4),
- (6, 19, 16, 9, 21, 10, 8, 15, 14, 11, 20, 13, 12, 7, 17, 18))
+ (6, 19, 16, 21, 9, 10, 15, 8, 20, 11, 14, 13, 7, 12, 18, 17))
We can also restrict the group action to linear isometries::
diff --git a/src/sage/coding/linear_code.py b/src/sage/coding/linear_code.py
index e8e32f8..9d45160 100644
--- a/src/sage/coding/linear_code.py
+++ b/src/sage/coding/linear_code.py
@@ -466,27 +466,27 @@ class AbstractLinearCode(AbstractLinearCodeNoMetric):
0
sage: C = codes.HammingCode(GF(4, 'z'), 3)
sage: C.automorphism_group_gens()
- ([((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
+ ([((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
+ Defn: z |--> z + 1),
+ ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
Defn: z |--> z + 1),
- ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
- Defn: z |--> z),
((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
Defn: z |--> z)],
362880)
sage: C.automorphism_group_gens(equivalence="linear")
- ([((z + 1, 1, z + 1, z + 1, z + 1, z, 1, z, 1, 1, 1, 1, z + 1, z + 1, z + 1, z, z, 1, z, z, z); (1,15,2,8,16,18,3)(4,9,12,13,20,10,11)(5,21,14,6,7,19,17), Ring endomorphism of Finite Field in z of size 2^2
+ ([((z, 1, z + 1, z + 1, 1, z + 1, z, 1, z + 1, z + 1, 1, z, 1, z + 1, z, 1, z, 1, z + 1, 1, 1); (1,12,11,10,6,8,9,20,13,21,5,14,3,16,17,19,7,4,2,15,18), Ring endomorphism of Finite Field in z of size 2^2
Defn: z |--> z),
- ((z + 1, z + 1, z + 1, z + 1, z + 1, 1, z, 1, z, z, z, 1, z, 1, 1, 1, z + 1, z + 1, z + 1, 1, z); (1,15,21,8,9)(2,18,5,3,11,16,7,10,19,13,12,4,17,6,20), Ring endomorphism of Finite Field in z of size 2^2
+ ((z + 1, z + 1, z + 1, z, 1, 1, z, z, 1, z + 1, z, 1, 1, z, 1, z + 1, z, z + 1, z + 1, 1, z); (1,3,18,2,17,6,19)(4,15,13,20,7,14,16)(5,11,8,21,12,9,10), Ring endomorphism of Finite Field in z of size 2^2
Defn: z |--> z),
((z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1); (), Ring endomorphism of Finite Field in z of size 2^2
Defn: z |--> z)],
181440)
sage: C.automorphism_group_gens(equivalence="permutational")
- ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
+ ([((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
Defn: z |--> z),
- ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,11)(3,10)(4,9)(5,7)(12,21)(14,20)(15,19)(16,17), Ring endomorphism of Finite Field in z of size 2^2
+ ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,18)(3,19)(4,10)(5,16)(8,13)(9,14)(11,21)(15,20), Ring endomorphism of Finite Field in z of size 2^2
Defn: z |--> z),
- ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,17)(2,8)(3,14)(4,10)(7,12)(9,19)(13,18)(15,20), Ring endomorphism of Finite Field in z of size 2^2
+ ((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (1,19)(3,17)(4,21)(5,20)(7,14)(9,12)(10,16)(11,15), Ring endomorphism of Finite Field in z of size 2^2
Defn: z |--> z),
((1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); (2,13)(3,14)(4,20)(5,11)(8,18)(9,19)(10,15)(16,21), Ring endomorphism of Finite Field in z of size 2^2
Defn: z |--> z)],
@@ -692,10 +692,10 @@ class AbstractLinearCode(AbstractLinearCodeNoMetric):
sage: C_iso == aut_group_can_label.get_canonical_form()
True
sage: aut_group_can_label.get_autom_gens()
- [((1, 1, 1, 1, 1, z + 1, z, z + 1, z, z, z, 1, 1, z + 1, z + 1, z, z + 1, z, z + 1, z + 1, z + 1); (1,14,6,7,4,10,11,19)(2,8,16,13,3,17,21,15)(9,12,18,20), Ring endomorphism of Finite Field in z of size 2^2
+ [((1, 1, 1, z, z + 1, 1, 1, 1, 1, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z); (1,13,14,20)(2,21,8,18,7,16,19,15)(3,10,5,12,17,9,6,4), Ring endomorphism of Finite Field in z of size 2^2
+ Defn: z |--> z + 1),
+ ((z, 1, z, z, z, z + 1, z, z, z, z, z, z, z + 1, z, z, z, z, z + 1, z, z, z); (1,11,5,12,3,19)(2,8)(6,18,13)(7,17,15)(9,10,14,16,20,21), Ring endomorphism of Finite Field in z of size 2^2
Defn: z |--> z + 1),
- ((z + 1, 1, 1, z, z + 1, z, z, z + 1, z + 1, z + 1, 1, z + 1, z, z, 1, z + 1, 1, z, z + 1, z + 1, z); (1,18,6,19,2,9,17,10,13,14,21,11,4,5,12)(3,20,7,16,8), Ring endomorphism of Finite Field in z of size 2^2
- Defn: z |--> z),
((z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z, z); (), Ring endomorphism of Finite Field in z of size 2^2
Defn: z |--> z)]
"""
diff --git a/src/sage/combinat/root_system/hecke_algebra_representation.py b/src/sage/combinat/root_system/hecke_algebra_representation.py
index bde2823..bffcc85 100644
--- a/src/sage/combinat/root_system/hecke_algebra_representation.py
+++ b/src/sage/combinat/root_system/hecke_algebra_representation.py
@@ -355,7 +355,7 @@ class HeckeAlgebraRepresentation(WithEqualityById, SageObject):
sage: q1, q2 = K.gens()
sage: KW = W.algebra(K)
sage: x = KW.an_element(); x
- 123 + 3*32 + 2*3 + e
+ 123 + 3*2312 + 2*31 + e
sage: T = KW.demazure_lusztig_operators(q1,q2)
sage: T12 = T.Tw( (1,2) )
diff --git a/src/sage/combinat/symmetric_group_algebra.py b/src/sage/combinat/symmetric_group_algebra.py
index c3d6755..da953d2 100644
--- a/src/sage/combinat/symmetric_group_algebra.py
+++ b/src/sage/combinat/symmetric_group_algebra.py
@@ -101,7 +101,7 @@ def SymmetricGroupAlgebra(R, W, category=None):
sage: SGA.group()
Weyl Group of type ['A', 3] (as a matrix group acting on the ambient space)
sage: SGA.an_element()
- s1*s2*s3 + 3*s3*s2 + 2*s3 + 1
+ s1*s2*s3 + 3*s2*s3*s1*s2 + 2*s3*s1 + 1
The preferred way to construct the symmetric group algebra is to
go through the usual ``algebra`` method::
diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
index 2a61bbf..d26891a 100644
--- a/src/sage/groups/finitely_presented.py
+++ b/src/sage/groups/finitely_presented.py
@@ -596,9 +596,9 @@ class RewritingSystem():
sage: k = G.rewriting_system()
sage: k.gap()
Knuth Bendix Rewriting System for Monoid( [ a, A, b, B ] ) with rules
- [ [ a^2, <identity ...> ], [ a*A, <identity ...> ],
- [ A*a, <identity ...> ], [ b^2, <identity ...> ],
- [ b*B, <identity ...> ], [ B*b, <identity ...> ] ]
+ [ [ a*A, <identity ...> ], [ A*a, <identity ...> ],
+ [ b*B, <identity ...> ], [ B*b, <identity ...> ],
+ [ a^2, <identity ...> ], [ b^2, <identity ...> ] ]
"""
return self._gap
diff --git a/src/sage/groups/fqf_orthogonal.py b/src/sage/groups/fqf_orthogonal.py
index 75de408..dd7d84d 100644
--- a/src/sage/groups/fqf_orthogonal.py
+++ b/src/sage/groups/fqf_orthogonal.py
@@ -143,7 +143,7 @@ class FqfOrthogonalGroup(AbelianGroupAutomorphismGroup_subgroup):
[2/3 0 0]
[ 0 2/3 0]
[ 0 0 4/3]
- generated by 2 elements
+ generated by 3 elements
sage: q = matrix.diagonal(QQ, [3/2, 1/4, 1/4])
sage: T = TorsionQuadraticForm(q)
sage: T.orthogonal_group().order()
diff --git a/src/sage/groups/libgap_wrapper.pyx b/src/sage/groups/libgap_wrapper.pyx
index a76afc2..9340c0d 100644
--- a/src/sage/groups/libgap_wrapper.pyx
+++ b/src/sage/groups/libgap_wrapper.pyx
@@ -25,7 +25,7 @@ Note how we call the constructor of both superclasses to initialize
its output via LibGAP::
sage: FooGroup()
- <pc group of size 3 with 1 generators>
+ <pc group of size 3 with 1 generator>
sage: type(FooGroup().gap())
<class 'sage.libs.gap.element.GapElement'>
@@ -106,7 +106,7 @@ class ParentLibGAP(SageObject):
....: ParentLibGAP.__init__(self, lg)
....: Group.__init__(self)
sage: FooGroup()
- <pc group of size 3 with 1 generators>
+ <pc group of size 3 with 1 generator>
"""
def __init__(self, libgap_parent, ambient=None):
@@ -461,7 +461,7 @@ cdef class ElementLibGAP(MultiplicativeGroupElement):
....: ParentLibGAP.__init__(self, lg)
....: Group.__init__(self)
sage: FooGroup()
- <pc group of size 3 with 1 generators>
+ <pc group of size 3 with 1 generator>
sage: FooGroup().gens()
(f1,)
"""
diff --git a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
index 2fcb036..ca73c6b 100644
--- a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
+++ b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
@@ -427,7 +427,7 @@ cdef class LabelledBranching:
sage: from sage.groups.perm_gps.partn_ref2.refinement_generic import LabelledBranching
sage: L = LabelledBranching(3)
sage: L.small_generating_set()
- []
+ [()]
sage: L.add_gen(libgap.eval('(1,2,3)'))
sage: L.small_generating_set()
[(1,2,3)]
diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py
index 4908934..34ba0cc 100644
--- a/src/sage/groups/perm_gps/permgroup.py
+++ b/src/sage/groups/perm_gps/permgroup.py
@@ -913,7 +913,7 @@ class PermutationGroup_generic(FiniteGroup):
sage: f = PG._coerce_map_from_(MG)
sage: mg = MG.an_element()
sage: p = f(mg); p
- (2,33,32,23,31,55)(3,49,38,44,40,28)(4,17,59,62,58,46)(5,21,47,20,43,8)(6,53,50)(7,37,12,57,14,29)(9,41,56,34,64,10)(11,25,19)(13,61,26,51,22,15)(16,45,36)(18,27,35,48,52,54)(24,63,42)(30,39,60)
+ (1,2,6,19,35,33)(3,9,26,14,31,23)(4,13,5)(7,22,17)(8,24,12)(10,16,32,27,20,28)(11,30,18)(15,25,36,34,29,21)
sage: PG(p._gap_()) == p
True
@@ -959,12 +959,12 @@ class PermutationGroup_generic(FiniteGroup):
sage: P = G.as_permutation_group(algorithm='smaller', seed=5)
sage: P1 = G.as_permutation_group()
sage: P == P1
- False
+ True
sage: g1, g2, g3 = G.gens()
sage: P(g1*g2)
- (1,3,7,12)(2,4,8,10)(5,11)(6,9)
+ (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
sage: P1(g1*g2)
- (2,29,25,68)(3,57,13,54)(4,11,72,37)(5,39,60,23)(6,64,75,63)(7,21,50,73)(8,46,38,32)(9,74,35,18)(10,44,49,48)(12,16,34,71)(14,79,27,40)(15,26)(17,62,59,76)(19,78,70,65)(20,22,58,51)(24,33,36,43)(28,81,80,52)(30,53,56,69)(31,61)(41,42,67,55)(45,77)(47,66)
+ (1,4,13,11)(2,5,14,18)(3,15,8,16)(6,7)(9,20,19,12)(10,17)
Another check for :trac:`5583`::
diff --git a/src/sage/libs/gap/libgap.pyx b/src/sage/libs/gap/libgap.pyx
index b1a64e5..6a36613 100644
--- a/src/sage/libs/gap/libgap.pyx
+++ b/src/sage/libs/gap/libgap.pyx
@@ -695,7 +695,7 @@ class Gap(Parent):
sage: libgap.List
<Gap function "List">
sage: libgap.GlobalRandomSource
- <RandomSource in IsGlobalRandomSource>
+ <RandomSource in IsGAPRandomSource>
"""
if name in dir(self.__class__):
return getattr(self.__class__, name)
diff --git a/src/sage/libs/gap/util.pyx b/src/sage/libs/gap/util.pyx
index 344ab88..6350987 100644
--- a/src/sage/libs/gap/util.pyx
+++ b/src/sage/libs/gap/util.pyx
@@ -362,15 +362,9 @@ cdef Obj gap_eval(str gap_string) except? NULL:
GAPError: Error, Variable: 'Complex' must have a value
Syntax error: ; expected in stream:1
Complex Field with 53 bits of precision;;
- ^^^^^^^^^^^^
+ ^^^^^
Error, Variable: 'with' must have a value
- Syntax error: ; expected in stream:1
- Complex Field with 53 bits of precision;;
- ^^^^^^^^^^^^^^^^^^^^
Error, Variable: 'bits' must have a value
- Syntax error: ; expected in stream:1
- Complex Field with 53 bits of precision;;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error, Variable: 'precision' must have a value
Test that on a subsequent attempt we get the same message (no garbage was
diff --git a/src/sage/tests/gap_packages.py b/src/sage/tests/gap_packages.py
index 2e4518c..c302b16 100644
--- a/src/sage/tests/gap_packages.py
+++ b/src/sage/tests/gap_packages.py
@@ -103,7 +103,7 @@ def all_installed_packages(ignore_dot_gap=False, gap=None):
sage: from sage.tests.gap_packages import all_installed_packages
sage: all_installed_packages()
- (...'GAPDoc'...)
+ (...'gapdoc'...)
sage: all_installed_packages(ignore_dot_gap=True) == all_installed_packages(gap=gap, ignore_dot_gap=True)
True
"""
--
cgit v1.0-1-gd88e
From cbc902a79ff9ec01d4d4eb9a767a1c661fb5dda7 Mon Sep 17 00:00:00 2001
From: Antonio Rojas <arojas@archlinux.org>
Date: Fri, 30 Sep 2022 19:17:42 +0200
Subject: Adapt test to new is_transitive and is_primitive behavior
---
src/sage/groups/perm_gps/permgroup.py | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py
index 34ba0cc..5832b98 100644
--- a/src/sage/groups/perm_gps/permgroup.py
+++ b/src/sage/groups/perm_gps/permgroup.py
@@ -4359,17 +4359,23 @@ class PermutationGroup_generic(FiniteGroup):
::
- sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
- sage: G.is_transitive([1,4,5])
+ sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)],[(6,7)]])
+ sage: G.is_transitive([1,2,3,4,5])
True
- sage: G.is_transitive([2..6])
+ sage: G.is_transitive([1..7])
False
sage: G.is_transitive(G.non_fixed_points())
- True
+ False
sage: H = PermutationGroup([[(1,2,3)],[(4,5,6)]])
sage: H.is_transitive(H.non_fixed_points())
False
+ If `G` does not act on the domain, it always returns ``False``::
+
+ sage: G = PermutationGroup([[(1,2,3,4,5)],[(1,2)]]) #S_5 on [1..5]
+ sage: G.is_transitive([1,4,5])
+ False
+
Note that this differs from the definition in GAP, where
``IsTransitive`` returns whether the group is transitive on the
set of points moved by the group.
@@ -4425,12 +4431,16 @@ class PermutationGroup_generic(FiniteGroup):
sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
sage: G.is_primitive([1..4])
False
- sage: G.is_primitive([1,2,3])
- True
sage: G = PermutationGroup([[(3,4,5,6)],[(3,4)]]) #S_4 on [3..6]
sage: G.is_primitive(G.non_fixed_points())
True
+ If `G` does not act on the domain, it always returns ``False``::
+
+ sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]])
+ sage: G.is_primitive([1,2,3])
+ False
+
"""
#If the domain is not a subset of self.domain(), then the
#action isn't primitive.
--
cgit v1.0-1-gd88e
From 80dd6b338236f170efca1fc3545df18ce8d8795c Mon Sep 17 00:00:00 2001
From: Antonio Rojas <arojas@archlinux.org>
Date: Fri, 30 Sep 2022 19:18:06 +0200
Subject: Mark test as random. With gap 4.12 on x86_64 it is no longer 2
---
src/sage/groups/perm_gps/permgroup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py
index 5832b98..c1230a3 100644
--- a/src/sage/groups/perm_gps/permgroup.py
+++ b/src/sage/groups/perm_gps/permgroup.py
@@ -1287,7 +1287,7 @@ class PermutationGroup_generic(FiniteGroup):
sage: G.gens_small() # random
[('b','c'), ('a','c','b')] ## (on 64-bit Linux)
[('a','b'), ('a','c','b')] ## (on Solaris)
- sage: len(G.gens_small()) == 2
+ sage: len(G.gens_small()) == 2 # random
True
"""
gens = self._libgap_().SmallGeneratingSet()
--
cgit v1.0-1-gd88e
From a6c293d67cfcdf8fba7bc6aa7899e2086d42cc7e Mon Sep 17 00:00:00 2001
From: Antonio Rojas <arojas@archlinux.org>
Date: Fri, 30 Sep 2022 19:18:30 +0200
Subject: Remove test that is now redundant, all seeds give the same answer
---
src/sage/groups/matrix_gps/finitely_generated.py | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/sage/groups/matrix_gps/finitely_generated.py b/src/sage/groups/matrix_gps/finitely_generated.py
index a6d3dc0..63956ad 100644
--- a/src/sage/groups/matrix_gps/finitely_generated.py
+++ b/src/sage/groups/matrix_gps/finitely_generated.py
@@ -563,9 +563,6 @@ class FinitelyGeneratedMatrixGroup_gap(MatrixGroup_gap):
21499084800
sage: P = G.as_permutation_group()
sage: Psmaller = G.as_permutation_group(algorithm="smaller", seed=6)
- sage: P == Psmaller # see the note below
- True
- sage: Psmaller = G.as_permutation_group(algorithm="smaller")
sage: P == Psmaller
False
sage: P.cardinality()
--
cgit v1.0-1-gd88e

View File

@ -0,0 +1,19 @@
commit 04971318f032caf8dc1c0de9489346d894409091
Author: John H. Palmieri <jhpalmieri64@gmail.com>
Date: Wed Aug 31 14:22:26 2022 -0700
trac 34465: fix invalid escape sequence in functions/special.py
diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py
index 02596e49620..901f02f9bee 100644
--- a/src/sage/functions/special.py
+++ b/src/sage/functions/special.py
@@ -849,7 +849,7 @@ class EllipticF(BuiltinFunction):
- :wikipedia:`Elliptic_integral#Incomplete_elliptic_integral_of_the_first_kind`
"""
def __init__(self):
- """
+ r"""
EXAMPLES::
sage: loads(dumps(elliptic_f))

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,29 @@
From f0365f30834b6890313790b3845c647d0160fa6a Mon Sep 17 00:00:00 2001
From: Vincent Delecroix <20100.delecroix@gmail.com*>
Date: Fri, 30 Sep 2022 16:31:08 +0200
Subject: fix doctest if fqf_orthogonal
---
src/sage/groups/fqf_orthogonal.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/sage/groups/fqf_orthogonal.py b/src/sage/groups/fqf_orthogonal.py
index 75de408..7fc4dbe 100644
--- a/src/sage/groups/fqf_orthogonal.py
+++ b/src/sage/groups/fqf_orthogonal.py
@@ -245,10 +245,10 @@ class FqfOrthogonalGroup(AbelianGroupAutomorphismGroup_subgroup):
sage: all(x*f==x*fbar for x in q.gens())
True
sage: L = IntegralLattice("A2").twist(3)
- sage: q = L.discriminant_group()
sage: OL = L.orthogonal_group()
+ sage: assert OL(OL.0.matrix()) == OL.0
+ sage: q = L.discriminant_group()
sage: Oq = q.orthogonal_group()
- sage: assert Oq(OL.0) == Oq(OL.0.matrix())
sage: assert Oq(Oq.0.matrix()) == Oq.0
"""
from sage.libs.gap.element import GapElement
--
cgit v1.0-1-gd88e

View File

@ -0,0 +1,72 @@
commit 5501e0de0dca1cff0355326dd42bd8c7e5749568
Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
Date: Tue Oct 11 17:25:04 2022 -0300
Support matplotlib 3.6
diff --git a/src/sage/plot/arc.py b/src/sage/plot/arc.py
index bb834763afc..f65973bcbd5 100644
--- a/src/sage/plot/arc.py
+++ b/src/sage/plot/arc.py
@@ -273,9 +273,9 @@ class Arc(GraphicPrimitive):
p = patches.Arc((self.x, self.y),
2. * self.r1,
2. * self.r2,
- fmod(self.angle, 2 * pi) * (180. / pi),
- self.s1 * (180. / pi),
- self.s2 * (180. / pi))
+ angle=fmod(self.angle, 2 * pi) * (180. / pi),
+ theta1=self.s1 * (180. / pi),
+ theta2=self.s2 * (180. / pi))
return p
def bezier_path(self):
diff --git a/src/sage/plot/ellipse.py b/src/sage/plot/ellipse.py
index a77e6fe640a..c35bed574ef 100644
--- a/src/sage/plot/ellipse.py
+++ b/src/sage/plot/ellipse.py
@@ -192,7 +192,8 @@ class Ellipse(GraphicPrimitive):
options = self.options()
p = patches.Ellipse(
(self.x,self.y),
- self.r1*2.,self.r2*2.,self.angle/pi*180.)
+ self.r1*2.,self.r2*2.,
+ angle=self.angle/pi*180.)
p.set_linewidth(float(options['thickness']))
p.set_fill(options['fill'])
a = float(options['alpha'])
diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
index e779e1210e3..8d620b5c625 100644
--- a/src/sage/plot/graphics.py
+++ b/src/sage/plot/graphics.py
@@ -2007,7 +2007,7 @@ class Graphics(WithEqualityById, SageObject):
We can also do custom formatting if you need it. See above for full
details::
- sage: plot(2*x+1,(x,0,5),ticks=[[0,1,e,pi,sqrt(20)],2],tick_formatter="latex")
+ sage: plot(2*x+1,(x,0,5),ticks=[[0,1,e,pi,sqrt(20)],2],tick_formatter="latex") # not tested (broken with matplotlib 3.6)
Graphics object consisting of 1 graphics primitive
This is particularly useful when setting custom ticks in multiples
@@ -2341,7 +2341,7 @@ class Graphics(WithEqualityById, SageObject):
sage: subplot = Figure().add_subplot(111)
sage: p._objects[0]._render_on_subplot(subplot)
sage: p._matplotlib_tick_formatter(subplot, **d)
- (<AxesSubplot:>,
+ (<AxesSubplot:...>,
<matplotlib.ticker.MaxNLocator object at ...>,
<matplotlib.ticker.MaxNLocator object at ...>,
<matplotlib.ticker.ScalarFormatter object at ...>,
diff --git a/src/sage/plot/plot.py b/src/sage/plot/plot.py
index b36ee57227c..5301a05c3dc 100644
--- a/src/sage/plot/plot.py
+++ b/src/sage/plot/plot.py
@@ -1741,7 +1741,7 @@ def plot(funcs, *args, **kwds):
::
- sage: plot(2*x+1,(x,0,5),ticks=[[0,1,e,pi,sqrt(20)],2],tick_formatter="latex")
+ sage: plot(2*x+1,(x,0,5),ticks=[[0,1,e,pi,sqrt(20)],2],tick_formatter="latex") # not tested (broken with matplotlib 3.6)
Graphics object consisting of 1 graphics primitive
.. PLOT::

View File

@ -1,14 +0,0 @@
- this is not a proper fix... should fix sage_getfile() instead
--- a/src/sage/misc/sageinspect.py
+++ b/src/sage/misc/sageinspect.py
@@ -187,7 +187,8 @@ def loadable_module_extension():
True
"""
# Return the full platform-specific extension module suffix
- return import_machinery.EXTENSION_SUFFIXES[0]
+ # PATCHED for void linux, we use the shortest extension (.so)
+ return import_machinery.EXTENSION_SUFFIXES[-1]
def isclassinstance(obj):

View File

@ -1,11 +1,11 @@
# Template file for 'sagemath'
pkgname=sagemath
version=9.5
revision=2
version=9.7
revision=1
wrksrc=sage-$version
build_wrksrc=pkgs/sagemath-standard
build_style=python3-module
_bindir=/usr/lib/sagemath/bin
_bindir=/usr/lib/sagemath/$version/bin
make_install_args="--install-scripts=$_bindir"
hostmakedepends="m4 pkg-config python3-Cython python3-Jinja2 python3-pkgconfig
python3-setuptools"
@ -33,66 +33,52 @@ maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
license="GPL-2.0-or-later"
homepage="http://sagemath.org/"
distfiles="https://github.com/sagemath/sage/archive/refs/tags/$version.tar.gz"
checksum=8d70a3b26080802c5b2e33dda4c23795d494d8216a0c2ecfcd608ebab0e64ff6
post_patch() {
# these are unused and nothing else uses ratpoints
rm sage/libs/ratpoints.{pyx,pxd}
# git tree needs bootstrapping
pushd $wrksrc/build/pkgs/sagelib
PATH=../../bin:$PATH BOOTSTRAP_QUIET=no ./bootstrap
popd
}
checksum=9f26f14aa322e3cf38a71835b12ac34b23026b467f74d54b064c5d025e76fbfd
do_configure() {
# set variables in sage.env since we do not install sage_conf
cat >> sage/env.py <<-EOF
CONWAY_POLYNOMIALS_DATA_DIR = "/usr/share/sagemath/conway_polynomials"
GRAPHS_DATA_DIR = "/usr/share/sagemath/graphs"
ELLCURVE_DATA_DIR = "/usr/share/sagemath/ellcurves"
POLYTOPE_DATA_DIR = "/usr/share/sagemath/reflexive_polytopes"
COMBINATORIAL_DESIGN_DATA_DIR = "/usr/share/sagemath/combinatorial_designs"
CREMONA_MINI_DATA_DIR = "/usr/share/sagemath/cremona"
CREMONA_LARGE_DATA_DIR = "/usr/share/sagemath/cremona"
THREEJS_DIR = "/usr/share/sagemath/threejs-sage"
EOF
# don't install sage-venv-config: it is used to set SAGE_VENV=/usr and
# then sage-env prepends "$SAGE_VENV/bin" to PATH which is undesired
vsed -e '/sage-venv-config/d' -i $wrksrc/src/setup.cfg
# git tree needs bootstrapping
( cd $wrksrc/build/pkgs/sagelib &&
PATH=../../bin:$PATH \
BOOTSTRAP_QUIET=no \
./bootstrap )
}
pre_build() {
export PYTHONPATH=../sage-setup
export PYTHONDONTWRITEBYTECODE=yes
export SAGE_NUM_THREADS="$XBPS_MAKEJOBS"
}
post_build() {
_lib=$(cd build/lib* && pwd)
_scripts=$(cd build/scripts* && pwd)
cat >> $_scripts/sage-env-config <<-'EOF'
PATH=$(dirname $SELF):$PATH
EOF
# configuration files
cp ${FILESDIR}/sage_conf.py $_lib
cp ${FILESDIR}/sage-env-config $_scripts
}
pre_install() {
export PYTHONPATH=../sage-setup
export PYTHONDONTWRITEBYTECODE=yes
export SAGE_NUM_THREADS="$XBPS_MAKEJOBS"
}
post_install() {
# fix jupyter kernel spec
vsed -i -e 's|"/usr/bin/sage", "--python"|"/usr/bin/python"|' \
vsed -i -e 's|"/usr/bin/sage"|"'${_bindir}'/sage"|' \
${DESTDIR}/usr/share/jupyter/kernels/sagemath/kernel.json
# replace broken symlinks by good copies (sagemath logo images)
for file in $(ls sage/ext_data/notebook-ipython); do
rm ${DESTDIR}/usr/share/jupyter/kernels/sagemath/$file
cp -a sage/ext_data/notebook-ipython/$file \
${DESTDIR}/usr/share/jupyter/kernels/sagemath
done
# we don't have docs here
rm ${DESTDIR}/usr/share/jupyter/kernels/sagemath/doc
# we don't have threejs in void
# this symlink is shipped in threejs-sage pkg
rm ${DESTDIR}/usr/share/jupyter/nbextensions/threejs-sage
# symlink main binary
@ -102,14 +88,17 @@ post_install() {
}
do_check() {
_lib=$(cd build/lib* && pwd)
_scripts=$(cd build/scripts* && pwd)
export PYTHONPATH=$(cd build/lib* && pwd)
export PYTHONPATH=$_lib
export PYTHONDONTWRITEBYTECODE=yes
# get out of $build_wrksrc, otherwise python picks the wrong sage module
cd $(mktemp -dp build)
if [ -f ${XBPS_DISTDIR}/sagemath-check ] ; then
_sed='s|#.*||;/^\s*$/d;s|[^ ]*/sage/|'$PYTHONPATH'/sage/|g' \
_sed='s|#.*||;/^\s*$/d;s|^\([^ ]*/\)\?sage/|'$_lib'/sage/|g' \
_test_files=$(sed -e "$_sed" ${XBPS_DISTDIR}/sagemath-check)
fi
if [ -z "$_test_files" ]; then