Opened 10 years ago
Last modified 4 years ago
#5417 new defect
Fix some more deepcopy/caching issues in the quadratic forms code (followup to #5403)
Reported by: | mabshoff | Owned by: | justin |
---|---|---|---|
Priority: | major | Milestone: | sage-6.4 |
Component: | quadratic forms | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
Gonzalo found some problem in the QF code when working on #5403. These problems are related to deepcopy.
Cheers,
Michael
Change History (7)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
- Summary changed from Fix some more deepcopy issues (followup to #5403) to Fix some more deepcopy/caching issues in the quadratic forms code (followup to #5403)
comment:3 Changed 6 years ago by
- Milestone changed from sage-5.11 to sage-5.12
comment:4 Changed 5 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:5 Changed 5 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:6 Changed 5 years ago by
- Milestone changed from sage-6.3 to sage-6.4
comment:7 Changed 4 years ago by
- Report Upstream set to N/A
Exactly what is the problem here? The description is very vague...
Note: See
TracTickets for help on using
tickets.
The patch in #5403 fixes the function
scale_by_factor
inquadratic_form__variable_substitutions.py
, by replacing the use ofcopy.deepcopy
+__init__
by a call to the constructor.The issue with this is that the caches for some functions are copied, hence the results may be incorrect. There seem to be more instances of this bug in the quadratic_forms code, hence this ticket, but that one is the only one currently triggered by the following doctest (this only happens after applying the
import *
fix in #5403 without thedeepcopy
fix):In this example, after the first call to
jordan_blocks_in_unimodular_list_by_scale_power
, the result is cached, and the functionscale_by_factor
copies this cached result, so that the second call returns the answer for the original quadratic form.