spyrit.core.torch.walsh_matrix

spyrit.core.torch.walsh_matrix(n)[source]

Returns a 1D Walsh-ordered Hadamard.

Args:

n (int): Order of the transform \(n\), which must be a power of two.

Raises:

ValueError: If n is not a positive integer that is a power of 2.

Returns:

torch.tensor: Matrix \(H\) with shape \((n,n)\).