Note
This is the documentation for the current state of the development branch of Qiskit Experiments. The documentation or APIs here can change prior to being released.
ProcessTomographyAnalysis¶
- class ProcessTomographyAnalysis[source]¶
Quantum state and process tomography experiment analysis.
Warning
The API for tomography fitters is still under development so may change in future releases.
Overview
Fitter Functions
Built-in fitter functions may be selected using the following string labels, refer to the corresponding functions documentation for additional details on the fitters.
"linear_inversion"
:linear_inversion()
(Default)"scipy_linear_lstsq"
:scipy_linear_lstsq()
"cvxpy_linear_lstsq"
:cvxpy_linear_lstsq()
"scipy_gaussian_lstsq"
:scipy_gaussian_lstsq()
"cvxpy_gaussian_lstsq"
:cvxpy_gaussian_lstsq()
PSD Rescaling
For fitters that do not constrain the reconstructed state to be positive-semidefinite (PSD) we construct the maximum-likelihood nearest PSD state under the assumption of Gaussian measurement noise using the rescaling method in Reference [1]. For fitters that already support PSD constraints this option can be disabled by setting
rescale_positive=False
.References
[1] John A. Smolin, Jay M. Gambetta, Graeme Smith, Maximum Likelihood, Minimum Effort, Phys. Rev. Lett. 108, 070502 (2012), doi: 10.1103/PhysRevLett.108.070502 (open)
Analysis options
These are the keyword arguments of
run()
method.- Options
Defined in the class
ProcessTomographyAnalysis
:measurement_basis (
MeasurementBasis
)Default value: Instance ofPauliMeasurementBasis
The measurementMeasurementBasis
to use for tomographic process reconstruction.preparation_basis (
PreparationBasis
)Default value: Instance ofPauliPreparationBasis
The preparationPreparationBasis
to use for tomographic process reconstruction.fitter (str or Callable)
Default value:"linear_inversion"
The fitter function to use for reconstruction. rescale_psd (bool): If True rescale the fitted state to be positive-semidefinite (Default: True).fitter_options (dict)
Default value: {}Any addition kwarg options to be supplied to the fitter function. For documentation of available kwargs refer to the fitter function documentation.rescale_positive (bool)
Default value:True
If True rescale the state returned by the fitter to be positive-semidefinite. See the PSD Rescaling section for additional information (Default: True).rescale_trace (bool)
Default value:True
If True rescale the state returned by the fitter have either trace 1 forDensityMatrix
, or trace dim forChoi
matrices (Default: True).measurement_qubits (Sequence[int])
Default value:None
Optional, the physical qubits with tomographic measurements. If not specified will be set to[0, ..., N-1]
for N-qubit tomographic measurements.preparation_qubits (Sequence[int])
Default value:None
Optional, the physical qubits with tomographic preparations. If not specified will be set to[0, ..., N-1]
for N-qubit tomographic preparations. This can be a string to select one of the built-in fitters, or a callable to supply a custom fitter function. See the Fitter Functions section for additional information.target (str or
QuantumChannel
orOperator
)Default value:None
Optional, Set a custom target quantum channel for computing theprocess_fidelity()
of the fitted process against (Default: None).conditional_circuit_clbits (list[int])
Default value:None
Optional, the clbit indices in the source circuit to be conditioned on when reconstructing the channel. Enabling this will return a list of reconstrated channel components conditional on the values of these clbit values. The integer value of the conditioning clbits is stored in state analysis result extra field “conditional_circuit_outcome”.conditional_measurement_indices (list[int])
Default value:None
Optional, indices of tomography measurement qubits to used for conditional state reconstruction. Enabling this will return a list of reconstrated channel components conditioned on the remaining tomographic bases conditional on the basis index, and outcome value for these measurements. The conditional measurement basis index and integer value of the measurement outcome is stored in state analysis result extra fields “conditional_measurement_index” and “conditional_measurement_outcome” respectively.conditional_preparation_indices (list[int])
Default value:None
Optional, indices of tomography preparation qubits to used for conditional state reconstruction. Enabling this will return a list of reconstrated channel components conditioned on the remaining tomographic bases conditional on the basis index. The conditional preparation basis index is stored in state analysis result extra fields “conditional_preparation_index”.
Defined in the class
TomographyAnalysis
:target_bootstrap_samples (int)
Default value:0
Optional, number of outcome re-samples to draw from measurement data for each basis for computing a bootstrapped standard error of fidelity with the target state. If 0 no bootstrapping will be performed and the target fidelity will not include a standard error (Default: 0).target_bootstrap_seed (int | None | Generator)
Default value:None
Optional, RNG seed or Generator to use for bootstrapping data for boostrapped fidelity standard error calculation (Default: None).
Defined in the class
BaseAnalysis
:figure_names (str or List[str])
Default value:None
Identifier of figures that appear in the experiment data to sort figures by name.
Note
Fitters starting with
"cvxpy_*"
require the optional CVXPY Python package to be installed.See also
Initialization
Initialize the analysis object.
Attributes
Return the analysis options for
run()
method.Methods
Return the config dataclass for this analysis
Return a copy of the analysis
Initialize an analysis class from analysis config
ProcessTomographyAnalysis.run
(experiment_data)Run analysis and update ExperimentData with analysis result.
ProcessTomographyAnalysis.set_options
(**fields)Set the analysis options for
run()
method.