An algorithm for computing generalized Hamming weights and the Sage package GHWs
Rodrigo San-José
TL;DR
This work addresses the computational challenge of generalized Hamming weights $d_r(C)$ and relative generalized Hamming weights $M_r(C_1,C_2)$ for linear codes by generalizing the Brouwer-Zimmermann algorithm and implementing it in a Sage package, GHWs. The method enumerates subspaces $E eq ext{F}_q^k$ of dimension $r$ in order of increasing $| ext{supp}(E)|$, leveraging multiple information sets and duality to prune search and tighten bounds. Empirical results show substantial speedups over naive definitions across RS, RM, and cyclic codes, with both full and low-memory variants discussed. The open-source tool facilitates practical analysis of weight hierarchies and related parameters for secrecy and quantum-code applications, and the authors outline avenues for further optimizations, particularly for $q=2$ and specific $r$.
Abstract
We generalize the Brouwer-Zimmermann algorithm, which is the most efficient general algorithm for computing the minimum distance of a random linear code, to the case of generalized Hamming weights. We also adapt this algorithm to compute the relative generalized Hamming weights of a nested pair of linear codes. In the package GHWs we provide an implementation of this algorithm in Sage, as well as several other utilities for working with generalized Hamming weights. With this implementation, we show that the proposed algorithm is faster than the naive approach of computing the generalized Hamming weights using the definition.
