Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

[PhaseEstimation] Enable task 1.3 in Jupyter notebook #784

Closed
tcNickolas opened this issue May 19, 2022 · 0 comments · Fixed by #847
Closed

[PhaseEstimation] Enable task 1.3 in Jupyter notebook #784

tcNickolas opened this issue May 19, 2022 · 0 comments · Fixed by #847
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed tracking This label keeps public GitHub issues consistent with internal ADO tracking.

Comments

@tcNickolas
Copy link
Contributor

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 Extra attention is needed good first issue Good for newcomers tracking This label keeps public GitHub issues consistent with internal ADO tracking. labels May 19, 2022
@tcNickolas tcNickolas self-assigned this Oct 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers help wanted Extra attention is needed tracking This label keeps public GitHub issues consistent with internal ADO tracking.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant