exa.core.post_processing.excited_state_probability_computation.compute_average_state_probabilities

exa.core.post_processing.excited_state_probability_computation.compute_average_state_probabilities#

compute_average_state_probabilities(state_probabilities, average_state_probability_parameter, coords_to_values_mapping, dimension_for_averaging=None)#

Calculate average state probabilities for raw complex readout data of an RB experiment using already calculated state probabilities.

Excited state probability should be added to the dataset before executing this function.

The procedure goes roughly as follows. Average over a dimension in the data. Often, this corresponds to averaging across different Clifford sequences. In purity RB this corresponds to taking an (additional) average of the selected state probabilities (probability_parameter) obtained in a state tomography measurement for a given final rotation.

Parameters:
  • state_probabilities (DataArray) – The data for which average state probabilities are computed.

  • average_state_probability_parameter (Parameter) – The parameter that is used to build the returned data array.

  • coords_to_values_mapping (dict[Hashable, Any]) – Coordinate names to coordinate values mapping.

  • dimension_for_averaging (str | None) – Name of the dimension to take the average over. If not provided, will average over the first dimension.

Returns:

An instance of xarray.DataArray built with parameter average_state_probability_parameter.

Return type:

DataArray