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
Now that the Python 3.6 support is dropped we can use dataclasses in Qiskit. Since our AlgorithmResult was essentially a dictionary replacement we implemented ourselves, should we switch to simply using dataclass as an algorithm result?
That would have advantages like
much less overhead in writing algorithm results since no getters/setters are required (the docs can go into the class docstring)
access to dataclass features such as easy conversion to dicts or easily creating immutable results
The text was updated successfully, but these errors were encountered:
Also we should see whether we want/need to have something custom for a printable output - see comments in #58. The dataclass has a repr but potentially that may be viewed to have similar problems to the default in AlgorithmResult. Of course an end user can print any field they like - this was always a convenience to see everything - but everything may not scale well and a short result firm e.g. just the eigenvalue when thats what you are computing for, I can see too.
What should we add?
Now that the Python 3.6 support is dropped we can use
dataclasses
in Qiskit. Since ourAlgorithmResult
was essentially a dictionary replacement we implemented ourselves, should we switch to simply usingdataclass
as an algorithm result?That would have advantages like
The text was updated successfully, but these errors were encountered: