qsharp-lang 1.5.6-dev → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. package/dist/katas-content.generated.js +239 -2
  2. package/docs/Microsoft.Quantum.Arrays/All.md +1 -1
  3. package/docs/Microsoft.Quantum.Arrays/Any.md +1 -1
  4. package/docs/Microsoft.Quantum.Arrays/Chunks.md +1 -1
  5. package/docs/Microsoft.Quantum.Arrays/CircularlyShifted.md +1 -1
  6. package/docs/Microsoft.Quantum.Arrays/ColumnAt.md +1 -1
  7. package/docs/Microsoft.Quantum.Arrays/Count.md +1 -1
  8. package/docs/Microsoft.Quantum.Arrays/Diagonal.md +1 -1
  9. package/docs/Microsoft.Quantum.Arrays/DrawMany.md +1 -1
  10. package/docs/Microsoft.Quantum.Arrays/Enumerated.md +1 -1
  11. package/docs/Microsoft.Quantum.Arrays/Excluding.md +1 -1
  12. package/docs/Microsoft.Quantum.Arrays/Filtered.md +1 -1
  13. package/docs/Microsoft.Quantum.Arrays/FlatMapped.md +1 -1
  14. package/docs/Microsoft.Quantum.Arrays/Flattened.md +1 -1
  15. package/docs/Microsoft.Quantum.Arrays/Fold.md +1 -1
  16. package/docs/Microsoft.Quantum.Arrays/ForEach.md +1 -1
  17. package/docs/Microsoft.Quantum.Arrays/Head.md +1 -1
  18. package/docs/Microsoft.Quantum.Arrays/HeadAndRest.md +1 -1
  19. package/docs/Microsoft.Quantum.Arrays/IndexOf.md +1 -1
  20. package/docs/Microsoft.Quantum.Arrays/IndexRange.md +1 -1
  21. package/docs/Microsoft.Quantum.Arrays/Interleaved.md +1 -1
  22. package/docs/Microsoft.Quantum.Arrays/IsEmpty.md +1 -1
  23. package/docs/Microsoft.Quantum.Arrays/IsRectangularArray.md +1 -1
  24. package/docs/Microsoft.Quantum.Arrays/IsSorted.md +1 -1
  25. package/docs/Microsoft.Quantum.Arrays/IsSquareArray.md +1 -1
  26. package/docs/Microsoft.Quantum.Arrays/Mapped.md +1 -1
  27. package/docs/Microsoft.Quantum.Arrays/MappedByIndex.md +1 -1
  28. package/docs/Microsoft.Quantum.Arrays/MappedOverRange.md +1 -1
  29. package/docs/Microsoft.Quantum.Arrays/Most.md +1 -1
  30. package/docs/Microsoft.Quantum.Arrays/MostAndTail.md +1 -1
  31. package/docs/Microsoft.Quantum.Arrays/Padded.md +1 -1
  32. package/docs/Microsoft.Quantum.Arrays/Partitioned.md +1 -1
  33. package/docs/Microsoft.Quantum.Arrays/Rest.md +1 -1
  34. package/docs/Microsoft.Quantum.Arrays/Reversed.md +1 -1
  35. package/docs/Microsoft.Quantum.Arrays/SequenceI.md +1 -1
  36. package/docs/Microsoft.Quantum.Arrays/SequenceL.md +1 -1
  37. package/docs/Microsoft.Quantum.Arrays/Sorted.md +1 -1
  38. package/docs/Microsoft.Quantum.Arrays/Subarray.md +1 -1
  39. package/docs/Microsoft.Quantum.Arrays/Swapped.md +1 -1
  40. package/docs/Microsoft.Quantum.Arrays/Tail.md +1 -1
  41. package/docs/Microsoft.Quantum.Arrays/Transposed.md +1 -1
  42. package/docs/Microsoft.Quantum.Arrays/Unzipped.md +1 -1
  43. package/docs/Microsoft.Quantum.Arrays/Where.md +1 -1
  44. package/docs/Microsoft.Quantum.Arrays/Windows.md +1 -1
  45. package/docs/Microsoft.Quantum.Arrays/Zipped.md +1 -1
  46. package/docs/Microsoft.Quantum.Canon/ApplyCNOTChain.md +1 -1
  47. package/docs/Microsoft.Quantum.Canon/ApplyControlledOnBitString.md +1 -1
  48. package/docs/Microsoft.Quantum.Canon/ApplyControlledOnInt.md +1 -1
  49. package/docs/Microsoft.Quantum.Canon/ApplyP.md +1 -1
  50. package/docs/Microsoft.Quantum.Canon/ApplyPauli.md +1 -1
  51. package/docs/Microsoft.Quantum.Canon/ApplyPauliFromBitString.md +1 -1
  52. package/docs/Microsoft.Quantum.Canon/ApplyPauliFromInt.md +1 -1
  53. package/docs/Microsoft.Quantum.Canon/ApplyQFT.md +1 -1
  54. package/docs/Microsoft.Quantum.Canon/ApplyToEach.md +1 -1
  55. package/docs/Microsoft.Quantum.Canon/ApplyToEachA.md +1 -1
  56. package/docs/Microsoft.Quantum.Canon/ApplyToEachC.md +1 -1
  57. package/docs/Microsoft.Quantum.Canon/ApplyToEachCA.md +1 -1
  58. package/docs/Microsoft.Quantum.Canon/ApplyXorInPlace.md +1 -1
  59. package/docs/Microsoft.Quantum.Canon/ApplyXorInPlaceL.md +1 -1
  60. package/docs/Microsoft.Quantum.Canon/CX.md +1 -1
  61. package/docs/Microsoft.Quantum.Canon/CY.md +1 -1
  62. package/docs/Microsoft.Quantum.Canon/CZ.md +1 -1
  63. package/docs/Microsoft.Quantum.Canon/Fst.md +1 -1
  64. package/docs/Microsoft.Quantum.Canon/Snd.md +1 -1
  65. package/docs/Microsoft.Quantum.Canon/SwapReverseRegister.md +1 -1
  66. package/docs/Microsoft.Quantum.Convert/BigIntAsBoolArray.md +1 -1
  67. package/docs/Microsoft.Quantum.Convert/BoolArrayAsBigInt.md +1 -1
  68. package/docs/Microsoft.Quantum.Convert/BoolArrayAsInt.md +1 -1
  69. package/docs/Microsoft.Quantum.Convert/BoolArrayAsResultArray.md +1 -1
  70. package/docs/Microsoft.Quantum.Convert/BoolAsResult.md +1 -1
  71. package/docs/Microsoft.Quantum.Convert/ComplexAsComplexPolar.md +1 -1
  72. package/docs/Microsoft.Quantum.Convert/ComplexPolarAsComplex.md +1 -1
  73. package/docs/Microsoft.Quantum.Convert/IntAsBigInt.md +1 -1
  74. package/docs/Microsoft.Quantum.Convert/IntAsBoolArray.md +1 -1
  75. package/docs/Microsoft.Quantum.Convert/IntAsDouble.md +1 -1
  76. package/docs/Microsoft.Quantum.Convert/ResultArrayAsBoolArray.md +1 -1
  77. package/docs/Microsoft.Quantum.Convert/ResultArrayAsInt.md +1 -1
  78. package/docs/Microsoft.Quantum.Convert/ResultAsBool.md +1 -1
  79. package/docs/Microsoft.Quantum.Core/IsRangeEmpty.md +1 -1
  80. package/docs/Microsoft.Quantum.Core/Length.md +1 -1
  81. package/docs/Microsoft.Quantum.Core/RangeEnd.md +1 -1
  82. package/docs/Microsoft.Quantum.Core/RangeReverse.md +1 -1
  83. package/docs/Microsoft.Quantum.Core/RangeStart.md +1 -1
  84. package/docs/Microsoft.Quantum.Core/RangeStep.md +1 -1
  85. package/docs/Microsoft.Quantum.Core/Repeated.md +1 -1
  86. package/docs/Microsoft.Quantum.Diagnostics/DumpMachine.md +1 -1
  87. package/docs/Microsoft.Quantum.Diagnostics/DumpRegister.md +1 -1
  88. package/docs/Microsoft.Quantum.Diagnostics/Fact.md +1 -1
  89. package/docs/Microsoft.Quantum.Intrinsic/CCNOT.md +1 -1
  90. package/docs/Microsoft.Quantum.Intrinsic/CNOT.md +1 -1
  91. package/docs/Microsoft.Quantum.Intrinsic/Exp.md +1 -1
  92. package/docs/Microsoft.Quantum.Intrinsic/H.md +1 -1
  93. package/docs/Microsoft.Quantum.Intrinsic/I.md +1 -1
  94. package/docs/Microsoft.Quantum.Intrinsic/M.md +1 -1
  95. package/docs/Microsoft.Quantum.Intrinsic/Measure.md +1 -1
  96. package/docs/Microsoft.Quantum.Intrinsic/Message.md +1 -1
  97. package/docs/Microsoft.Quantum.Intrinsic/R.md +1 -1
  98. package/docs/Microsoft.Quantum.Intrinsic/R1.md +1 -1
  99. package/docs/Microsoft.Quantum.Intrinsic/R1Frac.md +1 -1
  100. package/docs/Microsoft.Quantum.Intrinsic/RFrac.md +1 -1
  101. package/docs/Microsoft.Quantum.Intrinsic/Reset.md +1 -1
  102. package/docs/Microsoft.Quantum.Intrinsic/ResetAll.md +1 -1
  103. package/docs/Microsoft.Quantum.Intrinsic/Rx.md +1 -1
  104. package/docs/Microsoft.Quantum.Intrinsic/Rxx.md +1 -1
  105. package/docs/Microsoft.Quantum.Intrinsic/Ry.md +1 -1
  106. package/docs/Microsoft.Quantum.Intrinsic/Ryy.md +1 -1
  107. package/docs/Microsoft.Quantum.Intrinsic/Rz.md +1 -1
  108. package/docs/Microsoft.Quantum.Intrinsic/Rzz.md +1 -1
  109. package/docs/Microsoft.Quantum.Intrinsic/S.md +1 -1
  110. package/docs/Microsoft.Quantum.Intrinsic/SWAP.md +1 -1
  111. package/docs/Microsoft.Quantum.Intrinsic/T.md +1 -1
  112. package/docs/Microsoft.Quantum.Intrinsic/X.md +1 -1
  113. package/docs/Microsoft.Quantum.Intrinsic/Y.md +1 -1
  114. package/docs/Microsoft.Quantum.Intrinsic/Z.md +1 -1
  115. package/docs/Microsoft.Quantum.Logical/Xor.md +1 -1
  116. package/docs/Microsoft.Quantum.Math/AbsComplex.md +1 -1
  117. package/docs/Microsoft.Quantum.Math/AbsComplexPolar.md +1 -1
  118. package/docs/Microsoft.Quantum.Math/AbsD.md +1 -1
  119. package/docs/Microsoft.Quantum.Math/AbsI.md +1 -1
  120. package/docs/Microsoft.Quantum.Math/AbsL.md +1 -1
  121. package/docs/Microsoft.Quantum.Math/AbsSquaredComplex.md +1 -1
  122. package/docs/Microsoft.Quantum.Math/AbsSquaredComplexPolar.md +1 -1
  123. package/docs/Microsoft.Quantum.Math/ApproximateFactorial.md +1 -1
  124. package/docs/Microsoft.Quantum.Math/ArcCos.md +1 -1
  125. package/docs/Microsoft.Quantum.Math/ArcCosh.md +1 -1
  126. package/docs/Microsoft.Quantum.Math/ArcSin.md +1 -1
  127. package/docs/Microsoft.Quantum.Math/ArcSinh.md +1 -1
  128. package/docs/Microsoft.Quantum.Math/ArcTan.md +1 -1
  129. package/docs/Microsoft.Quantum.Math/ArcTan2.md +1 -1
  130. package/docs/Microsoft.Quantum.Math/ArcTanh.md +1 -1
  131. package/docs/Microsoft.Quantum.Math/ArgComplex.md +1 -1
  132. package/docs/Microsoft.Quantum.Math/ArgComplexPolar.md +1 -1
  133. package/docs/Microsoft.Quantum.Math/Binom.md +1 -1
  134. package/docs/Microsoft.Quantum.Math/BitSizeI.md +1 -1
  135. package/docs/Microsoft.Quantum.Math/BitSizeL.md +1 -1
  136. package/docs/Microsoft.Quantum.Math/Ceiling.md +1 -1
  137. package/docs/Microsoft.Quantum.Math/Complex.md +1 -1
  138. package/docs/Microsoft.Quantum.Math/ComplexPolar.md +1 -1
  139. package/docs/Microsoft.Quantum.Math/ContinuedFractionConvergentI.md +1 -1
  140. package/docs/Microsoft.Quantum.Math/ContinuedFractionConvergentL.md +1 -1
  141. package/docs/Microsoft.Quantum.Math/Cos.md +1 -1
  142. package/docs/Microsoft.Quantum.Math/Cosh.md +1 -1
  143. package/docs/Microsoft.Quantum.Math/DivRemI.md +1 -1
  144. package/docs/Microsoft.Quantum.Math/DivRemL.md +1 -1
  145. package/docs/Microsoft.Quantum.Math/DividedByC.md +1 -1
  146. package/docs/Microsoft.Quantum.Math/DividedByCP.md +1 -1
  147. package/docs/Microsoft.Quantum.Math/E.md +1 -1
  148. package/docs/Microsoft.Quantum.Math/ExpModI.md +1 -1
  149. package/docs/Microsoft.Quantum.Math/ExpModL.md +1 -1
  150. package/docs/Microsoft.Quantum.Math/ExtendedGreatestCommonDivisorI.md +1 -1
  151. package/docs/Microsoft.Quantum.Math/ExtendedGreatestCommonDivisorL.md +1 -1
  152. package/docs/Microsoft.Quantum.Math/FactorialI.md +1 -1
  153. package/docs/Microsoft.Quantum.Math/FactorialL.md +1 -1
  154. package/docs/Microsoft.Quantum.Math/Floor.md +1 -1
  155. package/docs/Microsoft.Quantum.Math/GreatestCommonDivisorI.md +1 -1
  156. package/docs/Microsoft.Quantum.Math/GreatestCommonDivisorL.md +1 -1
  157. package/docs/Microsoft.Quantum.Math/HammingWeightI.md +1 -1
  158. package/docs/Microsoft.Quantum.Math/InverseModI.md +1 -1
  159. package/docs/Microsoft.Quantum.Math/InverseModL.md +1 -1
  160. package/docs/Microsoft.Quantum.Math/IsCoprimeI.md +1 -1
  161. package/docs/Microsoft.Quantum.Math/IsCoprimeL.md +1 -1
  162. package/docs/Microsoft.Quantum.Math/IsInfinite.md +1 -1
  163. package/docs/Microsoft.Quantum.Math/IsNaN.md +1 -1
  164. package/docs/Microsoft.Quantum.Math/LargestFixedPoint.md +1 -1
  165. package/docs/Microsoft.Quantum.Math/Lg.md +1 -1
  166. package/docs/Microsoft.Quantum.Math/Log.md +1 -1
  167. package/docs/Microsoft.Quantum.Math/Log10.md +1 -1
  168. package/docs/Microsoft.Quantum.Math/LogFactorialD.md +1 -1
  169. package/docs/Microsoft.Quantum.Math/LogGammaD.md +1 -1
  170. package/docs/Microsoft.Quantum.Math/LogOf2.md +1 -1
  171. package/docs/Microsoft.Quantum.Math/Max.md +1 -1
  172. package/docs/Microsoft.Quantum.Math/MaxD.md +1 -1
  173. package/docs/Microsoft.Quantum.Math/MaxI.md +1 -1
  174. package/docs/Microsoft.Quantum.Math/MaxL.md +1 -1
  175. package/docs/Microsoft.Quantum.Math/Min.md +1 -1
  176. package/docs/Microsoft.Quantum.Math/MinD.md +1 -1
  177. package/docs/Microsoft.Quantum.Math/MinI.md +1 -1
  178. package/docs/Microsoft.Quantum.Math/MinL.md +1 -1
  179. package/docs/Microsoft.Quantum.Math/MinusC.md +1 -1
  180. package/docs/Microsoft.Quantum.Math/MinusCP.md +1 -1
  181. package/docs/Microsoft.Quantum.Math/ModulusI.md +1 -1
  182. package/docs/Microsoft.Quantum.Math/ModulusL.md +1 -1
  183. package/docs/Microsoft.Quantum.Math/NegationC.md +1 -1
  184. package/docs/Microsoft.Quantum.Math/NegationCP.md +1 -1
  185. package/docs/Microsoft.Quantum.Math/PI.md +1 -1
  186. package/docs/Microsoft.Quantum.Math/PNorm.md +1 -1
  187. package/docs/Microsoft.Quantum.Math/PNormalized.md +1 -1
  188. package/docs/Microsoft.Quantum.Math/PlusC.md +1 -1
  189. package/docs/Microsoft.Quantum.Math/PlusCP.md +1 -1
  190. package/docs/Microsoft.Quantum.Math/PowC.md +1 -1
  191. package/docs/Microsoft.Quantum.Math/PowCP.md +1 -1
  192. package/docs/Microsoft.Quantum.Math/RealMod.md +1 -1
  193. package/docs/Microsoft.Quantum.Math/Round.md +1 -1
  194. package/docs/Microsoft.Quantum.Math/SignD.md +1 -1
  195. package/docs/Microsoft.Quantum.Math/SignI.md +1 -1
  196. package/docs/Microsoft.Quantum.Math/SignL.md +1 -1
  197. package/docs/Microsoft.Quantum.Math/Sin.md +1 -1
  198. package/docs/Microsoft.Quantum.Math/Sinh.md +1 -1
  199. package/docs/Microsoft.Quantum.Math/SmallestFixedPoint.md +1 -1
  200. package/docs/Microsoft.Quantum.Math/Sqrt.md +1 -1
  201. package/docs/Microsoft.Quantum.Math/SquaredNorm.md +1 -1
  202. package/docs/Microsoft.Quantum.Math/Tan.md +1 -1
  203. package/docs/Microsoft.Quantum.Math/Tanh.md +1 -1
  204. package/docs/Microsoft.Quantum.Math/TimesC.md +1 -1
  205. package/docs/Microsoft.Quantum.Math/TimesCP.md +1 -1
  206. package/docs/Microsoft.Quantum.Math/TrailingZeroCountI.md +1 -1
  207. package/docs/Microsoft.Quantum.Math/TrailingZeroCountL.md +1 -1
  208. package/docs/Microsoft.Quantum.Math/Truncate.md +1 -1
  209. package/docs/Microsoft.Quantum.Measurement/MResetEachZ.md +1 -1
  210. package/docs/Microsoft.Quantum.Measurement/MResetX.md +1 -1
  211. package/docs/Microsoft.Quantum.Measurement/MResetY.md +1 -1
  212. package/docs/Microsoft.Quantum.Measurement/MResetZ.md +1 -1
  213. package/docs/Microsoft.Quantum.Measurement/MeasureAllZ.md +1 -1
  214. package/docs/Microsoft.Quantum.Measurement/MeasureEachZ.md +1 -1
  215. package/docs/Microsoft.Quantum.Measurement/MeasureInteger.md +1 -1
  216. package/docs/Microsoft.Quantum.ResourceEstimation/AccountForEstimates.md +1 -1
  217. package/docs/Microsoft.Quantum.ResourceEstimation/AuxQubitCount.md +1 -1
  218. package/docs/Microsoft.Quantum.ResourceEstimation/BeginEstimateCaching.md +1 -1
  219. package/docs/Microsoft.Quantum.ResourceEstimation/BeginRepeatEstimates.md +1 -1
  220. package/docs/Microsoft.Quantum.ResourceEstimation/CczCount.md +1 -1
  221. package/docs/Microsoft.Quantum.ResourceEstimation/EndEstimateCaching.md +1 -1
  222. package/docs/Microsoft.Quantum.ResourceEstimation/EndRepeatEstimates.md +1 -1
  223. package/docs/Microsoft.Quantum.ResourceEstimation/MeasurementCount.md +1 -1
  224. package/docs/Microsoft.Quantum.ResourceEstimation/PSSPCLayout.md +1 -1
  225. package/docs/Microsoft.Quantum.ResourceEstimation/RepeatEstimates.md +1 -1
  226. package/docs/Microsoft.Quantum.ResourceEstimation/RotationCount.md +1 -1
  227. package/docs/Microsoft.Quantum.ResourceEstimation/RotationDepth.md +1 -1
  228. package/docs/Microsoft.Quantum.ResourceEstimation/SingleVariant.md +1 -1
  229. package/docs/Microsoft.Quantum.ResourceEstimation/TCount.md +1 -1
  230. package/docs/Microsoft.Quantum.Unstable.Arithmetic/AddLE.md +1 -1
  231. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfEqualL.md +1 -1
  232. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfEqualLE.md +1 -1
  233. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterL.md +1 -1
  234. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterLE.md +1 -1
  235. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterOrEqualL.md +1 -1
  236. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterOrEqualLE.md +1 -1
  237. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessL.md +1 -1
  238. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessLE.md +1 -1
  239. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessOrEqualL.md +1 -1
  240. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessOrEqualLE.md +1 -1
  241. package/docs/Microsoft.Quantum.Unstable.Arithmetic/FourierTDIncByLE.md +1 -1
  242. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByI.md +1 -1
  243. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByIUsingIncByLE.md +1 -1
  244. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByL.md +1 -1
  245. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLE.md +1 -1
  246. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLEUsingAddLE.md +1 -1
  247. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLUsingIncByLE.md +1 -1
  248. package/docs/Microsoft.Quantum.Unstable.Arithmetic/LookAheadDKRSAddLE.md +1 -1
  249. package/docs/Microsoft.Quantum.Unstable.Arithmetic/MAJ.md +1 -1
  250. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ReflectAboutInteger.md +1 -1
  251. package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryCGAddLE.md +1 -1
  252. package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryCGIncByLE.md +1 -1
  253. package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryTTKIncByLE.md +1 -1
  254. package/docs/Microsoft.Quantum.Unstable.StatePreparation/ApproximatelyPreparePureStateCP.md +1 -1
  255. package/docs/Microsoft.Quantum.Unstable.StatePreparation/PreparePureStateD.md +1 -1
  256. package/docs/Microsoft.Quantum.Unstable.TableLookup/Select.md +1 -1
  257. package/lib/node/qsc_wasm_bg.wasm +0 -0
  258. package/lib/web/qsc_wasm_bg.wasm +0 -0
  259. package/package.json +1 -1
  260. package/ux/circuit.tsx +31 -1
