pygsti.baseobjs.basisconstructors.pp_matrices

Contents

pygsti.baseobjs.basisconstructors.pp_matrices#

pp_matrices(matrix_dim, max_weight=None, normalize=True)#

Get the elements of the Pauil-product basis with matrix dimension matrix_dim.

These matrices span the space of matrix_dim x matrix_dim density matrices (matrix-dimension matrix_dim, space dimension matrix_dim^2).

The returned matrices are given in the standard basis of the density matrix space, and are thus kronecker products of the standard representation of the Pauli matrices, (i.e. where sigma_y == [[ 0, -i ], [i, 0]] ) normalized (when normalize=True so that the resulting basis is orthonormal under the trace inner product, i.e. Tr( dot(Mi,Mj) ) == delta_ij. In the returned list, the right-most factor of the kronecker product varies the fastest, so, for example, when matrix_dim == 4 the returned list is [ II,IX,IY,IZ,XI,XX,XY,XY,YI,YX,YY,YZ,ZI,ZX,ZY,ZZ ].

Parameters:
  • matrix_dim (int) – Matrix-dimension of the density-matrix space. Must be a power of 2.

  • max_weight (int, optional) – Restrict the elements returned to those having weight <= max_weight. An element’s “weight” is defined as the number of non-identity single-qubit factors of which it is comprised. For example, if matrix_dim == 4 and max_weight == 1 then the returned list is [II, IX, IY, IZ, XI, YI, ZI].

  • normalize (bool, optional) – Whether the Pauli matrices are normalized (see above) or not.

Returns:

A list of N numpy arrays each of shape (matrix_dim, matrix_dim), where N == matrix_dim^2, the dimension of the density-matrix space. (Exception: when max_weight is not None, the returned list may have fewer than N elements.)

Return type:

list

Notes

Matrices are ordered with first qubit being most significant, e.g., for 2 qubits: II, IX, IY, IZ, XI, XX, XY, XZ, YI, … ZZ