Advertisement
Guest User

Untitled

a guest
Mar 1st, 2019
563
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. namespace Solution {
  2. open Microsoft.Quantum.Primitive;
  3. open Microsoft.Quantum.Canon;
  4.  
  5. operation F2 (x : Qubit[], y : Qubit) : Unit {
  6. F1(x, y);
  7. }
  8.  
  9. operation F1 (x : Qubit[], y : Qubit) : Unit {
  10. if (Length(x) > 1) {
  11. F2(x[0..Length(x)-2], y);
  12. }
  13. else {
  14. X(y);
  15. }
  16. }
  17.  
  18. operation Solve (x : Qubit[], y : Qubit) : Unit
  19. {
  20. F1(x, y);
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement