pygsti.toolsΒΆ

Gate Set Tomography Tools Python Package

Functions

basis_element_labels(basis, dimOrBlockDims) Returns a list of short labels corresponding to to the elements of the described basis.
basis_longname(basis[, dimOrBlockDims]) Get the “long name” for a particular basis, which is typically used in reports, etc.
chi2(dataset, gateset[, gateStrings, ...]) Computes the total chi^2 for a set of gate strings.
chi2fn(N, p, f[, minProbClipForWeighting]) Computes the chi^2 term corresponding to a single outcome.
chi2fn_2outcome(N, p, f[, ...]) Computes chi^2 for a 2-outcome measurement.
chi2fn_2outcome_wfreqs(N, p, f[, ...]) Computes chi^2 for a 2-outcome measurement using frequency-weighting.
chi2fn_wfreqs(N, p, f[, minProbClipForWeighting]) Computes the frequency-weighed chi^2 term corresponding to a single outcome.
contract_to_std_direct_sum_mx(mxInStdBasis, ...) Convert a gate matrix in the standard basis of the embedding space to a matrix in the standard basis of the “direct-sum” space.
cptp_penalty(gateset[, include_spam_penalty]) The sum of all negative Choi matrix eigenvalues, and if include_spam_penalty is True, the rho-vector and E-vector penalties of gateset.
create_count_vec_dict(spamLabels, dataset, ...) Create a count-vector dictionary that is useful for speeding up multiple evaluations of logl(...).
decompose_gate_matrix(gateMx) Compute how the action of a gate matrix can be is decomposed into fixed points, axes of rotation, angles of rotation, and decays.
diamonddist(A, B[, mxBasis, dimOrStateSpaceDims]) Returns the approximate diamond norm describing the difference between gate
effect_penalty(EVec) Penalty assigned to a POVM effect vector EVec.
error_generator(gate, target_gate) Construct the error generator from a gate and its target.
expand_from_std_direct_sum_mx(mxInStdBasis, ...) Convert a gate matrix in the standard basis of a “direct-sum” space to a matrix in the standard basis of the embedding space.
fidelity(A, B) Returns the quantum state fidelity between density
fidelity_upper_bound(gateMx) Get an upper bound on the fidelity of the given gate matrix with any unitary gate matrix.
fill_count_vecs(mxToFill, spam_label_rows, ...) Fill a matrix of counts that is useful for speeding up multiple evaluations of logl(...).
forbidden_prob(gateset, dataset) Compute the sum of the out-of-range probabilities generated by gateset, using only those gate strings contained in dataset.
frobeniusdist(A, B) Returns the frobenius distance between gate
frobeniusdist2(A, B) Returns the square of the frobenius distance between gate
frobeniusnorm(ar) Compute the frobenius norm of an array (or matrix),
frobeniusnorm2(ar) Compute the squared frobenius norm of an array (or matrix),
gate_string_chi2(gatestring, dataset, gateset) Computes the chi-squared term for a single gate string.
gm_matrices(dimOrBlockDims) Get the normalized elements of the generalized Gell-Mann basis spanning the density-matrix space given by dimOrBlockDims.
gm_matrices_unnormalized(dimOrBlockDims) Get the elements of the generalized Gell-Mann basis spanning the density-matrix space given by dimOrBlockDims.
gm_to_pp(mxInGellMannBasis[, dimOrBlockDims]) Convert a gate matrix in the Gell-Mann basis of a density matrix space to the Pauil-product basis (of the same space).
gm_to_std(mxInGellMannBasis[, dimOrBlockDims]) Convert a gate matrix in the Gell-Mann basis of a density matrix space to the Standard basis (of the same space).
gm_to_std_transform_matrix(dimOrBlockDims) Construct the matrix which transforms a gate matrix in the Gell-Mann basis for a density matrix space to the Standard basis (for the same space).
gmvec_to_stdmx(v) Convert a vector in the Gell-Mann basis to a matrix in the standard basis.
hamiltonian_to_lindbladian(hamiltonian) Construct the Lindbladian corresponding to a given Hamiltonian.
is_hermitian(mx[, TOL]) Test whether mx is a hermitian matrix.
is_pos_def(mx[, TOL]) Test whether mx is a positive-definite matrix.
is_valid_density_mx(mx[, TOL]) Test whether mx is a valid density matrix (hermitian, positive-definite, and unit trace).
jamiolkowski_iso(gateMx[, gateMxBasis, ...]) Given a gate matrix, return the corresponding Choi matrix that is normalized to have trace == 1.
jamiolkowski_iso_inv(choiMx[, choiMxBasis, ...]) Given a choi matrix, return the corresponding gate matrix.
jtracedist(A, B[, mxBasis]) Compute the Jamiolkowski trace distance between gate matrices A and B,
logl(gateset, dataset[, gatestring_list, ...]) The log-likelihood function.
logl_hessian(gateset, dataset[, ...]) The hessian of the log-likelihood function.
logl_jacobian(gateset, dataset[, ...]) The jacobian of the log-likelihood function.
logl_max(dataset[, gatestring_list, ...]) The maximum log-likelihood possible for a DataSet.
mags_of_negative_choi_evals(gateset) Compute the magnitudes of the negative eigenvalues of the Choi matricies for each gate in gateset.
mx_to_string(m[, width, prec]) Generate a “pretty-format” string for a matrix.
mx_to_string_complex(m[, real_width, ...]) Generate a “pretty-format” string for a complex-valued matrix.
pp_matrices(dim) Get the elements of the Pauil-product basis spanning the space of dim x dim density matrices (matrix-dimension dim, space dimension dim^2).
pp_to_gm(mxInPauliProdBasis[, dimOrBlockDims]) Convert a gate matrix in the Pauli-product basis of a density matrix space to the Gell-Mann basis (of the same space).
pp_to_std(mxInPauliProdBasis[, dimOrBlockDims]) Convert a gate matrix in the Pauli-product basis of a density matrix space to the Standard basis (of the same space).
pp_to_std_transform_matrix(dimOrBlockDims) Construct the matrix which transforms a gate matrix in the Pauil-product basis for a density matrix space to the Standard basis (for the same space).
ppvec_to_stdmx(v) Convert a vector in the Pauli basis to a matrix in the standard basis.
prep_penalty(rhoVec) Penalty assigned to a state preparation (rho) vector rhoVec.
print_mx(mx[, width, prec]) Print matrix in pretty format.
process_fidelity(A, B[, mxBasis]) Returns the process fidelity between gate
rb_decay(x, a, b) Return the Randomized Benchmarking (RB) decay function:
rb_decay_rate(dataset[, showPlot, xlim, ...]) Compute the Randomized Benchmarking (RB) decay rate given an data set containing counts for RB gate strings.
remove_duplicates(l[, indexToTest]) Remove duplicates from the a list and return the result.
remove_duplicates_in_place(l[, indexToTest]) Remove duplicates from the list passed as an argument.
single_qubit_gate(hx, hy, hz[, noise]) Construct the single-qubit gate matrix.
state_to_pauli_density_vec(state_vec) Convert a single qubit state vector into a density matrix.
std_matrices(dimOrBlockDims) Get the elements of the matrix unit, or “standard”, basis spanning the density-matrix space given by dimOrBlockDims.
std_to_gm(mxInStdBasis[, dimOrBlockDims]) Convert a gate matrix in the Standard basis of a density matrix space to the Gell-Mann basis (of the same space).
std_to_pp(mxInStdBasis[, dimOrBlockDims]) Convert a gate matrix in the Standard basis of a density matrix space to the Pauil-product basis (of the same space).
stdmx_to_gmvec(m) Convert a matrix in the standard basis to a vector in the Gell-Mann basis.
stdmx_to_ppvec(m) Convert a matrix in the standard basis to a vector in the Pauli basis.
stdmx_to_stdvec(m) Convert a matrix in the standard basis to a vector in the standard basis.
stdvec_to_stdmx(v) Convert a vector in the standard basis to a matrix in the standard basis.
sum_of_negative_choi_evals(gateset) Compute the amount of non-CP-ness of a gateset by summing the negative eigenvalues of the Choi matrix for each gate in gateset.
sums_of_negative_choi_evals(gateset) Compute the amount of non-CP-ness of a gateset by summing the negative eigenvalues of the Choi matrix for each gate in gateset separately.
trace(M) The trace of a matrix, sum_i M[i,i].
tracedist(A, B) Compute the trace distance between matrices A and B,
two_delta_loglfn(N, p, f[, minProbClip, ...]) Term of the 2*[log(L)-upper-bound - log(L)] sum corresponding to a single gate string and spam label.
two_qubit_gate([ix, iy, iz, xi, xx, xy, xz, ...]) Construct the single-qubit gate matrix.
unitary_to_pauligate_1q(U) Get the linear operator on (vectorized) density matrices corresponding to a 1-qubit unitary operator on states.
unitary_to_pauligate_2q(U) Get the linear operator on (vectorized) density matrices corresponding to a 2-qubit unitary operator on states.
unitary_to_process_mx(U) Compute the super-operator which acts on (row)-vectorized density matrices from a unitary operator (matrix) U which acts on state vectors.
vec_to_stdmx(v, basis) Convert a vector in the given basis to a matrix in the standard basis.