low_rank_toolbox.cssp.utils.givens

low_rank_toolbox.cssp.utils.givens(x, y)[source]

Computes the complex Givens rotation matrix for a 2-element complex vector [x, y].

This function generalizes the real Givens rotation to the complex plane. The rotation is a unitary matrix G such that for a vector v = [x, y].T, the product G @ v is equal to [r, 0].T, where r is the real, non-negative value sqrt(|x|^2 + |y|^2).

The resulting matrix G is an element of SU(2) and has the form: [[c, s],

[-conj(s), conj(c)]]

where c and s are complex numbers satisfying |c|^2 + |s|^2 = 1. Specifically, the parameters are calculated as c = conj(x)/r and s = conj(y)/r. This implementation is numerically stable, avoiding overflow for large inputs.

Parameters:
Return type:

ndarray

Returns:

np.ndarray: A 2x2 complex unitary Givens rotation matrix.