# qiskit.ignis.measurement.DiscriminationFilter¶

class DiscriminationFilter(discriminator, base=None)[ソース]

Implements a filter based on a discriminator that takes level 1 data to level 2 data.

Usage:

my_filter = DiscriminationFilter(my_discriminator) new_result = filter.apply(level_1_data)

パラメータ
• discriminator (BaseDiscriminationFitter) – a discriminator that maps level 1 data to level 2 data. - Level 1 data may correspond to, e. g., IQ data. - Level 2 data is the state counts.

• base (Optional[int]) – the base of the expected states. If it is not given the base is inferred from the expected_state instance of discriminator.

__init__(discriminator, base=None)[ソース]
パラメータ
• discriminator (BaseDiscriminationFitter) – a discriminator that maps level 1 data to level 2 data. - Level 1 data may correspond to, e. g., IQ data. - Level 2 data is the state counts.

• base (Optional[int]) – the base of the expected states. If it is not given the base is inferred from the expected_state instance of discriminator.

Methods

 __init__(discriminator[, base]) type discriminator BaseDiscriminationFitter apply(raw_data) Create a new result from the raw_data by converting level 1 data to level 2 data. count(y_data) Converts discriminated results into raw counts. get_base(expected_states) Returns the base inferred from expected_states.
apply(raw_data)[ソース]

Create a new result from the raw_data by converting level 1 data to level 2 data.

パラメータ

raw_data (Result) – list of qiskit.Result or qiskit.Result.

Result

A list of qiskit.Result or qiskit.Result.

count(y_data)[ソース]

Converts discriminated results into raw counts.

パラメータ

y_data (List[str]) – result of a discrimination.

dict

A dict of raw counts.

static get_base(expected_states)[ソース]

Returns the base inferred from expected_states.

The intent is to allow users to discriminate states higher than 0/1.

DiscriminationFilter infers the basis from the expected states to allow users to discriminate states outside of the computational sub-space. For example, if the discriminated states are 00, 01, 02, 10, 11, …, 22 the basis will be 3.

With this implementation the basis can be at most 10.

パラメータ

expected_states (dict) –

the base inferred from the expected states

int

QiskitError – if there is an invalid input in the expected states