qiskit
qiskit copied to clipboard
Add support for visualisation `Annotation`
What should we add?
Currently, the BoxOp.annotations field is ignored during visualisation. It really ought to show up somehow in the MPL drawer in particular.
This is tricky to do well, because Annotation is designed to be user subclassable, and in general may represent very complex data. Possible strategies might be:
- just the built-in
__repr__/__str__and rely on subclasses to fill that in with something that will work in a visualisation (not ideal: this overloads the functionality heavily) - add some sort of subclassable
Annotation.visualizemethod with a default implementation - have a global registry of "default" OQ3 serialisers/deserialisers (which annotation authors populate themselves), available for use by default by Qiskit and by users, and use that.