exa.core.post_processing.contrast_computation.compute_contrast

exa.core.post_processing.contrast_computation.compute_contrast#

compute_contrast(data, primary_dim, contrast_param=Parameter(name='contrast', label='Qubit readout contrast', unit='', data_type=<DataType.FLOAT: 1>, collection_type=<CollectionType.SCALAR: 0>, element_indices=None), poq_param=Parameter(name='phase_optimal_quad', label='Phase of the first principal component', unit='', data_type=<DataType.FLOAT: 1>, collection_type=<CollectionType.SCALAR: 0>, element_indices=None))#

Compute qubit readout contrast using principal component analysis (Heinsoo2019), and the angle in the complex plane that maximizes the contrast.

Parameters:
  • data (DataArray) – DataArray containing complex readout results. May be N-dimensional. One of the coordinates should have a name given by primary_dim.

  • primary_dim (str) – The name of the axis in the data xr.DataArray, along which to perform principal component analysis.

  • contrast_param (Parameter) – optional custom parameter for the contrast.

  • poq_param (Parameter) – optional custom parameter for the phase of the optimal quadrature component. By default, will be Parameter("phase_optimal_quad").

Returns:

  • The calculated contrast, in same shape as data.

  • The angle of maximal contrast, in same shape as data with one dimension removed

Return type:

tuple[DataArray, DataArray]