pygsti.tools.optools.create_elementary_errorgen_nqudit#
- create_elementary_errorgen_nqudit(typ, basis_element_labels, basis_1q, normalize=False, sparse=False, tensorprod_basis=False)#
Construct the elementary error generator matrix, either in a dense or sparse representation, corresponding to the specified type and basis element subscripts.
- Parameters:
typ (str) – String specifying the type of error generator to be constructed. Can be either ‘H’, ‘S’, ‘C’ or ‘A’.
basis_element_labels (list or tuple of str) – A list or tuple of strings corresponding to the basis element labels subscripting the desired elementary error generators. If typ is ‘H’ or ‘S’ this should be length-1, and for ‘C’ and ‘A’ length-2.
basis_1q (Basis) – A one-qubit Basis object used in the construction of the elementary error generator.
normalize (bool, optional (default False)) – If True the elementary error generator is normalized to have unit Frobenius norm.
sparse (bool, optional (default False)) – If True the elementary error generator is returned as a sparse array.
tensorprod_basis (bool, optional (default False)) – If True, the returned array is given in a basis consisting of the appropriate tensor product of single-qubit standard bases, as opposed to the N=2^n dimensional standard basis (the values are the same but this may result in some reordering of entries).
- Return type:
np.ndarray or Scipy CSR matrix