qiskit-community / qiskit-ignis

Ignis (deprecated) provides tools for quantum hardware verification, noise characterization, and error correction.
Apache License 2.0
168 stars 162 forks source link

Recreates get_subsystems_counts with marginal_counts #589

Closed splch closed 2 years ago

splch commented 2 years ago

Summary

With the deprecation of Qiskit Aqua, get_subsystems_counts will be lost. This method, however, is useful when looking at individual qubit counts from a multi-qubit circuit. marginal_counts helps create a simple version of get_subsystems_counts which is what this pull request does. By using marginal_counts, a new subsystems_counts method is made.

Details and comments

This pull request recreates basic functionality of get_subsystems_counts with a new subsystems_counts that uses the marginal_counts method.

Here is an example of the method:

results = execute(qc, backend=backend).result()
counts = subsystems_counts(results.get_counts())
plot_histogram(counts)

image

ShellyGarion commented 2 years ago

@splch - thank you very much for your suggestion!

However, Ignis will also be deprecated and eventually be replaced by Qiskit Experiments, written in a way that’s more modular and reusable for experimentalists, see the following blog: https://www.ibm.com/blogs/research/2021/04/qiskit-application-modules/

So we currently do not incorporate new code into Ignis. You may visit Qiskit Experiments github (https://github.com/Qiskit/qiskit-experiments) which is currently under active development.

Many of Qiskit Aqua functionalities were moved to Qiskit Terra. In fact, marginal_counts code is now part of qiskit.result: https://qiskit.org/documentation/stubs/qiskit.result.marginal_counts.html

So perhaps you would like to re-open your PR as part of Qiskit Terra github (https://github.com/Qiskit/qiskit-terra)?

mtreinish commented 2 years ago

Active feature development has ceased on qiskit-ignis as the project is deprecated and most of the work has moved to qiskit-experiments. As such I'm closing this PR but I agree with @ShellyGarion this seems like a use feature we can add to terra.