The QuantumCircuit.append method looks as follows
def append(
self,
instruction: Operation | CircuitInstruction,
qargs: Sequence[QubitSpecifier] | None = None,
cargs: Sequence[ClbitSpecifier] | None = None,
*,
copy: bool = True,
) -> InstructionSet:
with the instruction being appended to a quantum circuit being of type Operation | CircuitInstruction.
In practice, however, we can add also anything that has a to_instruction method (see also this comment). It would be nice to reflect this functionality in the type hints and/or in the following docstring.
The
QuantumCircuit.appendmethod looks as followswith the instruction being appended to a quantum circuit being of type
Operation | CircuitInstruction.In practice, however, we can add also anything that has a
to_instructionmethod (see also this comment). It would be nice to reflect this functionality in the type hints and/or in the following docstring.