qsharp-lang 1.1.3 → 1.1.5-dev

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 (301) hide show
  1. package/dist/browser.d.ts +3 -3
  2. package/dist/browser.js +12 -58
  3. package/dist/compiler/compiler.d.ts +4 -2
  4. package/dist/compiler/compiler.js +14 -1
  5. package/dist/compiler/events.d.ts +1 -1
  6. package/dist/compiler/worker-browser.d.ts +1 -1
  7. package/dist/compiler/worker-browser.js +3 -40
  8. package/dist/compiler/worker-node.js +3 -39
  9. package/dist/debug-service/debug-service.d.ts +5 -3
  10. package/dist/debug-service/debug-service.js +18 -1
  11. package/dist/debug-service/worker-browser.d.ts +1 -1
  12. package/dist/debug-service/worker-browser.js +3 -29
  13. package/dist/debug-service/worker-node.js +3 -28
  14. package/dist/katas-content.generated.js +419 -408
  15. package/dist/language-service/language-service.d.ts +10 -2
  16. package/dist/language-service/language-service.js +30 -0
  17. package/dist/language-service/worker-browser.d.ts +1 -1
  18. package/dist/language-service/worker-browser.js +3 -29
  19. package/dist/language-service/worker-node.js +3 -28
  20. package/dist/main.d.ts +2 -2
  21. package/dist/main.js +7 -42
  22. package/dist/samples.generated.js +1 -1
  23. package/dist/workers/browser.d.ts +21 -0
  24. package/dist/workers/browser.js +67 -0
  25. package/dist/{worker-proxy.d.ts → workers/common.d.ts} +26 -9
  26. package/dist/{worker-proxy.js → workers/common.js} +33 -4
  27. package/dist/workers/node.d.ts +20 -0
  28. package/dist/workers/node.js +55 -0
  29. package/docs/Microsoft.Quantum.Arrays/All.md +42 -0
  30. package/docs/Microsoft.Quantum.Arrays/Any.md +41 -0
  31. package/docs/Microsoft.Quantum.Arrays/Chunks.md +34 -0
  32. package/docs/Microsoft.Quantum.Arrays/CircularlyShifted.md +46 -0
  33. package/docs/Microsoft.Quantum.Arrays/ColumnAt.md +47 -0
  34. package/docs/Microsoft.Quantum.Arrays/Count.md +42 -0
  35. package/docs/Microsoft.Quantum.Arrays/Diagonal.md +43 -0
  36. package/docs/Microsoft.Quantum.Arrays/DrawMany.md +43 -0
  37. package/docs/Microsoft.Quantum.Arrays/Enumerated.md +44 -0
  38. package/docs/Microsoft.Quantum.Arrays/Excluding.md +46 -0
  39. package/docs/Microsoft.Quantum.Arrays/Filtered.md +42 -0
  40. package/docs/Microsoft.Quantum.Arrays/FlatMapped.md +45 -0
  41. package/docs/Microsoft.Quantum.Arrays/Flattened.md +38 -0
  42. package/docs/Microsoft.Quantum.Arrays/Fold.md +46 -0
  43. package/docs/Microsoft.Quantum.Arrays/ForEach.md +41 -0
  44. package/docs/Microsoft.Quantum.Arrays/Head.md +32 -0
  45. package/docs/Microsoft.Quantum.Arrays/HeadAndRest.md +32 -0
  46. package/docs/Microsoft.Quantum.Arrays/IndexOf.md +39 -0
  47. package/docs/Microsoft.Quantum.Arrays/IndexRange.md +40 -0
  48. package/docs/Microsoft.Quantum.Arrays/Interleaved.md +49 -0
  49. package/docs/Microsoft.Quantum.Arrays/IsEmpty.md +28 -0
  50. package/docs/Microsoft.Quantum.Arrays/IsRectangularArray.md +42 -0
  51. package/docs/Microsoft.Quantum.Arrays/IsSorted.md +42 -0
  52. package/docs/Microsoft.Quantum.Arrays/IsSquareArray.md +42 -0
  53. package/docs/Microsoft.Quantum.Arrays/Mapped.md +41 -0
  54. package/docs/Microsoft.Quantum.Arrays/MappedByIndex.md +52 -0
  55. package/docs/Microsoft.Quantum.Arrays/MappedOverRange.md +46 -0
  56. package/docs/Microsoft.Quantum.Arrays/Most.md +33 -0
  57. package/docs/Microsoft.Quantum.Arrays/MostAndTail.md +32 -0
  58. package/docs/Microsoft.Quantum.Arrays/Padded.md +49 -0
  59. package/docs/Microsoft.Quantum.Arrays/Partitioned.md +44 -0
  60. package/docs/Microsoft.Quantum.Arrays/Rest.md +33 -0
  61. package/docs/Microsoft.Quantum.Arrays/Reversed.md +33 -0
  62. package/docs/Microsoft.Quantum.Arrays/SequenceI.md +41 -0
  63. package/docs/Microsoft.Quantum.Arrays/SequenceL.md +41 -0
  64. package/docs/Microsoft.Quantum.Arrays/Sorted.md +51 -0
  65. package/docs/Microsoft.Quantum.Arrays/Subarray.md +49 -0
  66. package/docs/Microsoft.Quantum.Arrays/Swapped.md +40 -0
  67. package/docs/Microsoft.Quantum.Arrays/Tail.md +32 -0
  68. package/docs/Microsoft.Quantum.Arrays/Transposed.md +46 -0
  69. package/docs/Microsoft.Quantum.Arrays/Unzipped.md +45 -0
  70. package/docs/Microsoft.Quantum.Arrays/Where.md +35 -0
  71. package/docs/Microsoft.Quantum.Arrays/Windows.md +47 -0
  72. package/docs/Microsoft.Quantum.Arrays/Zipped.md +49 -0
  73. package/docs/Microsoft.Quantum.Canon/ApplyCNOTChain.md +35 -0
  74. package/docs/Microsoft.Quantum.Canon/ApplyControlledOnBitString.md +41 -0
  75. package/docs/Microsoft.Quantum.Canon/ApplyControlledOnInt.md +40 -0
  76. package/docs/Microsoft.Quantum.Canon/ApplyP.md +38 -0
  77. package/docs/Microsoft.Quantum.Canon/ApplyPauli.md +40 -0
  78. package/docs/Microsoft.Quantum.Canon/ApplyPauliFromBitString.md +46 -0
  79. package/docs/Microsoft.Quantum.Canon/ApplyPauliFromInt.md +44 -0
  80. package/docs/Microsoft.Quantum.Canon/ApplyQFT.md +34 -0
  81. package/docs/Microsoft.Quantum.Canon/ApplyToEach.md +38 -0
  82. package/docs/Microsoft.Quantum.Canon/ApplyToEachA.md +42 -0
  83. package/docs/Microsoft.Quantum.Canon/ApplyToEachC.md +42 -0
  84. package/docs/Microsoft.Quantum.Canon/ApplyToEachCA.md +42 -0
  85. package/docs/Microsoft.Quantum.Canon/ApplyXorInPlace.md +30 -0
  86. package/docs/Microsoft.Quantum.Canon/ApplyXorInPlaceL.md +30 -0
  87. package/docs/Microsoft.Quantum.Canon/CX.md +50 -0
  88. package/docs/Microsoft.Quantum.Canon/CY.md +44 -0
  89. package/docs/Microsoft.Quantum.Canon/CZ.md +44 -0
  90. package/docs/Microsoft.Quantum.Canon/Fst.md +20 -0
  91. package/docs/Microsoft.Quantum.Canon/Snd.md +20 -0
  92. package/docs/Microsoft.Quantum.Canon/SwapReverseRegister.md +25 -0
  93. package/docs/Microsoft.Quantum.Convert/BigIntAsBoolArray.md +35 -0
  94. package/docs/Microsoft.Quantum.Convert/BoolArrayAsBigInt.md +34 -0
  95. package/docs/Microsoft.Quantum.Convert/BoolArrayAsInt.md +25 -0
  96. package/docs/Microsoft.Quantum.Convert/BoolArrayAsResultArray.md +29 -0
  97. package/docs/Microsoft.Quantum.Convert/BoolAsResult.md +29 -0
  98. package/docs/Microsoft.Quantum.Convert/ComplexAsComplexPolar.md +29 -0
  99. package/docs/Microsoft.Quantum.Convert/ComplexPolarAsComplex.md +29 -0
  100. package/docs/Microsoft.Quantum.Convert/IntAsBigInt.md +21 -0
  101. package/docs/Microsoft.Quantum.Convert/IntAsBoolArray.md +35 -0
  102. package/docs/Microsoft.Quantum.Convert/IntAsDouble.md +21 -0
  103. package/docs/Microsoft.Quantum.Convert/ResultArrayAsBoolArray.md +29 -0
  104. package/docs/Microsoft.Quantum.Convert/ResultArrayAsInt.md +34 -0
  105. package/docs/Microsoft.Quantum.Convert/ResultAsBool.md +29 -0
  106. package/docs/Microsoft.Quantum.Core/IsRangeEmpty.md +32 -0
  107. package/docs/Microsoft.Quantum.Core/Length.md +28 -0
  108. package/docs/Microsoft.Quantum.Core/RangeEnd.md +37 -0
  109. package/docs/Microsoft.Quantum.Core/RangeReverse.md +32 -0
  110. package/docs/Microsoft.Quantum.Core/RangeStart.md +36 -0
  111. package/docs/Microsoft.Quantum.Core/RangeStep.md +33 -0
  112. package/docs/Microsoft.Quantum.Core/Repeated.md +36 -0
  113. package/docs/Microsoft.Quantum.Diagnostics/CheckAllZero.md +18 -0
  114. package/docs/Microsoft.Quantum.Diagnostics/CheckOperationsAreEqual.md +47 -0
  115. package/docs/Microsoft.Quantum.Diagnostics/CheckZero.md +18 -0
  116. package/docs/Microsoft.Quantum.Diagnostics/DumpMachine.md +18 -0
  117. package/docs/Microsoft.Quantum.Diagnostics/Fact.md +20 -0
  118. package/docs/Microsoft.Quantum.Intrinsic/CCNOT.md +35 -0
  119. package/docs/Microsoft.Quantum.Intrinsic/CNOT.md +47 -0
  120. package/docs/Microsoft.Quantum.Intrinsic/Exp.md +40 -0
  121. package/docs/Microsoft.Quantum.Intrinsic/H.md +34 -0
  122. package/docs/Microsoft.Quantum.Intrinsic/I.md +25 -0
  123. package/docs/Microsoft.Quantum.Intrinsic/M.md +45 -0
  124. package/docs/Microsoft.Quantum.Intrinsic/Measure.md +55 -0
  125. package/docs/Microsoft.Quantum.Intrinsic/Message.md +30 -0
  126. package/docs/Microsoft.Quantum.Intrinsic/R.md +42 -0
  127. package/docs/Microsoft.Quantum.Intrinsic/R1.md +41 -0
  128. package/docs/Microsoft.Quantum.Intrinsic/R1Frac.md +51 -0
  129. package/docs/Microsoft.Quantum.Intrinsic/RFrac.md +53 -0
  130. package/docs/Microsoft.Quantum.Intrinsic/Reset.md +26 -0
  131. package/docs/Microsoft.Quantum.Intrinsic/ResetAll.md +26 -0
  132. package/docs/Microsoft.Quantum.Intrinsic/Rx.md +44 -0
  133. package/docs/Microsoft.Quantum.Intrinsic/Rxx.md +42 -0
  134. package/docs/Microsoft.Quantum.Intrinsic/Ry.md +44 -0
  135. package/docs/Microsoft.Quantum.Intrinsic/Ryy.md +42 -0
  136. package/docs/Microsoft.Quantum.Intrinsic/Rz.md +44 -0
  137. package/docs/Microsoft.Quantum.Intrinsic/Rzz.md +42 -0
  138. package/docs/Microsoft.Quantum.Intrinsic/S.md +36 -0
  139. package/docs/Microsoft.Quantum.Intrinsic/SWAP.md +49 -0
  140. package/docs/Microsoft.Quantum.Intrinsic/T.md +36 -0
  141. package/docs/Microsoft.Quantum.Intrinsic/X.md +36 -0
  142. package/docs/Microsoft.Quantum.Intrinsic/Y.md +36 -0
  143. package/docs/Microsoft.Quantum.Intrinsic/Z.md +36 -0
  144. package/docs/Microsoft.Quantum.Logical/Xor.md +38 -0
  145. package/docs/Microsoft.Quantum.Math/AbsComplex.md +29 -0
  146. package/docs/Microsoft.Quantum.Math/AbsComplexPolar.md +29 -0
  147. package/docs/Microsoft.Quantum.Math/AbsD.md +21 -0
  148. package/docs/Microsoft.Quantum.Math/AbsI.md +21 -0
  149. package/docs/Microsoft.Quantum.Math/AbsL.md +20 -0
  150. package/docs/Microsoft.Quantum.Math/AbsSquaredComplex.md +29 -0
  151. package/docs/Microsoft.Quantum.Math/AbsSquaredComplexPolar.md +29 -0
  152. package/docs/Microsoft.Quantum.Math/ApproximateFactorial.md +40 -0
  153. package/docs/Microsoft.Quantum.Math/ArcCos.md +21 -0
  154. package/docs/Microsoft.Quantum.Math/ArcCosh.md +21 -0
  155. package/docs/Microsoft.Quantum.Math/ArcSin.md +21 -0
  156. package/docs/Microsoft.Quantum.Math/ArcSinh.md +21 -0
  157. package/docs/Microsoft.Quantum.Math/ArcTan.md +21 -0
  158. package/docs/Microsoft.Quantum.Math/ArcTan2.md +21 -0
  159. package/docs/Microsoft.Quantum.Math/ArcTanh.md +21 -0
  160. package/docs/Microsoft.Quantum.Math/ArgComplex.md +29 -0
  161. package/docs/Microsoft.Quantum.Math/ArgComplexPolar.md +28 -0
  162. package/docs/Microsoft.Quantum.Math/Binom.md +34 -0
  163. package/docs/Microsoft.Quantum.Math/BitSizeI.md +22 -0
  164. package/docs/Microsoft.Quantum.Math/BitSizeL.md +22 -0
  165. package/docs/Microsoft.Quantum.Math/Ceiling.md +22 -0
  166. package/docs/Microsoft.Quantum.Math/Complex.md +29 -0
  167. package/docs/Microsoft.Quantum.Math/ComplexPolar.md +28 -0
  168. package/docs/Microsoft.Quantum.Math/ContinuedFractionConvergentI.md +23 -0
  169. package/docs/Microsoft.Quantum.Math/ContinuedFractionConvergentL.md +23 -0
  170. package/docs/Microsoft.Quantum.Math/Cos.md +21 -0
  171. package/docs/Microsoft.Quantum.Math/Cosh.md +21 -0
  172. package/docs/Microsoft.Quantum.Math/DivRemI.md +21 -0
  173. package/docs/Microsoft.Quantum.Math/DivRemL.md +21 -0
  174. package/docs/Microsoft.Quantum.Math/DividedByC.md +30 -0
  175. package/docs/Microsoft.Quantum.Math/DividedByCP.md +30 -0
  176. package/docs/Microsoft.Quantum.Math/E.md +28 -0
  177. package/docs/Microsoft.Quantum.Math/ExpModI.md +22 -0
  178. package/docs/Microsoft.Quantum.Math/ExpModL.md +22 -0
  179. package/docs/Microsoft.Quantum.Math/ExtendedGreatestCommonDivisorI.md +22 -0
  180. package/docs/Microsoft.Quantum.Math/ExtendedGreatestCommonDivisorL.md +22 -0
  181. package/docs/Microsoft.Quantum.Math/FactorialI.md +38 -0
  182. package/docs/Microsoft.Quantum.Math/FactorialL.md +32 -0
  183. package/docs/Microsoft.Quantum.Math/Floor.md +22 -0
  184. package/docs/Microsoft.Quantum.Math/GreatestCommonDivisorI.md +22 -0
  185. package/docs/Microsoft.Quantum.Math/GreatestCommonDivisorL.md +22 -0
  186. package/docs/Microsoft.Quantum.Math/HammingWeightI.md +21 -0
  187. package/docs/Microsoft.Quantum.Math/InverseModI.md +25 -0
  188. package/docs/Microsoft.Quantum.Math/InverseModL.md +25 -0
  189. package/docs/Microsoft.Quantum.Math/IsCoprimeI.md +34 -0
  190. package/docs/Microsoft.Quantum.Math/IsCoprimeL.md +34 -0
  191. package/docs/Microsoft.Quantum.Math/IsInfinite.md +48 -0
  192. package/docs/Microsoft.Quantum.Math/IsNaN.md +29 -0
  193. package/docs/Microsoft.Quantum.Math/LargestFixedPoint.md +31 -0
  194. package/docs/Microsoft.Quantum.Math/Lg.md +21 -0
  195. package/docs/Microsoft.Quantum.Math/Log.md +21 -0
  196. package/docs/Microsoft.Quantum.Math/Log10.md +21 -0
  197. package/docs/Microsoft.Quantum.Math/LogFactorialD.md +34 -0
  198. package/docs/Microsoft.Quantum.Math/LogGammaD.md +38 -0
  199. package/docs/Microsoft.Quantum.Math/LogOf2.md +24 -0
  200. package/docs/Microsoft.Quantum.Math/Max.md +28 -0
  201. package/docs/Microsoft.Quantum.Math/MaxD.md +21 -0
  202. package/docs/Microsoft.Quantum.Math/MaxI.md +21 -0
  203. package/docs/Microsoft.Quantum.Math/MaxL.md +21 -0
  204. package/docs/Microsoft.Quantum.Math/Min.md +28 -0
  205. package/docs/Microsoft.Quantum.Math/MinD.md +21 -0
  206. package/docs/Microsoft.Quantum.Math/MinI.md +21 -0
  207. package/docs/Microsoft.Quantum.Math/MinL.md +21 -0
  208. package/docs/Microsoft.Quantum.Math/MinusC.md +30 -0
  209. package/docs/Microsoft.Quantum.Math/MinusCP.md +30 -0
  210. package/docs/Microsoft.Quantum.Math/ModulusI.md +22 -0
  211. package/docs/Microsoft.Quantum.Math/ModulusL.md +22 -0
  212. package/docs/Microsoft.Quantum.Math/NegationC.md +28 -0
  213. package/docs/Microsoft.Quantum.Math/NegationCP.md +28 -0
  214. package/docs/Microsoft.Quantum.Math/PI.md +28 -0
  215. package/docs/Microsoft.Quantum.Math/PNorm.md +31 -0
  216. package/docs/Microsoft.Quantum.Math/PNormalized.md +35 -0
  217. package/docs/Microsoft.Quantum.Math/PlusC.md +30 -0
  218. package/docs/Microsoft.Quantum.Math/PlusCP.md +30 -0
  219. package/docs/Microsoft.Quantum.Math/PowC.md +31 -0
  220. package/docs/Microsoft.Quantum.Math/PowCP.md +31 -0
  221. package/docs/Microsoft.Quantum.Math/RealMod.md +38 -0
  222. package/docs/Microsoft.Quantum.Math/Round.md +22 -0
  223. package/docs/Microsoft.Quantum.Math/SignD.md +21 -0
  224. package/docs/Microsoft.Quantum.Math/SignI.md +21 -0
  225. package/docs/Microsoft.Quantum.Math/SignL.md +21 -0
  226. package/docs/Microsoft.Quantum.Math/Sin.md +21 -0
  227. package/docs/Microsoft.Quantum.Math/Sinh.md +21 -0
  228. package/docs/Microsoft.Quantum.Math/SmallestFixedPoint.md +30 -0
  229. package/docs/Microsoft.Quantum.Math/Sqrt.md +21 -0
  230. package/docs/Microsoft.Quantum.Math/SquaredNorm.md +32 -0
  231. package/docs/Microsoft.Quantum.Math/Tan.md +21 -0
  232. package/docs/Microsoft.Quantum.Math/Tanh.md +21 -0
  233. package/docs/Microsoft.Quantum.Math/TimesC.md +30 -0
  234. package/docs/Microsoft.Quantum.Math/TimesCP.md +30 -0
  235. package/docs/Microsoft.Quantum.Math/TrailingZeroCountI.md +22 -0
  236. package/docs/Microsoft.Quantum.Math/TrailingZeroCountL.md +22 -0
  237. package/docs/Microsoft.Quantum.Math/Truncate.md +22 -0
  238. package/docs/Microsoft.Quantum.Measurement/MResetEachZ.md +27 -0
  239. package/docs/Microsoft.Quantum.Measurement/MResetX.md +35 -0
  240. package/docs/Microsoft.Quantum.Measurement/MResetY.md +35 -0
  241. package/docs/Microsoft.Quantum.Measurement/MResetZ.md +35 -0
  242. package/docs/Microsoft.Quantum.Measurement/MeasureAllZ.md +36 -0
  243. package/docs/Microsoft.Quantum.Measurement/MeasureEachZ.md +30 -0
  244. package/docs/Microsoft.Quantum.Measurement/MeasureInteger.md +34 -0
  245. package/docs/Microsoft.Quantum.Random/DrawRandomDouble.md +40 -0
  246. package/docs/Microsoft.Quantum.Random/DrawRandomInt.md +40 -0
  247. package/docs/Microsoft.Quantum.ResourceEstimation/AccountForEstimates.md +33 -0
  248. package/docs/Microsoft.Quantum.ResourceEstimation/AuxQubitCount.md +22 -0
  249. package/docs/Microsoft.Quantum.ResourceEstimation/BeginEstimateCaching.md +37 -0
  250. package/docs/Microsoft.Quantum.ResourceEstimation/BeginRepeatEstimates.md +31 -0
  251. package/docs/Microsoft.Quantum.ResourceEstimation/CczCount.md +22 -0
  252. package/docs/Microsoft.Quantum.ResourceEstimation/EndEstimateCaching.md +23 -0
  253. package/docs/Microsoft.Quantum.ResourceEstimation/EndRepeatEstimates.md +22 -0
  254. package/docs/Microsoft.Quantum.ResourceEstimation/MeasurementCount.md +22 -0
  255. package/docs/Microsoft.Quantum.ResourceEstimation/PSSPCLayout.md +23 -0
  256. package/docs/Microsoft.Quantum.ResourceEstimation/RepeatEstimates.md +29 -0
  257. package/docs/Microsoft.Quantum.ResourceEstimation/RotationCount.md +22 -0
  258. package/docs/Microsoft.Quantum.ResourceEstimation/RotationDepth.md +22 -0
  259. package/docs/Microsoft.Quantum.ResourceEstimation/SingleVariant.md +22 -0
  260. package/docs/Microsoft.Quantum.ResourceEstimation/TCount.md +22 -0
  261. package/docs/Microsoft.Quantum.Unstable.Arithmetic/AddLE.md +28 -0
  262. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfEqualL.md +22 -0
  263. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfEqualLE.md +23 -0
  264. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterL.md +22 -0
  265. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterLE.md +23 -0
  266. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterOrEqualL.md +22 -0
  267. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterOrEqualLE.md +23 -0
  268. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessL.md +22 -0
  269. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessLE.md +23 -0
  270. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessOrEqualL.md +22 -0
  271. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessOrEqualLE.md +23 -0
  272. package/docs/Microsoft.Quantum.Unstable.Arithmetic/FourierTDIncByLE.md +31 -0
  273. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByI.md +27 -0
  274. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByIUsingIncByLE.md +26 -0
  275. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByL.md +27 -0
  276. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLE.md +27 -0
  277. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLEUsingAddLE.md +36 -0
  278. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLUsingIncByLE.md +26 -0
  279. package/docs/Microsoft.Quantum.Unstable.Arithmetic/LookAheadDKRSAddLE.md +35 -0
  280. package/docs/Microsoft.Quantum.Unstable.Arithmetic/MAJ.md +34 -0
  281. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ReflectAboutInteger.md +37 -0
  282. package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryCGAddLE.md +33 -0
  283. package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryCGIncByLE.md +33 -0
  284. package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryTTKIncByLE.md +35 -0
  285. package/docs/Microsoft.Quantum.Unstable.StatePreparation/ApproximatelyPreparePureStateCP.md +66 -0
  286. package/docs/Microsoft.Quantum.Unstable.StatePreparation/PreparePureStateD.md +64 -0
  287. package/docs/Microsoft.Quantum.Unstable.TableLookup/Select.md +53 -0
  288. package/docs/toc.yml +307 -0
  289. package/lib/node/qsc_wasm.cjs +40 -13
  290. package/lib/node/qsc_wasm.d.cts +15 -0
  291. package/lib/node/qsc_wasm_bg.wasm +0 -0
  292. package/lib/web/qsc_wasm.d.ts +17 -0
  293. package/lib/web/qsc_wasm.js +38 -11
  294. package/lib/web/qsc_wasm_bg.wasm +0 -0
  295. package/package.json +4 -2
  296. package/dist/compiler/worker-proxy.d.ts +0 -7
  297. package/dist/compiler/worker-proxy.js +0 -18
  298. package/dist/debug-service/worker-proxy.d.ts +0 -7
  299. package/dist/debug-service/worker-proxy.js +0 -22
  300. package/dist/language-service/worker-proxy.d.ts +0 -6
  301. package/dist/language-service/worker-proxy.js +0 -27
