Opened 4 years ago

Last modified 3 years ago

## #23376 closed defect

# Equality testing of genera of quadratic forms over ZZ changes the genus and produces false results — at Initial Version

Reported by: | sbrandhorst | Owned by: | |
---|---|---|---|

Priority: | major | Milestone: | sage-8.0 |

Component: | quadratic forms | Keywords: | sd87, Genus, sd91 |

Cc: | Merged in: | ||

Authors: | Simon Brandhorst | Reviewers: | |

Report Upstream: | N/A | Work issues: | |

Branch: | Commit: | ||

Dependencies: | Stopgaps: |

### Description

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.

**Note:**See TracTickets for help on using tickets.