Skip to content

Convenience syntax for quaternion ideals #32264

@yyyyx4

Description

@yyyyx4

Currently (sage 9.3), quaternion ideals do not support some of the operations one may expect them to:

  • Trying to scale an ideal I on the left by an element a by writing a*I throws a TypeError.
  • Trying to scale an ideal I on the right by an element a by writing I*a throws an AttributeError (this seems to be because the _scale method was renamed to scale at some point).
  • Trying to compute the sum of two ideals I and J by writing I+J "works", but it returns a generic Twosided Ideal (which, by the way, is usually incorrect) rather than a quaternion ideal.
  • Trying to construct a one-sided principal ideal of a quaternion order O by writing a*O or O*a throws a NotImplementedError.

This patch makes all of these things work. There's a good chance I messed up something with respect to sage's coercion system though, so I am hoping for someone to educate me on this matter.

As a side note, given the issue with the implementation of + inherited from generic ideals, I'm not sure we should be deriving quaternion ideals from the generic ideal class in the first place.

Depends on #32245

Component: algebra

Keywords: quaternion ideals

Author: Lorenz Panny

Branch/Commit: eef228d

Reviewer: Peter Bruin

Issue created by migration from https://trac.sagemath.org/ticket/32264

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions