matmul_gf2_spdn#

cuquantum.stabilizer.jax.matmul_gf2_spdn(
A_rowoff: Array,
A_colidx: Array,
B_packed: Array,
*,
m: int,
n: int,
k: int,
) Array[source]#

GF(2) sparse-dense matmul C = A @ B via cuStabilizer SpDn FFI.

Parameters:
  • A_rowoff(m+1,) uint64 CSR row offsets of A (device).

  • A_colidx(>= rowoff[m],) uint64 CSR column indices of A (device). nnz is read from A_rowoff[m]; trailing entries are ignored.

  • B_packed(k, n // 32) uint32 bit-packed dense matrix (device).

  • m – rows of A/C.

  • n – columns of B/C; must be a multiple of 32.

  • k – columns of A / rows of B.

Returns:

(m, n // 32) uint32 bit-packed device tensor.

See also

For computing (A_rowoff, A_colidx) from a dense A:

  • jax.experimental.sparse.CSR.fromdense() – jax-native.

  • cupyx.scipy.sparse.csr_matrix().

  • nvmath.bindings.cusparse cusparseDenseToSparse_*.