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: sage-8.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:

Status badges

Description (last modified by sbrandhorst)

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 sbrandhorst

  • Branch set to u/sbrandhorst/bug_in_printing_of_a_genus_symbol

comment:2 Changed 4 years ago by sbrandhorst

  • Commit set to b23a8d21301bde7dfcb61226a55edf59c8883e5d
  • Status changed from new to needs_review

New commits:

b23a8d2print the correct oddity of a compartment

comment:3 Changed 3 years ago by sbrandhorst

  • Milestone changed from sage-8.3 to sage-8.4

comment:4 Changed 3 years ago by tscrim

  • 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 sbrandhorst

  • Authors set to Simon Brandhorst

comment:6 Changed 3 years ago by sbrandhorst

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 0|0 0]
[0 3|0 0]
[---+---]
[0 0|4 2]
[0 0|2 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.

Last edited 3 years ago by sbrandhorst (previous) (diff)

comment:7 Changed 3 years ago by sbrandhorst

  • Summary changed from bug in printing of a genus symbol to Better printing for the genus symbol

comment:8 Changed 3 years ago by git

  • Commit changed from b23a8d21301bde7dfcb61226a55edf59c8883e5d to 7af4d4a9c1934aec80086c7ae451984a62b18698

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

b33dd62fix coverage
d201139Merge branch 'u/sbrandhorst/add_access_methods_to_the_genus_' of git://trac.sagemath.org/sage into t/25682/add_access_methods_to_the_genus_
3f22518Various docfixes
d689be4Merge branch 'develop' into t/25682/add_access_methods_to_the_genus_
851e23cimport Genus into the global namespace and small docfixed
5089a18signature method and docfixes
9d6efa3fix doc and revert to signature_pair_of_matrix to avoid a deprecation
5abf9ffRaw strings for documentation.
3fc0b47Merge commit '5abf9ffddef8b6dff940cd2c6820193959a7c870' of git://trac.sagemath.org/sage into u/sbrandhorst/25776
7af4d4aAdd Signature to the printing.

comment:9 Changed 3 years ago by sbrandhorst

  • Dependencies set to #25682

comment:10 Changed 3 years ago by sbrandhorst

  • Description modified (diff)

comment:11 Changed 3 years ago by tscrim

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 git

  • Commit changed from 7af4d4a9c1934aec80086c7ae451984a62b18698 to c979627303332adc59c486d35fcf5490b32c83b4

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

c979627nitpicks

comment:13 Changed 3 years ago by sbrandhorst

thank you. Those tricks were new to me.

comment:14 Changed 3 years ago by tscrim

  • Status changed from needs_review to positive_review

comment:15 Changed 3 years ago by vbraun

  • 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
Note: See TracTickets for help on using tickets.