#10606: Trouble with deepcopy of vectorspaces where the inner product matrix is
specified
------------------------------+---------------------------------------------
Reporter: jonhanke | Owner: jason, was
Type: defect | Status: new
Priority: critical | Milestone: sage-4.6.1
Component: linear algebra | Keywords: copy, vectorspace
Author: Jonathan Hanke | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------------+---------------------------------------------
There are some serious problems using deepcopy on vectorspaces where the
inner_product_matrix is specified. This fails over GF(p) for large
primes, and over RR.
Please see also Ticket #10577 for a related problem over GF(2).
{{{
sage: V = VectorSpace(GF(46337), 2,
inner_product_matrix=DiagonalMatrix(ZZ, [1,1]))
sage: deepcopy(V)
Ambient quadratic space of dimension 2 over Finite Field of size 46337
Inner product matrix:
[1 0]
[0 1]
sage:
sage: V = VectorSpace(GF(46349), 2,
inner_product_matrix=DiagonalMatrix(ZZ, [1,1]))
sage: deepcopy(V)
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/Users/jonhanke/Documents/SAGE/sage-4.6/<ipython console> in <module>()
/Users/jonhanke/Documents/SAGE/sage-4.6/local/lib/python/copy.pyc in
deepcopy(x, memo, _nil)
187 raise Error(
188 "un(deep)copyable object of type
%s" % cls)
--> 189 y = _reconstruct(x, rv, 1, memo)
190
191 memo[d] = y
/Users/jonhanke/Documents/SAGE/sage-4.6/local/lib/python/copy.pyc in
_reconstruct(x, info, deep, memo)
320 dictiter = None
321 if deep:
--> 322 args = deepcopy(args, memo)
323 y = callable(*args)
324 memo[id(x)] = y
/Users/jonhanke/Documents/SAGE/sage-4.6/local/lib/python/copy.pyc in
deepcopy(x, memo, _nil)
160 copier = _deepcopy_dispatch.get(cls)
161 if copier:
--> 162 y = copier(x, memo)
163 else:
164 try:
/Users/jonhanke/Documents/SAGE/sage-4.6/local/lib/python/copy.pyc in
_deepcopy_tuple(x, memo)
233 y = []
234 for a in x:
--> 235 y.append(deepcopy(a, memo))
236 d = id(x)
237 try:
/Users/jonhanke/Documents/SAGE/sage-4.6/local/lib/python/copy.pyc in
deepcopy(x, memo, _nil)
160 copier = _deepcopy_dispatch.get(cls)
161 if copier:
--> 162 y = copier(x, memo)
163 else:
164 try:
/Users/jonhanke/Documents/SAGE/sage-4.6/local/lib/python/copy.pyc in
_deepcopy_tuple(x, memo)
233 y = []
234 for a in x:
--> 235 y.append(deepcopy(a, memo))
236 d = id(x)
237 try:
/Users/jonhanke/Documents/SAGE/sage-4.6/local/lib/python/copy.pyc in
deepcopy(x, memo, _nil)
171 copier = getattr(x, "__deepcopy__", None)
172 if copier:
--> 173 y = copier(memo)
174 else:
175 reductor = dispatch_table.get(cls)
TypeError: __deepcopy__() takes no arguments (1 given)
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10606>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.