Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the type hints for QuantumCircuit.append #13617

Open
alexanderivrii opened this issue Jan 7, 2025 · 0 comments
Open

Update the type hints for QuantumCircuit.append #13617

alexanderivrii opened this issue Jan 7, 2025 · 0 comments
Labels
documentation Something is not clear or an error documentation good first issue Good for newcomers
Milestone

Comments

@alexanderivrii
Copy link
Contributor

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.

@alexanderivrii alexanderivrii added documentation Something is not clear or an error documentation good first issue Good for newcomers labels Jan 7, 2025
@alexanderivrii alexanderivrii added this to the 2.0.0 milestone Jan 7, 2025
@github-project-automation github-project-automation bot moved this to Tagged but unassigned in Contributor Monitoring Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Something is not clear or an error documentation good first issue Good for newcomers
Projects
Status: Tagged but unassigned
Development

No branches or pull requests

1 participant