diff --git a/src/sage/algebras/quatalg/quaternion_algebra.py b/src/sage/algebras/quatalg/quaternion_algebra.py index 77dcfe4db43..04f8f2a0d84 100644 --- a/src/sage/algebras/quatalg/quaternion_algebra.py +++ b/src/sage/algebras/quatalg/quaternion_algebra.py @@ -1400,8 +1400,8 @@ def __init__(self, A, basis, check=True): raise ValueError("lattice must contain 1") # check if multiplicatively closed - M1 = basis_for_quaternion_lattice(basis) - M2 = basis_for_quaternion_lattice(list(basis) + [x * y for x in basis for y in basis]) + M1 = basis_for_quaternion_lattice(basis, reverse=False) + M2 = basis_for_quaternion_lattice(list(basis) + [x * y for x in basis for y in basis], reverse=False) if M1 != M2: raise ValueError("given lattice must be a ring") @@ -2549,7 +2549,7 @@ def __mul__(self, right): # if self.__right_order == right.__left_order: # left_order = self.__left_order # right_order = right.__right_order - basis = tuple(basis_for_quaternion_lattice(gens)) + basis = tuple(basis_for_quaternion_lattice(gens, reverse=False)) A = self.quaternion_algebra() return A.ideal(basis, check=False) @@ -2692,7 +2692,7 @@ def multiply_by_conjugate(self, J): """ Jbar = [b.conjugate() for b in J.basis()] gens = [a * b for a in self.basis() for b in Jbar] - basis = tuple(basis_for_quaternion_lattice(gens)) + basis = tuple(basis_for_quaternion_lattice(gens, reverse=False)) R = self.quaternion_algebra() return R.ideal(basis, check=False) @@ -2900,7 +2900,7 @@ def cyclic_right_subideals(self, p, alpha=None): ####################################################################### -def basis_for_quaternion_lattice(gens, reverse=False): +def basis_for_quaternion_lattice(gens, reverse=None): r""" Return a basis for the `\ZZ`-lattice in a quaternion algebra spanned by the given gens. @@ -2919,12 +2919,18 @@ def basis_for_quaternion_lattice(gens, reverse=False): sage: from sage.algebras.quatalg.quaternion_algebra import basis_for_quaternion_lattice sage: A. = QuaternionAlgebra(-1,-7) sage: basis_for_quaternion_lattice([i+j, i-j, 2*k, A(1/3)]) + doctest:warning ... DeprecationWarning: ... [1/3, i + j, 2*j, 2*k] sage: basis_for_quaternion_lattice([A(1),i,j,k]) [1, i, j, k] """ + if reverse is None: + from sage.misc.superseded import deprecation + deprecation(34880, 'The default value for the "reverse" argument to basis_for_quaternion_lattice() will' + ' change from False to True. Pass the argument explicitly to silence this warning.') + reverse = False if not gens: return [] Z, d = quaternion_algebra_cython.integral_matrix_and_denom_from_rational_quaternions(gens, reverse) diff --git a/src/sage/modular/quatalg/brandt.py b/src/sage/modular/quatalg/brandt.py index 9bbe2865b47..effb2adbfcf 100644 --- a/src/sage/modular/quatalg/brandt.py +++ b/src/sage/modular/quatalg/brandt.py @@ -399,7 +399,7 @@ def basis_for_left_ideal(R, gens): sage: sage.modular.quatalg.brandt.basis_for_left_ideal(B.maximal_order(), [3*(i+j),3*(i-j),6*k,A(3)]) [3/2 + 1/2*i + k, i + 2*k, 3/2*j + 3/2*k, 3*k] """ - return basis_for_quaternion_lattice([b * g for b in R.basis() for g in gens]) + return basis_for_quaternion_lattice([b * g for b in R.basis() for g in gens], reverse=False) def right_order(R, basis):