#23376 closed defect (fixed)
Equality testing of genera of quadratic forms over ZZ changes the genus and produces false results
Reported by:  Simon Brandhorst  Owned by:  

Priority:  major  Milestone:  sage8.0 
Component:  quadratic forms  Keywords:  sd87, Genus, sd91 
Cc:  Merged in:  
Authors:  Simon Brandhorst  Reviewers:  Anthony VárillyAlvarado, Jen Berg 
Report Upstream:  N/A  Work issues:  
Branch:  24a5b0b (Commits, GitHub, GitLab)  Commit:  
Dependencies:  Stopgaps: 
Description (last modified by )
sage: D4 = QuadraticForm(Matrix(ZZ,4,4,[2,0,0,1,0,2,0,1,0,0,2,1,1,1,1,2])) sage: G = D4.global_genus_symbol() sage: sage.quadratic_forms.genera.genus.is_GlobalGenus(G) True sage: G == copy(G) True sage: sage.quadratic_forms.genera.genus.is_GlobalGenus(G) False
The reason is that various functions unintentionally modify their input. Since a genus consists of lists containing lists, functions do just copy the lists but not deepcopy.
For example sage.quadratic_forms.genera.genus.canonical_2_adic_reduction modifies its input which does not seem to be intended.
Change History (16)
comment:1 Changed 5 years ago by
Branch:  → u/sbrandhorst/equality_testing_of_genera_of_quadratic_forms_over_zz_changes_the_genus_and_produces_false_results 

comment:2 Changed 5 years ago by
Commit:  → 88bdf3c89c5522df62d0035cd3d8826755d451d2 

Status:  new → needs_review 
comment:3 Changed 5 years ago by
Status:  needs_review → needs_work 

comment:4 Changed 5 years ago by
Commit:  88bdf3c89c5522df62d0035cd3d8826755d451d2 → 8e62210714bf1bcc426733eab9848bd3ff230c23 

Branch pushed to git repo; I updated commit sha1. New commits:
8e62210  Seems that is_2_adic_genus did not assume the input to be canonical but instead did not reduce the determinants mod 8. Changed that.

comment:5 Changed 5 years ago by
Status:  needs_work → needs_review 

comment:7 Changed 5 years ago by
Keywords:  sd87 added 

comment:8 Changed 5 years ago by
Keywords:  sd91 added; sd87 removed 

comment:10 Changed 5 years ago by
Status:  needs_review → needs_work 

Doesn't follow the doctest conventions; needs empty line after TESTS::
comment:11 Changed 5 years ago by
Commit:  8e62210714bf1bcc426733eab9848bd3ff230c23 → 24a5b0bcc3f31e1dcf08ce88c0c709578a8bbf7c 

comment:12 Changed 5 years ago by
Status:  needs_work → positive_review 

Fix looks good now. Passes all doc tests and documentation builds.
comment:14 Changed 5 years ago by
Reviewers:  → Anthony VarillyAlvarado, Jen Berg 

Status:  needs_work → positive_review 
Added reviewer names.
comment:15 Changed 5 years ago by
Branch:  u/sbrandhorst/equality_testing_of_genera_of_quadratic_forms_over_zz_changes_the_genus_and_produces_false_results → 24a5b0bcc3f31e1dcf08ce88c0c709578a8bbf7c 

Resolution:  → fixed 
Status:  positive_review → closed 
comment:16 Changed 5 years ago by
Commit:  24a5b0bcc3f31e1dcf08ce88c0c709578a8bbf7c 

Reviewers:  Anthony VarillyAlvarado, Jen Berg → Anthony VárillyAlvarado, Jen Berg 
Note: See
TracTickets for help on using
tickets.
New commits:
Fixed two bugs in the genus class