NVIDIA / NVIDIA/cuda-quantum

Allow decomposing gates with wires as inputs in `DecompositionPatterns`

Open
#674 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement stale-notified
Dominant language
C++
Stars
1.1k
Forks
456
Avg merge
1d 22h
Merged PRs (30d)
165

Description

Currently, all OpRewritePattern in DecompositionPatterns.cpp have the check

if (!quake::isAllReferences(op))
      return failure();

disallowing WireType as gate operands.

We should be able to lift this constraint.

See the discussion in: https://github.com/NVIDIA/cuda-quantum/pull/672#discussion_r1331747540

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in DecompositionPatterns.cpp and review the discussion in PR #672, especially the linked comment. Trace each OpRewritePattern's isAllReferences check and inspect the existing decomposition tests, if present, to understand wire operands and expected behavior. Done means gates with WireType operands can be decomposed without the current guard rejecting them.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.