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

dumps doesn't save immutability for Matrix_mod2_dense #14681

Closed
sagetrac-matthew-weippert mannequin opened this issue Jun 3, 2013 · 3 comments
Closed

dumps doesn't save immutability for Matrix_mod2_dense #14681

sagetrac-matthew-weippert mannequin opened this issue Jun 3, 2013 · 3 comments

Comments

@sagetrac-matthew-weippert
Copy link
Mannequin

Dumps doesn't save immutability for matrices over GF(2).

Simple example:

z = zero_matrix(GF(2), 3)
z.set_immutable()
print(z.is_immutable())
zstr = z.dumps()
z2 = loads(zstr)
print(z2.is_immutable())

This affects saving matrices and in particular raises TypeError('mutable matrices are unhashable',) when these matrices are used in hashed collections (set/dict etc):

z = zero_matrix(GF(2), 3)
z.set_immutable()
s = set()
s.add(z)
sstr = dumps(s)
s2 = loads(sstr)

Work Around for saving:
Saving lists of matrices works just fine, so if you need to save a set or dictionary, convert to/from a list on before/after save.

CC: @tscrim

Component: linear algebra

Keywords: immutable hashable matrix GF(2)

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

@sagetrac-matthew-weippert sagetrac-matthew-weippert mannequin added this to the sage-5.11 milestone Jun 3, 2013
@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Member

mkoeppe commented Sep 10, 2021

comment:6

outdated, works ok in 9.5.beta0

@mkoeppe mkoeppe removed this from the sage-6.4 milestone Sep 10, 2021
@kwankyu
Copy link
Collaborator

kwankyu commented Sep 10, 2021

comment:7

Non-existent issue now.

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

5 participants