microsoft/qdk
Publicmirrored fromhttps://github.com/microsoft/qdkAvailable
katas/content/marking_oracles/contains_substring/Placeholder.qs
11lines · modecode
| 1 | namespace Kata { |
| 2 | operation Oracle_ContainsSubstring (x : Qubit[], y : Qubit, r : Bool[]) : Unit is Adj + Ctl { |
| 3 | // Implement your solution here... |
| 4 | |
| 5 | } |
| 6 | |
| 7 | // You might find this helper operation from an earlier task useful. |
| 8 | operation Oracle_ContainsSubstringAtPosition (x : Qubit[], y : Qubit, r : Bool[], p : Int) : Unit is Adj + Ctl { |
| 9 | ApplyControlledOnBitString(r, X, x[p .. p + Length(r) - 1], y); |
| 10 | } |
| 11 | } |
| 12 | |