quara.protocol.qtomography.standard.preprocessing module

calc_num_ratios(nums)[source]

Returns number ratios.

Parameters

nums (List[int]) – a list of non-negative integers

Returns

a list of racios, ci:=Ni/N, where N:=sum_i Ni

Return type

List[float]

Raises

ValueError – All elements of nums must be non-negative.

calc_total_num(nums)[source]

Returns the total number in the list.

Parameters

nums (List[int]) – a list of non-negative integers, Ni.

Returns

sum_i Ni

Return type

int

extract_nums_from_empi_dists(empi_dists)[source]

Returns a list of numbers of data extracted from empirical distributions.

Parameters

empi_dists (List[Tuple[int, np.array]]) – A empirical distributions

Returns

A list of numbers of data

Return type

List[int]

extract_prob_dists_from_empi_dists(empi_dists)[source]

Returns a list of probbility distributions extracted from empirical distributions.

Parameters

empi_dists (List[Tuple[int, np.array]]) –

Returns

A list of probability distributions

Return type

List[np.array]

type_standard_qtomography(sqt)[source]

Returns string of Type of StandardQTomography.

Parameters

sqt (StandardQTomography) – StandardQTomography object to get string of Type.

Returns

string of Type of StandardQTomography.

Return type

str

Raises

TypeError – Type of StandardQTomography is invalid.