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

Quadratic forms and isometries - an Oscar (experimental) project #2563

Merged
merged 101 commits into from
Jul 21, 2023

Conversation

StevellM
Copy link
Member

Here is (finally) the first PR of the project on integral/rational quadratic forms and their isometries. It will stay as a draft for now because I need to check code coverage and deployment of the html documentation.

As a further remark: we cannot put all relevant tests for the project on Oscar since they are too heavy. I have put some tests for now, quite small and I might have to reduce them (at the end they will be "tautological" but necessary to ensure that the codes run, at least)

We are working on getting to heavier tests of all the functionalities, but we need more improvements on some other Oscar/Hecke features to do this. The project would be ready to be made available in the src of Oscar as soon as those heavy checks would have been performed (and with the agreement of the maintainers).

For the curious reviewers here: this project covers the algorithms present in the paper "Finite subgroups of automorphisms of K3 surfaces" of Simon Brandhorst and Tommy Hofmann. In particular, have been implemented the enumeration techniques for isometries with at most 2 prime divisors on even integer lattices, and the hermitian version of what they call "Miranda-Morrison theory". Moreover, we provide a first implementation of Nikulin's theory on primitive embeddings of even integer lattices in the primary case - more cases should be available in the future, for research reason or on demand of some users (maybe some more before the end of my PhD).

@thofma @simonbrandhorst here it is

@codecov
Copy link

codecov bot commented Jul 18, 2023

Codecov Report

Merging #2563 (e0515e5) into master (3b64d46) will decrease coverage by 0.52%.
The diff coverage is 89.69%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2563      +/-   ##
==========================================
- Coverage   72.84%   72.32%   -0.52%     
==========================================
  Files         416      427      +11     
  Lines       55600    59893    +4293     
==========================================
+ Hits        40503    43319    +2816     
- Misses      15097    16574    +1477     
Impacted Files Coverage Δ
...xperimental/QuadFormAndIsom/src/QuadFormAndIsom.jl 0.00% <0.00%> (ø)
.../QuadFormAndIsom/src/hermitian_miranda_morrison.jl 72.49% <72.49%> (ø)
experimental/QuadFormAndIsom/src/printings.jl 88.88% <88.88%> (ø)
experimental/QuadFormAndIsom/src/enumeration.jl 90.34% <90.34%> (ø)
...ntal/QuadFormAndIsom/src/lattices_with_isometry.jl 94.50% <94.50%> (ø)
experimental/QuadFormAndIsom/src/embeddings.jl 96.10% <96.10%> (ø)
...mental/QuadFormAndIsom/src/spaces_with_isometry.jl 98.36% <98.36%> (ø)
experimental/QuadFormAndIsom/test/runtests.jl 99.18% <99.18%> (ø)
experimental/QuadFormAndIsom/src/types.jl 100.00% <100.00%> (ø)
src/Groups/spinor_norms.jl 77.96% <100.00%> (ø)
... and 1 more

... and 72 files with indirect coverage changes

@StevellM StevellM marked this pull request as ready for review July 19, 2023 07:45
Copy link
Member

@lgoettgens lgoettgens left a comment

Choose a reason for hiding this comment

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

I do not have any knowledge about the mathematics behind all of this. But I have some minor remarks and nitpicks about the style and readability (see below). Feel free to ignore them.
And I think that your code is not formatted according to the .editorconfig and .JuliaFormatter.toml. It would be great if you could adapt that.

experimental/QuadFormAndIsom/docs/src/enumeration.md Outdated Show resolved Hide resolved
experimental/QuadFormAndIsom/docs/src/introduction.md Outdated Show resolved Hide resolved
experimental/QuadFormAndIsom/src/embeddings.jl Outdated Show resolved Hide resolved
experimental/QuadFormAndIsom/src/embeddings.jl Outdated Show resolved Hide resolved
experimental/QuadFormAndIsom/src/embeddings.jl Outdated Show resolved Hide resolved
experimental/QuadFormAndIsom/src/types.jl Outdated Show resolved Hide resolved
experimental/QuadFormAndIsom/src/types.jl Outdated Show resolved Hide resolved
experimental/QuadFormAndIsom/test/runtests.jl Outdated Show resolved Hide resolved
experimental/QuadFormAndIsom/test/runtests.jl Outdated Show resolved Hide resolved
@@ -0,0 +1,13 @@
function set_lwi_level(k::Int)
Copy link
Member

Choose a reason for hiding this comment

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

Is this lwi here an abbreviation of something? Maybe change it to a more meaningful name

Copy link
Member Author

Choose a reason for hiding this comment

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

