Opened 2 years ago

Closed 2 years ago

#23916 closed enhancement (fixed)

Pretty printing and latex for Genera of quadratic forms

Reported by: sbrandhorst 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) Commit: aeca8374cd3175b28e9b8a7e1a5af88a883b452f
Dependencies: #23955 Stopgaps:

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 2 years ago by sbrandhorst

  • Keywords sd91 added

comment:2 Changed 2 years ago by sbrandhorst

  • Branch set to u/sbrandhorst/pretty_printing_and_latex_for_genera_of_quadratic_forms

comment:3 Changed 2 years ago by sbrandhorst

  • Authors set to Simon Brandhorst
  • Commit set to d9f19ba3b8cacc818cd05fa4b9e30b256fc68060

New commits:

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

comment:4 Changed 2 years ago by git

  • Commit changed from d9f19ba3b8cacc818cd05fa4b9e30b256fc68060 to 30a28ce3ac9839fcfa3a9913537ab8dbb1d749a3

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

30a28ceAdded Latex representation. Still need doctests.

comment:5 Changed 2 years ago by git

  • Commit changed from 30a28ce3ac9839fcfa3a9913537ab8dbb1d749a3 to d9236f7f81b65f305eb254d8a479c3b0364cb6b9

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

d9236f7Added the latex representation of a Genus

comment:6 Changed 2 years ago by sbrandhorst

  • Status changed from new to needs_review

New commits:

d9236f7Added the latex representation of a Genus

comment:7 Changed 2 years ago by kedlaya

  • Branch changed from u/sbrandhorst/pretty_printing_and_latex_for_genera_of_quadratic_forms to u/kedlaya/pretty_printing_and_latex_for_genera_of_quadratic_forms

comment:8 Changed 2 years ago by kedlaya

  • Commit changed from d9236f7f81b65f305eb254d8a479c3b0364cb6b9 to 2f9048f048208b146ee0925db210c05bb2c04086

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 2 years ago by kedlaya

  • Status changed from needs_review to needs_work

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

comment:10 Changed 2 years ago by sbrandhorst

  • Branch changed from u/kedlaya/pretty_printing_and_latex_for_genera_of_quadratic_forms to u/sbrandhorst/pretty_printing_and_latex_for_genera_of_quadratic_forms

comment:11 Changed 2 years ago by sbrandhorst

  • Commit changed from 2f9048f048208b146ee0925db210c05bb2c04086 to fda4bcd3579184857c1e26815a3b547782c4ef79
  • Dependencies set to #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 2 years ago by git

  • Commit changed from fda4bcd3579184857c1e26815a3b547782c4ef79 to f81fb90f5ad4b409e811eb730a84f2da1460e36b

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 2 years ago by sbrandhorst

  • Status changed from needs_work to needs_review

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

comment:14 Changed 2 years ago by kedlaya

  • Reviewers set to Kiran Kedlaya
  • Status changed from needs_review to positive_review

All tests pass on k8s. Positive review.

comment:15 Changed 2 years ago by vbraun

  • Status changed from positive_review to needs_work

Merge conflict

comment:16 Changed 2 years ago by git

  • Commit changed from f81fb90f5ad4b409e811eb730a84f2da1460e36b to 4dcf91afb5598c682514bc8a72f0693737976cbc

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 2 years ago by git

  • Commit changed from 4dcf91afb5598c682514bc8a72f0693737976cbc to 4b9249ac102265b890a027a4ba54325da57ed191

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 2 years ago by sbrandhorst

  • Status changed from needs_work to needs_review

comment:19 Changed 2 years ago by 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 2 years ago by sbrandhorst

I guess we can make that an example instead.

comment:21 Changed 2 years ago by kedlaya

  • Branch changed from u/sbrandhorst/pretty_printing_and_latex_for_genera_of_quadratic_forms to u/kedlaya/pretty_printing_and_latex_for_genera_of_quadratic_forms

comment:22 Changed 2 years ago by sbrandhorst

  • Branch changed from u/kedlaya/pretty_printing_and_latex_for_genera_of_quadratic_forms to u/sbrandhorst/pretty_printing_and_latex_for_genera_of_quadratic_forms

comment:23 Changed 2 years ago by git

  • Commit changed from 4b9249ac102265b890a027a4ba54325da57ed191 to 7d3b712a9530fdb577c24bba2eb3d1a86ad0acb7

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 2 years ago by 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 2 years ago by kedlaya

  • Status changed from needs_review to needs_work

comment:26 Changed 2 years ago by git

  • Commit changed from 7d3b712a9530fdb577c24bba2eb3d1a86ad0acb7 to aeca8374cd3175b28e9b8a7e1a5af88a883b452f

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

aeca837updated output

comment:27 Changed 2 years ago by sbrandhorst

  • Status changed from needs_work to needs_review

comment:28 Changed 2 years ago by kedlaya

  • Status changed from needs_review to positive_review

All tests now passing on k8s. Positive review.

comment:29 Changed 2 years ago by vbraun

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