tsim.utils.linalg.matmul_gf2
← Module overview
function
source
functionmatmul_gf2¶source
tsim.utils.linalg.matmul_gf2
def matmul_gf2(a: Array, b: Array) -> ArrayCompute 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
| Name | Type | Description |
|---|---|---|
a | Array | Parameter bit-masks, shape ``(G, T, P)`` — G graphs, T terms, P parameters. |
b | Array | Binary parameter values, shape ``(B, P)`` — B batch elements. |
Returns
ArrayBinary row-sums mod 2, shape ``(B, G, T)``.