Skip to content

Commit a7af729

Browse files
author
Release Manager
committed
gh-35683: deprecation warning for #34880 Per #34962 (comment), we should first issue deprecation warnings for the change suggested in #34880. URL: #35683 Reported by: Lorenz Panny Reviewer(s): Kwankyu Lee
2 parents 15f8a33 + c27aafa commit a7af729

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/sage/algebras/quatalg/quaternion_algebra.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,8 +1400,8 @@ def __init__(self, A, basis, check=True):
14001400
raise ValueError("lattice must contain 1")
14011401

14021402
# check if multiplicatively closed
1403-
M1 = basis_for_quaternion_lattice(basis)
1404-
M2 = basis_for_quaternion_lattice(list(basis) + [x * y for x in basis for y in basis])
1403+
M1 = basis_for_quaternion_lattice(basis, reverse=False)
1404+
M2 = basis_for_quaternion_lattice(list(basis) + [x * y for x in basis for y in basis], reverse=False)
14051405
if M1 != M2:
14061406
raise ValueError("given lattice must be a ring")
14071407

@@ -2549,7 +2549,7 @@ def __mul__(self, right):
25492549
# if self.__right_order == right.__left_order:
25502550
# left_order = self.__left_order
25512551
# right_order = right.__right_order
2552-
basis = tuple(basis_for_quaternion_lattice(gens))
2552+
basis = tuple(basis_for_quaternion_lattice(gens, reverse=False))
25532553
A = self.quaternion_algebra()
25542554
return A.ideal(basis, check=False)
25552555

@@ -2692,7 +2692,7 @@ def multiply_by_conjugate(self, J):
26922692
"""
26932693
Jbar = [b.conjugate() for b in J.basis()]
26942694
gens = [a * b for a in self.basis() for b in Jbar]
2695-
basis = tuple(basis_for_quaternion_lattice(gens))
2695+
basis = tuple(basis_for_quaternion_lattice(gens, reverse=False))
26962696
R = self.quaternion_algebra()
26972697
return R.ideal(basis, check=False)
26982698

@@ -2900,7 +2900,7 @@ def cyclic_right_subideals(self, p, alpha=None):
29002900
#######################################################################
29012901

29022902

2903-
def basis_for_quaternion_lattice(gens, reverse=False):
2903+
def basis_for_quaternion_lattice(gens, reverse=None):
29042904
r"""
29052905
Return a basis for the `\ZZ`-lattice in a quaternion algebra
29062906
spanned by the given gens.
@@ -2919,12 +2919,18 @@ def basis_for_quaternion_lattice(gens, reverse=False):
29192919
sage: from sage.algebras.quatalg.quaternion_algebra import basis_for_quaternion_lattice
29202920
sage: A.<i,j,k> = QuaternionAlgebra(-1,-7)
29212921
sage: basis_for_quaternion_lattice([i+j, i-j, 2*k, A(1/3)])
2922+
doctest:warning ... DeprecationWarning: ...
29222923
[1/3, i + j, 2*j, 2*k]
29232924
29242925
sage: basis_for_quaternion_lattice([A(1),i,j,k])
29252926
[1, i, j, k]
29262927
29272928
"""
2929+
if reverse is None:
2930+
from sage.misc.superseded import deprecation
2931+
deprecation(34880, 'The default value for the "reverse" argument to basis_for_quaternion_lattice() will'
2932+
' change from False to True. Pass the argument explicitly to silence this warning.')
2933+
reverse = False
29282934
if not gens:
29292935
return []
29302936
Z, d = quaternion_algebra_cython.integral_matrix_and_denom_from_rational_quaternions(gens, reverse)

src/sage/modular/quatalg/brandt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ def basis_for_left_ideal(R, gens):
399399
sage: sage.modular.quatalg.brandt.basis_for_left_ideal(B.maximal_order(), [3*(i+j),3*(i-j),6*k,A(3)])
400400
[3/2 + 1/2*i + k, i + 2*k, 3/2*j + 3/2*k, 3*k]
401401
"""
402-
return basis_for_quaternion_lattice([b * g for b in R.basis() for g in gens])
402+
return basis_for_quaternion_lattice([b * g for b in R.basis() for g in gens], reverse=False)
403403

404404

405405
def right_order(R, basis):

0 commit comments

Comments
 (0)