Opened 5 years ago

Closed 3 years ago

#24082 closed enhancement (fixed)

Genus from a TorsionQuadraticModules and a signature pair

Reported by: sbrandhorst Owned by:
Priority: major Milestone: sage-8.8
Component: quadratic forms Keywords:
Cc: annahaensch, tscrim Merged in:
Authors: Simon Brandhorst Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: 3ad3200 (Commits, GitHub, GitLab) Commit: 3ad32006e86c6874b3f498692e73f7fb1d7c09e1
Dependencies: #23699,#23916,#24035,#24577,#24576, #24818, #25875, #24889 Stopgaps:

Status badges

Description

By results of Nikulin: The genus of an even integral quadratic form is determined by (s_+,s_-,q) where s_+,s_- is the signature and q a torsion quadratic form with values in QQ/2ZZ

The genus of an odd integral quadratic form is determined by (s_+,s_-,b) here b is a torsion bilinear form with values in QQ/ZZ

We have TorsionQuadraticModule and we have sage.quadratic_forms.genera.genus.Genus

This ticket should implement the Theorem of Nikulin.

Change History (51)

comment:1 Changed 5 years ago by sbrandhorst

  • Dependencies set to #23699

comment:2 Changed 5 years ago by sbrandhorst

  • Dependencies changed from #23699 to #23699,#23916

comment:3 Changed 5 years ago by sbrandhorst

  • Dependencies changed from #23699,#23916 to #23699,#23916,#24035

comment:4 Changed 5 years ago by sbrandhorst

  • Branch set to u/sbrandhorst/interaction_torsionquadraticmodules_vs_genus

comment:5 Changed 5 years ago by sbrandhorst

  • Commit set to 1b71e11643be41ffee0885953dbeb5d8c04619a3
  • Dependencies changed from #23699,#23916,#24035 to #23699,#23916,#24035,#24577,#24576

Last 10 new commits:

cf8aa90Relations of 2-adic forms
f7a3ccdPartial normal form implemented.
c40e246Full normal form - first prototype
1f5ad0fBugfixes and documentation
00b2fa5Optimizations and documentation
087867drenamed orthogonal_gens to normal_form
94fbd5bChange in convention in Torsion quadratic module normal form.
21d142fSetting minimal p-adic precision to 3
d0f06b1Merge branch 't/24035/orthogonal_jordan_decomposition_for_torsionquadraticmodules' into t/24082/interaction_torsionquadraticmodules_vs_genus
1b71e11Prototypes for Brown invariant and is_even_genus, incomplete work on even genus from torsion module + signature

comment:6 Changed 5 years ago by sbrandhorst

This ticket is now split into several subtasks to keep reviewing easy.

comment:7 Changed 5 years ago by git

  • Commit changed from 1b71e11643be41ffee0885953dbeb5d8c04619a3 to 54080b84a415d96d6961f5164f44aae906bf3f8e

Branch pushed to git repo; I updated commit sha1. New commits:

30abe3dMostly documentation and conventions. Small bugfix
1ae8c8bLots and lots of documentation.
52df7c6Some extra docs.
18ba56bMerge branch 't/24035/orthogonal_jordan_decomposition_for_torsionquadraticmodules' into t/24082/interaction_torsionquadraticmodules_vs_genus
097816bMerge branch 'u/sbrandhorst/orthogonal_jordan_decomposition_for_torsionquadraticmodules' of git://trac.sagemath.org/sage into t/24576/brown_invariant_of_a_torsionquadraticmodule
2c406fbThe Brown invariant.
22c2c78First prototype. Odd lattices are missing.
f6c2548Merge branch 'u/sbrandhorst/is_genus_for_torsion_quadratic_modules' of git://trac.sagemath.org/sage into t/24082/interaction_torsionquadraticmodules_vs_genus
54080b8..

comment:8 Changed 5 years ago by git

  • Commit changed from 54080b84a415d96d6961f5164f44aae906bf3f8e to 503c8fccee9ef7dae773dcd6489e9c5d8137e659

Branch pushed to git repo; I updated commit sha1. New commits:

503c8fcMerge branch 'develop' of git://trac.sagemath.org/sage into t/24082/interaction_torsionquadraticmodules_vs_genus

comment:9 Changed 4 years ago by sbrandhorst

  • Branch changed from u/sbrandhorst/interaction_torsionquadraticmodules_vs_genus to sbrandhorst/t/24082
  • Commit 503c8fccee9ef7dae773dcd6489e9c5d8137e659 deleted

comment:10 Changed 4 years ago by sbrandhorst

  • Branch changed from sbrandhorst/t/24082 to u/sbrandhorst/t/24082/genus_from_fqf

comment:11 Changed 4 years ago by git

  • Commit set to f949d2141e032b3bc8c686ddf7cc6f4e58575aa2

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

2c406fbThe Brown invariant.
b2acff7Merge branch 'develop' of git://trac.sagemath.org/sage into t/24576/brown_invariant_of_a_torsionquadraticmodule
fb9153eMerge commit '9ae1c1369b171d417e7a291055fa747335244abe' of git://trac.sagemath.org/sage into t/24576/brown_invariant_of_a_torsionquadraticmodule
b385271Merge branch 'u/sbrandhorst/brown_invariant_of_a_torsionquadraticmodule' of git://trac.sagemath.org/sage into u/sbrandhorst/t/24082/genus_from_fqf
22c2c78First prototype. Odd lattices are missing.
a82b4b3Merge branch 'develop' of git://trac.sagemath.org/sage into t/24577/is_genus_for_torsion_quadratic_modules
1ccb5cdMerge branch 'develop' of git://trac.sagemath.org/sage into t/24577/is_genus_for_torsion_quadratic_modules
5598294Cosmetic changes.
2251c52Added doctest.
f949d21Merge branch 'u/sbrandhorst/is_genus_for_torsion_quadratic_modules' of git://trac.sagemath.org/sage into u/sbrandhorst/t/24082/genus_from_fqf

comment:12 Changed 4 years ago by git

  • Commit changed from f949d2141e032b3bc8c686ddf7cc6f4e58575aa2 to 7f2fcf432f5d2a7872da6ff3bb595426dc0ae4c8

Branch pushed to git repo; I updated commit sha1. New commits:

7f2fcf4First working version

comment:13 Changed 4 years ago by sbrandhorst

  • Dependencies changed from #23699,#23916,#24035,#24577,#24576 to #23699,#23916,#24035,#24577,#24576, #24818

comment:14 Changed 4 years ago by git

  • Commit changed from 7f2fcf432f5d2a7872da6ff3bb595426dc0ae4c8 to a25e2976385cdae7310a0be01d54055d55ad66d3

Branch pushed to git repo; I updated commit sha1. New commits:

d8089e9Rewrite of the internal logic of canonical_2_adic_trains
a25e297Merge branch 't/24818/bug_in_genus_of_a_quadratic_form' into u/sbrandhorst/t/24082/genus_from_fqf

comment:15 Changed 4 years ago by sbrandhorst

  • Authors set to Simon Brandhorst

comment:16 Changed 4 years ago by git

  • Commit changed from a25e2976385cdae7310a0be01d54055d55ad66d3 to 7fb07f0720ad3b35acde0f42f5c480775ddc420a

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

edbd3c3Merge branch 't/24577/is_genus_for_torsion_quadratic_modules' into t/24082/t/24082/genus_from_fqf
daada4eMerge branch 't/23699/torsion_quadratic_module_symmetric' into t/24083/factory_function_for_torsionquadraticforms
a7c43f4 a first try
d320c40Merge branch 'develop' of git://trac.sagemath.org/sage into t/24083/factory_function_for_torsionquadraticforms
cbcd8d1Merge branch 'develop' into t/24083/factory_function_for_torsionquadraticforms
aeb35faadded TorsionQuadraticForm for torsion quadratic forms
328e543Added TorsionQuadraticForm for torsion quadratic modules
c4bed4fChanged only documentation and indentation
73bd99eAdded TorsionQuadraticForm to global name space
7fb07f0Merge branch 'u/khashimoto/factory_function_for_torsionquadraticforms' of git://trac.sagemath.org/sage into t/24082/t/24082/genus_from_fqf

comment:17 Changed 4 years ago by git

  • Commit changed from 7fb07f0720ad3b35acde0f42f5c480775ddc420a to 4f8e01c6aeefdbc4e0c5fa4241e7d94e20b6df35

Branch pushed to git repo; I updated commit sha1. New commits:

4f8e01cEven genera from torsion quadratic forms. First working version.

comment:18 Changed 4 years ago by sbrandhorst

Todo:

  • odd genera

comment:19 Changed 4 years ago by sbrandhorst

  • Status changed from new to needs_review

comment:20 Changed 4 years ago by git

  • Commit changed from 4f8e01c6aeefdbc4e0c5fa4241e7d94e20b6df35 to 7cb247ac5b9794bf69ddb8f89e05dcc0780cd520

Branch pushed to git repo; I updated commit sha1. New commits:

7cb247aMerge branch 'develop' into t/24082/t/24082/genus_from_fqf

comment:21 Changed 4 years ago by git

  • Commit changed from 7cb247ac5b9794bf69ddb8f89e05dcc0780cd520 to 60783f4170d901595ca22b027475a40cd8c20d04

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

6a4c663Merge branch 'u/sbrandhorst/orthogonal_jordan_decomposition_for_torsionquadraticmodules' of git://trac.sagemath.org/sage into t/24082/interaction_torsionquadraticmodules_vs_genus
d0f06b1Merge branch 't/24035/orthogonal_jordan_decomposition_for_torsionquadraticmodules' into t/24082/interaction_torsionquadraticmodules_vs_genus
1b71e11Prototypes for Brown invariant and is_even_genus, incomplete work on even genus from torsion module + signature
18ba56bMerge branch 't/24035/orthogonal_jordan_decomposition_for_torsionquadraticmodules' into t/24082/interaction_torsionquadraticmodules_vs_genus
f6c2548Merge branch 'u/sbrandhorst/is_genus_for_torsion_quadratic_modules' of git://trac.sagemath.org/sage into t/24082/interaction_torsionquadraticmodules_vs_genus
54080b8..
503c8fcMerge branch 'develop' of git://trac.sagemath.org/sage into t/24082/interaction_torsionquadraticmodules_vs_genus
6736c69Merge branch 'develop' into t/24082/interaction_torsionquadraticmodules_vs_genus
bfa9c28Merge branch 'u/sbrandhorst/t/24082/genus_from_fqf' of git://trac.sagemath.org/sage into t/24082/interaction_torsionquadraticmodules_vs_genus
60783f4Cleanup

comment:22 Changed 4 years ago by sbrandhorst

  • Branch changed from u/sbrandhorst/t/24082/genus_from_fqf to u/sbrandhorst/24082/genus_from_fqf
  • Commit changed from 60783f4170d901595ca22b027475a40cd8c20d04 to 8bdc326ba57d1bb9664f63cf165a9e9920cc1afc

comment:23 Changed 4 years ago by git

  • Commit changed from 8bdc326ba57d1bb9664f63cf165a9e9920cc1afc to 93f082e6b6326198a36447e56cfc53faab48f4fa

Branch pushed to git repo; I updated commit sha1. New commits:

93f082eadded a genus method for torsion quadratic forms

comment:24 Changed 4 years ago by sbrandhorst

  • Summary changed from Interaction TorsionQuadraticModules vs Genus to Genus from a TorsionQuadraticModules and a signature pair

comment:25 Changed 4 years ago by sbrandhorst

  • Dependencies changed from #23699,#23916,#24035,#24577,#24576, #24818 to #23699,#23916,#24035,#24577,#24576, #24818, #25875

comment:26 Changed 4 years ago by sbrandhorst

  • Status changed from needs_review to needs_work

comment:27 Changed 4 years ago by git

  • Commit changed from 93f082e6b6326198a36447e56cfc53faab48f4fa to 6807ddb0c51b99f399bb11c62d005f7a1a9d1275

Branch pushed to git repo; I updated commit sha1. New commits:

5fca826Documentation and access methods for the genus
de444a0Merge branch 'u/sbrandhorst/add_access_methods_to_the_genus_' of git://trac.sagemath.org/sage into t/25875/make_genera_immutable_and_add_a_reasonable_constructor
bba1834Construct a genus from a symbol list
b33dd62fix coverage
69b0811Merge branch 't/25682/add_access_methods_to_the_genus_' into t/25875/make_genera_immutable_and_add_a_reasonable_constructor
3b25947Merge branch 'u/sbrandhorst/make_genera_immutable_and_add_a_reasonable_constructor' of git://trac.sagemath.org/sage into t/24082/24082/genus_from_fqf
6807ddbdo not use the normal form but instead the genus constructor

