Rotation step used by both encode and decode. encode=true: xsigns
then hadamard_transform (forward). encode=false: hadamard_transform
then xsigns (inverse — Hadamard is self-inverse up to the 1/sqrt(d)
normalization mlx's hadamard_transform already applies by default, so
applying it twice with signs on the outside undoes the rotation
exactly, matching the reference's fwht(x, encode=False)).
Rotation step used by both encode and decode.
encode=true: xsigns then hadamard_transform (forward).encode=false: hadamard_transform then xsigns (inverse — Hadamard is self-inverse up to the 1/sqrt(d) normalization mlx's hadamard_transform already applies by default, so applying it twice with signs on the outside undoes the rotation exactly, matching the reference'sfwht(x, encode=False)).