Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApplyQFT operation name is misleading #1812

Open
tcNickolas opened this issue Aug 1, 2024 · 1 comment
Open

ApplyQFT operation name is misleading #1812

tcNickolas opened this issue Aug 1, 2024 · 1 comment
Assignees
Labels
library related to Q# library code rather than the compiler implementation or language design

Comments

@tcNickolas
Copy link
Member

To follow up #1810 and the internal discussion on this: using ApplyQFT name for an operation that applies only a part of QFT is misleading and can lead to long and unpleasant debugging sessions. I would suggest renaming it to something like ApplyQFTRotations, which is a more accurate name, since it accurately describes that only the rotations part of the QFT is applied, and to introduce a new operation ApplyQFT that actually applies a complete QFT.

For example, I'm working on the second part of QFT kata, and every task in it includes applying either QFT or Adjoint QFT. We don't have dependencies between kata cells, and we don't have a single operation to apply QFT, so I have to include instructions regarding this in every task. I will run into the same issue when working on the QPE kata, programming assignments that include QFT and QPE, and so on.

@DmitryVasilevsky
Copy link
Contributor

DmitryVasilevsky commented Aug 5, 2024

I just want to mention a couple of arguments in favor of having a function that doesn't include swaps after QFT rotations.

  1. Sometimes additional swaps are not necessary, and the results can be harvested without applying swaps. Sometimes using Reversed() on the register is sufficient without applying actual swaps. Both approaches use fewer quantum gates than the actual SwapReverseRegister().
  2. Wikipedia article doesn't include SWAPs in the pictured QFT circuit.

When we started modernizing QDK we wanted to include only minimal functionality. That said, nothing prevents us from having both functions now.

@sezna sezna added library related to Q# library code rather than the compiler implementation or language design and removed needs triage labels Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
library related to Q# library code rather than the compiler implementation or language design
Projects
None yet
Development

No branches or pull requests

3 participants