Opened 4 years ago
Closed 3 years ago
#25776 closed defect (fixed)
Better printing for the genus symbol
Reported by:  sbrandhorst  Owned by:  

Priority:  major  Milestone:  sage8.4 
Component:  quadratic forms  Keywords:  genus 
Cc:  Merged in:  
Authors:  Simon Brandhorst  Reviewers:  Travis Scrimshaw 
Report Upstream:  N/A  Work issues:  
Branch:  c979627 (Commits, GitHub, GitLab)  Commit:  c979627303332adc59c486d35fcf5490b32c83b4 
Dependencies:  #25682  Stopgaps: 
Description (last modified by )
sage: G Genus of [ 2 0 0] [ 0 2 0] [ 0 0 64] Genus symbol at 2: [2^2]_1 :[64^1]_1
The correct symbol is
[2^2]_2:[64^1]_1
Moreover the signature should be printed and if the representative is very large it can be suppressed.
Change History (15)
comment:1 Changed 4 years ago by
 Branch set to u/sbrandhorst/bug_in_printing_of_a_genus_symbol
comment:2 Changed 4 years ago by
 Commit set to b23a8d21301bde7dfcb61226a55edf59c8883e5d
 Status changed from new to needs_review
comment:3 Changed 3 years ago by
 Milestone changed from sage8.3 to sage8.4
comment:4 Changed 3 years ago by
 Reviewers set to Travis Scrimshaw
LGTM (I don't understand the math, but the code matches what you put in the comments.). Once you add the author name, you can set a positive review.
comment:5 Changed 3 years ago by
comment:6 Changed 3 years ago by
I just noticed another bug:
sage: a=matrix.diagonal([1,3]) sage: b=matrix(ZZ,2,[2,1,1,2])*2 sage: c = matrix.block_diagonal([a,b]) sage: Genus(c) Genus of [1 00 0] [0 30 0] [+] [0 04 2] [0 02 4] Genus symbol at 2: [1^2]_02^2 Genus symbol at 3: 1^2 3^2
Here
Genus symbol at 2: [1^2]_0 2^2
is better.
Also it would be good to print the signature of the quadratic form and
moreover if the representative is greater than 20 x 20
or something to suppress it  just like our matrices.
comment:7 Changed 3 years ago by
 Summary changed from bug in printing of a genus symbol to Better printing for the genus symbol
comment:8 Changed 3 years ago by
 Commit changed from b23a8d21301bde7dfcb61226a55edf59c8883e5d to 7af4d4a9c1934aec80086c7ae451984a62b18698
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
b33dd62  fix coverage

d201139  Merge branch 'u/sbrandhorst/add_access_methods_to_the_genus_' of git://trac.sagemath.org/sage into t/25682/add_access_methods_to_the_genus_

3f22518  Various docfixes

d689be4  Merge branch 'develop' into t/25682/add_access_methods_to_the_genus_

851e23c  import Genus into the global namespace and small docfixed

5089a18  signature method and docfixes

9d6efa3  fix doc and revert to signature_pair_of_matrix to avoid a deprecation

5abf9ff  Raw strings for documentation.

3fc0b47  Merge commit '5abf9ffddef8b6dff940cd2c6820193959a7c870' of git://trac.sagemath.org/sage into u/sbrandhorst/25776

7af4d4a  Add Signature to the printing.

comment:9 Changed 3 years ago by
 Dependencies set to #25682
comment:10 Changed 3 years ago by
 Description modified (diff)
comment:11 Changed 3 years ago by
Nitpicking: It would be a much nicer test output to run latex(G)
instead of G.__latex__()
(this is also a often done test). Similarly repr(s)
instead of s.__repr__()
. It would also be more useful to use raw strings when writing the latex strings, e.g., "\\\\"
> r"\\"
.
Otherwise LGTM (i.e., feel free to set a positive review if you don't want to change these things).
comment:12 Changed 3 years ago by
 Commit changed from 7af4d4a9c1934aec80086c7ae451984a62b18698 to c979627303332adc59c486d35fcf5490b32c83b4
Branch pushed to git repo; I updated commit sha1. New commits:
c979627  nitpicks

comment:13 Changed 3 years ago by
thank you. Those tricks were new to me.
comment:14 Changed 3 years ago by
 Status changed from needs_review to positive_review
comment:15 Changed 3 years ago by
 Branch changed from u/sbrandhorst/bug_in_printing_of_a_genus_symbol to c979627303332adc59c486d35fcf5490b32c83b4
 Resolution set to fixed
 Status changed from positive_review to closed
New commits:
print the correct oddity of a compartment