An equality check on subclasses of `LinearCode`

Issue #154 new
Johan Rosenkilde created an issue

Right now the semantics of LinearCode.__eq__ is to check equality of the vector spaces (by computing kernels of both codes and checking that these are orthogonal to the other code's).

Right now the semantics of e.g. GeneralizedReedSolomonCode.__eq__ is the cheap match that all the parameters agree (n,k,field, eval points and column multipliers).

I'm somewhat concerned about this semantics, but in the end I think it makes sense. However, two GRS codes might be the same even though their parameters are different, e.g. if I double all the column multipliers. To test this, I currently have to throw both codes into linear codes and test equality there:

LinearCode(C1.generator_matrix()) == LinearCode(C2.generator_matrix())

I think there should be a function for testing this kind of equality exposed to all subclasses of AbstractLinearCode, and the default implementation in AbstractLinearCode.__eq__ should just call this function.

I'm not sure what the function should be called, though. equivalent_code is no good since that's usually under e.g. permutations or other metric-preserving transformations. Though there could of course be an equivalent_code taking an optional argument specifying which equivalence we're talking about.

Comments (0)

  1. Log in to comment