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:  sage8.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: 
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
 Dependencies set to #23699
comment:2 Changed 5 years ago by
 Dependencies changed from #23699 to #23699,#23916
comment:3 Changed 5 years ago by
 Dependencies changed from #23699,#23916 to #23699,#23916,#24035
comment:4 Changed 5 years ago by
 Branch set to u/sbrandhorst/interaction_torsionquadraticmodules_vs_genus
comment:5 Changed 5 years ago by
 Commit set to 1b71e11643be41ffee0885953dbeb5d8c04619a3
 Dependencies changed from #23699,#23916,#24035 to #23699,#23916,#24035,#24577,#24576
comment:6 Changed 5 years ago by
This ticket is now split into several subtasks to keep reviewing easy.
comment:7 Changed 5 years ago by
 Commit changed from 1b71e11643be41ffee0885953dbeb5d8c04619a3 to 54080b84a415d96d6961f5164f44aae906bf3f8e
Branch pushed to git repo; I updated commit sha1. New commits:
30abe3d  Mostly documentation and conventions. Small bugfix

1ae8c8b  Lots and lots of documentation.

52df7c6  Some extra docs.

18ba56b  Merge branch 't/24035/orthogonal_jordan_decomposition_for_torsionquadraticmodules' into t/24082/interaction_torsionquadraticmodules_vs_genus

097816b  Merge branch 'u/sbrandhorst/orthogonal_jordan_decomposition_for_torsionquadraticmodules' of git://trac.sagemath.org/sage into t/24576/brown_invariant_of_a_torsionquadraticmodule

2c406fb  The Brown invariant.

22c2c78  First prototype. Odd lattices are missing.

f6c2548  Merge 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
 Commit changed from 54080b84a415d96d6961f5164f44aae906bf3f8e to 503c8fccee9ef7dae773dcd6489e9c5d8137e659
Branch pushed to git repo; I updated commit sha1. New commits:
503c8fc  Merge branch 'develop' of git://trac.sagemath.org/sage into t/24082/interaction_torsionquadraticmodules_vs_genus

comment:9 Changed 4 years ago by
 Branch changed from u/sbrandhorst/interaction_torsionquadraticmodules_vs_genus to sbrandhorst/t/24082
 Commit 503c8fccee9ef7dae773dcd6489e9c5d8137e659 deleted
comment:10 Changed 4 years ago by
 Branch changed from sbrandhorst/t/24082 to u/sbrandhorst/t/24082/genus_from_fqf
comment:11 Changed 4 years ago by
 Commit set to f949d2141e032b3bc8c686ddf7cc6f4e58575aa2
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
2c406fb  The Brown invariant.

b2acff7  Merge branch 'develop' of git://trac.sagemath.org/sage into t/24576/brown_invariant_of_a_torsionquadraticmodule

fb9153e  Merge commit '9ae1c1369b171d417e7a291055fa747335244abe' of git://trac.sagemath.org/sage into t/24576/brown_invariant_of_a_torsionquadraticmodule

b385271  Merge branch 'u/sbrandhorst/brown_invariant_of_a_torsionquadraticmodule' of git://trac.sagemath.org/sage into u/sbrandhorst/t/24082/genus_from_fqf

22c2c78  First prototype. Odd lattices are missing.

a82b4b3  Merge branch 'develop' of git://trac.sagemath.org/sage into t/24577/is_genus_for_torsion_quadratic_modules

1ccb5cd  Merge branch 'develop' of git://trac.sagemath.org/sage into t/24577/is_genus_for_torsion_quadratic_modules

5598294  Cosmetic changes.

2251c52  Added doctest.

f949d21  Merge 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
 Commit changed from f949d2141e032b3bc8c686ddf7cc6f4e58575aa2 to 7f2fcf432f5d2a7872da6ff3bb595426dc0ae4c8
Branch pushed to git repo; I updated commit sha1. New commits:
7f2fcf4  First working version

comment:13 Changed 4 years ago by
 Dependencies changed from #23699,#23916,#24035,#24577,#24576 to #23699,#23916,#24035,#24577,#24576, #24818
comment:14 Changed 4 years ago by
 Commit changed from 7f2fcf432f5d2a7872da6ff3bb595426dc0ae4c8 to a25e2976385cdae7310a0be01d54055d55ad66d3
comment:15 Changed 4 years ago by
comment:16 Changed 4 years ago by
 Commit changed from a25e2976385cdae7310a0be01d54055d55ad66d3 to 7fb07f0720ad3b35acde0f42f5c480775ddc420a
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
edbd3c3  Merge branch 't/24577/is_genus_for_torsion_quadratic_modules' into t/24082/t/24082/genus_from_fqf

daada4e  Merge branch 't/23699/torsion_quadratic_module_symmetric' into t/24083/factory_function_for_torsionquadraticforms

