Make exact-angle matching consistent across the compiler

Open
#5,680 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
cpp
Domain
compilers

Research direction

Start by comparing the angle handling described for the Clifford+T classifier, quake-simplify, skip-below, prune-negligible-rotations, the phase canonicalizer, state preparation, unitary synthesis, and gridsynth. The issue asks maintainers to decide how exactness and tolerance units should work across these cases, but does not identify files or tests. Done means agreeing on the rules and applying them consistently across the compiler.

Written by the indexing model from the issue text.

Description

enhancement stale-notified
Required prerequisites
  • Search the issue tracker to check if your feature has already been mentioned or rejected in other issues.
Describe the feature

A number of our passes need to decide whether a rotation angle is "really" an exact value, like zero or a multiple of π/4 that maps to a Clifford+T gate. Right now each pass makes that call in its own way.

The Clifford+T angle classifier compares bit for bit against a value it computes in quad precision from a 60-digit π/4 string (Eric asked about this in #5557). quake-simplify folds the angle by the gate's period and checks it against a threshold. skip-below and prune-negligible-rotations look at the raw angle and don't fold at all, and the phase canonicalizer, state preparation, unitary synthesis and gridsynth each have their own rules and defaults. We also get π from five different places at different precisions...

I think we should settle on one way of doing this (or different cases) and use it everywhere. That means deciding what "exact" should mean when no tolerance is given, what unit tolerances are expressed in. There are arguments for handling this in different way in different scenarios but we should be intentional.

Dominant language
C++
Stars
1.2k
Forks
508
Avg merge
1d 19h
Merged PRs (30d)
100

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

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.

More from NVIDIA/cuda-quantum

All issues in NVIDIA/cuda-quantum

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.