Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.

qiskit.aqua.utils.get_subsystems_counts

get_subsystems_counts(complete_system_counts, post_select_index=None, post_select_flag=None)

GitHub

Extract all subsystems’ counts from the single complete system count dictionary.

If multiple classical registers are used to measure various parts of a quantum system, Each of the measurement dictionary’s keys would contain spaces as delimiters to separate the various parts being measured. For example, you might have three keys ‘11 010’, ‘01 011’ and ‘11 011’, among many other, in the count dictionary of the 5-qubit complete system, and would like to get the two subsystems’ counts (one 2-qubit, and the other 3-qubit) in order to get the counts for the 2-qubit partial measurement ‘11’ or the 3-qubit partial measurement ‘011’.

If the post_select_index and post_select_flag parameter are specified, the counts are returned subject to that specific post selection, that is, the counts for all subsystems where the subsystem at index post_select_index is equal to post_select_flag.

Parameters

  • complete_system_counts (dict) – The measurement count dictionary of a complete system that contains multiple classical registers for measurements s.t. the dictionary’s keys have space delimiters.
  • post_select_index (int) – Optional, the index of the subsystem to apply the post selection to.
  • post_select_flag (str) – Optional, the post selection value to apply to the subsystem at index post_select_index.

Returns

A list of measurement count dictionaries corresponding to

each of the subsystems measured.

Return type

list

Was this page helpful?
Report a bug or request content on GitHub.