@@ -6111,6 +6111,157 @@ export default {
6111
6111
  ],
6112
6112
  "published": false
6113
6113
  },
6114
+ {
6115
+ "id": "marking_oracles",
6116
+ "title": "Marking Oracles",
6117
+ "sections": [
6118
+ {
6119
+ "type": "lesson",
6120
+ "id": "marking_oracles__overview",
6121
+ "title": "Overview",
6122
+ "items": [
6123
+ {
6124
+ "type": "text-content",
6125
+ "asHtml": "<p>Quantum oracles are a key part of many quantum algorithms that rely on a quantum implementation of a classical function. The algorithms' discussions often assume that the quantum oracle that implements the function of interest is provided.\nHowever, in practice implementing a quantum oracle for a specific problem can be quite challenging.</p>\n<p>This kata continues the exploration of quantum oracles started in the Oracles kata, offering you a variety of practice problems on implementing marking oracles. If you're not familiar with the concept of quantum oracles, make sure to check out the Oracles kata that introduces the key concepts in this topic and offers a lot of simple practice problems.</p>\n<p><strong>This kata covers the following topics:</strong></p>\n<ul>\n<li>Implementation of marking oracles for different classical functions</li>\n</ul>\n<p><strong>What you should know to start working on this kata:</strong></p>\n<ul>\n<li>Fundamental quantum concepts</li>\n<li>Controlled gates</li>\n<li>Oracles, in particular marking oracles</li>\n</ul>\n",
6126
+ "asMarkdown": "\nQuantum oracles are a key part of many quantum algorithms that rely on a quantum implementation of a classical function. The algorithms' discussions often assume that the quantum oracle that implements the function of interest is provided.\nHowever, in practice implementing a quantum oracle for a specific problem can be quite challenging.\n\nThis kata continues the exploration of quantum oracles started in the Oracles kata, offering you a variety of practice problems on implementing marking oracles. If you're not familiar with the concept of quantum oracles, make sure to check out the Oracles kata that introduces the key concepts in this topic and offers a lot of simple practice problems.\n\n**This kata covers the following topics:**\n\n- Implementation of marking oracles for different classical functions\n\n**What you should know to start working on this kata:**\n\n- Fundamental quantum concepts\n- Controlled gates\n- Oracles, in particular marking oracles"
6127
+ }
6128
+ ]
6129
+ },
6130
+ {
6131
+ "type": "exercise",
6132
+ "id": "marking_oracles__kth_bit",
6133
+ "title": "K-th Bit",
6134
+ "description": {
6135
+ "type": "text-content",
6136
+ "asHtml": "<p><strong>Inputs:</strong></p>\n<ol>\n<li>$N$ qubits in an arbitrary state $\\ket{x}$ (input/query register).</li>\n<li>A qubit in an arbitrary state $\\ket{y}$ (output/target qubit).</li>\n<li>An integer $k$ such that $0 \\le k &lt; N$.</li>\n</ol>\n<p><strong>Goal:</strong>\nImplement a marking oracle which calculates the $k$-th bit of the input array, that is, the function\n$$f(x) = x_k$$</p>\n<p>In other words, for each basis state $\\ket{x}$, flip the state of the target qubit $\\ket{y}$ if $f(x) = 1$, and leave it unchanged otherwise.\nLeave the qubits in the input register in the same state they started in.\nYour solution should work on inputs in superposition, and not use any measurements.</p>\n",
6137
+ "asMarkdown": "**Inputs:** \n\n1. $N$ qubits in an arbitrary state $\\ket{x}$ (input/query register).\n2. A qubit in an arbitrary state $\\ket{y}$ (output/target qubit).\n3. An integer $k$ such that $0 \\le k < N$.\n\n**Goal:** \nImplement a marking oracle which calculates the $k$-th bit of the input array, that is, the function\n$$f(x) = x_k$$\n\nIn other words, for each basis state $\\ket{x}$, flip the state of the target qubit $\\ket{y}$ if $f(x) = 1$, and leave it unchanged otherwise.\nLeave the qubits in the input register in the same state they started in. \nYour solution should work on inputs in superposition, and not use any measurements.\n"
6138
+ },
6139
+ "sourceIds": [
6140
+ "marking_oracles__kth_bit__Verification.qs",
6141
+ "KatasLibrary.qs"
6142
+ ],
6143
+ "placeholderCode": "namespace Kata {\n operation Oracle_Kth_Bit(x : Qubit[], y : Qubit, k : Int) : Unit is Adj + Ctl {\n // Implement your solution here...\n\n }\n}\n",
6144
+ "explainedSolution": {
6145
+ "type": "explained-solution",
6146
+ "items": [
6147
+ {
6148
+ "type": "text-content",
6149
+ "asHtml": "<p>Since the effect of this oracle depends only on the value of the $k$-th qubit, we can ignore the rest of the qubits and focus on just <code>x[k]</code>. We need to flip the state of the target qubit if the input qubit <code>x[k]</code> is in the $\\ket{1}$ state and leave it unchanged otherwise - this is exactly the effect of the $CNOT$ gate with the qubit <code>x[k]</code> used as control and the qubit <code>y</code> used as target.</p>\n",
6150
+ "asMarkdown": "\nSince the effect of this oracle depends only on the value of the $k$-th qubit, we can ignore the rest of the qubits and focus on just `x[k]`. We need to flip the state of the target qubit if the input qubit `x[k]` is in the $\\ket{1}$ state and leave it unchanged otherwise - this is exactly the effect of the $CNOT$ gate with the qubit `x[k]` used as control and the qubit `y` used as target."
6151
+ },
6152
+ {
6153
+ "type": "solution",
6154
+ "id": "marking_oracles__kth_bit_solution",
6155
+ "code": "namespace Kata {\n operation Oracle_Kth_Bit(x : Qubit[], y : Qubit, k : Int) : Unit is Adj + Ctl {\n CNOT(x[k], y);\n }\n}\n"
6156
+ }
6157
+ ]
6158
+ }
6159
+ },
6160
+ {
6161
+ "type": "exercise",
6162
+ "id": "marking_oracles__parity",
6163
+ "title": "Parity Function",
6164
+ "description": {
6165
+ "type": "text-content",
6166
+ "asHtml": "<p><strong>Inputs:</strong></p>\n<ol>\n<li>$N$ qubits in an arbitrary state $\\ket{x}$ (input/query register).</li>\n<li>A qubit in an arbitrary state $\\ket{y}$ (output/target qubit).</li>\n</ol>\n<p><strong>Goal:</strong>\nImplement a marking oracle which calculates the parity of the input array, that is, the function\n$$f(x) = 1 \\text{ if } x \\text{ has an odd number of 1s, and } 0 \\text{ otherwise }$$</p>\n<p>In other words, for each basis state $\\ket{x}$, flip the state of the target qubit $\\ket{y}$ if $f(x) = 1$, and leave it unchanged otherwise.\nLeave the qubits in the input register in the same state they started in.\nYour solution should work on inputs in superposition, and not use any measurements.</p>\n<details>\n<summary><strong>Need a hint?</strong></summary>\n$f(x)$ can be represented as $x_0 \\oplus x_1 \\oplus ... \\oplus x_{N-1}$.\n</details>\n",
6167
+ "asMarkdown": "**Inputs:** \n\n1. $N$ qubits in an arbitrary state $\\ket{x}$ (input/query register).\n2. A qubit in an arbitrary state $\\ket{y}$ (output/target qubit).\n\n**Goal:** \nImplement a marking oracle which calculates the parity of the input array, that is, the function\n$$f(x) = 1 \\text{ if } x \\text{ has an odd number of 1s, and } 0 \\text{ otherwise }$$\n\nIn other words, for each basis state $\\ket{x}$, flip the state of the target qubit $\\ket{y}$ if $f(x) = 1$, and leave it unchanged otherwise.\nLeave the qubits in the input register in the same state they started in. \nYour solution should work on inputs in superposition, and not use any measurements.\n\n<details>\n<summary><strong>Need a hint?</strong></summary>\n$f(x)$ can be represented as $x_0 \\oplus x_1 \\oplus ... \\oplus x_{N-1}$.\n</details>\n"
6168
+ },
6169
+ "sourceIds": [
6170
+ "marking_oracles__parity__Verification.qs",
6171
+ "KatasLibrary.qs"
6172
+ ],
6173
+ "placeholderCode": "namespace Kata {\n operation Oracle_Parity(x : Qubit[], y : Qubit) : Unit is Adj + Ctl {\n // Implement your solution here...\n\n }\n}\n",
6174
+ "explainedSolution": {
6175
+ "type": "explained-solution",
6176
+ "items": [
6177
+ {
6178
+ "type": "text-content",
6179
+ "asHtml": "<p>We can write $f(x)$ as follows:</p>\n<p>$$f(x) = x_0 \\oplus x_1 \\oplus ... \\oplus x_{N-1}$$</p>\n<p>Let's substitute this expression in the expression for the oracle effect on the quantum state:</p>\n<p>$$U_f \\ket{x} \\ket{y} = \\ket{x} \\ket{y \\oplus f(x)} = \\ket{x} \\ket{y \\oplus x_0 \\oplus x_1 \\oplus ... \\oplus x_{N-1}}$$</p>\n<p>Now, we can represent the final state of the target qubit as a result of a series of $N$ marking oracles applied sequentially, marking oracle $j$ flipping its state if the state of the input qubit $j$ $\\ket{x_j}$ is $\\ket{1}$.\nAs we saw in the previous task, each of these marking oracles can be implemented as a single $CNOT$ gate.</p>\n",
6180
+ "asMarkdown": "\nWe can write $f(x)$ as follows:\n\n$$f(x) = x_0 \\oplus x_1 \\oplus ... \\oplus x_{N-1}$$\n\nLet's substitute this expression in the expression for the oracle effect on the quantum state:\n\n$$U_f \\ket{x} \\ket{y} = \\ket{x} \\ket{y \\oplus f(x)} = \\ket{x} \\ket{y \\oplus x_0 \\oplus x_1 \\oplus ... \\oplus x_{N-1}}$$\n\nNow, we can represent the final state of the target qubit as a result of a series of $N$ marking oracles applied sequentially, marking oracle $j$ flipping its state if the state of the input qubit $j$ $\\ket{x_j}$ is $\\ket{1}$.\nAs we saw in the previous task, each of these marking oracles can be implemented as a single $CNOT$ gate."
6181
+ },
6182
+ {
6183
+ "type": "solution",
6184
+ "id": "marking_oracles__parity_solution",
6185
+ "code": "namespace Kata {\n operation Oracle_Parity(x : Qubit[], y : Qubit) : Unit is Adj + Ctl {\n for xi in x {\n CNOT(xi, y);\n }\n }\n}\n"
6186
+ }
6187
+ ]
6188
+ }
6189
+ },
6190
+ {
6191
+ "type": "exercise",
6192
+ "id": "marking_oracles__product",
6193
+ "title": "Product Function",
6194
+ "description": {
6195
+ "type": "text-content",
6196
+ "asHtml": "<p><strong>Inputs:</strong></p>\n<ol>\n<li>$N$ qubits in an arbitrary state $\\ket{x}$ (input/query register).</li>\n<li>A qubit in an arbitrary state $\\ket{y}$ (output/target qubit).</li>\n<li>A bit vector $r$ of length $N$ represented as a <code>Bool[]</code>.</li>\n</ol>\n<p><strong>Goal:</strong>\nImplement a marking oracle which calculates the scalar product function\n$$f(x) = \\bigoplus\\limits_{i=0}^{N-1} r_i x_i$$</p>\n<p>In other words, for each basis state $\\ket{x}$, flip the state of the target qubit $\\ket{y}$ if $f(x) = 1$, and leave it unchanged otherwise.\nLeave the qubits in the input register in the same state they started in.\nYour solution should work on inputs in superposition, and not use any measurements.</p>\n",
6197
+ "asMarkdown": "**Inputs:** \n\n1. $N$ qubits in an arbitrary state $\\ket{x}$ (input/query register).\n2. A qubit in an arbitrary state $\\ket{y}$ (output/target qubit).\n3. A bit vector $r$ of length $N$ represented as a `Bool[]`.\n\n**Goal:** \nImplement a marking oracle which calculates the scalar product function\n$$f(x) = \\bigoplus\\limits_{i=0}^{N-1} r_i x_i$$\n\nIn other words, for each basis state $\\ket{x}$, flip the state of the target qubit $\\ket{y}$ if $f(x) = 1$, and leave it unchanged otherwise.\nLeave the qubits in the input register in the same state they started in. \nYour solution should work on inputs in superposition, and not use any measurements.\n"
6198
+ },
6199
+ "sourceIds": [
6200
+ "marking_oracles__product__Verification.qs",
6201
+ "KatasLibrary.qs"
6202
+ ],
6203
+ "placeholderCode": "namespace Kata {\n operation Oracle_Product(x : Qubit[], y : Qubit, r : Bool[]) : Unit is Adj + Ctl {\n // Implement your solution here...\n\n }\n}\n",
6204
+ "explainedSolution": {
6205
+ "type": "explained-solution",
6206
+ "items": [
6207
+ {
6208
+ "type": "text-content",
6209
+ "asHtml": "<p>This problem is similar to the previous one, but this time the input qubit <code>x[j]</code> affects the state of the target qubit only if the classical input <code>r[i]</code> is set to <code>true</code>.\nWe can use a similar approach to the solution as well: iterate through all input qubits, check whether the corresponding input bit <code>r[i]</code> is <code>true</code>, and if it is, apply a $CNOT$ gate with qubit <code>x[j]</code> as the control and the qubit <code>y</code> as the target.</p>\n",
6210
+ "asMarkdown": "\nThis problem is similar to the previous one, but this time the input qubit `x[j]` affects the state of the target qubit only if the classical input `r[i]` is set to `true`. \nWe can use a similar approach to the solution as well: iterate through all input qubits, check whether the corresponding input bit `r[i]` is `true`, and if it is, apply a $CNOT$ gate with qubit `x[j]` as the control and the qubit `y` as the target."
6211
+ },
6212
+ {
6213
+ "type": "solution",
6214
+ "id": "marking_oracles__product_solution",
6215
+ "code": "namespace Kata {\n operation Oracle_Product(x : Qubit[], y : Qubit, r : Bool[]) : Unit is Adj + Ctl {\n for i in 0 .. Length(x) - 1 {\n if r[i] {\n CNOT(x[i], y);\n }\n }\n }\n}\n"
6216
+ }
6217
+ ]
6218
+ }
6219
+ },
6220
+ {
6221
+ "type": "exercise",
6222
+ "id": "marking_oracles__product_negation",
6223
+ "title": "Product Function with Negation",
6224
+ "description": {
6225
+ "type": "text-content",
6226
+ "asHtml": "<p><strong>Inputs:</strong></p>\n<ol>\n<li>$N$ qubits in an arbitrary state $\\ket{x}$ (input/query register).</li>\n<li>A qubit in an arbitrary state $\\ket{y}$ (output/target qubit).</li>\n<li>A bit vector $r$ of length $N$ represented as a <code>Bool[]</code>.</li>\n</ol>\n<p><strong>Goal:</strong>\nImplement a marking oracle which calculates the following function:\n$$f(x) = \\bigoplus\\limits_{i=0}^{N-1} \\left(r_i x_i \\oplus (1 - r_i) (1 - x_i) \\right)$$</p>\n<p>In other words, for each basis state $\\ket{x}$, flip the state of the target qubit $\\ket{y}$ if $f(x) = 1$, and leave it unchanged otherwise.\nLeave the qubits in the input register in the same state they started in.\nYour solution should work on inputs in superposition, and not use any measurements.</p>\n<details>\n<summary><strong>Need a hint?</strong></summary>\nSince each addition is done modulo $2$, you can evaluate the effect of each term independently.\n</details>\n",
6227
+ "asMarkdown": "**Inputs:** \n\n1. $N$ qubits in an arbitrary state $\\ket{x}$ (input/query register).\n2. A qubit in an arbitrary state $\\ket{y}$ (output/target qubit).\n3. A bit vector $r$ of length $N$ represented as a `Bool[]`.\n\n**Goal:** \nImplement a marking oracle which calculates the following function:\n$$f(x) = \\bigoplus\\limits_{i=0}^{N-1} \\left(r_i x_i \\oplus (1 - r_i) (1 - x_i) \\right)$$\n\nIn other words, for each basis state $\\ket{x}$, flip the state of the target qubit $\\ket{y}$ if $f(x) = 1$, and leave it unchanged otherwise.\nLeave the qubits in the input register in the same state they started in. \nYour solution should work on inputs in superposition, and not use any measurements.\n\n<details>\n<summary><strong>Need a hint?</strong></summary>\nSince each addition is done modulo $2$, you can evaluate the effect of each term independently.\n</details>\n"
6228
+ },
6229
+ "sourceIds": [
6230
+ "marking_oracles__product_negation__Verification.qs",
6231
+ "KatasLibrary.qs"
6232
+ ],
6233
+ "placeholderCode": "namespace Kata {\n operation Oracle_ProductWithNegation(x : Qubit[], y : Qubit, r : Bool[]) : Unit is Adj + Ctl {\n // Implement your solution here...\n\n }\n}\n",
6234
+ "explainedSolution": {
6235
+ "type": "explained-solution",
6236
+ "items": [
6237
+ {
6238
+ "type": "text-content",
6239
+ "asHtml": "<p>Again, this problem is similar to the previous one. This time, each input qubit <code>x[j]</code> always affects the state of the target qubit, and the matching classical input <code>r[i]</code> specifies the way how it does that.\nIf the bit <code>r[i]</code> is <code>true</code>, the state of the target qubit is flipped if the input qubit <code>x[j]</code> is in the $\\ket{1}$ state;\notherwise, it is flipped if <code>x[j]</code> is in the $\\ket{0}$ state. (You can check that this is exactly what the formula\n$\\left(r_i x_i \\oplus (1 - r_i) (1 - x_i) \\right)$ evaluates to!)</p>\n<p>This means that we need to modify our solution to the previous task to add a second clause to the if statement, to handle the case when <code>r[i]</code> is <code>false</code>. The gate we need to apply in this scenario is controlled-on-zero $X$, which we can implement using the library operation <code>ApplyControlledOnInt</code>.</p>\n",
6240
+ "asMarkdown": "\nAgain, this problem is similar to the previous one. This time, each input qubit `x[j]` always affects the state of the target qubit, and the matching classical input `r[i]` specifies the way how it does that. \nIf the bit `r[i]` is `true`, the state of the target qubit is flipped if the input qubit `x[j]` is in the $\\ket{1}$ state;\notherwise, it is flipped if `x[j]` is in the $\\ket{0}$ state. (You can check that this is exactly what the formula \n$\\left(r_i x_i \\oplus (1 - r_i) (1 - x_i) \\right)$ evaluates to!)\n\nThis means that we need to modify our solution to the previous task to add a second clause to the if statement, to handle the case when `r[i]` is `false`. The gate we need to apply in this scenario is controlled-on-zero $X$, which we can implement using the library operation `ApplyControlledOnInt`."
6241
+ },
6242
+ {
6243
+ "type": "solution",
6244
+ "id": "marking_oracles__product_negation_solution",
6245
+ "code": "namespace Kata {\n operation Oracle_ProductWithNegation(x : Qubit[], y : Qubit, r : Bool[]) : Unit is Adj + Ctl {\n for i in 0 .. Length(x) - 1 {\n if r[i] {\n CNOT(x[i], y);\n } else {\n ApplyControlledOnInt(0, X, [x[i]], y);\n }\n }\n }\n}\n"
6246
+ }
6247
+ ]
6248
+ }
6249
+ },
6250
+ {
6251
+ "type": "lesson",
6252
+ "id": "marking_oracles__conclusion",
6253
+ "title": "Conclusion",
6254
+ "items": [
6255
+ {
6256
+ "type": "text-content",
6257
+ "asHtml": "<p>Congratulations! In this kata you got a lot of practice building quantum oracles for different classical functions.</p>\n",
6258
+ "asMarkdown": "\nCongratulations! In this kata you got a lot of practice building quantum oracles for different classical functions."
6259
+ }
6260
+ ]
6261
+ }
6262
+ ],
6263
+ "published": false
6264
+ },
6114
6265
  {
6115
6266
  "id": "teleportation",
6116
6267
  "title": "Teleportation",
@@ -6262,6 +6413,68 @@ export default {
6262
6413
  }
6263
6414
  ]
