Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define behaviour of < and > for fractional ideals in a quaternion algebra #37113

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion src/sage/algebras/quatalg/quaternion_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -2393,8 +2393,35 @@ def _richcmp_(self, right, op):

sage: I != I # indirect doctest
False

TESTS:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TESTS: -> TESTS::

and add en empty line after TESTS::

sage: B = QuaternionAlgebra(QQ,-1,-11)
sage: i,j,k = B.gens()
sage: I = B.ideal([1,i,j,i*j])
sage: I == I
True
sage: O = B.ideal([1,i,(i+j)/2,(1+i*j)/2])
sage: I <= O
True
sage: I >= O
False
sage: I != O
True
sage: I == O
False
sage: I != I
False
sage: I < I
False
sage: I < O
True
sage: I <= I
True
sage: O >= O
True

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this empty line.

"""
return self.basis_matrix()._richcmp_(right.basis_matrix(), op)
return self.free_module().__richcmp__(right.free_module(), op)

def __hash__(self):
"""
Expand Down
3 changes: 2 additions & 1 deletion src/sage/modular/quatalg/brandt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,8 @@ def right_ideals(self, B=None):
ideals_theta[J_theta] = [J]
verbose("found %s of %s ideals" % (len(ideals), self.dimension()), level=2)
if len(ideals) >= self.dimension():
ideals = tuple(sorted(ideals))
#order by basis matrix (as ideals were previously ordered) for backward compatibility and deterministic order of the output
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments need a space after # and are usually aligned in 80 columns mode

-                            #order by basis matrix (as ideals were previously ordered) for backward compatibility and deterministic order of the output
+                            # order by basis matrix (as ideals were previously
+	 		     # ordered) for backward compatibility and
+	 		     # deterministic order of the output

ideals = tuple(sorted(ideals, key=lambda x: x.basis_matrix()))
self.__right_ideals = ideals
return ideals
got_something_new = True
Expand Down
Loading