pygsti.tools.basistools.resize_mx

Contents

pygsti.tools.basistools.resize_mx#

resize_mx(mx, dim_or_block_dims=None, resize=None)#

Wrapper for resize_std_mx(), that manipulates mx to be in another basis.

This function first constructs two ‘std’-type bases using dim_or_block_dims and sum(dim_or_block_dims). The matrix mx is converted from the former to the latter when resize == “expand”, and from the latter to the former when resize == “contract”.

Parameters:
  • mx (numpy array) – Matrix of size N x N, where N is the dimension of the density matrix space, i.e. sum( dimOrBlockDims_i^2 )

  • dim_or_block_dims (int or list of ints) – Structure of the density-matrix space. Gives the matrix dimensions of each block.

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

Return type:

numpy.ndarray