6264
6415
  }
6416
+ },
6417
+ {
6418
+ "type": "exercise",
6419
+ "id": "teleportation__prepare_and_send_message",
6420
+ "title": "Prepare Message and Send It",
6421
+ "description": {
6422
+ "type": "text-content",
6423
+ "asHtml": "<p>Given a message represented as a Pauli basis and a Result value indicating a basis state of that basis, prepare a message qubit in that state.\nResult values <code>Zero</code> and <code>One</code> correspond to preparing states $\\ket{0}$ or $\\ket{1}$ for <code>PauliZ</code> basis, $\\ket{+}$ or $\\ket{-}$ for <code>PauliX</code> basis, and $\\ket{i}$ or $\\ket{-i}$ for <code>PauliY</code> basis. Then entangle this <code>qMessage</code> qubit with Alice's qubit, and extract two classical bits to be sent to Bob.</p>\n<p><strong>Inputs:</strong></p>\n<ol>\n<li>Alice's part of the entangled pair of qubits <code>qAlice</code>.</li>\n<li>A basis in which the message qubit should be prepared - <code>PauliX</code>, <code>PauliY</code>, or <code>PauliZ</code>.</li>\n<li>A Result value indicating the qubit state.</li>\n</ol>\n<p><strong>Outputs:</strong>\nTwo classical bits Alice will send to Bob via classical channel as a tuple of <code>Bool</code> values. Same as in the earlier task, the first bit in the tuple should hold the result of measurement of the message qubit and the second bit, the result of measurement of Alice's qubit. Represent measurement result <code>One</code> as <code>true</code> and <code>Zero</code> as <code>false</code>. The state of the qubit <code>qAlice</code> in the end of the operation doesn't matter.</p>\n",
6424
+ "asMarkdown": "Given a message represented as a Pauli basis and a Result value indicating a basis state of that basis, prepare a message qubit in that state. \nResult values `Zero` and `One` correspond to preparing states $\\ket{0}$ or $\\ket{1}$ for `PauliZ` basis, $\\ket{+}$ or $\\ket{-}$ for `PauliX` basis, and $\\ket{i}$ or $\\ket{-i}$ for `PauliY` basis. Then entangle this `qMessage` qubit with Alice's qubit, and extract two classical bits to be sent to Bob.\n\n**Inputs:** \n1. Alice's part of the entangled pair of qubits `qAlice`.\n2. A basis in which the message qubit should be prepared - `PauliX`, `PauliY`, or `PauliZ`.\n3. A Result value indicating the qubit state.\n\n**Outputs:** \nTwo classical bits Alice will send to Bob via classical channel as a tuple of `Bool` values. Same as in the earlier task, the first bit in the tuple should hold the result of measurement of the message qubit and the second bit, the result of measurement of Alice's qubit. Represent measurement result `One` as `true` and `Zero` as `false`. The state of the qubit `qAlice` in the end of the operation doesn't matter."
6425
+ },
6426
+ "sourceIds": [
6427
+ "teleportation__prepare_and_send_message__Verification.qs",
6428
+ "KatasLibrary.qs",
6429
+ "teleportation__Common.qs"
6430
+ ],
6431
+ "placeholderCode": "namespace Kata {\n operation PrepareAndSendMessage(qAlice : Qubit, basis : Pauli, state : Result) : (Bool, Bool) {\n // Implement your solution here...\n return (false, false);\n }\n \n // You might find this helper operation from earlier tasks useful.\n operation SendMessage(qAlice: Qubit, qMessage: Qubit) : (Bool, Bool) {\n CNOT(qMessage, qAlice);\n H(qMessage);\n return (M(qMessage) == One, M(qAlice) == One);\n }\n}",
6432
+ "explainedSolution": {
6433
+ "type": "explained-solution",
6434
+ "items": [
6435
+ {
6436
+ "type": "text-content",
6437
+ "asHtml": "<p>The exercise aims to prepare the <code>qMessage</code> as one of the basis states of the required Pauli bases.</p>\n<ul>\n<li>Initialize the <code>qMessage</code> qubit in $\\ket{0}$ or $\\ket{1}$ based on the value of <code>state</code>. These are the eigenstates of Pauli $Z$ gate.</li>\n<li>Using the $H$ gate, eigenstates of the Pauli $X$ gate can be prepared from the eigenstates of Pauli $Z$:\n$$\\ket{+} = H\\ket{0}, \\ket{-} = H\\ket{1}$$</li>\n<li>Using the $S$ gate, eigenstates of the Pauli $Y$ gate can be prepared from the eigenstates of Pauli $X$:\n$$\\ket{i} = S\\ket{+}, \\ket{-i} = S\\ket{-}$$</li>\n</ul>\n<p>Finally, use the <code>SendMessage</code> operation implemented in the earlier exercise to send the message.</p>\n",
6438
+ "asMarkdown": "\nThe exercise aims to prepare the `qMessage` as one of the basis states of the required Pauli bases.\n\n- Initialize the `qMessage` qubit in $\\ket{0}$ or $\\ket{1}$ based on the value of `state`. These are the eigenstates of Pauli $Z$ gate.\n- Using the $H$ gate, eigenstates of the Pauli $X$ gate can be prepared from the eigenstates of Pauli $Z$:\n $$\\ket{+} = H\\ket{0}, \\ket{-} = H\\ket{1}$$\n- Using the $S$ gate, eigenstates of the Pauli $Y$ gate can be prepared from the eigenstates of Pauli $X$:\n $$\\ket{i} = S\\ket{+}, \\ket{-i} = S\\ket{-}$$\n\nFinally, use the `SendMessage` operation implemented in the earlier exercise to send the message."
6439
+ },
6440
+ {
6441
+ "type": "solution",
6442
+ "id": "teleportation__prepare_and_send_message_solution",
6443
+ "code": "namespace Kata {\n operation PrepareAndSendMessage(qAlice : Qubit, basis : Pauli, state : Result) : (Bool, Bool) {\n use qMessage = Qubit();\n if state == One {\n X(qMessage);\n }\n if basis != PauliZ {\n H(qMessage);\n }\n if basis == PauliY {\n S(qMessage);\n }\n let classicalBits = SendMessage(qAlice, qMessage);\n Reset(qMessage);\n return classicalBits;\n }\n\n operation SendMessage(qAlice: Qubit, qMessage: Qubit) : (Bool, Bool) {\n CNOT(qMessage, qAlice);\n H(qMessage);\n return (M(qMessage) == One, M(qAlice) == One);\n }\n}"
6444
+ }
6445
+ ]
6446
+ }
6447
+ },
6448
+ {
6449
+ "type": "exercise",
6450
+ "id": "teleportation__reconstruct_and_measure_message",
6451
+ "title": "Reconstruct Message and Measure It",
6452
+ "description": {
6453
+ "type": "text-content",
6454
+ "asHtml": "<p>Transform Bob's qubit into the required state using the two classical bits received from Alice and measure it in the same basis in which she prepared the message.</p>\n<p><strong>Inputs:</strong></p>\n<ol>\n<li>Bob's part of the entangled pair of qubits <code>qBob</code>.</li>\n<li>The tuple of classical bits received from Alice, in the format used in the Send Message exercise.</li>\n<li>The basis in which the message qubit was originally prepared - <code>PauliX</code>, <code>PauliY</code>, or <code>PauliZ</code>.</li>\n</ol>\n<p><strong>Output:</strong>\nA Result value indicating the basis state in which the message qubit was prepared, <code>One</code> or <code>Zero</code>. The state of the qubit <code>qBob</code> in the end of the operation doesn't matter.</p>\n",
6455
+ "asMarkdown": "Transform Bob's qubit into the required state using the two classical bits received from Alice and measure it in the same basis in which she prepared the message.\n\n**Inputs:** \n1. Bob's part of the entangled pair of qubits `qBob`.\n2. The tuple of classical bits received from Alice, in the format used in the Send Message exercise.\n3. The basis in which the message qubit was originally prepared - `PauliX`, `PauliY`, or `PauliZ`.\n\n**Output:** \nA Result value indicating the basis state in which the message qubit was prepared, `One` or `Zero`. The state of the qubit `qBob` in the end of the operation doesn't matter."
6456
+ },
6457
+ "sourceIds": [
6458
+ "teleportation__reconstruct_and_measure_message__Verification.qs",
6459
+ "KatasLibrary.qs",
6460
+ "teleportation__Common.qs"
6461
+ ],
6462
+ "placeholderCode": "namespace Kata {\n operation ReconstructAndMeasureMessage(qBob : Qubit, (b1 : Bool, b2 : Bool), basis : Pauli) : Result { \n // Implement your solution here...\n return Zero;\n }\n \n // You might find this helper operation from earlier tasks useful.\n operation ReconstructMessage(qBob : Qubit, (b1 : Bool, b2 : Bool)) : Unit {\n if b1 {\n Z(qBob);\n }\n if b2 {\n X(qBob);\n }\n }\n}",
6463
+ "explainedSolution": {
6464
+ "type": "explained-solution",
6465
+ "items": [
6466
+ {
6467
+ "type": "text-content",
6468
+ "asHtml": "<p>The exercise can be done easily using solutions to earlier exercises.</p>\n<ul>\n<li>First, reconstruct the state of qubit <code>qBob</code> using the <code>ReconstructMessage</code> operation from an earlier exercise. This would bring the <code>qBob</code> state into one of the basis states of the given basis.</li>\n<li>Now, we know from the &quot;Measurements in Single-Qubit Systems&quot; kata that the default measurement operation <code>M</code> performs measurement in the <code>Pauli Z</code> basis. To get the correct result for the measurement of <code>qBob</code> qubit, you need to perform the measurement in the given basis using the operation <code>Measure</code>.</li>\n</ul>\n",
6469
+ "asMarkdown": "\nThe exercise can be done easily using solutions to earlier exercises.\n- First, reconstruct the state of qubit `qBob` using the `ReconstructMessage` operation from an earlier exercise. This would bring the `qBob` state into one of the basis states of the given basis.\n- Now, we know from the \"Measurements in Single-Qubit Systems\" kata that the default measurement operation `M` performs measurement in the `Pauli Z` basis. To get the correct result for the measurement of `qBob` qubit, you need to perform the measurement in the given basis using the operation `Measure`."
6470
+ },
6471
+ {
6472
+ "type": "solution",
6473
+ "id": "teleportation__reconstruct_and_measure_solution",
6474
+ "code": "namespace Kata {\n operation ReconstructAndMeasureMessage(qBob : Qubit, (b1 : Bool, b2 : Bool), basis : Pauli) : Result {\n ReconstructMessage(qBob, (b1, b2));\n return Measure([basis], [qBob]);\n }\n\n operation ReconstructMessage(qBob : Qubit, (b1 : Bool, b2 : Bool)) : Unit {\n if b1 {\n Z(qBob);\n }\n if b2 {\n X(qBob);\n }\n }\n}"
6475
+ }
6476
+ ]
6477
+ }
6265
6478
  }
6266
6479
  ],
6267
6480
  "published": false
@@ -6274,7 +6487,7 @@ export default {
6274
6487
  },
6275
6488
  {
6276
6489
  "id": "KatasLibrary.qs",
6277
- "code": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nnamespace Microsoft.Quantum.Katas {\n open Microsoft.Quantum.Arrays;\n open Microsoft.Quantum.Diagnostics;\n open Microsoft.Quantum.Math;\n open Microsoft.Quantum.Random;\n\n /// # Summary\n /// Given two operations, checks whether they act identically (including global phase) for all input states.\n /// This is done through controlled versions of the operations instead of plain ones which convert the global phase\n /// into a relative phase that can be detected.\n operation CheckOperationsAreEqualStrict(\n inputSize : Int,\n op : (Qubit[] => Unit is Adj + Ctl),\n reference : (Qubit[] => Unit is Adj + Ctl))\n : Bool {\n Fact(inputSize > 0, \"`inputSize` must be positive\");\n let controlledOp = register => Controlled op(register[...0], register[1...]);\n let controlledReference = register => Controlled reference(register[...0], register[1...]);\n let areEquivalent = CheckOperationsAreEqual(inputSize + 1, controlledOp, controlledReference);\n areEquivalent\n }\n\n /// # Summary\n /// Given two operations, checks whether they act identically on the zero state |0〉 ⊗ |0〉 ⊗ ... ⊗ |0〉 composed of\n /// `inputSize` qubits.\n operation CheckOperationsEquivalenceOnZeroState(\n op : (Qubit[] => Unit),\n reference : (Qubit[] => Unit is Adj),\n inputSize : Int)\n : Bool {\n Fact(inputSize > 0, \"`inputSize` must be positive\");\n use target = Qubit[inputSize];\n op(target);\n Adjoint reference(target);\n let isCorrect = CheckAllZero(target);\n ResetAll(target);\n isCorrect\n }\n\n\n /// # Summary\n /// Given two operations, checks whether they act identically on the given initial state composed of `inputSize` qubits.\n /// The initial state is prepared by applying the `initialState` operation to the state |0〉 ⊗ |0〉 ⊗ ... ⊗ |0〉.\n /// This operation introduces a control qubit to convert a global phase into a relative phase to be able to detect it.\n /// `initialState` operation should be deterministic.\n operation CheckOperationsEquivalenceOnInitialStateStrict(\n initialState : Qubit[] => Unit is Adj,\n op : (Qubit[] => Unit is Adj + Ctl),\n reference : (Qubit[] => Unit is Adj + Ctl),\n inputSize : Int\n ) : Bool {\n use (control, target) = (Qubit(), Qubit[inputSize]);\n within {\n H(control);\n initialState(target);\n }\n apply {\n Controlled op([control], target);\n Adjoint Controlled reference([control], target);\n }\n\n let isCorrect = CheckAllZero([control] + target);\n ResetAll([control] + target);\n isCorrect\n }\n\n\n /// # Summary\n /// Given two operations, checks whether they act identically on the zero state |0〉 ⊗ |0〉 ⊗ ... ⊗ |0〉 composed of\n /// `inputSize` qubits.\n /// This operation introduces a control qubit to convert a global phase into a relative phase to be able to detect\n /// it.\n operation CheckOperationsEquivalenceOnZeroStateStrict(\n op : (Qubit[] => Unit is Adj + Ctl),\n reference : (Qubit[] => Unit is Adj + Ctl),\n inputSize : Int)\n : Bool {\n Fact(inputSize > 0, \"`inputSize` must be positive\");\n CheckOperationsEquivalenceOnInitialStateStrict(qs => (), op, reference, inputSize)\n }\n\n\n /// # Summary\n /// Shows the comparison of the quantum states produced by a specific operation and a reference operation\n /// when applied to the state prepared using deterministic operation `initialState`.\n operation ShowQuantumStateComparison(\n registerSize : Int,\n initialState : Qubit[] => Unit,\n op : Qubit[] => Unit,\n reference : Qubit[] => Unit)\n : Unit {\n {\n use register = Qubit[registerSize];\n initialState(register);\n\n Message(\"Initial quantum state:\");\n DumpMachine();\n\n // Apply the reference operation and dump the simulator state\n reference(register);\n Message(\"Expected quantum state after applying the operation:\");\n DumpMachine();\n ResetAll(register);\n }\n\n {\n use register = Qubit[registerSize];\n initialState(register);\n // Apply the comparison operation and dump the simulator state\n op(register);\n Message(\"Actual quantum state after applying the operation:\");\n DumpMachine();\n ResetAll(register);\n }\n }\n\n /// # Summary\n /// Given two operations, checks whether they act identically on the zero state |0〉 ⊗ |0〉 ⊗ ... ⊗ |0〉 composed of\n /// `inputSize` qubits. If they don't, prints user feedback.\n operation CheckOperationsEquivalenceOnZeroStateWithFeedback(\n testImpl : (Qubit[] => Unit),\n refImpl : (Qubit[] => Unit is Adj),\n inputSize : Int\n ) : Bool {\n\n let isCorrect = CheckOperationsEquivalenceOnZeroState(testImpl, refImpl, inputSize);\n\n // Output different feedback to the user depending on whether the exercise was correct.\n if isCorrect {\n Message(\"Correct!\");\n } else {\n Message(\"Incorrect.\");\n ShowQuantumStateComparison(inputSize, (qs => ()), testImpl, refImpl);\n }\n isCorrect\n }\n\n\n internal operation EntangleRegisters(\n control : Qubit[],\n target : Qubit[]) : Unit is Adj + Ctl {\n Fact(\n Length(control) == Length(target),\n $\"The length of qubit registers must be the same.\");\n\n for index in IndexRange(control) {\n H(control[index]);\n CNOT(control[index], target[index]);\n }\n }\n\n\n /// # Summary\n /// Prepare a random uneven superposition state on the given qubit array.\n operation PrepDemoState(qs : Qubit[]) : Unit {\n Fact(Length(qs) <= 4, \"States with 5 qubits or more are not supported.\");\n let probs = [0.36, 0.25, 1. / 3., 1. / 5.][... Length(qs) - 1];\n for (q, prob) in Zipped(qs, probs) {\n Ry(ArcCos(Sqrt(prob)) * 2.0, q);\n }\n }\n\n\n // \"Framework\" operation for testing single-qubit tasks for distinguishing states of one qubit\n // with Bool return\n operation DistinguishTwoStates_SingleQubit(\n statePrep : ((Qubit, Int) => Unit is Adj),\n testImpl : (Qubit => Bool),\n stateNames : String[],\n preserveState : Bool) : Bool {\n\n let nTotal = 100;\n let nStates = 2;\n mutable misclassifications = [0, size=nStates];\n\n use q = Qubit();\n for _ in 1 .. nTotal {\n // get a random bit to define whether qubit will be in a state corresponding to true return (1) or to false one (0)\n // state = 0 false return\n // state = 1 true return\n let state = DrawRandomInt(0, 1);\n\n // do state prep: convert |0⟩ to outcome with false return or to outcome with true return depending on state\n statePrep(q, state);\n\n // get the solution's answer and verify if NOT a match, then differentiate what kind of mismatch\n let ans = testImpl(q);\n if ans != (state == 1) {\n set misclassifications w/= state <- misclassifications[state] + 1;\n }\n\n // If the final state is to be preserved, check if it was not modified\n if preserveState {\n Adjoint statePrep(q, state);\n if not CheckZero(q) {\n Message($\"Input quantum state {stateNames[state]} was not preserved during the measurement.\");\n Reset(q);\n return false;\n }\n } else {\n Reset(q);\n }\n }\n\n mutable totalMisclassifications = 0;\n for i in 0 .. nStates - 1 {\n if misclassifications[i] != 0 {\n set totalMisclassifications += misclassifications[i];\n Message($\"Misclassified {stateNames[i]} as {stateNames[1 - i]} in {misclassifications[i]} test runs.\");\n }\n }\n\n totalMisclassifications == 0\n }\n\n\n // \"Framework\" operation for testing multi-qubit tasks for distinguishing states of an array of qubits\n // with Int return\n operation DistinguishStates_MultiQubit(\n nQubits : Int,\n nStates : Int,\n statePrep : ((Qubit[], Int, Double) => Unit is Adj),\n testImpl : (Qubit[] => Int),\n preserveState : Bool,\n stateNames : String[]) : Bool {\n\n let nTotal = 100;\n // misclassifications will store the number of times state i has been classified as state j (dimension nStates^2)\n mutable misclassifications = [0, size = nStates * nStates];\n // unknownClassifications will store the number of times state i has been classified as some invalid state (index < 0 or >= nStates)\n mutable unknownClassifications = [0, size = nStates];\n\n use qs = Qubit[nQubits];\n for _ in 1 .. nTotal {\n // get a random integer to define the state of the qubits\n let state = DrawRandomInt(0, nStates - 1);\n // get a random rotation angle to define the exact state of the qubits\n // for some exercises, this value might be a dummy variable which does not matter\n let alpha = DrawRandomDouble(0.0, 1.0) * PI();\n\n // do state prep: convert |0...0⟩ to outcome with return equal to state\n statePrep(qs, state, alpha);\n\n // get the solution's answer and verify that it's a match, if not, increase the exact mismatch count\n let ans = testImpl(qs);\n if ans >= 0 and ans < nStates {\n // classification result is a valid state index - check if is it correct\n if ans != state {\n set misclassifications w/= ((state * nStates) + ans) <- (misclassifications[(state * nStates) + ans] + 1);\n }\n }\n else {\n // classification result is an invalid state index - file it separately\n set unknownClassifications w/= state <- (unknownClassifications[state] + 1);\n }\n\n if preserveState {\n // check that the state of the qubit after the operation is unchanged\n Adjoint statePrep(qs, state, alpha);\n if not CheckAllZero(qs) {\n Message($\"Input quantum state {stateNames[state]} was not preserved during the measurement.\");\n ResetAll(qs);\n return false;\n }\n } else {\n // we're not checking the state of the qubit after the operation\n ResetAll(qs);\n }\n }\n\n mutable totalMisclassifications = 0;\n for i in 0 .. nStates - 1 {\n for j in 0 .. nStates - 1 {\n if misclassifications[(i * nStates) + j] != 0 {\n set totalMisclassifications += misclassifications[i * nStates + j];\n Message($\"Misclassified {stateNames[i]} as {stateNames[j]} in {misclassifications[(i * nStates) + j]} test runs.\");\n }\n }\n if unknownClassifications[i] != 0 {\n set totalMisclassifications += unknownClassifications[i];\n Message($\"Misclassified {stateNames[i]} as Unknown State in {unknownClassifications[i]} test runs.\");\n }\n }\n totalMisclassifications == 0\n }\n\n}\n"
6490
+ "code": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nnamespace Microsoft.Quantum.Katas {\n open Microsoft.Quantum.Arrays;\n open Microsoft.Quantum.Convert;\n open Microsoft.Quantum.Diagnostics;\n open Microsoft.Quantum.Math;\n open Microsoft.Quantum.Random;\n\n /// # Summary\n /// Given two operations, checks whether they act identically (including global phase) for all input states.\n /// This is done through controlled versions of the operations instead of plain ones which convert the global phase\n /// into a relative phase that can be detected.\n operation CheckOperationsAreEqualStrict(\n inputSize : Int,\n op : (Qubit[] => Unit is Adj + Ctl),\n reference : (Qubit[] => Unit is Adj + Ctl))\n : Bool {\n Fact(inputSize > 0, \"`inputSize` must be positive\");\n let controlledOp = register => Controlled op(register[...0], register[1...]);\n let controlledReference = register => Controlled reference(register[...0], register[1...]);\n let areEquivalent = CheckOperationsAreEqual(inputSize + 1, controlledOp, controlledReference);\n areEquivalent\n }\n\n /// # Summary\n /// Given two operations, checks whether they act identically on the zero state |0〉 ⊗ |0〉 ⊗ ... ⊗ |0〉 composed of\n /// `inputSize` qubits.\n operation CheckOperationsEquivalenceOnZeroState(\n op : (Qubit[] => Unit),\n reference : (Qubit[] => Unit is Adj),\n inputSize : Int)\n : Bool {\n Fact(inputSize > 0, \"`inputSize` must be positive\");\n use target = Qubit[inputSize];\n op(target);\n Adjoint reference(target);\n let isCorrect = CheckAllZero(target);\n ResetAll(target);\n isCorrect\n }\n\n\n /// # Summary\n /// Given two operations, checks whether they act identically on the given initial state composed of `inputSize` qubits.\n /// The initial state is prepared by applying the `initialState` operation to the state |0〉 ⊗ |0〉 ⊗ ... ⊗ |0〉.\n /// This operation introduces a control qubit to convert a global phase into a relative phase to be able to detect it.\n /// `initialState` operation should be deterministic.\n operation CheckOperationsEquivalenceOnInitialStateStrict(\n initialState : Qubit[] => Unit is Adj,\n op : (Qubit[] => Unit is Adj + Ctl),\n reference : (Qubit[] => Unit is Adj + Ctl),\n inputSize : Int\n ) : Bool {\n use (control, target) = (Qubit(), Qubit[inputSize]);\n within {\n H(control);\n initialState(target);\n }\n apply {\n Controlled op([control], target);\n Adjoint Controlled reference([control], target);\n }\n\n let isCorrect = CheckAllZero([control] + target);\n ResetAll([control] + target);\n isCorrect\n }\n\n\n /// # Summary\n /// Given two operations, checks whether they act identically on the zero state |0〉 ⊗ |0〉 ⊗ ... ⊗ |0〉 composed of\n /// `inputSize` qubits.\n /// This operation introduces a control qubit to convert a global phase into a relative phase to be able to detect\n /// it.\n operation CheckOperationsEquivalenceOnZeroStateStrict(\n op : (Qubit[] => Unit is Adj + Ctl),\n reference : (Qubit[] => Unit is Adj + Ctl),\n inputSize : Int)\n : Bool {\n Fact(inputSize > 0, \"`inputSize` must be positive\");\n CheckOperationsEquivalenceOnInitialStateStrict(qs => (), op, reference, inputSize)\n }\n\n\n /// # Summary\n /// Shows the comparison of the quantum states produced by a specific operation and a reference operation\n /// when applied to the state prepared using deterministic operation `initialState`.\n operation ShowQuantumStateComparison(\n registerSize : Int,\n initialState : Qubit[] => Unit,\n op : Qubit[] => Unit,\n reference : Qubit[] => Unit)\n : Unit {\n {\n use register = Qubit[registerSize];\n initialState(register);\n\n Message(\"Initial quantum state:\");\n DumpMachine();\n\n // Apply the reference operation and dump the simulator state\n reference(register);\n Message(\"Expected quantum state after applying the operation:\");\n DumpMachine();\n ResetAll(register);\n }\n\n {\n use register = Qubit[registerSize];\n initialState(register);\n // Apply the comparison operation and dump the simulator state\n op(register);\n Message(\"Actual quantum state after applying the operation:\");\n DumpMachine();\n ResetAll(register);\n }\n }\n\n /// # Summary\n /// Given two operations, checks whether they act identically on the zero state |0〉 ⊗ |0〉 ⊗ ... ⊗ |0〉 composed of\n /// `inputSize` qubits. If they don't, prints user feedback.\n operation CheckOperationsEquivalenceOnZeroStateWithFeedback(\n testImpl : (Qubit[] => Unit),\n refImpl : (Qubit[] => Unit is Adj),\n inputSize : Int\n ) : Bool {\n\n let isCorrect = CheckOperationsEquivalenceOnZeroState(testImpl, refImpl, inputSize);\n\n // Output different feedback to the user depending on whether the exercise was correct.\n if isCorrect {\n Message(\"Correct!\");\n } else {\n Message(\"Incorrect.\");\n ShowQuantumStateComparison(inputSize, (qs => ()), testImpl, refImpl);\n }\n isCorrect\n }\n\n\n internal operation EntangleRegisters(\n control : Qubit[],\n target : Qubit[]) : Unit is Adj + Ctl {\n Fact(\n Length(control) == Length(target),\n $\"The length of qubit registers must be the same.\");\n\n for index in IndexRange(control) {\n H(control[index]);\n CNOT(control[index], target[index]);\n }\n }\n\n\n /// # Summary\n /// Prepare a random uneven superposition state on the given qubit array.\n operation PrepDemoState(qs : Qubit[]) : Unit {\n Fact(Length(qs) <= 4, \"States with 5 qubits or more are not supported.\");\n let probs = [0.36, 0.25, 1. / 3., 1. / 5.][... Length(qs) - 1];\n for (q, prob) in Zipped(qs, probs) {\n Ry(ArcCos(Sqrt(prob)) * 2.0, q);\n }\n }\n\n\n // \"Framework\" operation for testing single-qubit tasks for distinguishing states of one qubit\n // with Bool return\n operation DistinguishTwoStates_SingleQubit(\n statePrep : ((Qubit, Int) => Unit is Adj),\n testImpl : (Qubit => Bool),\n stateNames : String[],\n preserveState : Bool) : Bool {\n\n let nTotal = 100;\n let nStates = 2;\n mutable misclassifications = [0, size=nStates];\n\n use q = Qubit();\n for _ in 1 .. nTotal {\n // get a random bit to define whether qubit will be in a state corresponding to true return (1) or to false one (0)\n // state = 0 false return\n // state = 1 true return\n let state = DrawRandomInt(0, 1);\n\n // do state prep: convert |0⟩ to outcome with false return or to outcome with true return depending on state\n statePrep(q, state);\n\n // get the solution's answer and verify if NOT a match, then differentiate what kind of mismatch\n let ans = testImpl(q);\n if ans != (state == 1) {\n set misclassifications w/= state <- misclassifications[state] + 1;\n }\n\n // If the final state is to be preserved, check if it was not modified\n if preserveState {\n Adjoint statePrep(q, state);\n if not CheckZero(q) {\n Message($\"Input quantum state {stateNames[state]} was not preserved during the measurement.\");\n Reset(q);\n return false;\n }\n } else {\n Reset(q);\n }\n }\n\n mutable totalMisclassifications = 0;\n for i in 0 .. nStates - 1 {\n if misclassifications[i] != 0 {\n set totalMisclassifications += misclassifications[i];\n Message($\"Misclassified {stateNames[i]} as {stateNames[1 - i]} in {misclassifications[i]} test runs.\");\n }\n }\n\n totalMisclassifications == 0\n }\n\n\n // \"Framework\" operation for testing multi-qubit tasks for distinguishing states of an array of qubits\n // with Int return\n operation DistinguishStates_MultiQubit(\n nQubits : Int,\n nStates : Int,\n statePrep : ((Qubit[], Int, Double) => Unit is Adj),\n testImpl : (Qubit[] => Int),\n preserveState : Bool,\n stateNames : String[]) : Bool {\n\n let nTotal = 100;\n // misclassifications will store the number of times state i has been classified as state j (dimension nStates^2)\n mutable misclassifications = [0, size = nStates * nStates];\n // unknownClassifications will store the number of times state i has been classified as some invalid state (index < 0 or >= nStates)\n mutable unknownClassifications = [0, size = nStates];\n\n use qs = Qubit[nQubits];\n for _ in 1 .. nTotal {\n // get a random integer to define the state of the qubits\n let state = DrawRandomInt(0, nStates - 1);\n // get a random rotation angle to define the exact state of the qubits\n // for some exercises, this value might be a dummy variable which does not matter\n let alpha = DrawRandomDouble(0.0, 1.0) * PI();\n\n // do state prep: convert |0...0⟩ to outcome with return equal to state\n statePrep(qs, state, alpha);\n\n // get the solution's answer and verify that it's a match, if not, increase the exact mismatch count\n let ans = testImpl(qs);\n if ans >= 0 and ans < nStates {\n // classification result is a valid state index - check if is it correct\n if ans != state {\n set misclassifications w/= ((state * nStates) + ans) <- (misclassifications[(state * nStates) + ans] + 1);\n }\n }\n else {\n // classification result is an invalid state index - file it separately\n set unknownClassifications w/= state <- (unknownClassifications[state] + 1);\n }\n\n if preserveState {\n // check that the state of the qubit after the operation is unchanged\n Adjoint statePrep(qs, state, alpha);\n if not CheckAllZero(qs) {\n Message($\"Input quantum state {stateNames[state]} was not preserved during the measurement.\");\n ResetAll(qs);\n return false;\n }\n } else {\n // we're not checking the state of the qubit after the operation\n ResetAll(qs);\n }\n }\n\n mutable totalMisclassifications = 0;\n for i in 0 .. nStates - 1 {\n for j in 0 .. nStates - 1 {\n if misclassifications[(i * nStates) + j] != 0 {\n set totalMisclassifications += misclassifications[i * nStates + j];\n Message($\"Misclassified {stateNames[i]} as {stateNames[j]} in {misclassifications[(i * nStates) + j]} test runs.\");\n }\n }\n if unknownClassifications[i] != 0 {\n set totalMisclassifications += unknownClassifications[i];\n Message($\"Misclassified {stateNames[i]} as Unknown State in {unknownClassifications[i]} test runs.\");\n }\n }\n totalMisclassifications == 0\n }\n\n\n /// # Summary\n /// Given a marking oracle acting on N inputs, and a classical function acting on N bits, \n /// checks whether the oracle effect matches that of the function on every classical input.\n operation CheckOracleImplementsFunction (\n N : Int, \n oracle : (Qubit[], Qubit) => Unit, \n f : Bool[] -> Bool\n ) : Bool {\n let size = 1 <<< N;\n use (input, target) = (Qubit[N], Qubit());\n for k in 0 .. size - 1 {\n // Prepare k-th bit vector\n let binaryLE = IntAsBoolArray(k, N);\n \n // \"binary\" is little-endian notation, so the second vector tried has qubit 0 in state 1 and the rest in state 0\n ApplyPauliFromBitString(PauliX, true, binaryLE, input);\n \n // Apply the operation\n oracle(input, target);\n \n // Calculate the expected classical result\n let val = f(binaryLE);\n\n // Apply operations that will revert the qubits to the 0 state if the oracle acted correctly.\n if val {\n X(target);\n }\n ApplyPauliFromBitString(PauliX, true, binaryLE, input);\n\n if not CheckAllZero(input + [target]) {\n Message($\"Unexpected result on input {binaryLE}.\");\n if not CheckAllZero(input) {\n Message(\"The state of the input qubits changed, or they ended up entangled with the target qubit.\");\n Message(\"The state of the system after oracle application:\");\n DumpMachine();\n } else {\n Message($\"Expected result `{val}`, got `{not val}`.\");\n }\n ResetAll(input + [target]);\n return false;\n }\n }\n return true;\n }\n}\n"
6278
6491
  },
6279
6492
  {
6280
6493
  "id": "complex_arithmetic__powers_of_i__Verification.qs",
@@ -6856,13 +7069,29 @@ export default {
6856
7069
  "id": "distinguishing_states__Common.qs",
6857
7070
  "code": "namespace Kata.Verification {\n open Microsoft.Quantum.Convert;\n open Microsoft.Quantum.Random;\n\n operation DistinguishStates_MultiQubit_Threshold (nQubit : Int, \n nState : Int, \n threshold : Double, \n statePrep : ((Qubit, Int) => Unit), \n testImpl : (Qubit => Bool)) : Bool {\n let nTotal = 1000;\n mutable nOk = 0;\n\n use qs = Qubit[nQubit];\n for i in 1 .. nTotal {\n // get a random integer to define the state of the qubits\n let state = DrawRandomInt(0, nState - 1);\n\n // do state prep: convert |0⟩ to outcome with return equal to state\n statePrep(qs[0], state);\n\n // get the solution's answer and verify that it's a match\n let ans = testImpl(qs[0]);\n if ans == (state == 0) {\n set nOk += 1;\n }\n\n // we're not checking the state of the qubit after the operation\n ResetAll(qs);\n }\n\n if IntAsDouble(nOk) < threshold * IntAsDouble(nTotal) {\n Message($\"{nTotal - nOk} test runs out of {nTotal} returned incorrect state, which does not meet the required threshold of at least {threshold * 100.0}%.\");\n Message(\"Incorrect.\");\n return false;\n } else {\n Message(\"Correct!\");\n return true;\n }\n }\n}\n"
6858
7071
  },
7072
+ {
7073
+ "id": "marking_oracles__kth_bit__Verification.qs",
7074
+ "code": "namespace Kata.Verification {\n open Microsoft.Quantum.Katas;\n\n function F_Kth_Bit(x : Bool[], k : Int) : Bool {\n x[k]\n }\n\n @EntryPoint()\n operation CheckSolution() : Bool {\n for n in 3 .. 5 {\n for k in 0 .. n - 1 {\n if not CheckOracleImplementsFunction(n, Kata.Oracle_Kth_Bit(_, _, k), F_Kth_Bit(_, k)) {\n Message($\"Test failed for n = {n}, k = {k}\");\n return false;\n }\n }\n }\n\n Message(\"Correct!\");\n true\n }\n}\n"
7075
+ },
7076
+ {
7077
+ "id": "marking_oracles__parity__Verification.qs",
7078
+ "code": "namespace Kata.Verification {\n open Microsoft.Quantum.Katas;\n\n function F_Parity(x : Bool[]) : Bool {\n mutable parity = false;\n for xi in x {\n if xi {\n set parity = not parity;\n }\n }\n parity\n }\n\n @EntryPoint()\n operation CheckSolution() : Bool {\n for n in 1 .. 5 {\n if not CheckOracleImplementsFunction(n, Kata.Oracle_Parity, F_Parity) {\n return false;\n }\n }\n\n Message(\"Correct!\");\n true\n }\n}\n"
7079
+ },
7080
+ {
7081
+ "id": "marking_oracles__product__Verification.qs",
7082
+ "code": "namespace Kata.Verification {\n open Microsoft.Quantum.Convert;\n open Microsoft.Quantum.Katas;\n\n function F_Product(x : Bool[], r : Bool[]) : Bool {\n mutable product = false;\n for i in 0 .. Length(x) - 1 {\n if r[i] and x[i] {\n set product = not product;\n }\n }\n product\n }\n\n @EntryPoint()\n operation CheckSolution() : Bool {\n let n = 3;\n for mask in 0 .. 2 ^ n - 1 {\n let r = IntAsBoolArray(mask, 3);\n if not CheckOracleImplementsFunction(n, Kata.Oracle_Product(_, _, r), F_Product(_, r)) {\n Message($\"Test failed for n = {n}, r = {r}\");\n return false;\n }\n }\n\n Message(\"Correct!\");\n true\n }\n}\n"
7083
+ },
7084
+ {
7085
+ "id": "marking_oracles__product_negation__Verification.qs",
7086
+ "code": "namespace Kata.Verification {\n open Microsoft.Quantum.Convert;\n open Microsoft.Quantum.Katas;\n\n function F_ProductWithNegation(x : Bool[], r : Bool[]) : Bool {\n mutable product = false;\n for i in 0 .. Length(x) - 1 {\n if r[i] and x[i] or (not r[i] and not x[i]) {\n set product = not product;\n }\n }\n product\n }\n\n @EntryPoint()\n operation CheckSolution() : Bool {\n let n = 3;\n for mask in 0 .. 2 ^ n - 1 {\n let r = IntAsBoolArray(mask, 3);\n if not CheckOracleImplementsFunction(n, Kata.Oracle_ProductWithNegation(_, _, r), F_ProductWithNegation(_, r)) {\n Message($\"Test failed for n = {n}, r = {r}\");\n return false;\n }\n }\n\n Message(\"Correct!\");\n true\n }\n}\n"
7087
+ },
6859
7088
  {
6860
7089
  "id": "teleportation__entangled_pair__Verification.qs",
6861
7090
  "code": "namespace Kata.Verification {\n open Microsoft.Quantum.Diagnostics;\n open Microsoft.Quantum.Katas;\n\n operation Entangle_Wrapper (qs : Qubit[]) : Unit is Adj {\n Kata.Entangle(qs[0], qs[1]);\n }\n\n @EntryPoint()\n operation CheckSolution() : Bool {\n \n return CheckOperationsEquivalenceOnZeroStateWithFeedback(\n Entangle_Wrapper,\n EntangleWrapper_Reference,\n 2\n );\n \n }\n}\n"
6862
7091
  },
6863
7092
  {
6864
7093
  "id": "teleportation__Common.qs",
6865
- "code": "namespace Kata.Verification {\n open Microsoft.Quantum.Diagnostics;\n open Microsoft.Quantum.Math;\n\n operation EntangleWrapper_Reference(qs : Qubit[]) : Unit is Adj + Ctl {\n let (qAlice, qBob) = (qs[0], qs[1]);\n H(qAlice);\n CNOT(qAlice, qBob);\n }\n\n // ------------------------------------------------------\n // Helper which prepares proper Bell state on two qubits\n // 0 - |Φ⁺⟩ = (|00⟩ + |11⟩) / sqrt(2)\n // 1 - |Φ⁻⟩ = (|00⟩ - |11⟩) / sqrt(2)\n // 2 - |Ψ⁺⟩ = (|01⟩ + |10⟩) / sqrt(2)\n // 3 - |Ψ⁻⟩ = (|01⟩ - |10⟩) / sqrt(2)\n operation StatePrep_BellState(q1 : Qubit, q2 : Qubit, state : Int) : Unit {\n H(q1);\n CNOT(q1, q2);\n \n // now we have |00⟩ + |11⟩ - modify it based on state arg\n if state % 2 == 1 {\n // negative phase\n Z(q2);\n }\n \n if state / 2 == 1 {\n X(q2);\n }\n }\n\n // ------------------------------------------------------\n // Helper operation that run teleportation using the given operations to prepare the message qubit\n // and the entangled pair, and to run sender and receiver parts of the protocol.\n operation ComposeTeleportation(\n bellPrepOp : ((Qubit, Qubit) => Unit), \n getDescriptionOp : ((Qubit, Qubit) => (Bool, Bool)), \n reconstructOp : ((Qubit, (Bool, Bool)) => Unit),\n qAlice : Qubit, \n qBob : Qubit, \n qMessage : Qubit) : Unit {\n\n bellPrepOp(qAlice, qBob);\n let classicalBits = getDescriptionOp(qAlice, qMessage);\n \n // Alice sends the classical bits to Bob.\n // Bob uses these bits to transform his part of the entangled pair into the message.\n reconstructOp(qBob, classicalBits);\n }\n \n operation SendMessage_Reference(qAlice: Qubit, qMessage: Qubit) : (Bool, Bool) {\n CNOT(qMessage, qAlice);\n H(qMessage);\n return (M(qMessage) == One, M(qAlice) == One);\n }\n\n operation ReconstructMessage_Reference(qBob : Qubit, (b1 : Bool, b2 : Bool)) : Unit {\n if b1 {\n Z(qBob);\n }\n if b2 {\n X(qBob);\n }\n }\n\n // ------------------------------------------------------\n // Helper operation that runs a teleportation operation (specified by teleportOp).\n // The state to teleport is set up using an operation (specified by setupPsiOp).\n //\n // Specifying the state to teleport through an operation allows to get the inverse\n // which makes testing easier.\n operation TeleportTestHelper(\n teleportOp : ((Qubit, Qubit, Qubit) => Unit), \n setupPsiOp : (Qubit => Unit is Adj),\n psiName: String) : Bool {\n \n use (qMessage, qAlice, qBob) = (Qubit(), Qubit(), Qubit());\n setupPsiOp(qMessage);\n \n // This should modify qBob to be identical to the state\n // of qMessage before the function call.\n teleportOp(qAlice, qBob, qMessage);\n \n // Applying the inverse of the setup operation to qBob\n // should make it Zero.\n Adjoint setupPsiOp(qBob);\n if not CheckZero(qBob) {\n Message($\"Incorrect. The state {psiName} was teleported incorrectly.\");\n setupPsiOp(qBob);\n Message(\"The state of the qubits [qMessage, qAlice, qBob] after teleportation:\");\n DumpMachine();\n ResetAll([qMessage, qAlice, qBob]);\n return false;\n }\n ResetAll([qMessage, qAlice, qBob]);\n return true;\n }\n\n // ------------------------------------------------------\n // Run teleportation for a number of different states.\n // After each teleportation success is asserted.\n // Also repeats for each state several times as\n // code is expected to take different paths each time because\n // measurements done by Alice are not deterministic.\n operation TeleportTestLoop(teleportOp : ((Qubit, Qubit, Qubit) => Unit)) : Bool {\n // Define setup operations for the message qubit\n // on which to test teleportation: |0⟩, |1⟩, |0⟩ + |1⟩, unequal superposition.\n let setupPsiOps = [(I, \"|0⟩\"), (X, \"|1⟩\"), (H, \"|+⟩\"), (Ry(ArcCos(0.6) * 2.0, _), \"0.6|0⟩ + 0.8|1⟩\")];\n \n // As part of teleportation Alice runs some measurements\n // with nondeterministic outcome.\n // Depending on the outcomes different paths are taken on Bob's side.\n // We repeat each test run several times to ensure that all paths are checked.\n let numRepetitions = 100;\n for (psiOp, psiName) in setupPsiOps {\n for j in 1 .. numRepetitions {\n if not TeleportTestHelper(teleportOp, psiOp, psiName) {\n return false;\n }\n }\n }\n Message(\"Correct.\");\n return true;\n }\n}"
7094
+ "code": "namespace Kata.Verification {\n open Microsoft.Quantum.Diagnostics;\n open Microsoft.Quantum.Math;\n\n operation EntangleWrapper_Reference(qs : Qubit[]) : Unit is Adj + Ctl {\n let (qAlice, qBob) = (qs[0], qs[1]);\n H(qAlice);\n CNOT(qAlice, qBob);\n }\n\n // ------------------------------------------------------\n // Helper which prepares proper Bell state on two qubits\n // 0 - |Φ⁺⟩ = (|00⟩ + |11⟩) / sqrt(2)\n // 1 - |Φ⁻⟩ = (|00⟩ - |11⟩) / sqrt(2)\n // 2 - |Ψ⁺⟩ = (|01⟩ + |10⟩) / sqrt(2)\n // 3 - |Ψ⁻⟩ = (|01⟩ - |10⟩) / sqrt(2)\n operation StatePrep_BellState(q1 : Qubit, q2 : Qubit, state : Int) : Unit {\n H(q1);\n CNOT(q1, q2);\n \n // now we have |00⟩ + |11⟩ - modify it based on state arg\n if state % 2 == 1 {\n // negative phase\n Z(q2);\n }\n \n if state / 2 == 1 {\n X(q2);\n }\n }\n\n // ------------------------------------------------------\n // Helper operation that run teleportation using the given operations to prepare the message qubit\n // and the entangled pair, and to run sender and receiver parts of the protocol.\n operation ComposeTeleportation(\n bellPrepOp : ((Qubit, Qubit) => Unit), \n getDescriptionOp : ((Qubit, Qubit) => (Bool, Bool)), \n reconstructOp : ((Qubit, (Bool, Bool)) => Unit),\n qAlice : Qubit, \n qBob : Qubit, \n qMessage : Qubit) : Unit {\n\n bellPrepOp(qAlice, qBob);\n let classicalBits = getDescriptionOp(qAlice, qMessage);\n \n // Alice sends the classical bits to Bob.\n // Bob uses these bits to transform his part of the entangled pair into the message.\n reconstructOp(qBob, classicalBits);\n }\n \n operation SendMessage_Reference(qAlice: Qubit, qMessage: Qubit) : (Bool, Bool) {\n CNOT(qMessage, qAlice);\n H(qMessage);\n return (M(qMessage) == One, M(qAlice) == One);\n }\n\n operation ReconstructMessage_Reference(qBob : Qubit, (b1 : Bool, b2 : Bool)) : Unit {\n if b1 {\n Z(qBob);\n }\n if b2 {\n X(qBob);\n }\n }\n\n // ------------------------------------------------------\n // Helper operation that runs a teleportation operation (specified by teleportOp).\n // The state to teleport is set up using an operation (specified by setupPsiOp).\n //\n // Specifying the state to teleport through an operation allows to get the inverse\n // which makes testing easier.\n operation TeleportTestHelper(\n teleportOp : ((Qubit, Qubit, Qubit) => Unit), \n setupPsiOp : (Qubit => Unit is Adj),\n psiName: String) : Bool {\n \n use (qMessage, qAlice, qBob) = (Qubit(), Qubit(), Qubit());\n setupPsiOp(qMessage);\n \n // This should modify qBob to be identical to the state\n // of qMessage before the function call.\n teleportOp(qAlice, qBob, qMessage);\n \n // Applying the inverse of the setup operation to qBob\n // should make it Zero.\n Adjoint setupPsiOp(qBob);\n if not CheckZero(qBob) {\n Message($\"Incorrect. The state {psiName} was teleported incorrectly.\");\n setupPsiOp(qBob);\n Message(\"The state of the qubits [qMessage, qAlice, qBob] after teleportation:\");\n DumpMachine();\n ResetAll([qMessage, qAlice, qBob]);\n return false;\n }\n ResetAll([qMessage, qAlice, qBob]);\n return true;\n }\n\n // ------------------------------------------------------\n // Run teleportation for a number of different states.\n // After each teleportation success is asserted.\n // Also repeats for each state several times as\n // code is expected to take different paths each time because\n // measurements done by Alice are not deterministic.\n operation TeleportTestLoop(teleportOp : ((Qubit, Qubit, Qubit) => Unit)) : Bool {\n // Define setup operations for the message qubit\n // on which to test teleportation: |0⟩, |1⟩, |0⟩ + |1⟩, unequal superposition.\n let setupPsiOps = [(I, \"|0⟩\"), (X, \"|1⟩\"), (H, \"|+⟩\"), (Ry(ArcCos(0.6) * 2.0, _), \"0.6|0⟩ + 0.8|1⟩\")];\n \n // As part of teleportation Alice runs some measurements\n // with nondeterministic outcome.\n // Depending on the outcomes different paths are taken on Bob's side.\n // We repeat each test run several times to ensure that all paths are checked.\n let numRepetitions = 100;\n for (psiOp, psiName) in setupPsiOps {\n for j in 1 .. numRepetitions {\n if not TeleportTestHelper(teleportOp, psiOp, psiName) {\n return false;\n }\n }\n }\n Message(\"Correct.\");\n return true;\n }\n\n operation PrepareAndSendMessage_Reference(qAlice : Qubit, basis : Pauli, state : Result) : (Bool, Bool) {\n use qMessage = Qubit();\n if state == One {\n X(qMessage);\n }\n if basis != PauliZ {\n H(qMessage);\n }\n if basis == PauliY {\n S(qMessage);\n }\n let classicalBits = SendMessage_Reference(qAlice, qMessage);\n Reset(qMessage);\n return classicalBits;\n }\n\n operation ReconstructAndMeasureMessage_Reference(qBob : Qubit, (b1 : Bool, b2 : Bool), basis : Pauli) : Result {\n ReconstructMessage_Reference(qBob, (b1, b2));\n return Measure([basis], [qBob]);\n }\n\n // ------------------------------------------------------\n // Runs teleportation for each state that is to be prepared and\n // sent by Alice. Success is asserted after each teleportation.\n // Also repeats for each state several times; this is because\n // code is expected to take different paths each time since\n // measurements done by Alice are not deterministic.\n operation TeleportPreparedStateTestLoop(\n prepareAndSendMessageOp : ((Qubit, Pauli, Result) => (Bool, Bool)), \n reconstructAndMeasureMessageOp : ((Qubit, (Bool, Bool), Pauli) => Result)\n ) : Bool {\n \n let messages = [(PauliX, Zero, \"|+⟩\"), \n (PauliX, One, \"|-⟩\"), \n (PauliY, Zero, \"|i⟩\"), \n (PauliY, One, \"|-i⟩\"), \n (PauliZ, Zero, \"|0⟩\"), \n (PauliZ, One, \"|1⟩\")];\n let numRepetitions = 100;\n use (qAlice, qBob) = (Qubit(), Qubit());\n for (basis, sentState, stateName) in messages {\n for j in 1 .. numRepetitions {\n StatePrep_BellState(qAlice, qBob, 0);\n let classicalBits = prepareAndSendMessageOp(qAlice, basis, sentState);\n let receivedState = reconstructAndMeasureMessageOp(qBob, classicalBits, basis);\n if sentState != receivedState {\n Message($\"Received incorrect basis state when sending {stateName} in the {basis} basis.\");\n ResetAll([qAlice, qBob]);\n return false;\n }\n ResetAll([qAlice, qBob]);\n }\n }\n Message($\"Correct\");\n return true;\n }\n}"
6866
7095
  },
6867
7096
  {
6868
7097
  "id": "teleportation__send_message__Verification.qs",
@@ -6875,6 +7104,14 @@ export default {
6875
7104
  {
6876
7105
  "id": "teleportation__standard_teleportation_protocol__Verification.qs",
6877
7106
  "code": "namespace Kata.Verification {\n open Microsoft.Quantum.Katas;\n\n @EntryPoint()\n operation CheckSolution() : Bool {\n let teleport = Kata.StandardTeleport;\n return TeleportTestLoop(teleport);\n }\n\n}"
7107
+ },
7108
+ {
7109
+ "id": "teleportation__prepare_and_send_message__Verification.qs",
7110
+ "code": "namespace Kata.Verification {\n open Microsoft.Quantum.Katas;\n\n @EntryPoint()\n operation CheckSolution() : Bool {\n return TeleportPreparedStateTestLoop(Kata.PrepareAndSendMessage, ReconstructAndMeasureMessage_Reference);\n }\n\n}"
7111
+ },
7112
+ {
7113
+ "id": "teleportation__reconstruct_and_measure_message__Verification.qs",
7114
+ "code": "namespace Kata.Verification {\n open Microsoft.Quantum.Katas;\n\n @EntryPoint()\n operation CheckSolution() : Bool {\n return TeleportPreparedStateTestLoop(PrepareAndSendMessage_Reference, Kata.ReconstructAndMeasureMessage);\n }\n\n}"
6878
7115
  }
6879
7116
  ]
6880
7117
  };
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  uid: Qdk.Microsoft.Quantum.Arrays.All
3
3
  title: All function
4
- ms.date: 06/03/2024 12:00:00 AM
4
+ ms.date: 06/06/2024 12:00:00 AM
5
5
  ms.topic: managed-reference
6
6
  qsharp.kind: function
7
7
  qsharp.namespace: Microsoft.Quantum.Arrays
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  uid: Qdk.Microsoft.Quantum.Arrays.Any
3
3
  title: Any function
4
- ms.date: 06/03/2024 12:00:00 AM
4
+ ms.date: 06/06/2024 12:00:00 AM
5
5
  ms.topic: managed-reference
6
6
  qsharp.kind: function
7
7
  qsharp.namespace: Microsoft.Quantum.Arrays
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  uid: Qdk.Microsoft.Quantum.Arrays.Chunks
3
3
  title: Chunks function
4
- ms.date: 06/03/2024 12:00:00 AM
4
+ ms.date: 06/06/2024 12:00:00 AM
5
5
  ms.topic: managed-reference
6
6
  qsharp.kind: function
7
7
  qsharp.namespace: Microsoft.Quantum.Arrays
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  uid: Qdk.Microsoft.Quantum.Arrays.CircularlyShifted
3
3
  title: CircularlyShifted function
4
- ms.date: 06/03/2024 12:00:00 AM
4
+ ms.date: 06/06/2024 12:00:00 AM
5
5
  ms.topic: managed-reference
6
6
  qsharp.kind: function
7
7
  qsharp.namespace: Microsoft.Quantum.Arrays
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  uid: Qdk.Microsoft.Quantum.Arrays.ColumnAt
3
3
  title: ColumnAt function
4
- ms.date: 06/03/2024 12:00:00 AM
4
+ ms.date: 06/06/2024 12:00:00 AM
5
5
  ms.topic: managed-reference
6
6
  qsharp.kind: function
7
7
  qsharp.namespace: Microsoft.Quantum.Arrays
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  uid: Qdk.Microsoft.Quantum.Arrays.Count
3
3
  title: Count function
4
- ms.date: 06/03/2024 12:00:00 AM
4
+ ms.date: 06/06/2024 12:00:00 AM
5
5
  ms.topic: managed-reference
6
6
  qsharp.kind: function
7
7
  qsharp.namespace: Microsoft.Quantum.Arrays
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  uid: Qdk.Microsoft.Quantum.Arrays.Diagonal
3
3
  title: Diagonal function
4
- ms.date: 06/03/2024 12:00:00 AM
4
+ ms.date: 06/06/2024 12:00:00 AM
5
5
  ms.topic: managed-reference
6
6
  qsharp.kind: function
7
7
  qsharp.namespace: Microsoft.Quantum.Arrays
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  uid: Qdk.Microsoft.Quantum.Arrays.DrawMany
3
3
  title: DrawMany operation
4
- ms.date: 06/03/2024 12:00:00 AM
4
+ ms.date: 06/06/2024 12:00:00 AM
5
5
  ms.topic: managed-reference
6
6
  qsharp.kind: operation
7
7
  qsharp.namespace: Microsoft.Quantum.Arrays
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  uid: Qdk.Microsoft.Quantum.Arrays.Enumerated
3
3
  title: Enumerated function
4
- ms.date: 06/03/2024 12:00:00 AM
4
+ ms.date: 06/06/2024 12:00:00 AM
5
5
  ms.topic: managed-reference
6
6
  qsharp.kind: function
7
7
  qsharp.namespace: Microsoft.Quantum.Arrays
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  uid: Qdk.Microsoft.Quantum.Arrays.Excluding
3
3
  title: Excluding function
4
- ms.date: 06/03/2024 12:00:00 AM
4
+ ms.date: 06/06/2024 12:00:00 AM
5
5
  ms.topic: managed-reference
6
6
  qsharp.kind: function
7
7
  qsharp.namespace: Microsoft.Quantum.Arrays
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  uid: Qdk.Microsoft.Quantum.Arrays.Filtered
3
3
  title: Filtered function
4
- ms.date: 06/03/2024 12:00:00 AM
4
+ ms.date: 06/06/2024 12:00:00 AM
5
5
  ms.topic: managed-reference
6
6
  qsharp.kind: function
7
7
  qsharp.namespace: Microsoft.Quantum.Arrays
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  uid: Qdk.Microsoft.Quantum.Arrays.FlatMapped
3
3
  title: FlatMapped function
4
- ms.date: 06/03/2024 12:00:00 AM
4
+ ms.date: 06/06/2024 12:00:00 AM
5
5
  ms.topic: managed-reference
6
6
  qsharp.kind: function
7
7
  qsharp.namespace: Microsoft.Quantum.Arrays
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  uid: Qdk.Microsoft.Quantum.Arrays.Flattened
3
3
  title: Flattened function
4
- ms.date: 06/03/2024 12:00:00 AM
4
+ ms.date: 06/06/2024 12:00:00 AM
5
5
  ms.topic: managed-reference
6
6
  qsharp.kind: function
7
7
  qsharp.namespace: Microsoft.Quantum.Arrays
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  uid: Qdk.Microsoft.Quantum.Arrays.Fold
3
3
  title: Fold function
4
- ms.date: 06/03/2024 12:00:00 AM
4
+ ms.date: 06/06/2024 12:00:00 AM
5
5
  ms.topic: managed-reference
6
6
  qsharp.kind: function
7
7
  qsharp.namespace: Microsoft.Quantum.Arrays
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  uid: Qdk.Microsoft.Quantum.Arrays.ForEach
3
3
  title: ForEach operation
4
- ms.date: 06/03/2024 12:00:00 AM
4
+ ms.date: 06/06/2024 12:00:00 AM
5
5
  ms.topic: managed-reference
6
6
  qsharp.kind: operation
7
7
  qsharp.namespace: Microsoft.Quantum.Arrays
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  uid: Qdk.Microsoft.Quantum.Arrays.Head
3
3
  title: Head function
4
- ms.date: 06/03/2024 12:00:00 AM
4
+ ms.date: 06/06/2024 12:00:00 AM
5
5
  ms.topic: managed-reference
6
6
  qsharp.kind: function
7
7
  qsharp.namespace: Microsoft.Quantum.Arrays
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  uid: Qdk.Microsoft.Quantum.Arrays.HeadAndRest
3
3
  title: HeadAndRest function
4
- ms.date: 06/03/2024 12:00:00 AM
4
+ ms.date: 06/06/2024 12:00:00 AM
5
5
  ms.topic: managed-reference
6
6
  qsharp.kind: function
7
7
  qsharp.namespace: Microsoft.Quantum.Arrays
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  uid: Qdk.Microsoft.Quantum.Arrays.IndexOf
3
3
  title: IndexOf function
4
- ms.date: 06/03/2024 12:00:00 AM
4
+ ms.date: 06/06/2024 12:00:00 AM
5
5
  ms.topic: managed-reference
6
6
  qsharp.kind: function
7
7
  qsharp.namespace: Microsoft.Quantum.Arrays
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  uid: Qdk.Microsoft.Quantum.Arrays.IndexRange
3
3
  title: IndexRange function
4
- ms.date: 06/03/2024 12:00:00 AM
4
+ ms.date: 06/06/2024 12:00:00 AM
5
5
  ms.topic: managed-reference
6
6
  qsharp.kind: function
7
7
  qsharp.namespace: Microsoft.Quantum.Arrays