Skip to content

Commit c27aafa

Browse files
committed
add deprecation warning for #34880
1 parent 7404764 commit c27aafa

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
@@ -1399,8 +1399,8 @@ def __init__(self, A, basis, check=True):
13991399
raise ValueError("lattice must contain 1")
14001400

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

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

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

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

29012901

2902-
def basis_for_quaternion_lattice(gens, reverse=False):
2902+
def basis_for_quaternion_lattice(gens, reverse=None):
29032903
r"""
29042904
Return a basis for the `\ZZ`-lattice in a quaternion algebra
29052905
spanned by the given gens.
@@ -2918,12 +2918,18 @@ def basis_for_quaternion_lattice(gens, reverse=False):
29182918
sage: from sage.algebras.quatalg.quaternion_algebra import basis_for_quaternion_lattice
29192919
sage: A.<i,j,k> = QuaternionAlgebra(-1,-7)
29202920
sage: basis_for_quaternion_lattice([i+j, i-j, 2*k, A(1/3)])
2921+
doctest:warning ... DeprecationWarning: ...
29212922
[1/3, i + j, 2*j, 2*k]
29222923
29232924
sage: basis_for_quaternion_lattice([A(1),i,j,k])
29242925
[1, i, j, k]
29252926
29262927
"""
2928+
if reverse is None:
2929+
from sage.misc.superseded import deprecation
2930+
deprecation(34880, 'The default value for the "reverse" argument to basis_for_quaternion_lattice() will'
2931+
' change from False to True. Pass the argument explicitly to silence this warning.')
2932+
reverse = False
29272933
if not gens:
29282934
return []
29292935
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)