pygsti.tools.matrixmod2.albert_factor#
- albert_factor(d, failcount=0, rand_state=None)#
Returns a matrix M such that d = M M.T for symmetric d, where d and M are matrices over [0,1] mod 2.
The algorithm mostly follows the proof in “Orthogonal Matrices Over Finite Fields” by Jessie MacWilliams in The American Mathematical Monthly, Vol. 76, No. 2 (Feb., 1969), pp. 152-164
There is generally not a unique albert factorization, and this algorithm is randomized. It will general return a different factorizations from multiple calls.
- Parameters:
d (array-like) – Symmetric matrix mod 2.
failcount (int, optional) – UNUSED.
rand_state (np.random.RandomState, optional) – Random number generator to allow for determinism.
- Return type:
numpy.ndarray