microsoft/qdk
Publicmirrored fromhttps://github.com/microsoft/qdkAvailable
samples/python_interop/teleportation_project/src/RunTeleport.qs
19lines · modecode
| 1 | namespace RunTeleport { |
| 2 | import TeleportOperations.Teleport.*; // references the Teleport.qs file |
| 3 | |
| 4 | operation Main() : Unit { |
| 5 | use msg = Qubit(); |
| 6 | use target = Qubit(); |
| 7 | |
| 8 | H(msg); |
| 9 | Teleport(msg, target); // calls the Teleport() operation from Teleport.qs |
| 10 | H(target); |
| 11 | |
| 12 | if M(target) == Zero { |
| 13 | Message("Teleported successfully!"); |
| 14 | |
| 15 | Reset(msg); |
| 16 | Reset(target); |
| 17 | } |
| 18 | } |
| 19 | } |