Note

This is the documentation for the current state of the development branch of Qiskit Experiments. The documentation or APIs here can change prior to being released.

MultiStateDiscrimination

class MultiStateDiscrimination(physical_qubits, backend=None, n_states=None, schedules=None)[source]

An experiment that discriminates between the first n energy states.

Overview

The experiment creates n circuits that prepare, respectively, the energy states |0,,|n1. For, e.g., n=4 the circuits are of the form

Circuit preparing \(|0\rangle\)

           ░ ┌─┐
       q: ─░─┤M├
           ░ └╥┘
    meas: ════╩═

...

Circuit preparing \(|3\rangle\)

          ┌───┐┌─────┐┌─────┐ ░ ┌─┐
       q: ┤ X ├┤ x12 ├┤ x23 ├─░─┤M├
          └───┘└─────┘└─────┘ ░ └╥┘
    meas: ═══════════════════════╩═

References

Qiskit Textbook

Analysis class reference

MultiStateDiscriminationAnalysis

Experiment options

These options can be set by the set_experiment_options() method.

Options
  • Defined in the class MultiStateDiscrimination:

    • n_states (int)

      Default value: 2
      The number of states to discriminate.
    • schedules (dict)

      Default value: None
      A dictionary of the schedules for the gates in the experiment. Each key is a gate name of the form xii+1 which should implement an x-rotation between level i and i+1.
  • Defined in the class BaseExperiment:

    • max_circuits (Optional[int])

      Default value: None
      The maximum number of circuits per job when running an experiment on a backend.

Initialization

Setup an experiment to prepare different energy states on a given qubit.

Parameters:
  • physical_qubits (Sequence[int]) – A single-element sequence containing the qubit on which to run the experiment.

  • backend (Optional[Backend]) – Optional, the backend to run the experiment on.

  • n_states (Optional[int]) – The number of energy levels to prepare.

  • schedules (Optional[Dict[str, ScheduleBlock]]) – The schedules of the x gates between neighboring energy levels.

Attributes

MultiStateDiscrimination.analysis

Return the analysis instance for the experiment

MultiStateDiscrimination.backend

Return the backend for the experiment

MultiStateDiscrimination.experiment_options

Return the options for the experiment.

MultiStateDiscrimination.experiment_type

Return experiment type.

MultiStateDiscrimination.num_qubits

Return the number of qubits for the experiment.

MultiStateDiscrimination.physical_qubits

Return the device qubits for the experiment.

MultiStateDiscrimination.run_options

Return options values for the experiment run() method.

MultiStateDiscrimination.transpile_options

Return the transpiler options for the run() method.

Methods

MultiStateDiscrimination.circuits()

Create the circuits for the multi state discrimination experiment.

MultiStateDiscrimination.config()

Return the config dataclass for this experiment

MultiStateDiscrimination.copy()

Return a copy of the experiment

MultiStateDiscrimination.from_config(config)

Initialize an experiment from experiment config

MultiStateDiscrimination.run([backend, ...])

Run an experiment and perform analysis.

MultiStateDiscrimination.set_experiment_options(...)

Set the experiment options.

MultiStateDiscrimination.set_run_options(...)

Set options values for the experiment run() method.

MultiStateDiscrimination.set_transpile_options(...)

Set the transpiler options for run() method.