How this calculation works
Decide whether two generator row spaces are carried into each other by coordinate permutation and nonzero scalings, returning the map. Equal distance or equal weight distribution alone cannot decide code equivalence.
C₂={ (c_{π(1)}s₁,…,c_{π(n)}sₙ): c∈C₁ }, with each sⱼ≠0; equivalently U G₁ P D=G₂ for normalized bases.A worked example
Over GF(3), the code generated by [1,1] becomes the code generated by [1,2] after scaling its second coordinate by 2. They are monomial-equivalent, although coordinate permutation alone cannot map them.
Good to know
Prime field 2,3,5; length 1–7, rank ≤4, equal lengths and dimensions. Search permutation-scaling combinations ≤2 million; classify field Frobenius maps as outside initial scope.
Reference: SageMath: Canonical forms and automorphisms of linear codes (opens in a new tab) ↗
Generator row-space conventions
Two generator matrices may use different row bases for the same code. The comparison therefore concerns their complete row spaces, rather than equality of the written matrix entries.
Reduce dependent rows first and require equal field, length and rank. A rank mismatch already proves inequivalence, while harmless row changes must not make an equivalent pair appear different.
Compare this with the Linear error correcting code distance and weight enumerator calculator. Decide whether two generator row spaces are carried into each other by coordinate permutation and nonzero scalings, returning the map. Equal distance or equal weight distribution alone cannot decide code equivalence.
Permutation versus monomial equivalence
A coordinate permutation rearranges positions. A monomial map also multiplies each position by a nonzero field scalar, preserving Hamming distance while allowing more maps than permutation equivalence.
Over GF(2) every nonzero scalar is one, so the two notions coincide. Over GF(3), the distinction is already visible in one-dimensional length-two codes. The default ternary one-dimensional codes generated by [1,1] and [1,2] are monomially equivalent. Scaling the second coordinate by two maps the first generator into the second over GF(3). This simple example cannot be captured by coordinate permutation alone: swapping [1,1] leaves it unchanged. It also shows why arithmetic is performed in the selected prime field, so multiplying by two twice gives one modulo three rather than an ordinary real factor of four.
Row-space equality rather than weight invariants
The bounded implementation enumerates coordinate permutations and nonzero scalings, then tests equality of the transformed and target row spaces. It does not depend on a weight enumerator or projective invariant as a complete equivalence decision.
Equal weight enumerators are necessary under monomial equivalence, but they are not a general decision procedure. A positive result must still include a concrete coordinate map and an exact row-space equality check.
Search and invariant pruning
The permutation convention must be read explicitly: output coordinate j receives a selected input coordinate and is then multiplied by its scalar. An inverse permutation can describe the same transformation in a different notation.
Compare the rank of the stacked transformed and target bases with the common code dimension. Equality certifies the same row space, without returning a separate basis-change matrix. The output convention states that target coordinate i takes the source coordinate listed in permutation[i], multiplied by scalings[i]. The transformed generator rows are then compared with the target row space through a rank test. They need not equal the entered target rows entry for entry, because a different basis generates the same code. The current output supplies the coordinate map and transformed generator, not a separate row-change matrix U. The row-space test certifies equivalence without that additional presentation of the basis change.
Ternary scaling worked example
The GF(3) span of [1,1] consists of [0,0],[1,1],[2,2]. Scaling the second coordinate by two gives [0,0],[1,2],[2,1], exactly the span of [1,2].
No permutation can perform this conversion: swapping the two equal entries of [1,1] leaves them equal. The example isolates the extra freedom supplied by coordinate scaling.
Verifying the complete matrix identity
The figure pairs the two length-two generators and labels the nontrivial scalar. For a longer input, retain the permutation and scalar lists with the field value so the codeword map can be replayed.
A useful independent check maps every codeword of a tiny code and compares the resulting set. The production certificate uses row spaces, which avoids requiring large codebook listings. Equal dimension, length, minimum distance and weight distribution are useful preliminary invariants but do not prove equivalence. The search must find an actual coordinate map or completely exhaust the bounded possibilities. A cap reached before exhaustion is unresolved. Nonprime extension fields and their Frobenius automorphisms are excluded; changing the field can change both the allowable scalings and the equivalence relation.
Search limits and excluded semilinear maps
The initial domain uses prime fields and a finite search cap. Extension-field automorphisms would add semilinear equivalence and require an explicit Frobenius-action convention. They are not silently included here.
A completed negative result means all allowed maps were excluded. If the search stops at its work limit, the pair remains unresolved even when no equivalent map has yet been found.
A few questions, answered
Are row operations allowed?
Yes. Arbitrary invertible row changes preserve the code row space and are allowed.
Does an equal weight enumerator prove equivalence?
No. Weight enumerators are useful invariants but do not completely classify linear codes.
How do permutation and monomial equivalence differ?
Monomial equivalence additionally permits independent nonzero coordinate scalings.
Are extension-field automorphisms included?
No. The initial calculator uses prime fields and excludes semilinear Frobenius maps.