pyFDN.rotation_matrix_from_angles#
- pyFDN.rotation_matrix_from_angles(angles, n=None)[source]#
Generate orthogonal matrix with prescribed eigenvalue angles.
Builds a block-diagonal matrix of 2x2 Givens rotations, one block per angle, so the eigenvalues are exp(+-1j * angles). For odd matrix sizes, a single eigenvalue at 1 is appended.
- Parameters:
- Returns:
Orthogonal matrix of shape (n, n)
- Return type:
rotation_matrix
Example
>>> angles = torch.tensor([0.1, 0.2], dtype=torch.float64) >>> R = rotation_matrix_from_angles(angles, n=5) >>> R.shape torch.Size([5, 5]) >>> torch.allclose(R @ R.T, torch.eye(5, dtype=R.dtype), atol=1e-12) True