utils

Utility functions and classes.

Functions

average_gate_fidelity_from_process_matrices(...)

Return the average gate fidelity between two process matrices.

average_gate_fidelity_from_unitaries(...[, ...])

Return the average gate fidelity between two unitary matrices.

expm(matrix, *[, unp_inner])

Matrix exponential that uses the configured namespace.

fill_array_by_idx(array, dimension, idxs, *)

Extend a square array using specified indices.

is_unitary(matrix, *[, unp_inner])

Check if a given matrix is unitary.

leakage_from_process_matrix(matrix, *[, ...])

Return the leakage from the qubit subspace.

leakage_from_time_evolution_operator(matrix, *)

Compute the leakage from the qubit subspace of a quantum operation.

partial_trace(matrix, sub_dims, keep, *[, ...])

Compute the partial trace of a matrix.

tensorprod(*args[, unp_inner])

Return the Kronecker tensor product of arrays using the provided namespace.

Classes

Components1D([vec, normalize])

1D components (vector) class.

Components2D([tensor])

2D components (tensor) class.