a7c43f4  a first try

d320c40  Merge branch 'develop' of git://trac.sagemath.org/sage into t/24083/factory_function_for_torsionquadraticforms

cbcd8d1  Merge branch 'develop' into t/24083/factory_function_for_torsionquadraticforms

aeb35fa  added TorsionQuadraticForm for torsion quadratic forms

328e543  Added TorsionQuadraticForm for torsion quadratic modules

c4bed4f  Changed only documentation and indentation

73bd99e  Added TorsionQuadraticForm to global name space

7fb07f0  Merge 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
 Commit changed from 7fb07f0720ad3b35acde0f42f5c480775ddc420a to 4f8e01c6aeefdbc4e0c5fa4241e7d94e20b6df35
Branch pushed to git repo; I updated commit sha1. New commits:
4f8e01c  Even genera from torsion quadratic forms. First working version.

comment:18 Changed 4 years ago by
Todo:
 odd genera
comment:19 Changed 4 years ago by
 Status changed from new to needs_review
comment:20 Changed 4 years ago by
 Commit changed from 4f8e01c6aeefdbc4e0c5fa4241e7d94e20b6df35 to 7cb247ac5b9794bf69ddb8f89e05dcc0780cd520
Branch pushed to git repo; I updated commit sha1. New commits:
7cb247a  Merge branch 'develop' into t/24082/t/24082/genus_from_fqf

comment:21 Changed 4 years ago by
 Commit changed from 7cb247ac5b9794bf69ddb8f89e05dcc0780cd520 to 60783f4170d901595ca22b027475a40cd8c20d04
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
6a4c663  Merge branch 'u/sbrandhorst/orthogonal_jordan_decomposition_for_torsionquadraticmodules' of git://trac.sagemath.org/sage into t/24082/interaction_torsionquadraticmodules_vs_genus

d0f06b1  Merge branch 't/24035/orthogonal_jordan_decomposition_for_torsionquadraticmodules' into t/24082/interaction_torsionquadraticmodules_vs_genus

1b71e11  Prototypes for Brown invariant and is_even_genus, incomplete work on even genus from torsion module + signature

18ba56b  Merge branch 't/24035/orthogonal_jordan_decomposition_for_torsionquadraticmodules' into t/24082/interaction_torsionquadraticmodules_vs_genus

f6c2548  Merge branch 'u/sbrandhorst/is_genus_for_torsion_quadratic_modules' of git://trac.sagemath.org/sage into t/24082/interaction_torsionquadraticmodules_vs_genus

54080b8  ..

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

6736c69  Merge branch 'develop' into t/24082/interaction_torsionquadraticmodules_vs_genus

bfa9c28  Merge branch 'u/sbrandhorst/t/24082/genus_from_fqf' of git://trac.sagemath.org/sage into t/24082/interaction_torsionquadraticmodules_vs_genus

60783f4  Cleanup

comment:22 Changed 4 years ago by
 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
 Commit changed from 8bdc326ba57d1bb9664f63cf165a9e9920cc1afc to 93f082e6b6326198a36447e56cfc53faab48f4fa
Branch pushed to git repo; I updated commit sha1. New commits:
93f082e  added a genus method for torsion quadratic forms

comment:24 Changed 4 years ago by
 Summary changed from Interaction TorsionQuadraticModules vs Genus to Genus from a TorsionQuadraticModules and a signature pair
comment:25 Changed 4 years ago by
 Dependencies changed from #23699,#23916,#24035,#24577,#24576, #24818 to #23699,#23916,#24035,#24577,#24576, #24818, #25875
comment:26 Changed 4 years ago by
 Status changed from needs_review to needs_work
comment:27 Changed 4 years ago by
 Commit changed from 93f082e6b6326198a36447e56cfc53faab48f4fa to 6807ddb0c51b99f399bb11c62d005f7a1a9d1275
Branch pushed to git repo; I updated commit sha1. New commits:
5fca826  Documentation and access methods for the genus

de444a0  Merge 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

bba1834  Construct a genus from a symbol list

b33dd62  fix coverage

69b0811  Merge branch 't/25682/add_access_methods_to_the_genus_' into t/25875/make_genera_immutable_and_add_a_reasonable_constructor

3b25947  Merge branch 'u/sbrandhorst/make_genera_immutable_and_add_a_reasonable_constructor' of git://trac.sagemath.org/sage into t/24082/24082/genus_from_fqf

6807ddb  do not use the normal form but instead the genus constructor

comment:28 Changed 4 years ago by
 Cc annahaensch added
comment:29 Changed 4 years ago by
 Commit changed from 6807ddb0c51b99f399bb11c62d005f7a1a9d1275 to 4d28633feabde1dacfa0e63a9535add762a0d9fc