comment:28 Changed 4 years ago by sbrandhorst

  • Cc annahaensch added

comment:29 Changed 4 years ago by git

  • Commit changed from 6807ddb0c51b99f399bb11c62d005f7a1a9d1275 to 4d28633feabde1dacfa0e63a9535add762a0d9fc

Branch pushed to git repo; I updated commit sha1. New commits:

ee22fb2Merge branch 'develop' into t/24082/24082/genus_from_fqf
4d28633Merge branch 'u/sbrandhorst/24082/genus_from_fqf' of git://trac.sagemath.org/sage into t/24082/24082/genus_from_fqf

comment:30 Changed 4 years ago by git

  • Commit changed from 4d28633feabde1dacfa0e63a9535add762a0d9fc to fe7a5fe2b44b5f52343559ac76f3ac01a48d7e32

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

6f393f7docfix
46fc91cMerge branch 'u/sbrandhorst/make_genera_immutable_and_add_a_reasonable_constructor' of git://trac.sagemath.org/sage into t/24889/enumerate_all_genera_of_given_signature__determinant_and_bounded_scale_of_a_jordan_block_
d63626cMerge branch 't/25875/make_genera_immutable_and_add_a_reasonable_constructor' into t/24889/enumerate_all_genera_of_given_signature__determinant_and_bounded_scale_of_a_jordan_block_
e3d938ffix copy import and make output order deterministic
1fd2f27Merge branch 'u/sbrandhorst/enumerate_all_genera_of_given_signature__determinant_and_bounded_scale_of_a_jordan_block_' of git://trac.sagemath.org/sage into t/24889/enumerate_all_genera_of_given_signature__determinant_and_bounded_scale_of_a_jordan_block_
6083fa7Merge branch 'develop' into t/24889/enumerate_all_genera_of_given_signature__determinant_and_bounded_scale_of_a_jordan_block_
b549629fix a doctest
e1080a9level -> scale
2670de6Merge branch 't/24889/enumerate_all_genera_of_given_signature__determinant_and_bounded_scale_of_a_jordan_block_' into t/24082/24082/genus_from_fqf
fe7a5ferework genus from fqf

comment:31 Changed 4 years ago by sbrandhorst

  • Dependencies changed from #23699,#23916,#24035,#24577,#24576, #24818, #25875 to #23699,#23916,#24035,#24577,#24576, #24818, #25875, #24889

comment:32 Changed 4 years ago by sbrandhorst

  • Status changed from needs_work to needs_review

comment:33 Changed 4 years ago by git

  • Commit changed from fe7a5fe2b44b5f52343559ac76f3ac01a48d7e32 to 5000d63e16d7da9ae4b5a17691399ed269092dc1

Branch pushed to git repo; I updated commit sha1. New commits:

7a9b657ZZ instead of int in symbol
5000d63Merge branch 't/24889/enumerate_all_genera_of_given_signature__determinant_and_bounded_scale_of_a_jordan_block_' into t/24082/24082/genus_from_fqf

comment:34 Changed 4 years ago by git

  • Commit changed from 5000d63e16d7da9ae4b5a17691399ed269092dc1 to 9a22c043f8e0795cadb48376402326fb495a6694

Branch pushed to git repo; I updated commit sha1. New commits:

eb1a586Merge branch 'develop' into u/sbrandhorst/24082/genus_from_fqf
9a22c04Merge branch 'u/sbrandhorst/24082/genus_from_fqf' of git://trac.sagemath.org/sage into u/sbrandhorst/24082/genus_from_fqf

comment:35 Changed 3 years ago by git

  • Commit changed from 9a22c043f8e0795cadb48376402326fb495a6694 to 08223a6cc75e59ceed73be34f7216a4aac7f962e

Branch pushed to git repo; I updated commit sha1. New commits:

08223a6Fix a bug in TorsionQuadraticForm where the output

comment:36 Changed 3 years ago by sbrandhorst

Correctness of the code can be checked with the following systematic exhaustion of small examples:

from sage.quadratic_forms.genera.genus import genera
for signature in [(1,0), (1,1),(1,2), (4,0), (0,5)]:
    for det in range(1,257):
        det
        for genus in genera(signature,det,even=False):
            assert genus == genus.discriminant_form().genus(signature)

comment:37 Changed 3 years ago by sbrandhorst

  • Cc tscrim added

