qiskit/test/python/providers
Jake Lishman a357f54fca
Annotation serialisation framework (#14439)
* Add `Annotation` base class and `BoxOp` support

This adds the basics of support for a custom annotation framework to
Qiskit.  An `Annotation` is a piece of custom-defined information (from
Qiskit's perspective; it's most likely to be transpiler-pass defined,
even downstream) that is localised to a particular instruction or scope.
Currently, the only supported location for use of annotations is `box`.

The meaning of the `Annotation` may currently be completely custom.  We
expect in the future to have a coarse set of validity ranges that
annotations associate themselves with, to allow the transpiler to
enforce that annotations are not violated by compiler passes that do not
understand them.  For now, it's up to the user not to call compiler
passes that invalidate annotations.

Annotations are closely related to the OpenQASM 3 concept of the same
name.  Serialisation to and from OpenQASM 3 and QPY is supported by
additional user-defined classes, whose interfaces are defined in
`qiskit.circuit.annotation`.  QPY version 15 is introduced, which makes
it a collaborative serialisation format, with well-defined slots in the
output stream for custom serialisers to store their data, including
state.  OpenQASM 3 annotation serialisers must be stateless, since that
language does not provide (nor intend) the same arbitrary co-operation.
QPY has this additional support for statefulness because we anticipate
larger amounts of data being transferred in annotations in QPY format
for subsequent processing.

* Complete documentation of subclassing

* Fix circuit equality of boxes

* Add support for annotations in `qasm3.load` API

This does a small amount of version negotiation with
`qiskit_qasm3_import`, which in turn checks the version of Qiskit.

* Include comment on equality

* Add OpenQASM 3 import/export tests

* Fix previous parameter-expression QPY documentation

* Support `BoxOp` in `GenericBackendV2`

* Fix annotation handling in `BoxOp.replace_blocks`

* Add transpilation integration test

* Fix GenericBackendV2 test

* Add `iter_namespaces` test

* Add QPY tests

* Add release note

* Fix parameter documentation

* Make test logic errors exceptions
2025-06-04 20:20:27 +00:00
..
basic_provider Remove Provider ABC (deprecated in 1.1) (#13435) 2025-02-27 19:45:44 +00:00
fake_provider Annotation serialisation framework (#14439) 2025-06-04 20:20:27 +00:00
__init__.py Remove coding: utf-8 per PEP 3120 (#4914) 2020-08-12 08:29:16 -04:00
fake_mumbai_v2.py Remove provider-specific fake backends,`FakeProvider` class and related tools in 1.0 (#11376) 2024-02-01 19:27:05 -05:00
test_backend_v2.py Remove pulse from GenericBackendV2 (#13829) 2025-02-13 16:08:52 +00:00
test_options.py Remove deprecated `BackendV1` elements, including base class, `providers.models` and `qobj` modules (#13793) 2025-03-05 23:11:24 +00:00