pygsti.extras.interpygate.process_tomography

Perform process tomography on a simulated quantum process.

Module Contents

Functions

multi_kron(*a)

Construct the tensor product of a series of matrices

vec(matrix)

A function that vectorizes a matrix.

unvec(vectorized)

A function that vectorizes a process in the basis of matrix units, sorted first

split(n, a)

Divide list into n approximately equally sized chunks

run_process_tomography(state_to_density_matrix_fn[, ...])

A function to compute the process matrix for a quantum channel given a function

pygsti.extras.interpygate.process_tomography.multi_kron(*a)

Construct the tensor product of a series of matrices

pygsti.extras.interpygate.process_tomography.vec(matrix)

A function that vectorizes a matrix.

Args:

matrix (list,numpy.ndarray): NxN matrix

Returns:

numpy.ndarray: N^2x1 dimensional column vector

Raises:

ValueError: If the input matrix is not square.

pygsti.extras.interpygate.process_tomography.unvec(vectorized)

A function that vectorizes a process in the basis of matrix units, sorted first by column, then row.

Args:

vectorized (list,numpy.ndarray): Nx1 matrix or N-dimensional vector

Returns:

numpy.ndarray: NxN dimensional column vector

Raises:

ValueError: If the length of the input is not a perfect square

pygsti.extras.interpygate.process_tomography.split(n, a)

Divide list into n approximately equally sized chunks

Args:
nint

The number of chunks

aiterable

The array to be divided into chunks

Returns:
numpy.ndarray

The original data divided into n approximately equally sized chunks.

pygsti.extras.interpygate.process_tomography.run_process_tomography(state_to_density_matrix_fn, n_qubits=1, comm=None, verbose=False, basis='pp', time_dependent=False, opt_args=None)

A function to compute the process matrix for a quantum channel given a function that maps a pure input state to an output density matrix.

Args:
state_to_density_matrix_fn(function: array -> array)

The function that computes the output density matrix from an input pure state.

n_qubits(int, optional, default 1)

The number of qubits expected by the function. Defaults to 1.

comm(MPI.comm object, optional)

An MPI communicator object for parallel computation. Defaults to local comm.

verbose(bool, optional, default False)

How much detail to send to stdout

basis(str, optional, default ‘pp’)

The basis in which to return the process matrix

time_dependent(bool, optional, default False )

If the process is time dependent, then expect the density matrix function to return a list of density matrices, one at each time point.

opt_args(dict, optional)

Optional keyword arguments for state_to_density_matrix_fn

Returns:
numpy.ndarray

The process matrix representation of the quantum channel in the basis specified by ‘basis’. If ‘time_dependent’=True, then this will be an array of process matrices.