:py:mod:`pygsti.extras.interpygate.process_tomography` ====================================================== .. py:module:: pygsti.extras.interpygate.process_tomography .. autoapi-nested-parse:: Perform process tomography on a simulated quantum process. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: pygsti.extras.interpygate.process_tomography.multi_kron pygsti.extras.interpygate.process_tomography.vec pygsti.extras.interpygate.process_tomography.unvec pygsti.extras.interpygate.process_tomography.unvec_square pygsti.extras.interpygate.process_tomography.split pygsti.extras.interpygate.process_tomography.run_process_tomography .. py:function:: multi_kron(*a) Construct the tensor product of a series of matrices .. py:function:: vec(matrix) Returns an explicit column-vector representation of a square matrix, obtained by reading from the square matrix in column-major order. Args: matrix (list,numpy.ndarray): NxN matrix Returns: numpy.ndarray: N^2x1 dimensional column vector Raises: ValueError: If the input matrix is not square. .. py:function:: 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 .. py:function:: unvec_square(vectorized, order) Takes a vector whose length is a perfect square, and returns a square matrix representation by reading from the vectors entries to define the matrix in column-major order (order='F') or row-major order (order='C'). Args: vectorized: array-like, where np.array(vectorized).size is a perfect square. order: 'F' or 'C' Returns: numpy.ndarray: NxN dimensional array Raises: ValueError: If the length of the input is not a perfect square. .. py:function:: split(n, a) Divide list into n approximately equally sized chunks Args: n : int The number of chunks a : iterable The array to be divided into chunks Returns: numpy.ndarray The original data divided into n approximately equally sized chunks. .. py:function:: 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.