microsoft/qdk
Publicmirrored from https://github.com/microsoft/qdkAvailable
katas/content/multi_qubit_systems/prepare_with_complex/verification.qs
19lines · modecode
| 1 | namespace Kata.Verification { |
| 2 | operation PrepareWithComplex_Reference(qs : Qubit[]) : Unit is Adj + Ctl { |
| 3 | H(qs[0]); |
| 4 | H(qs[1]); |
| 5 | S(qs[0]); |
| 6 | T(qs[1]); |
| 7 | } |
| 8 | |
| 9 | @EntryPoint() |
| 10 | operation CheckSolution() : Bool { |
| 11 | let isCorrect = AssertEqualOnZeroState(Kata.PrepareWithComplex, PrepareWithComplex_Reference); |
| 12 | if isCorrect { |
| 13 | Message("Correct!"); |
| 14 | } else { |
| 15 | Message("Incorrect."); |
| 16 | } |
| 17 | return isCorrect; |
| 18 | } |
| 19 | } |
| 20 | |