Skip to content

Make cancel_inverses also apply to gates through control flows #1066

Open
@paul0403

Description

@paul0403

Currently cancel_inverses does not detect potential opportunities if they are separated across the boundary of control flow constructs, e.g. for(4){Hadamard} or Hadamard, if(cond){True: Identity, False: Hadamard}. Being able to detect these opportunities would be a good addition.

This issue is more general than cancel_inverses. We essentially want to have an analysis available without having to explicitly unroll loops or hoist conditionals, since these could be expensive and are not guaranteed to happen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions