pygsti.tools.basistools

pygsti.tools.basistools#

Utility functions for working with Basis objects

Functions

basis_element_labels(basis, dim)

Get a list of short labels corresponding to to the elements of the described basis.

basis_longname(basis)

Get the "long name" for a particular basis, which is typically used in reports, etc.

basis_matrices(name_or_basis, dim[, sparse])

Get the elements of the specified basis-type which spans the density-matrix space given by dim.

change_basis(mx, from_basis, to_basis[, ...])

Convert a operation matrix from one basis of a density matrix space to another.

create_basis_for_matrix(mx, basis)

Construct a Basis object with type given by basis and dimension appropriate for transforming mx.

create_basis_pair(mx, from_basis, to_basis)

Constructs bases from transforming mx between two basis names.

flexible_change_basis(mx, start_basis, end_basis)

Change mx from start_basis to end_basis allowing embedding expansion and contraction if needed.

is_sparse_basis(name_or_basis)

Whether a basis contains sparse matrices.

resize_mx(mx[, dim_or_block_dims, resize])

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

resize_std_mx(mx, resize, std_basis_1, ...)

Change the basis of mx to a potentially larger or smaller 'std'-type basis given by std_basis_2.

state_to_pauli_density_vec(state_vec)

Convert a single qubit state vector into a Liouville vector in the Pauli basis.

state_to_stdmx(state_vec)

Convert a state vector into a density matrix.

stdmx_to_vec(m, basis)

Convert a matrix in the standard basis to a vector in the Pauli basis.

vec_to_stdmx(v, basis[, keep_complex])

Convert a vector in this basis to a matrix in the standard basis.