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

Quaternion ideal behaviour changed in 10.4 #38422

Open
2 tasks done
Eloitor opened this issue Jul 25, 2024 · 3 comments
Open
2 tasks done

Quaternion ideal behaviour changed in 10.4 #38422

Eloitor opened this issue Jul 25, 2024 · 3 comments

Comments

@Eloitor
Copy link
Contributor

Eloitor commented Jul 25, 2024

Steps To Reproduce

In sage 10.3 this code worked as expected:

B.<i,j,k> = QuaternionAlgebra(-1, -1)
O = B.maximal_order()
K = QuadraticField(-35)
I = K.class_group()[1].ideal()
f0 = K.hom([5*i + j + 3*k])
O * f0(I)

It can be tested in sagecell: https://sagecell.sagemath.org/?z=eJwtyz8PgjAQh-HdxO9w4xWhkRg3NZHBhDAQZ0JIlVIPSktKjXx865_hlue9X8YPFPfxcIIjXJ_CS2fImrNW8uYEJmkMScrWqzLkjI9ioVHoxrpWOgxc_FatE57uF5K6xWS3DyEPoeB3Lea5Uc4-J2RVWnNqpdCfYbf9PjzsiNU-IthAH24XDXWIkyPjsYQIui3mLEj2X1YqCrQw6KyDBchAzpU0c-NfFn-qPlp-FVnN3ox1QKs=&lang=sage&interacts=eJyLjgUAARUAuQ==

Expected Behavior

Output is

Fractional ideal (1/2 + 1/2*i + 5/2*j + 3/2*k, i + j + k, 3*j, 3*k)

Actual Behavior

In sage 10.4 the last line gives an error:

ValueError: fractional ideal must have rank 4

As an alternative I can use

B.ideal([g*f0(x) for x in I.gens_two() for g in O.gens()])

Which gives the same result, but it would be nice to have a less verbose way to accomplish the same.


By the way, if you run the sagecell code multiple times, you will see that sometimes it outputs:

/home/sc_serv/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/tornado/platform/asyncio.py:206: RuntimeWarning: cypari2 leaked 129522523427248 bytes on the PARI stack
  handler_func(fileobj, events)

Is this a known issue?

Additional Information

No response

Environment

- **OS**: Void Linux
- **Sage Version**: 10.4

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide
@S17A05
Copy link
Contributor

S17A05 commented Jul 26, 2024

This was introduced in #37100 and seems slightly tricky to solve in a robust way if I understand it correctly:
You want to use the embedding of K to multiply O by the quadratic ideal I - the way Sage did this previously is by interpreting f_0(I) as a fractional quaternion ideal, even though it never is one (having rank 2 instead of 4).
So the main question probably is: What type of object should Sage understand f_0(I) as, especially if you then want to use it for multiplication with an order?

@S17A05
Copy link
Contributor

S17A05 commented Jul 26, 2024

As far as I understand it correctly, the generic code in rings.morphism wants to consider the ideal generated by f_0(I) - but for quaternion algebras the .ideal-method requires a ZZ-basis for generation, as the properly generated ideal would be the whole quaternion algebra.

@S17A05
Copy link
Contributor

S17A05 commented Jul 26, 2024

Since some of the code in quaternion_algebra.py relies on quaternion fractional ideals actually being full rank, the rank restriction was put in place - to have your code work, one would probably want to implement sublattices inside a quaternion algebra more generally, and then consider quaternion fractional ideals as full rank lattices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants