You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The qiskit marginal_counts method uses deprecated functionality when a Result object is used as input.
How can we reproduce the issue?
from qiskit.circuit import QuantumCircuit
from qiskit.result.utils import marginal_counts
from qiskit_aer import AerSimulator
import qiskit_aer
qiskit_aer.__version__
import warnings
warnings.simplefilter('default')
qc = QuantumCircuit(1, 1)
qc.h(0)
qc.measure_all()
backend = AerSimulator()
result = backend.run(qc, shots=100, memory=False).result()
result = marginal_counts(result, [0])
# qiskit 1.2.0
# qiskit_aer: 0.15.0
What should happen?
No warnings should be generated, but instead the output is
C:\develop\Python312\Lib\copy.py:434: DeprecationWarning: The class ``qiskit.qobj.common.QobjDictField`` is deprecated as of qiskit 1.2. It will be removed in the 2.0 release. The `Qobj` class and related functionality are part of the deprecated `BackendV1` workflow, and no longer necessary for `BackendV2`. If a user workflow requires `Qobj` it likely relies on deprecated functionality and should be updated to use `BackendV2`.
y = func(*args)
Any suggestions?
No response
The text was updated successfully, but these errors were encountered:
All of these warnings have their stack levels set correctly so that they do not blame user code. Setting the warnings to "show all warnings despite the filters" does show additional warnings, but there is some degree to which this is expected when deprecated functionality is in the process of being removed.
Fwiw, the actual deprecated functionality coming from the Result object that Aer is producing - the trouble is that Aer is still putting various deprecated Qobj things in its Result object, which are then dutifully deepcopyed. Qiskit isn't actually using deprecated functionality, the problem is just that it's deepcopying some deprecated objects that Aer actually created.
Environment
What is happening?
The qiskit
marginal_counts
method uses deprecated functionality when aResult
object is used as input.How can we reproduce the issue?
What should happen?
No warnings should be generated, but instead the output is
Any suggestions?
No response
The text was updated successfully, but these errors were encountered: