Skip to content

tsim.utils.linalg.matmul_gf2

← Module overview

functionmatmul_gf2source

tsim.utils.linalg.matmul_gf2

def matmul_gf2(a: Array, b: Array) -> Array

Compute binary dot products mod 2 as a_GTP x b_BP -> b_BGT.

Uses float32 matmul (integer matmul does not have BLAS support on CPU) then casts back to uint8.

Parameters

NameTypeDescription
aArrayParameter bit-masks, shape ``(G, T, P)`` — G graphs, T terms, P parameters.
bArrayBinary parameter values, shape ``(B, P)`` — B batch elements.

Returns

ArrayBinary row-sums mod 2, shape ``(B, G, T)``.

source