cr.sparse.data.two_subspaces_at_angle

cr.sparse.data.two_subspaces_at_angle(key, N, D, theta)[source]

Returns ONBs for two subspaces at angle theta with each other

Parameters
  • key – a PRNG key used as the random key.

  • N (int) – Dimension of the ambient space

  • D (int) – Dimension of the low dimensional subspace

  • theta (float) – Smallest principal angle (in degrees) between the two subspaces

Returns

A tuple (A, B) consiting of two ONBs for the two subspaces

Return type

(jax.numpy.ndarray, jax.numpy.ndarray)

Example

>>> rkey = random.PRNGKey(1)
>>> N = 20
>>> D = 4
>>> theta = 15
>>> A, B = two_subspaces_at_angle(rkey, N, D, theta)
>>> print(A.shape, B.shape)
(20, 4) (20, 4) (20, 4)
>>> from cr.nimble.subspaces import principal_angles_deg
>>> print(principal_angles_deg(A, B))
[15. 90. 90. 90.]