Opened 5 years ago

Closed 5 years ago

#23916 closed enhancement (fixed)

Pretty printing and latex for Genera of quadratic forms

Reported by: Simon Brandhorst Owned by:
Priority: minor Milestone: sage-8.1
Component: quadratic forms Keywords: sd91
Cc: Merged in:
Authors: Simon Brandhorst Reviewers: Kiran Kedlaya
Report Upstream: N/A Work issues:
Branch: aeca837 (Commits, GitHub, GitLab) Commit: aeca8374cd3175b28e9b8a7e1a5af88a883b452f
Dependencies: #23955 Stopgaps:

Status badges

Description

Currently:

sage: sage.quadratic_forms.genera.genus.Genus(Matrix(ZZ,2,2,[2,-1,-1,2]))

Genus of [ 2 -1]
[-1  2]

Better:

sage: sage.quadratic_forms.genera.genus.Genus(Matrix(ZZ,2,2,[2,-1,-1,2]))
Genus of 
[ 2 -1]
[-1  2]
Conway Sloane Genus Symbol:
II( 3^-1 )

See Conway Sloane Spherepackings lattices and groups. Chapter 15, 7.8

Change History (29)

comment:1 Changed 5 years ago by Simon Brandhorst

Keywords: sd91 added

comment:2 Changed 5 years ago by Simon Brandhorst

Branch: u/sbrandhorst/pretty_printing_and_latex_for_genera_of_quadratic_forms

comment:3 Changed 5 years ago by Simon Brandhorst

Authors: Simon Brandhorst
Commit: d9f19ba3b8cacc818cd05fa4b9e30b256fc68060

New commits:

d9f19baPrinting representation now matches the printing in Conway Sloane's Spherepackings, Lattices and Groups

comment:4 Changed 5 years ago by git

Commit: d9f19ba3b8cacc818cd05fa4b9e30b256fc6806030a28ce3ac9839fcfa3a9913537ab8dbb1d749a3

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

30a28ceAdded Latex representation. Still need doctests.

comment:5 Changed 5 years ago by git

Commit: 30a28ce3ac9839fcfa3a9913537ab8dbb1d749a3d9236f7f81b65f305eb254d8a479c3b0364cb6b9

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

d9236f7Added the latex representation of a Genus

comment:6 Changed 5 years ago by Simon Brandhorst

Status: newneeds_review

New commits:

d9236f7Added the latex representation of a Genus

comment:7 Changed 5 years ago by Kiran Kedlaya

Branch: u/sbrandhorst/pretty_printing_and_latex_for_genera_of_quadratic_formsu/kedlaya/pretty_printing_and_latex_for_genera_of_quadratic_forms

comment:8 Changed 5 years ago by Kiran Kedlaya

Commit: d9236f7f81b65f305eb254d8a479c3b0364cb6b92f9048f048208b146ee0925db210c05bb2c04086

Please check the signs in the docstrings. If they are all correct, then give this a positive review (or preferably, wait for patchbot to concur).


New commits:

2f9048fSpacing and other corrections

comment:9 Changed 5 years ago by Kiran Kedlaya

Status: needs_reviewneeds_work

Oops, a few more doctest failures in src/sage/quadratic_forms/quadratic_form__genus.py.

comment:10 Changed 5 years ago by Simon Brandhorst

Branch: u/kedlaya/pretty_printing_and_latex_for_genera_of_quadratic_formsu/sbrandhorst/pretty_printing_and_latex_for_genera_of_quadratic_forms

comment:11 Changed 5 years ago by Simon Brandhorst

Commit: 2f9048f048208b146ee0925db210c05bb2c04086fda4bcd3579184857c1e26815a3b547782c4ef79
Dependencies: #23955

New commits:

88bdf3cFixed two bugs in the genus class
8e62210Seems that is_2_adic_genus did not assume the input to be canonical but instead did not reduce the determinants mod 8. Changed that.
a7cf87eMerge branch 'u/bhutz/projective_infinity' of git://trac.sagemath.org/sage into t/23376/equality_testing_of_genera_of_quadratic_forms_over_zz_changes_the_genus_and_produces_false_results
24a5b0bDoctest formatting.
c4ced01Merge branch 'u/sbrandhorst/equality_testing_of_genera_of_quadratic_forms_over_zz_changes_the_genus_and_produces_false_results' of git://trac.sagemath.org/sage into t/23916/pretty_printing_and_latex_for_genera_of_quadratic_forms
fda4bcdChanged the printing representation to use the canonical symbol instead of the symbol. There is a bug in the compartments() method which prevents meaningfull doctest. We have to wait for that to be fixed first.

