cr.sparse.data.three_subspaces_at_angle

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

Returns ONBs for three 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 three subspaces

Returns

A tuple consiting of three ONBs for the three subspaces

Return type

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

Example

>>> rkey = random.PRNGKey(1)
>>> N = 20
>>> D = 4
>>> theta = 15
>>> A, B, C = three_subspaces_at_angle(rkey, N, D, theta)
>>> print(A.shape, B.shape, C.shape)
(20, 4) (20, 4) (20, 4)
>>> from cr.nimble.subspaces import smallest_principal_angles_deg
>>> angles = smallest_principal_angles_deg(jnp.array([A, B, C]))
>>> print(jnp.round(angles, 2))
[[ 0. 15. 15.]
[15.  0. 15.]
[15. 15.  0.]]