Tomography
The tomography module in Perceval provides tools for performing quantum tomography experiments.
StateTomography
- class perceval.algorithm.tomography.tomography.StateTomography(operator_processor, **kwargs)
Experiment to reconstruct the state of the system by tomography experiment.
Adds preparation and measurement circuits to input processor (with the gate operation under study)
Computes parameters required to do state tomography
Performs Tomography experiment - Computes and Returns density matrices for each input state
- Parameters:
operator_processor (
AProcessor
) – A perceval Processor with gate (or operation) on which state tomography needs to be performed.
- perform_state_tomography(prep_state_indices)
Computes the density matrix of a state after the operator_circuit. Size d x d where d=size_of_hilbert_space
- Parameters:
prep_state_indices (
list
) – list of length of number of qubits to index the corresponding preparation circuit- Return type:
ndarray
- Returns:
density matrix for a given input state preparation. size_hilbert x size_hilbert array.
ProcessTomography
- class perceval.algorithm.tomography.tomography.ProcessTomography(operator_processor, **kwargs)
Experiment to reconstruct the process map of the gate operation by tomography experiment.
Computes the mathematical tensors/matrices defined by theory required to perform process tomography.
Computes Chi matrix form of the operation process map.
Provides analysis methods to investigate the results of process tomography such as the fidelity of the operation and error process maps.
- Parameters:
operator_processor (
AProcessor
) – A perceval Processor with gate (or operation) on which process tomography needs to be performed
- average_fidelity(operator)
Computes the average fidelity of an operator (ideal) and its implementation (realistic). This is not a full fidelity of the operation as given by the process_fidelity but simply that of the gate.
- Parameters:
operator (
ndarray
) – operator (gate) matrix whose fidelity is to be calculated- Return type:
float
- Returns:
the computed fidelity - between 0 and 1
- chi_matrix()
Computes the chi matrix of the operator_circuit.
- Return type:
ndarray
- Returns:
Chi matrix normalized by gate efficiency (=its trace).
- error_process_matrix(computed_chi, operator)
Computes the error matrix for an operation from the computed chi matrix.
- Parameters:
computed_chi (
ndarray
) – chi matrix computed from process tomography.operator (
ndarray
) – Gate (or operator) matrix.
- Return type:
ndarray
- Returns:
error process matrix.
TomographyMLE
- class perceval.algorithm.tomography.tomography_mle.TomographyMLE(operator_processor, **kwargs)
Maximum likelihood Estimation for Quantum Tomography with an Accelerated Projected Gradient descent algorithm which takes an input guess and uses measurements to reconstruct quantum maps - either state or process.
StateTomographyMLE
- class perceval.algorithm.tomography.tomography_mle.StateTomographyMLE(operator_processor, **kwargs)
Maximum likelihood estimations to reconstruct quantum state density matrices.
- Parameters:
operator_processor – A perceval processor with gate (or operation) on which state tomography needs to be performed.
- static state_fidelity(target_state_dm, computed_state_dm)
Computes the fidelity of the density matrix reconstructed after State Tomography using MLE algorithm :type target_state_dm:
ndarray
:param target_state_dm: target Density Matrix of the State :type computed_state_dm:ndarray
:param computed_state_dm: reconstructed Density Matrix of the State :rtype:float
:return: fidelity of the reconstructed state
ProcessTomographyMLE
- class perceval.algorithm.tomography.tomography_mle.ProcessTomographyMLE(operator_processor, **kwargs)
Maximum likelihood estimations to reconstruct a given quantum process.
- Parameters:
operator_processor – A perceval processor with gate (or operation) on which state tomography needs to be performed.
- chi_matrix()
Computes the chi matrix of the quantum process under study using the MLE tomography :rtype:
ndarray
:return: chi matrix