@@ -0,0 +1,41 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.Any
3
+ title: Any function
4
+ ms.date: 02/23/2024 12:00:00 AM
5
+ ms.topic: managed-reference
6
+ qsharp.kind: function
7
+ qsharp.namespace: Microsoft.Quantum.Arrays
8
+ qsharp.name: Any
9
+ qsharp.summary: Given an array and a predicate that is defined for the elements of the array, checks if at least one element of the array satisfies the predicate.
10
+ ---
11
+
12
+ # Any function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function Any<'T>(predicate : ('T -> Bool), array : 'T[]) : Bool
18
+ ```
19
+
20
+ ## Summary
21
+ Given an array and a predicate that is defined
22
+ for the elements of the array, checks if at least one element of
23
+ the array satisfies the predicate.
24
+
25
+ ## Type Parameters
26
+ ### 'T
27
+ The type of `array` elements.
28
+
29
+ ## Input
30
+ ### predicate
31
+ A function from `'T` to `Bool` that is used to check elements.
32
+ ### array
33
+ An array of elements over `'T`.
34
+
35
+ ## Output
36
+ A `Bool` value of the OR function of the predicate applied to all elements.
37
+
38
+ ## Example
39
+ ```qsharp
40
+ let anyEven = Any(x -> x % 2 == 0, [1, 3, 6, 7, 9]);
41
+ ```
@@ -0,0 +1,34 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.Chunks
3
+ title: Chunks function
4
+ ms.date: 02/23/2024 12:00:00 AM
5
+ ms.topic: managed-reference
6
+ qsharp.kind: function
7
+ qsharp.namespace: Microsoft.Quantum.Arrays
8
+ qsharp.name: Chunks
9
+ qsharp.summary: Splits an array into multiple parts of equal length.
10
+ ---
11
+
12
+ # Chunks function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function Chunks<'T>(chunkSize : Int, array : 'T[]) : 'T[][]
18
+ ```
19
+
20
+ ## Summary
21
+ Splits an array into multiple parts of equal length.
22
+
23
+ ## Input
24
+ ### chunkSize
25
+ The length of each chunk. Must be positive.
26
+ ### array
27
+ The array to be split in chunks.
28
+
29
+ ## Output
30
+ A array containing each chunk of the original array.
31
+
32
+ ## Remarks
33
+ Note that the last element of the output may be shorter
34
+ than `chunkSize` if `Length(array)` is not divisible by `chunkSize`.
@@ -0,0 +1,46 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.CircularlyShifted
3
+ title: CircularlyShifted function
4
+ ms.date: 02/23/2024 12:00:00 AM
5
+ ms.topic: managed-reference
6
+ qsharp.kind: function
7
+ qsharp.namespace: Microsoft.Quantum.Arrays
8
+ qsharp.name: CircularlyShifted
9
+ qsharp.summary: Shift an array circularly left or right by a specific step size.
10
+ ---
11
+
12
+ # CircularlyShifted function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function CircularlyShifted<'T>(stepCount : Int, array : 'T[]) : 'T[]
18
+ ```
19
+
20
+ ## Summary
21
+ Shift an array circularly left or right by a specific step size.
22
+
23
+ ## Type Parameters
24
+ ### 'T
25
+ The type of the array elements.
26
+
27
+ ## Input
28
+ ### stepCount
29
+ The amount of positions by which the array elements will be shifted.
30
+ If this is positive, `array` is circularly shifted to the right.
31
+ If this is negative, `array` is circularly shifted to the left.
32
+ ### array
33
+ Array to be circularly shifted.
34
+
35
+ ## Output
36
+ An array `output` that is the `array` circularly shifted to the right or left
37
+ by the specified step size.
38
+
39
+ ## Example
40
+ ```qsharp
41
+ let array = [10, 11, 12];
42
+ // The following line returns [11, 12, 10].
43
+ let output = CircularlyShifted(2, array);
44
+ // The following line returns [12, 10, 11].
45
+ let output = CircularlyShifted(-2, array);
46
+ ```
@@ -0,0 +1,47 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.ColumnAt
3
+ title: ColumnAt function
4
+ ms.date: 02/23/2024 12:00:00 AM
5
+ ms.topic: managed-reference
6
+ qsharp.kind: function
7
+ qsharp.namespace: Microsoft.Quantum.Arrays
8
+ qsharp.name: ColumnAt
9
+ qsharp.summary: Extracts a column from a matrix.
10
+ ---
11
+
12
+ # ColumnAt function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function ColumnAt<'T>(column : Int, matrix : 'T[][]) : 'T[]
18
+ ```
19
+
20
+ ## Summary
21
+ Extracts a column from a matrix.
22
+
23
+ ## Description
24
+ This function extracts a column in a matrix in row-wise order.
25
+ Extracting a row corresponds to element access of the first index
26
+ and therefore requires no further treatment.
27
+
28
+ ## Type Parameters
29
+ ### 'T
30
+ The type of each element of `matrix`.
31
+
32
+ ## Input
33
+ ### column
34
+ Column of the matrix
35
+ ### matrix
36
+ 2-dimensional matrix in row-wise order
37
+
38
+ ## Example
39
+ ```qsharp
40
+ let matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
41
+ let column = ColumnAt(0, matrix);
42
+ // same as: column = [1, 4, 7]
43
+ ```
44
+
45
+ ## See Also
46
+ - Microsoft.Quantum.Arrays.Transposed
47
+ - Microsoft.Quantum.Arrays.Diagonal
@@ -0,0 +1,42 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.Count
3
+ title: Count function
4
+ ms.date: 02/23/2024 12:00:00 AM
5
+ ms.topic: managed-reference
6
+ qsharp.kind: function
7
+ qsharp.namespace: Microsoft.Quantum.Arrays
8
+ qsharp.name: Count
9
+ qsharp.summary: Given an array and a predicate that is defined for the elements of the array, returns the number of elements an array that consists of those elements that satisfy the predicate.
10
+ ---
11
+
12
+ # Count function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function Count<'T>(predicate : ('T -> Bool), array : 'T[]) : Int
18
+ ```
19
+
20
+ ## Summary
21
+ Given an array and a predicate that is defined
22
+ for the elements of the array, returns the number of elements
23
+ an array that consists of those elements that satisfy the predicate.
24
+
25
+ ## Type Parameters
26
+ ### 'T
27
+ The type of `array` elements.
28
+
29
+ ## Input
30
+ ### predicate
31
+ A function from `'T` to Boolean that is used to filter elements.
32
+ ### array
33
+ An array of elements over `'T`.
34
+
35
+ ## Output
36
+ The number of elements in `array` that satisfy the predicate.
37
+
38
+ ## Example
39
+ ```qsharp
40
+ let evensCount = Count(x -> x % 2 == 0, [1, 3, 6, 7, 9]);
41
+ // evensCount is 1.
42
+ ```
@@ -0,0 +1,43 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.Diagonal
3
+ title: Diagonal function
4
+ ms.date: 02/23/2024 12:00:00 AM
5
+ ms.topic: managed-reference
6
+ qsharp.kind: function
7
+ qsharp.namespace: Microsoft.Quantum.Arrays
8
+ qsharp.name: Diagonal
9
+ qsharp.summary: Returns an array of diagonal elements of a 2-dimensional array
10
+ ---
11
+
12
+ # Diagonal function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function Diagonal<'T>(matrix : 'T[][]) : 'T[]
18
+ ```
19
+
20
+ ## Summary
21
+ Returns an array of diagonal elements of a 2-dimensional array
22
+
23
+ ## Description
24
+ If the 2-dimensional array has not a square shape, the diagonal over
25
+ the minimum over the number of rows and columns will be returned.
26
+
27
+ ## Type Parameters
28
+ ### 'T
29
+ The type of each element of `matrix`.
30
+
31
+ ## Input
32
+ ### matrix
33
+ 2-dimensional matrix in row-wise order.
34
+
35
+ ## Example
36
+ ```qsharp
37
+ let matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
38
+ let diagonal = Diagonal(matrix);
39
+ // same as: column = [1, 5, 9]
40
+ ```
41
+
42
+ ## See Also
43
+ - Microsoft.Quantum.Arrays.Transposed
@@ -0,0 +1,43 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.DrawMany
3
+ title: DrawMany operation
4
+ ms.date: 02/23/2024 12:00:00 AM
5
+ ms.topic: managed-reference
6
+ qsharp.kind: operation
7
+ qsharp.namespace: Microsoft.Quantum.Arrays
8
+ qsharp.name: DrawMany
9
+ qsharp.summary: Repeats an operation for a given number of samples, collecting its outputs in an array.
10
+ ---
11
+
12
+ # DrawMany operation
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ operation DrawMany<'TInput, 'TOutput>(op : ('TInput => 'TOutput), nSamples : Int, input : 'TInput) : 'TOutput[]
18
+ ```
19
+
20
+ ## Summary
21
+ Repeats an operation for a given number of samples, collecting its outputs
22
+ in an array.
23
+
24
+ ## Input
25
+ ### op
26
+ The operation to be called repeatedly.
27
+ ### nSamples
28
+ The number of samples of calling `op` to collect.
29
+ ### input
30
+ The input to be passed to `op`.
31
+
32
+ ## Type Parameters
33
+ ### TInput
34
+ The type of input expected by `op`.
35
+ ### TOutput
36
+ The type of output returned by `op`.
37
+
38
+ ## Example
39
+ The following samples an alternating array of results.
40
+ ```qsharp
41
+ use qubit = Qubit();
42
+ let results = Microsoft.Quantum.Arrays.DrawMany(q => {X(q); M(q)}, 3, qubit);
43
+ ```
@@ -0,0 +1,44 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.Enumerated
3
+ title: Enumerated function
4
+ ms.date: 02/23/2024 12:00:00 AM
5
+ ms.topic: managed-reference
6
+ qsharp.kind: function
7
+ qsharp.namespace: Microsoft.Quantum.Arrays
8
+ qsharp.name: Enumerated
9
+ qsharp.summary: Given an array, returns a new array containing elements of the original array along with the indices of each element.
10
+ ---
11
+
12
+ # Enumerated function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function Enumerated<'TElement>(array : 'TElement[]) : (Int, 'TElement)[]
18
+ ```
19
+
20
+ ## Summary
21
+ Given an array, returns a new array containing elements of the original
22
+ array along with the indices of each element.
23
+
24
+ ## Type Parameters
25
+ ### 'TElement
26
+ The type of elements of the array.
27
+
28
+ ## Input
29
+ ### array
30
+ An array whose elements are to be enumerated.
31
+
32
+ ## Output
33
+ A new array containing elements of the original array along with their
34
+ indices.
35
+
36
+ ## Example
37
+ The following `for` loops are equivalent:
38
+ ```qsharp
39
+ for (idx in IndexRange(array)) {
40
+ let element = array[idx];
41
+ ...
42
+ }
43
+ for ((idx, element) in Enumerated(array)) { ... }
44
+ ```
@@ -0,0 +1,46 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.Excluding
3
+ title: Excluding function
4
+ ms.date: 02/23/2024 12:00:00 AM
5
+ ms.topic: managed-reference
6
+ qsharp.kind: function
7
+ qsharp.namespace: Microsoft.Quantum.Arrays
8
+ qsharp.name: Excluding
9
+ qsharp.summary: Returns an array containing the elements of another array, excluding elements at a given list of indices.
10
+ ---
11
+
12
+ # Excluding function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function Excluding<'T>(remove : Int[], array : 'T[]) : 'T[]
18
+ ```
19
+
20
+ ## Summary
21
+ Returns an array containing the elements of another array,
22
+ excluding elements at a given list of indices.
23
+
24
+ ## Type Parameters
25
+ ### 'T
26
+ The type of the array elements.
27
+
28
+ ## Input
29
+ ### remove
30
+ An array of indices denoting which elements should be excluded.
31
+ from the output.
32
+ ### array
33
+ Array of which the values in the output array are taken.
34
+
35
+ ## Output
36
+ An array `output` such that `output[0]` is the first element
37
+ of `array` whose index does not appear in `remove`,
38
+ such that `output[1]` is the second such element, and so
39
+ forth.
40
+
41
+ ## Example
42
+ ```qsharp
43
+ let array = [10, 11, 12, 13, 14, 15];
44
+ // The following line returns [10, 12, 15].
45
+ let subarray = Excluding([1, 3, 4], array);
46
+ ```
@@ -0,0 +1,42 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.Filtered
3
+ title: Filtered function
4
+ ms.date: 02/23/2024 12:00:00 AM
5
+ ms.topic: managed-reference
6
+ qsharp.kind: function
7
+ qsharp.namespace: Microsoft.Quantum.Arrays
8
+ qsharp.name: Filtered
9
+ qsharp.summary: Given an array and a predicate that is defined for the elements of the array, returns an array that consists of those elements that satisfy the predicate.
10
+ ---
11
+
12
+ # Filtered function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function Filtered<'T>(predicate : ('T -> Bool), array : 'T[]) : 'T[]
18
+ ```
19
+
20
+ ## Summary
21
+ Given an array and a predicate that is defined
22
+ for the elements of the array, returns an array that consists of
23
+ those elements that satisfy the predicate.
24
+
25
+ ## Type Parameters
26
+ ### 'T
27
+ The type of `array` elements.
28
+
29
+ ## Input
30
+ ### predicate
31
+ A function from `'T` to Boolean that is used to filter elements.
32
+ ### array
33
+ An array of elements over `'T`.
34
+
35
+ ## Output
36
+ An array `'T[]` of elements that satisfy the predicate.
37
+
38
+ ## Example
39
+ The following code creates an array that contains only even numbers.
40
+ ```qsharp
41
+ Filtered(x -> x % 2 == 0, [0, 1, 2, 3, 4])
42
+ ```
@@ -0,0 +1,45 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.FlatMapped
3
+ title: FlatMapped function
4
+ ms.date: 02/23/2024 12:00:00 AM
5
+ ms.topic: managed-reference
6
+ qsharp.kind: function
7
+ qsharp.namespace: Microsoft.Quantum.Arrays
8
+ qsharp.name: FlatMapped
9
+ qsharp.summary: Given an array and a function that maps an array element to some output array, returns the concatenated output arrays for each array element.
10
+ ---
11
+
12
+ # FlatMapped function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function FlatMapped<'TInput, 'TOutput>(mapper : ('TInput -> 'TOutput[]), array : 'TInput[]) : 'TOutput[]
18
+ ```
19
+
20
+ ## Summary
21
+ Given an array and a function that maps an array element to some output
22
+ array, returns the concatenated output arrays for each array element.
23
+
24
+ ## Type Parameters
25
+ ### 'TInput
26
+ The type of `array` elements.
27
+ ### 'TOutput
28
+ The `mapper` function returns arrays of this type.
29
+
30
+ ## Input
31
+ ### mapper
32
+ A function from `'TInput` to `'TOutput[]` that is used to map array elements.
33
+ ### array
34
+ An array of elements.
35
+
36
+ ## Output
37
+ An array of `'TOutput[]` which is the concatenation of all arrays generated by
38
+ the mapping function.
39
+
40
+ ## Example
41
+ The following code creates an array with each element of the input array repeated twice.
42
+ ```qsharp
43
+ let repeatedPairs = FlatMapped(x -> Repeated(x, 2), [1, 2, 3]);
44
+ // repeatedPairs is [1, 1, 2, 2, 3, 3].
45
+ ```
@@ -0,0 +1,38 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.Flattened
3
+ title: Flattened function
4
+ ms.date: 02/23/2024 12:00:00 AM
5
+ ms.topic: managed-reference
6
+ qsharp.kind: function
7
+ qsharp.namespace: Microsoft.Quantum.Arrays
8
+ qsharp.name: Flattened
9
+ qsharp.summary: Given an array of arrays, returns the concatenation of all arrays.
10
+ ---
11
+
12
+ # Flattened function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function Flattened<'T>(arrays : 'T[][]) : 'T[]
18
+ ```
19
+
20
+ ## Summary
21
+ Given an array of arrays, returns the concatenation of all arrays.
22
+
23
+ ## Type Parameters
24
+ ### 'T
25
+ The type of `array` elements.
26
+
27
+ ## Input
28
+ ### arrays
29
+ Array of arrays.
30
+
31
+ ## Output
32
+ Concatenation of all arrays.
33
+
34
+ ## Example
35
+ ```qsharp
36
+ let flattened = Flattened([[1, 2], [3], [4, 5, 6]]);
37
+ // flattened = [1, 2, 3, 4, 5, 6]
38
+ ```
@@ -0,0 +1,46 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.Fold
3
+ title: Fold function
4
+ ms.date: 02/23/2024 12:00:00 AM
5
+ ms.topic: managed-reference
6
+ qsharp.kind: function
7
+ qsharp.namespace: Microsoft.Quantum.Arrays
8
+ qsharp.name: Fold
9
+ qsharp.summary: Iterates a function `f` through an array `array`, returning `f(...f(f(initialState, array[0]), array[1]), ...)`.
10
+ ---
11
+
12
+ # Fold function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function Fold<'State, 'T>(folder : (('State, 'T) -> 'State), state : 'State, array : 'T[]) : 'State
18
+ ```
19
+
20
+ ## Summary
21
+ Iterates a function `f` through an array `array`, returning
22
+ `f(...f(f(initialState, array[0]), array[1]), ...)`.
23
+
24
+ ## Type Parameters
25
+ ### 'State
26
+ The type of states the `folder` function operates on, i.e., accepts as its first
27
+ argument and returns.
28
+ ### 'T
29
+ The type of `array` elements.
30
+
31
+ ## Input
32
+ ### folder
33
+ A function to be folded over the array.
34
+ ### state
35
+ The initial state of the folder.
36
+ ### array
37
+ An array of values to be folded over.
38
+
39
+ ## Output
40
+ The final state returned by the folder after iterating over
41
+ all elements of `array`.
42
+
43
+ ## Example
44
+ ```qsharp
45
+ let sum = Fold((x, y) -> x + y, 0, [1, 2, 3, 4, 5]); // `sum` is 15.
46
+ ```
@@ -0,0 +1,41 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.ForEach
3
+ title: ForEach operation
4
+ ms.date: 02/23/2024 12:00:00 AM
5
+ ms.topic: managed-reference
6
+ qsharp.kind: operation
7
+ qsharp.namespace: Microsoft.Quantum.Arrays
8
+ qsharp.name: ForEach
9
+ qsharp.summary: Given an array and an operation that is defined for the elements of the array, returns a new array that consists of the images of the original array under the operation.
10
+ ---
11
+
12
+ # ForEach operation
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ operation ForEach<'T, 'U>(action : ('T => 'U), array : 'T[]) : 'U[]
18
+ ```
19
+
20
+ ## Summary
21
+ Given an array and an operation that is defined
22
+ for the elements of the array, returns a new array that consists
23
+ of the images of the original array under the operation.
24
+
25
+ ## Type Parameters
26
+ ### 'T
27
+ The type of `array` elements.
28
+ ### 'U
29
+ The result type of the `action` operation.
30
+
31
+ ## Input
32
+ ### action
33
+ An operation from `'T` to `'U` that is applied to each element.
34
+ ### array
35
+ An array of elements over `'T`.
36
+
37
+ ## Output
38
+ An array `'U[]` of elements that are mapped by the `action` operation.
39
+
40
+ ## See Also
41
+ - Microsoft.Quantum.Arrays.Mapped
@@ -0,0 +1,32 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.Head
3
+ title: Head function
4
+ ms.date: 02/23/2024 12:00:00 AM
5
+ ms.topic: managed-reference
6
+ qsharp.kind: function
7
+ qsharp.namespace: Microsoft.Quantum.Arrays
8
+ qsharp.name: Head
9
+ qsharp.summary: Returns the first element of the array.
10
+ ---
11
+
12
+ # Head function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function Head<'A>(array : 'A[]) : 'A
18
+ ```
19
+
20
+ ## Summary
21
+ Returns the first element of the array.
22
+
23
+ ## Type Parameters
24
+ ### 'A
25
+ The type of the array elements.
26
+
27
+ ## Input
28
+ ### array
29
+ Array of which the first element is taken. Array must have at least 1 element.
30
+
31
+ ## Output
32
+ The first element of the array.
@@ -0,0 +1,32 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.HeadAndRest
3
+ title: HeadAndRest function
4
+ ms.date: 02/23/2024 12:00:00 AM
5
+ ms.topic: managed-reference
6
+ qsharp.kind: function
7
+ qsharp.namespace: Microsoft.Quantum.Arrays
8
+ qsharp.name: HeadAndRest
9
+ qsharp.summary: Returns a tuple of first and all remaining elements of the array.
10
+ ---
11
+
12
+ # HeadAndRest function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function HeadAndRest<'A>(array : 'A[]) : ('A, 'A[])
18
+ ```
19
+
20
+ ## Summary
21
+ Returns a tuple of first and all remaining elements of the array.
22
+
23
+ ## Type Parameters
24
+ ### 'A
25
+ The type of the array elements.
26
+
27
+ ## Input
28
+ ### array
29
+ An array with at least one element.
30
+
31
+ ## Output
32
+ A tuple of first and all remaining elements of the array.