It is not meant to stay so forever, but only during the "experimental part" of this code. lwi means "lattice with isometry", which was the original name of the project. I would rather keep it like that because it is short enough, and the meaning is not really important compared to what it is used for (the documentation currently covers the use of the function.

@StevellM
Copy link
Member Author

Thanks @lgoettgens for the comments, I will make some changes accordingly.

@lgoettgens
Copy link
Member

The julia 1.6 failure (https://github.com/oscar-system/Oscar.jl/actions/runs/5596410493/jobs/10233396520?pr=2563) is #2570.

On julia 1.9 and 1.10, "Enumeration of lattices with finite isometries" test needs 6min30s and 9min, while on nightly it gets killed after 90min.

@StevellM
Copy link
Member Author

Yes, we have two problems here I guess: first the codes are calling functions in Hecke which are not precompiled by default. Second is that to have relevant tests, which covers most of the feature, I need to resort to some expensive algorithms. I could reduce them but then we loose of the coverage of the codes in case of breaking changes.

@StevellM
Copy link
Member Author

Do things look good now ? @lgoettgens @thofma If yes, it is good to go for me.

@lgoettgens
Copy link
Member

My comments seem to be all resolved now. But as wrote already, I have no knowledge about the mathematics behind, thus I will not approve this pr and leave that to e.g. @thofma

# Quadratic forms and isometries

This project is a complement to the code about *hermitian lattices* available
on Hecke. We aim here to connect Hecke and GAP to handle some algorithmic
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
on Hecke. We aim here to connect Hecke and GAP to handle some algorithmic
in Hecke. We aim here to connect Hecke and GAP to handle some algorithmic

This project is a complement to the code about *hermitian lattices* available
on Hecke. We aim here to connect Hecke and GAP to handle some algorithmic
methods regarding quadratic forms with their isometries. In particular,
the integration of this code to Oscar is necessary to benefit all the
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
the integration of this code to Oscar is necessary to benefit all the
the integration of this code within Oscar is necessary to benefit from all the

The former parametrizes pairs $(V, f)$ where $V$ is a rational quadratic form
and $f$ is an isometry of $V$. The latter parametrizes pairs $(L, f)$ where
$L$ is an integral quadratic form, also known as $\mathbb Z$-lattice and $f$
is an isometry of $L$. One of the main feature of this project is the
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
is an isometry of $L$. One of the main feature of this project is the
is an isometry of $L$. One of the main features of this project is the

and $f$ is an isometry of $V$. The latter parametrizes pairs $(L, f)$ where
$L$ is an integral quadratic form, also known as $\mathbb Z$-lattice and $f$
is an isometry of $L$. One of the main feature of this project is the
enumeration of isomorphism classes of pairs $(L, f)$ where $f$ is an isometry
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
enumeration of isomorphism classes of pairs $(L, f)$ where $f$ is an isometry
enumeration of isomorphism classes of pairs $(L, f)$, where $f$ is an isometry


This project has been slightly tested on simple and known examples. It is
currently being tested on a larger scale to test its reliability. Moreover,
there are still computational bottlenecks due to non optimized algorithms.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
there are still computational bottlenecks due to non optimized algorithms.
there are still computational bottlenecks due to non-optimized algorithms.

true
```
"""
rank(Vf::QuadSpaceWithIsom) = rank(space(Vf))::Integer
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
rank(Vf::QuadSpaceWithIsom) = rank(space(Vf))::Integer
rank(Vf::QuadSpaceWithIsom) = rank(space(Vf))

Should not be necessary?

true
```
"""
dim(Vf::QuadSpaceWithIsom) = dim(space(Vf))::Integer
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
dim(Vf::QuadSpaceWithIsom) = dim(space(Vf))::Integer
dim(Vf::QuadSpaceWithIsom) = dim(space(Vf))

end

@doc raw"""
Base.:^(Vf::QuadSpaceWithIsom, n::Int)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Base.:^(Vf::QuadSpaceWithIsom, n::Int)
^(Vf::QuadSpaceWithIsom, n::Int) -> QuadSpaceWithIsom

@@ -478,7 +478,7 @@ julia> order(Oq)
# we can compute the orthogonal group of L
Oq = orthogonal_group(discriminant_group(L))
G = orthogonal_group(L)
return sub(Oq, [Oq(g, check=false) for g in gens(G)])
return sub(Oq, unique([Oq(g, check=false) for g in gens(G)]))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return sub(Oq, unique([Oq(g, check=false) for g in gens(G)]))
return sub(Oq, unique!([Oq(g, check=false) for g in gens(G)]))

true
```
"""
gram_matrix(Vf::QuadSpaceWithIsom) = gram_matrix(space(Vf))::QQMatrix
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why all those annotations?

Copy link
Member Author

Choose a reason for hiding this comment

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

Isn't it better for type stability ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hm, it should not matter, since gram_matrix of a quadratic space should be type stable.

Copy link
Collaborator

@thofma thofma left a comment

Choose a reason for hiding this comment

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

I found a few things to adjust

@thofma
Copy link
Collaborator

thofma commented Jul 20, 2023

Doctests are suddenly failing?

@StevellM
Copy link
Member Author

Yes it appears that my fix was not a fix... I am working on it.

@thofma thofma enabled auto-merge (squash) July 21, 2023 13:42
@thofma thofma disabled auto-merge July 21, 2023 16:16
@thofma thofma merged commit aa4d50d into oscar-system:master Jul 21, 2023
12 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants