qiskit-algorithms
qiskit-algorithms copied to clipboard
[from qiskit] Use dataclass for AlgorithmResult
What should we add?
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