You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Dumps doesn't save immutability for matrices over GF(2).
Simple example:
This affects saving matrices and in particular raises
TypeError('mutable matrices are unhashable',)
when these matrices are used in hashed collections (set/dict etc):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
The text was updated successfully, but these errors were encountered: