PennyLaneAI / PennyLaneAI/catalyst
Make `cancel_inverses` also apply to gates through control flows
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 234
- Forks
- 84
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 66
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the cancel_inverses analysis and how the project represents control-flow constructs. Investigate the examples involving for(4){Hadamard} and conditional branches without explicitly unrolling loops or hoisting conditionals. Done means inverse opportunities are detected across these boundaries while preserving the requested general analysis.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100