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

[BUG] Circuit.simplify returns NoneType instead of an empty circuit #408

Open
ValentinS4t1qbit opened this issue Sep 16, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@ValentinS4t1qbit
Copy link
Collaborator

Issue: Bug Report

When using Circuit.simplify on a Circuit where all gates simply (ex: a circuit with 1 qubit, 2 consecutive H gates), the result is a NoneType.

Expected Behavior

It should instead be a circuit with 0 gates, containing the same number of qubits as before simplify.

Current Behavior
Tell us what happens instead of the expected behavior. Try to be clear and concise if you can. Feel free to add screenshots.

Steps to Reproduce (minimal example)

Circuit([Gate("H", 0)]*2).simplify() returns NoneType

Possible Solution

If the simplified circuit contains zero gates, simplify needs to return a circuit of 0 gates, containing the same number of qubits as the input circuit.

@ValentinS4t1qbit ValentinS4t1qbit added the bug Something isn't working label Sep 16, 2024
@ValentinS4t1qbit ValentinS4t1qbit self-assigned this Sep 16, 2024
@ValentinS4t1qbit ValentinS4t1qbit changed the title [BUG] <insert description> [BUG] Circuit.simplify returns NoneType instead of an empty circuit Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant