build_permutation_matrix: Build permutation matrix for a single operation
Description
Creates an n x n permutation matrix (column-major, F32) that represents
a single operation. When multiplied: new_state = state %*% P.
Usage
build_permutation_matrix(op, n, k)
Value
Numeric vector of length n*n (column-major permutation matrix)
Arguments
- op
Character, operation code ("L"/"1", "R"/"2", "X"/"3")
- n
Integer, state length
- k
Integer, reverse prefix length