SVD helpers (varipeps.utils.svd)

varipeps.utils.svd.gauge_fixed_svd(matrix: Array, only_u_or_vh=None, use_qr=False) Tuple[Array, Array, Array]

Calculate the gauge-fixed (also called sign-fixed) SVD. To this end, each singular vector are rotate in the way that the first element bigger than some numerical stability threshold (config parameter eps) is ensured to be along the positive real axis.

Parameters:

matrix (jnp.ndarray) – Matrix to calculate SVD for.

Keyword Arguments:

only_u_or_vh (str, optional) – Flag if only U or Uh should be calculated. If None (default), calculate the full SVD, if ‘U’ only calculate U, if ‘Vh’ only calculate Vh.

Default: None

Returns:

Tuple with sign-fixed U, S and Vh of the SVD.

Return type:

tuple(jnp.ndarray, jnp.ndarray, jnp.ndarray)