Skip to content

Commit

Permalink
add deprecation warning for #34880
Browse files Browse the repository at this point in the history
  • Loading branch information
yyyyx4 committed May 26, 2023
1 parent 7404764 commit c27aafa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions src/sage/algebras/quatalg/quaternion_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -1399,8 +1399,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")

Expand Down Expand Up @@ -2548,7 +2548,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)

Expand Down Expand Up @@ -2691,7 +2691,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)

Expand Down Expand Up @@ -2899,7 +2899,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.
Expand All @@ -2918,12 +2918,18 @@ def basis_for_quaternion_lattice(gens, reverse=False):
sage: from sage.algebras.quatalg.quaternion_algebra import basis_for_quaternion_lattice
sage: A.<i,j,k> = 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)
Expand Down
2 changes: 1 addition & 1 deletion src/sage/modular/quatalg/brandt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit c27aafa

Please sign in to comment.