comment:38 Changed 3 years ago by tscrim

I think you should add that as a test, although maybe shortening down the values of det?

Also, some nitpicks while-you-are-at-it:

  • The alignment of the import should be at the opening parenthesis level (otherwise it looks strange, and I think this is a PEP8 thing too).
  • The closing ] in block1 and block2 IMO looks better at the same level as the [.
  • The else after the for loops at the end of genus is unnecessary and makes it seem like the code could return a None (whereas you really want it to error out if that if statement is never satisfied).

comment:39 Changed 3 years ago by git

  • Commit changed from 08223a6cc75e59ceed73be34f7216a4aac7f962e to d2a7c60dedd058101bd0b403dd44aefb623b309f

Branch pushed to git repo; I updated commit sha1. New commits:

d2a7c60systematic doctest and nitpicks

comment:40 Changed 3 years ago by sbrandhorst

Thank you. For taking a look at this.

comment:41 Changed 3 years ago by tscrim

You're welcome, it was no problem.

You will need to do the following changes:

-            sage: genera = flatten([genera(s, d, even=False) for d in dets for s in signatures])    # long
-            sage: all(g == g.discriminant_form().genus(g.signature_pair()) for g in genera)
+            sage: genera = flatten([genera(s, d, even=False) for d in dets for s in signatures])  # long time
+            sage: all(g == g.discriminant_form().genus(g.signature_pair()) for g in genera)  # long time
             True
-            """
+        """

Without marking the second test as # long time, you will get an error when running only the short doctests as genera is undefined. Also, you will want to mark that as TESTS:, maybe also

-        A systematic test of lattices of
-        small ranks and determinants::
+        A systematic test of lattices of small ranks and determinants::

comment:42 Changed 3 years ago by git

  • Commit changed from d2a7c60dedd058101bd0b403dd44aefb623b309f to f2cc7e36146e3fdf1ea063604d9937e31084b67a

Branch pushed to git repo; I updated commit sha1. New commits:

f2cc7e3docs

comment:43 Changed 3 years ago by sbrandhorst

tests pass

comment:44 Changed 3 years ago by tscrim

Great, thanks. I will just wait for the patchbot to confirm the doc builds.

comment:45 Changed 3 years ago by sbrandhorst

*ping*

comment:46 Changed 3 years ago by tscrim

This is now getting a doctest failure:

File "src/sage/modules/torsion_quadratic_module.py", line 575, in sage.modules.torsion_quadratic_module.TorsionQuadraticModule.genus
Failed example:
    D.genus((1,0))
Expected:
    Traceback (most recent call last):
    ...
    ValueError: this discriminant form and signature do not define a genus
Got:
    <BLANKLINE>
    Traceback (most recent call last):
      File "/home/worker/sage-patchbot/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 671, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/worker/sage-patchbot/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1095, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.modules.torsion_quadratic_module.TorsionQuadraticModule.genus[12]>", line 1, in <module>
        D.genus((Integer(1),Integer(0)))
      File "/home/worker/sage-patchbot/local/lib/python2.7/site-packages/sage/modules/torsion_quadratic_module.py", line 630, in genus
        genus = GenusSymbol_global_ring(signature_pair, local_symbols)
      File "/home/worker/sage-patchbot/local/lib/python2.7/site-packages/sage/quadratic_forms/genera/genus.py", line 1980, in __init__
        raise TypeError("all local symbols must be of the same dimension")
    TypeError: all local symbols must be of the same dimension

comment:47 Changed 3 years ago by git

  • Commit changed from f2cc7e36146e3fdf1ea063604d9937e31084b67a to 3ad32006e86c6874b3f498692e73f7fb1d7c09e1

Branch pushed to git repo; I updated commit sha1. New commits:

3ad3200Added a reference and fixed the doctests

comment:48 Changed 3 years ago by sbrandhorst

Tests pass & doc builds on my machine

comment:49 Changed 3 years ago by sbrandhorst

and a green bot

comment:50 Changed 3 years ago by tscrim

  • Milestone changed from sage-8.1 to sage-8.8
  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

Thank you. LGTM.

comment:51 Changed 3 years ago by vbraun

  • Branch changed from u/sbrandhorst/24082/genus_from_fqf to 3ad32006e86c6874b3f498692e73f7fb1d7c09e1
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.