Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better printing for the genus symbol #25776

Closed
simonbrandhorst opened this issue Jul 5, 2018 · 16 comments
Closed

Better printing for the genus symbol #25776

simonbrandhorst opened this issue Jul 5, 2018 · 16 comments

Comments

@simonbrandhorst
Copy link

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.

Depends on #25682

Component: quadratic forms

Keywords: genus

Author: Simon Brandhorst

Branch/Commit: c979627

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/25776

@simonbrandhorst
Copy link
Author

@simonbrandhorst
Copy link
Author

Commit: b23a8d2

@simonbrandhorst
Copy link
Author

New commits:

b23a8d2print the correct oddity of a compartment

@tscrim
Copy link
Collaborator

tscrim commented Oct 4, 2018

comment:4

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.

@tscrim
Copy link
Collaborator

tscrim commented Oct 4, 2018

Reviewer: Travis Scrimshaw

@simonbrandhorst
Copy link
Author

Author: Simon Brandhorst

@simonbrandhorst
Copy link
Author

comment:6

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.

@simonbrandhorst simonbrandhorst changed the title bug in printing of a genus symbol Better printing for the genus symbol Oct 5, 2018
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 5, 2018

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.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 5, 2018

Changed commit from b23a8d2 to 7af4d4a

@simonbrandhorst
Copy link
Author

Dependencies: #25682

@simonbrandhorst

This comment has been minimized.

@tscrim
Copy link
Collaborator

tscrim commented Oct 5, 2018

comment:11

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).

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 5, 2018

Changed commit from 7af4d4a to c979627

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 5, 2018

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

c979627nitpicks

@simonbrandhorst
Copy link
Author

comment:13

thank you. Those tricks were new to me.

@vbraun
Copy link
Member

vbraun commented Oct 6, 2018

Changed branch from u/sbrandhorst/bug_in_printing_of_a_genus_symbol to c979627

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants