close
The Wayback Machine - https://web.archive.org/web/20220709115025/https://github.com/microsoft/QuantumKatas/issues/784
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

[PhaseEstimation] Enable task 1.3 in Jupyter notebook #784

Open
tcNickolas opened this issue May 19, 2022 · 0 comments
Open

[PhaseEstimation] Enable task 1.3 in Jupyter notebook #784

tcNickolas opened this issue May 19, 2022 · 0 comments
Labels
good first issue help wanted tracking

Comments

@tcNickolas
Copy link
Member

@tcNickolas tcNickolas commented May 19, 2022

Currently task 1.3 (Validate inputs to QPE) is covered by two types of tests - Q# test TestAssertIsEigenstate_True that checks that the solution doesn't throw exceptions on inputs that are a valid unitary-eigenstate pair, and C# tests that check that the solution does throw exception on inputs that are not a valid unitary-eigenstate pair. The first part of the test can be invoked via %kata magic, as usual, but the C# part cannot (see #166).

We can enable this task in the Jupyter Notebook frontend for this kata as follows:

  1. Add the code cell %kata TestAssertIsEigenstate_True magic and the operation skeleton, like we do for the regular tasks.
  2. Add another code cell after it that would define a new operation that calls AssertIsEigenstate with several commented out unitary-eigenstate pairs that should each throw exception.
  3. Add third code cell with %simulate magic calling the operation from the second cell*, and user instructions to uncomment a line, run second and third cells, check that an exception is thrown, comment the line and uncomment the next one, and try again.

This is not the best user experience we can offer, but fixing #166 is not trivial, and a temporary solution is better than none.

@tcNickolas tcNickolas added help wanted good first issue tracking labels May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue help wanted tracking
Projects
None yet
Development

No branches or pull requests

1 participant