pygsti.tools.basistools.resize_std_mx

Contents

pygsti.tools.basistools.resize_std_mx#

resize_std_mx(mx, resize, std_basis_1, std_basis_2)#

Change the basis of mx to a potentially larger or smaller ‘std’-type basis given by std_basis_2.

(mx is assumed to be in the ‘std’-type basis given by std_basis_1.)

This is possible when the two ‘std’-type bases have the same “embedding dimension”, equal to the sum of their block dimensions. If, for example, std_basis_1 has block dimensions (kite structure) of (4,2,1) then mx, expressed as a sum of 4^2 + 2^2 + 1^2 = 21 basis elements, can be “embedded” within a larger ‘std’ basis having a single block with dimension 7 (7^2 = 49 elements).

When std_basis_2 is smaller than std_basis_1 the reverse happens and mx is irreversibly truncated, or “contracted” to a basis having a particular kite structure.

Parameters:
  • mx (numpy array) – A square matrix in the std_basis_1 basis.

  • resize ({'expand','contract'}) – Whether mx can be expanded or contracted.

  • std_basis_1 (Basis) – The ‘std’-type basis that mx is currently in.

  • std_basis_2 (Basis) – The ‘std’-type basis that mx should be converted to.

Return type:

numpy.ndarray