pygsti.algorithms.germselection.construct_update_cache_rank_one

pygsti.algorithms.germselection.construct_update_cache_rank_one#

construct_update_cache_rank_one(mat, evd_tol=1e-10, prev_update_cache=None, rank_one_update=None)#

Calculates the parts of the pseudoinverse update loop algorithm that we can pre-compute and reuse throughout all of the potential updates.

This is based on a result from Carl Meyer in Generalized Inversion of Modified Matrices, and summarized in 3.2.7 of the matrix cookbook.

quantities we can pre-compute are (for initial matrix A): pinv(A) I-A@pinv(A)

Input:

matndarray

The matrix to construct a set of reusable objects for performing the updates. mat is assumed to be a symmetric square matrix.

evd_tolfloat (optional)

A threshold value for setting eigenvalues to zero.

Output:

pinv_Andarray

The pseudoinverse of the input matrix

proj_Andarray

A projectors onto the orthogonal complement of the column space of the input matrix.

pinv_A_tracefloat

The trace of pinv_A.

rankint

The current rank of A/pinv_A