Skip to content

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

@ValentinS4t1qbit

Description

@ValentinS4t1qbit

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.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions