qiskit-aer/qiskit_aer/library
Matthew Treinish 1e86d65d9a
Adjust QuantumError.to_dict() to handle lack of Instruction.condition (#2301)
* Adjust QuantumError.to_dict() to handle lack of Instruction.condition

In Qiskit 2.0 the Instruction.condition attribute will be removed
following it's deprecation in 1.3.0. This attribute has been superseded
by the IfElseOp which covers the use case but offers more functionality.
The removal is pending in Qiskit/qiskit#13506 and the use of qiskit-aer
in Qiskit's tests is blocking progress on that PR. This commit makes the
usage of .condition optional to maintain compatibility with Qiskit<2.0
but also work in >=2.0 with the attribute removed.

* Handle condition for AerJump as a custom attribute

With the removal of .condition from the base instruction data model the
.c_if() method was also removed. To handle the conditional jump that
AerJump was used for a custom attribute .condition is added to the
instruction. This enables retaining the functionality, but doesn't rely
on the base data model to provide the attribute or method.
2025-01-25 21:46:50 +00:00
..
control_flow_instructions Adjust QuantumError.to_dict() to handle lack of Instruction.condition (#2301) 2025-01-25 21:46:50 +00:00
save_instructions Remove standalone and qobj (#2187) 2024-08-20 23:31:34 +09:00
set_instructions Remove usage of ``qiskit.extensions`` (#2023) 2024-01-09 13:22:23 +09:00
__init__.py add code-formatting with black for python and with clang-format for c++ (#1630) 2023-03-13 20:19:06 +00:00
default_qubits.py Remove usage of ``qiskit.extensions`` (#2023) 2024-01-09 13:22:23 +09:00
instructions_table.csv Move Aer to its own package (#1526) 2022-08-31 10:33:59 +09:00