comment:12 Changed 5 years ago by git

Commit: fda4bcd3579184857c1e26815a3b547782c4ef79f81fb90f5ad4b409e811eb730a84f2da1460e36b

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

22c83b7Rewrote canonical_2_adic_trains()
711bbf0Removed unnecessary computations of compartments for the train function.
7dff05eResolved merge conflict in the doc tests
c3b136cAdapted the doctests and modified them by hand where necessary
f81fb90Cleanup in _latex_

comment:13 Changed 5 years ago by Simon Brandhorst

Status: needs_workneeds_review

I did check the signs in the docstrings. They are as intended now.

comment:14 Changed 5 years ago by Kiran Kedlaya

Reviewers: Kiran Kedlaya
Status: needs_reviewpositive_review

All tests pass on k8s. Positive review.

comment:15 Changed 5 years ago by Volker Braun

Status: positive_reviewneeds_work

Merge conflict

comment:16 Changed 5 years ago by git

Commit: f81fb90f5ad4b409e811eb730a84f2da1460e36b4dcf91afb5598c682514bc8a72f0693737976cbc

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

4dcf91aMerge branch 'develop' into t/23916/pretty_printing_and_latex_for_genera_of_quadratic_forms

comment:17 Changed 5 years ago by git

Commit: 4dcf91afb5598c682514bc8a72f0693737976cbc4b9249ac102265b890a027a4ba54325da57ed191

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

4b9249aMerge branch 'develop' into t/23916/pretty_printing_and_latex_for_genera_of_quadratic_forms

comment:18 Changed 5 years ago by Simon Brandhorst

Status: needs_workneeds_review

comment:19 Changed 5 years ago by Kiran Kedlaya

Patchbot is complaining about coverage. I think it's because the method _latex_ in genus.py only has tests, whereas it should also have at least one example.

comment:20 Changed 5 years ago by Simon Brandhorst

I guess we can make that an example instead.

comment:21 Changed 5 years ago by Kiran Kedlaya

Branch: u/sbrandhorst/pretty_printing_and_latex_for_genera_of_quadratic_formsu/kedlaya/pretty_printing_and_latex_for_genera_of_quadratic_forms

comment:22 Changed 5 years ago by Simon Brandhorst

Branch: u/kedlaya/pretty_printing_and_latex_for_genera_of_quadratic_formsu/sbrandhorst/pretty_printing_and_latex_for_genera_of_quadratic_forms

comment:23 Changed 5 years ago by git

Commit: 4b9249ac102265b890a027a4ba54325da57ed1917d3b712a9530fdb577c24bba2eb3d1a86ad0acb7

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

b8976dfChange test to example in _latex_
7d3b712Merge branch 'u/kedlaya/pretty_printing_and_latex_for_genera_of_quadratic_forms' of git://trac.sagemath.org/sage into t/23916/pretty_printing_and_latex_for_genera_of_quadratic_forms

comment:24 Changed 5 years ago by Kiran Kedlaya

I'm getting one doctest failure. Is this just a case where the output needs to be updated?

File "src/sage/modules/free_quadratic_module_integer_symmetric.py", line 437, in sage.modules.free_quadratic_module_integer_symmetric.FreeQuadraticModule_integer_symmetric.genus
Failed example:
    L.genus()
Expected:
    Genus of [0 1]
    [1 0]
Got:
    Genus of
    [0 1]
    [1 0]
    Genus symbol at 2:    1^2

comment:25 Changed 5 years ago by Kiran Kedlaya

Status: needs_reviewneeds_work

comment:26 Changed 5 years ago by git

Commit: 7d3b712a9530fdb577c24bba2eb3d1a86ad0acb7aeca8374cd3175b28e9b8a7e1a5af88a883b452f

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

aeca837updated output

comment:27 Changed 5 years ago by Simon Brandhorst

Status: needs_workneeds_review

comment:28 Changed 5 years ago by Kiran Kedlaya

Status: needs_reviewpositive_review

All tests now passing on k8s. Positive review.

comment:29 Changed 5 years ago by Volker Braun

Branch: u/sbrandhorst/pretty_printing_and_latex_for_genera_of_quadratic_formsaeca8374cd3175b28e9b8a7e1a5af88a883b452f
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.