pygstiΒΆ

A Python implementation of Gate Set Tomography

Sub-packages

pygsti.algorithms Gate Set Tomography Algorithms Python Package
pygsti.construction Gate Set Tomography Object Construction Python Package
pygsti.drivers Gate Set Tomography High-Level Drivers Python Package
pygsti.io Gate Set Tomography Input/Output Python Package
pygsti.objects Gate Set Tomography Objects Python Package
pygsti.optimize Gate Set Tomography Optimization Python Package
pygsti.report Gate Set Tomography Reporting Python Package
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(gateset, toWhat[, dataset, ...]) Contract a GateSet to a specified space.
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
do_exlgst(dataset, startGateset, ...[, ...]) Performs Extended Linear-inversion Gate Set Tomography on the dataset.
do_iterative_exlgst(dataset, startGateset, ...) Performs Iterated Extended Linear-inversion Gate Set Tomography on the dataset.
do_iterative_mc2gst(dataset, startGateset, ...) Performs Iterative Minimum Chi^2 Gate Set Tomography on the dataset.
do_iterative_mc2gst_with_model_selection(...) Performs Iterative Minimum Chi^2 Gate Set Tomography on the dataset, and at each iteration tests the current gateset model against gateset models with an increased and/or decreased dimension (model selection).
do_iterative_mlgst(dataset, startGateset, ...) Performs Iterative Maximum Liklihood Estimation Gate Set Tomography on the dataset.
do_lgst(dataset, specs[, targetGateset, ...]) Performs Linear-inversion Gate Set Tomography on the dataset.
do_long_sequence_gst(dataFilenameOrSet, ...) Perform end-to-end GST analysis using Ls and germs, with L as a maximum length.
do_mc2gst(dataset, startGateset, ...[, ...]) Performs Least-Squares Gate Set Tomography on the dataset.
do_mc2gst_with_model_selection(dataset, ...) Performs Least-Squares Gate Set Tomography on the dataset.
do_mlgst(dataset, startGateset, gateStringsToUse) Performs Maximum Likelihood Estimation Gate Set Tomography on the dataset.
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(...).
find_closest_unitary_gatemx(gateMx) Get the closest gate matrix (by maximizing fidelity) to gateMx that describes a unitary quantum gate.
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.
gateset_decomp_angle(gs)
gateset_decomp_decay_diag(gs)
gateset_decomp_decay_offdiag(gs)
gateset_diamonddist(gs, gs_target[, mxBasis])
gateset_jtracedist(gs, gs_target[, mxBasis])
gateset_process_fidelity(gs, gs_target)
gauge_optimize_gs_list(gsList, targetGateset) Optimizes the “spam weight” parameter used in gauge optimization by attempting spam a range of spam weights and taking the one the minimizes the average spam error multiplied by the average gate error (with respect to a target gate set).
get_max_gram_basis(gateLabels, dataset[, ...]) Compute a maximal set of gate strings that can be used as a basis for a Gram matrix.
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.
gram_rank_and_evals(dataset, specs[, ...]) Returns the rank and singular values of the Gram matrix for a dataset.
gs_mean(gsFunc, gsEnsemble[, axis])
gs_mean1(gsFunc, gsEnsemble[, axis])
gs_stdev(gsFunc, gsEnsemble[, ddof])
gs_stdev1(gsFunc, gsEnsemble[, ddof, axis])
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.
make_bootstrap_dataset(inputDataSet, ...[, ...]) Creates a DataSet used for generating bootstrapped error bars.
make_bootstrap_gatesets(numGateSets, ...[, ...]) Creates a series of “bootstrapped” GateSets form a single DataSet (and possibly GateSet) used for generating bootstrapped error bars.
max_gram_rank_and_evals(dataset[, ...]) Compute the rank and singular values of a maximal Gram matrix,that is, the Gram matrix using a basis computed by: get_max_gram_basis(dataset.get_gate_labels(), dataset, maxBasisStringLength).
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.
optimize_gauge(gateset, toGetTo[, maxiter, ...]) Optimize the gauge of a GateSet using some ‘goodness’ function.
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.
spamrameter(gs)
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.
to_mean_gateset(gsList, target_gs)
to_rms_gateset(gsList, target_gs)
to_std_gateset(gsList, target_gs[, ddof])
to_vector(gs)
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.