iq_readout.utils.from_complex#

from_complex(complex_shots)[source]#

Converts a complex numpy tensor to new float numpy tensor with an extra dimension at the end with the real and imaginary values. Useful to convert a vector with complex shots to the standard numpy arrays used in this package.

Parameters:
complex_shots

Complex numpy array.

Returns:
shots

Corresponding floating numpy array with shape (*complex_shots.shape, 2) where the last axis corresponds to the real and imaginary values.