comment:30 Changed 4 years ago by
 Commit changed from 4d28633feabde1dacfa0e63a9535add762a0d9fc to fe7a5fe2b44b5f52343559ac76f3ac01a48d7e32
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
6f393f7  docfix

46fc91c  Merge 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_

d63626c  Merge 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_

e3d938f  fix copy import and make output order deterministic

1fd2f27  Merge 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_

6083fa7  Merge branch 'develop' into t/24889/enumerate_all_genera_of_given_signature__determinant_and_bounded_scale_of_a_jordan_block_

b549629  fix a doctest

e1080a9  level > scale

2670de6  Merge branch 't/24889/enumerate_all_genera_of_given_signature__determinant_and_bounded_scale_of_a_jordan_block_' into t/24082/24082/genus_from_fqf

fe7a5fe  rework genus from fqf

comment:31 Changed 4 years ago by
 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
 Status changed from needs_work to needs_review
comment:33 Changed 4 years ago by
 Commit changed from fe7a5fe2b44b5f52343559ac76f3ac01a48d7e32 to 5000d63e16d7da9ae4b5a17691399ed269092dc1
comment:34 Changed 4 years ago by
 Commit changed from 5000d63e16d7da9ae4b5a17691399ed269092dc1 to 9a22c043f8e0795cadb48376402326fb495a6694
comment:35 Changed 3 years ago by
 Commit changed from 9a22c043f8e0795cadb48376402326fb495a6694 to 08223a6cc75e59ceed73be34f7216a4aac7f962e
Branch pushed to git repo; I updated commit sha1. New commits:
08223a6  Fix a bug in TorsionQuadraticForm where the output

comment:36 Changed 3 years ago by
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
 Cc tscrim added
comment:38 Changed 3 years ago by
I think you should add that as a test, although maybe shortening down the values of det
?
Also, some nitpicks whileyouareatit:
 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
]
inblock1
andblock2
IMO looks better at the same level as the[
.  The
else
after thefor
loops at the end ofgenus
is unnecessary and makes it seem like the code could return aNone
(whereas you really want it to error out if thatif
statement is never satisfied).
comment:39 Changed 3 years ago by
 Commit changed from 08223a6cc75e59ceed73be34f7216a4aac7f962e to d2a7c60dedd058101bd0b403dd44aefb623b309f
Branch pushed to git repo; I updated commit sha1. New commits:
d2a7c60  systematic doctest and nitpicks

comment:40 Changed 3 years ago by
Thank you. For taking a look at this.
comment:41 Changed 3 years ago by
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
 Commit changed from d2a7c60dedd058101bd0b403dd44aefb623b309f to f2cc7e36146e3fdf1ea063604d9937e31084b67a
Branch pushed to git repo; I updated commit sha1. New commits:
f2cc7e3  docs

comment:43 Changed 3 years ago by
tests pass
comment:44 Changed 3 years ago by
Great, thanks. I will just wait for the patchbot to confirm the doc builds.
comment:45 Changed 3 years ago by
*ping*
comment:46 Changed 3 years ago by
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/sagepatchbot/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 671, in _run self.compile_and_execute(example, compiler, test.globs) File "/home/worker/sagepatchbot/local/lib/python2.7/sitepackages/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/sagepatchbot/local/lib/python2.7/sitepackages/sage/modules/torsion_quadratic_module.py", line 630, in genus genus = GenusSymbol_global_ring(signature_pair, local_symbols) File "/home/worker/sagepatchbot/local/lib/python2.7/sitepackages/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
 Commit changed from f2cc7e36146e3fdf1ea063604d9937e31084b67a to 3ad32006e86c6874b3f498692e73f7fb1d7c09e1
Branch pushed to git repo; I updated commit sha1. New commits:
3ad3200  Added a reference and fixed the doctests

comment:48 Changed 3 years ago by
Tests pass & doc builds on my machine
comment:49 Changed 3 years ago by
and a green bot
comment:50 Changed 3 years ago by
 Milestone changed from sage8.1 to sage8.8
 Reviewers set to Travis Scrimshaw
 Status changed from needs_review to positive_review
Thank you. LGTM.
comment:51 Changed 3 years ago by
 Branch changed from u/sbrandhorst/24082/genus_from_fqf to 3ad32006e86c6874b3f498692e73f7fb1d7c09e1
 Resolution set to fixed
 Status changed from positive_review to closed
Last 10 new commits:
Relations of 2adic forms
Partial normal form implemented.
Full normal form  first prototype
Bugfixes and documentation
Optimizations and documentation
renamed orthogonal_gens to normal_form
Change in convention in Torsion quadratic module normal form.
Setting minimal padic precision to 3
Merge branch 't/24035/orthogonal_jordan_decomposition_for_torsionquadraticmodules' into t/24082/interaction_torsionquadraticmodules_vs_genus
Prototypes for Brown invariant and is_even_genus, incomplete work on even genus from torsion module + signature