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,39 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.IndexOf
3
+ title: IndexOf 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: IndexOf
9
+ qsharp.summary: Returns the first index of the first element in an array that satisfies a given predicate. If no such element exists, returns -1.
10
+ ---
11
+
12
+ # IndexOf function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function IndexOf<'T>(predicate : ('T -> Bool), array : 'T[]) : Int
18
+ ```
19
+
20
+ ## Summary
21
+ Returns the first index of the first element in an array that satisfies
22
+ a given predicate. If no such element exists, returns -1.
23
+
24
+ ## Input
25
+ ### predicate
26
+ A predicate function acting on elements of the array.
27
+ ### array
28
+ An array to be searched using the given predicate.
29
+
30
+ ## Output
31
+ Either the smallest index of an element for which `predicate(array[index])` is true,
32
+ or -1 if no such element exists.
33
+
34
+ ## Example
35
+ The following code gets the index of the first even number in the input array.
36
+ ```qsharp
37
+ let indexOfFirstEven = IndexOf(x -> x % 2 == 0, [1, 3, 17, 2, 21]);
38
+ // `indexOfFirstEven` is 3.
39
+ ```
@@ -0,0 +1,40 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.IndexRange
3
+ title: IndexRange 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: IndexRange
9
+ qsharp.summary: Given an array, returns a range over the indices of that array, suitable for use in a for loop.
10
+ ---
11
+
12
+ # IndexRange function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function IndexRange<'TElement>(array : 'TElement[]) : Range
18
+ ```
19
+
20
+ ## Summary
21
+ Given an array, returns a range over the indices of that array, suitable
22
+ for use in a for loop.
23
+
24
+ ## Type Parameters
25
+ ### 'TElement
26
+ The type of elements of the array.
27
+
28
+ ## Input
29
+ ### array
30
+ An array for which a range of indices should be returned.
31
+
32
+ ## Output
33
+ A range over all indices of the array.
34
+
35
+ ## Example
36
+ The following `for` loops are equivalent:
37
+ ```qsharp
38
+ for idx in IndexRange(array) { ... }
39
+ for idx in 0 .. Length(array) - 1 { ... }
40
+ ```
@@ -0,0 +1,49 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.Interleaved
3
+ title: Interleaved 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: Interleaved
9
+ qsharp.summary: Interleaves two arrays of (almost) same size.
10
+ ---
11
+
12
+ # Interleaved function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function Interleaved<'T>(first : 'T[], second : 'T[]) : 'T[]
18
+ ```
19
+
20
+ ## Summary
21
+ Interleaves two arrays of (almost) same size.
22
+
23
+ ## Description
24
+ This function returns the interleaving of two arrays, starting
25
+ with the first element from the first array, then the first
26
+ element from the second array, and so on.
27
+
28
+ The first array must either be
29
+ of the same length as the second one, or can have one more element.
30
+
31
+ ## Type Parameters
32
+ ### 'T
33
+ The type of each element of `first` and `second`.
34
+
35
+ ## Input
36
+ ### first
37
+ The first array to be interleaved.
38
+
39
+ ### second
40
+ The second array to be interleaved.
41
+
42
+ ## Output
43
+ Interleaved array
44
+
45
+ ## Example
46
+ ```qsharp
47
+ // same as interleaved = [1, -1, 2, -2, 3, -3]
48
+ let interleaved = Interleaved([1, 2, 3], [-1, -2, -3])
49
+ ```
@@ -0,0 +1,28 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.IsEmpty
3
+ title: IsEmpty 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: IsEmpty
9
+ qsharp.summary: Returns true if and only if an array is empty.
10
+ ---
11
+
12
+ # IsEmpty function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function IsEmpty<'T>(array : 'T[]) : Bool
18
+ ```
19
+
20
+ ## Summary
21
+ Returns true if and only if an array is empty.
22
+
23
+ ## Input
24
+ ### array
25
+ The array to be checked.
26
+
27
+ ## Output
28
+ `true` if and only if the array is empty (has length 0).
@@ -0,0 +1,42 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.IsRectangularArray
3
+ title: IsRectangularArray 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: IsRectangularArray
9
+ qsharp.summary: Returns whether a 2-dimensional array has a rectangular shape
10
+ ---
11
+
12
+ # IsRectangularArray function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function IsRectangularArray<'T>(array : 'T[][]) : Bool
18
+ ```
19
+
20
+ ## Summary
21
+ Returns whether a 2-dimensional array has a rectangular shape
22
+
23
+ ## Type Parameters
24
+ ### 'T
25
+ The type of each element of `array`.
26
+
27
+ ## Input
28
+ ### array
29
+ A 2-dimensional array of elements.
30
+
31
+ ## Output
32
+ `true` if the array is rectangular, `false` otherwise.
33
+
34
+ ## Example
35
+ ```qsharp
36
+ IsRectangularArray([[1, 2], [3, 4]]); // true
37
+ IsRectangularArray([[1, 2, 3], [4, 5, 6]]); // true
38
+ IsRectangularArray([[1, 2], [3, 4, 5]]); // false
39
+ ```
40
+
41
+ ## See Also
42
+ - Microsoft.Quantum.Arrays.IsSquareArray
@@ -0,0 +1,42 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.IsSorted
3
+ title: IsSorted 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: IsSorted
9
+ qsharp.summary: Given an array, returns whether that array is sorted as defined by a given comparison function.
10
+ ---
11
+
12
+ # IsSorted function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function IsSorted<'T>(comparison : (('T, 'T) -> Bool), array : 'T[]) : Bool
18
+ ```
19
+
20
+ ## Summary
21
+ Given an array, returns whether that array is sorted as defined by
22
+ a given comparison function.
23
+
24
+ ## Type Parameters
25
+ ### 'T
26
+ The type of each element of `array`.
27
+
28
+ ## Input
29
+ ### comparison
30
+ A function that compares two elements such that `a` is considered to
31
+ be less than or equal to `b` if `comparison(a, b)` is `true`.
32
+ ### array
33
+ The array to be checked.
34
+
35
+ ## Output
36
+ `true` if and only if for each pair of elements `a` and `b` of
37
+ `array` occurring in that order, `comparison(a, b)` is `true`.
38
+
39
+ ## Remarks
40
+ The function `comparison` is assumed to be transitive, such that
41
+ if `comparison(a, b)` and `comparison(b, c)`, then `comparison(a, c)`
42
+ is assumed.
@@ -0,0 +1,42 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.IsSquareArray
3
+ title: IsSquareArray 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: IsSquareArray
9
+ qsharp.summary: Returns whether a 2-dimensional array has a square shape
10
+ ---
11
+
12
+ # IsSquareArray function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function IsSquareArray<'T>(array : 'T[][]) : Bool
18
+ ```
19
+
20
+ ## Summary
21
+ Returns whether a 2-dimensional array has a square shape
22
+
23
+ ## Type Parameters
24
+ ### 'T
25
+ The type of each element of `array`.
26
+
27
+ ## Input
28
+ ### array
29
+ A 2-dimensional array of elements.
30
+
31
+ ## Example
32
+ ```qsharp
33
+ IsSquareArray([[1, 2], [3, 4]]); // true
34
+ IsSquareArray([[1, 2, 3], [4, 5, 6]]); // false
35
+ IsSquareArray([[1, 2], [3, 4], [5, 6]]); // false
36
+ ```
37
+
38
+ ## Output
39
+ `true` if the array is square, `false` otherwise.
40
+
41
+ ## See Also
42
+ - Microsoft.Quantum.Arrays.IsRectangularArray
@@ -0,0 +1,41 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.Mapped
3
+ title: Mapped 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: Mapped
9
+ qsharp.summary: Given an array and a function that is defined for the elements of the array, returns a new array that consists of the images of the original array under the function.
10
+ ---
11
+
12
+ # Mapped function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function Mapped<'T, 'U>(mapper : ('T -> 'U), array : 'T[]) : 'U[]
18
+ ```
19
+
20
+ ## Summary
21
+ Given an array and a function 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 function.
24
+
25
+ ## Type Parameters
26
+ ### 'T
27
+ The type of `array` elements.
28
+ ### 'U
29
+ The result type of the `mapper` function.
30
+
31
+ ## Input
32
+ ### mapper
33
+ A function from `'T` to `'U` that is used to map elements.
34
+ ### array
35
+ An array of elements over `'T`.
36
+
37
+ ## Output
38
+ An array `'U[]` of elements that are mapped by the `mapper` function.
39
+
40
+ ## See Also
41
+ - Microsoft.Quantum.Arrays.ForEach
@@ -0,0 +1,52 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.MappedByIndex
3
+ title: MappedByIndex 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: MappedByIndex
9
+ qsharp.summary: Given an array and a function that is defined for the indexed elements of the array, returns a new array that consists of the images of the original array under the function.
10
+ ---
11
+
12
+ # MappedByIndex function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function MappedByIndex<'T, 'U>(mapper : ((Int, 'T) -> 'U), array : 'T[]) : 'U[]
18
+ ```
19
+
20
+ ## Summary
21
+ Given an array and a function that is defined
22
+ for the indexed elements of the array, returns a new array that consists
23
+ of the images of the original array under the function.
24
+
25
+ ## Type Parameters
26
+ ### 'T
27
+ The type of `array` elements.
28
+ ### 'U
29
+ The result type of the `mapper` function.
30
+
31
+ ## Input
32
+ ### mapper
33
+ A function from `(Int, 'T)` to `'U` that is used to map elements
34
+ and their indices.
35
+ ### array
36
+ An array of elements over `'T`.
37
+
38
+ ## Output
39
+ An array `'U[]` of elements that are mapped by the `mapper` function.
40
+
41
+ ## Example
42
+ The following two lines are equivalent:
43
+ ```qsharp
44
+ let array = MappedByIndex(f, [x0, x1, x2]);
45
+ ```
46
+ and
47
+ ```qsharp
48
+ let array = [f(0, x0), f(1, x1), f(2, x2)];
49
+ ```
50
+
51
+ ## See Also
52
+ - Microsoft.Quantum.Arrays.Mapped
@@ -0,0 +1,46 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.MappedOverRange
3
+ title: MappedOverRange 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: MappedOverRange
9
+ qsharp.summary: Given a range and a function that takes an integer as input, returns a new array that consists of the images of the range values under the function.
10
+ ---
11
+
12
+ # MappedOverRange function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function MappedOverRange<'T>(mapper : (Int -> 'T), range : Range) : 'T[]
18
+ ```
19
+
20
+ ## Summary
21
+ Given a range and a function that takes an integer as input,
22
+ returns a new array that consists
23
+ of the images of the range values under the function.
24
+
25
+ ## Type Parameters
26
+ ### 'T
27
+ The result type of the `mapper` function.
28
+
29
+ ## Input
30
+ ### mapper
31
+ A function from `Int` to `'T` that is used to map range values.
32
+ ### range
33
+ A range of integers.
34
+
35
+ ## Output
36
+ An array `'T[]` of elements that are mapped by the `mapper` function.
37
+
38
+ ## Example
39
+ This example adds 1 to a range of even numbers:
40
+ ```qsharp
41
+ let numbers = MappedOverRange(x -> x + 1, 0..2..10);
42
+ // numbers = [1, 3, 5, 7, 9, 11]
43
+ ```
44
+
45
+ ## See Also
46
+ - Microsoft.Quantum.Arrays.Mapped
@@ -0,0 +1,33 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.Most
3
+ title: Most 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: Most
9
+ qsharp.summary: Creates an array that is equal to an input array except that the last array element is dropped.
10
+ ---
11
+
12
+ # Most function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function Most<'T>(array : 'T[]) : 'T[]
18
+ ```
19
+
20
+ ## Summary
21
+ Creates an array that is equal to an input array except that the last array
22
+ element is dropped.
23
+
24
+ ## Type Parameters
25
+ ### 'T
26
+ The type of the array elements.
27
+
28
+ ## Input
29
+ ### array
30
+ An array whose first to second-to-last elements are to form the output array.
31
+
32
+ ## Output
33
+ An array containing the elements `array[0..Length(array) - 2]`.
@@ -0,0 +1,32 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.MostAndTail
3
+ title: MostAndTail 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: MostAndTail
9
+ qsharp.summary: Returns a tuple of all but one and the last element of the array.
10
+ ---
11
+
12
+ # MostAndTail function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function MostAndTail<'A>(array : 'A[]) : ('A[], 'A)
18
+ ```
19
+
20
+ ## Summary
21
+ Returns a tuple of all but one and the last element 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 all but one and the last element of the array.
@@ -0,0 +1,49 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.Padded
3
+ title: Padded 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: Padded
9
+ qsharp.summary: Returns an array padded at with specified values up to a specified length.
10
+ ---
11
+
12
+ # Padded function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function Padded<'T>(paddedLength : Int, defaultElement : 'T, inputArray : 'T[]) : 'T[]
18
+ ```
19
+
20
+ ## Summary
21
+ Returns an array padded at with specified values up to a
22
+ specified length.
23
+
24
+ ## Type Parameters
25
+ ### 'T
26
+ The type of the array elements.
27
+
28
+ ## Input
29
+ ### paddedLength
30
+ The length of the padded array. If this is positive, `array`
31
+ is padded at the head. If this is negative, `array` is padded
32
+ at the tail.
33
+ ### defaultElement
34
+ Default value to use for padding elements.
35
+ ### array
36
+ Array to be padded.
37
+
38
+ ## Output
39
+ An array `output` that is the `array` padded at the head or the tail
40
+ with `defaultElement`s until `output` has length `paddedLength`
41
+
42
+ ## Example
43
+ ```qsharp
44
+ let array = [10, 11, 12];
45
+ // The following line returns [10, 12, 15, 2, 2].
46
+ let output = Padded(-5, 2, array);
47
+ // The following line returns [2, 2, 10, 12, 15].
48
+ let output = Padded(5, 2, array);
49
+ ```
@@ -0,0 +1,44 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.Partitioned
3
+ title: Partitioned 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: Partitioned
9
+ qsharp.summary: Splits an array into multiple parts.
10
+ ---
11
+
12
+ # Partitioned function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function Partitioned<'T>(partitionSizes : Int[], array : 'T[]) : 'T[][]
18
+ ```
19
+
20
+ ## Summary
21
+ Splits an array into multiple parts.
22
+
23
+ ## Input
24
+ ### partitionSizes
25
+ Number of elements in each split part of array.
26
+ ### array
27
+ Input array to be split.
28
+
29
+ ## Output
30
+ Multiple arrays where the first array is the first `partitionSizes[0]` of `array`
31
+ and the second array are the next `partitionSizes[1]` of `array` etc. The last array
32
+ will contain all remaining elements. If the array is split exactly, the
33
+ last array will be the empty array, indicating there are no remaining elements.
34
+ In other words, `Tail(Partitioned(...))` will always return the remaining
35
+ elements, while `Most(Partitioned(...))` will always return the complete
36
+ partitions of the array.
37
+
38
+ ## Example
39
+ ```qsharp
40
+ // The following returns [[2, 3], [5], [7]];
41
+ let split = Partitioned([2, 1], [2, 3, 5, 7]);
42
+ // The following returns [[2, 3], [5, 7], []];
43
+ let split = Partitioned([2, 2], [2, 3, 5, 7]);
44
+ ```
@@ -0,0 +1,33 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.Rest
3
+ title: Rest 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: Rest
9
+ qsharp.summary: Creates an array that is equal to an input array except that the first array element is dropped.
10
+ ---
11
+
12
+ # Rest function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function Rest<'T>(array : 'T[]) : 'T[]
18
+ ```
19
+
20
+ ## Summary
21
+ Creates an array that is equal to an input array except that the first array
22
+ element is dropped.
23
+
24
+ ## Type Parameters
25
+ ### 'T
26
+ The type of the array elements.
27
+
28
+ ## Input
29
+ ### array
30
+ An array whose second to last elements are to form the output array.
31
+
32
+ ## Output
33
+ An array containing the elements `array[1..Length(array) - 1]`.
@@ -0,0 +1,33 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.Reversed
3
+ title: Reversed 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: Reversed
9
+ qsharp.summary: Create an array that contains the same elements as an input array but in reversed order.
10
+ ---
11
+
12
+ # Reversed function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function Reversed<'T>(array : 'T[]) : 'T[]
18
+ ```
19
+
20
+ ## Summary
21
+ Create an array that contains the same elements as an input array but in reversed
22
+ order.
23
+
24
+ ## Type Parameters
25
+ ### 'T
26
+ The type of the array elements.
27
+
28
+ ## Input
29
+ ### array
30
+ An array whose elements are to be copied in reversed order.
31
+
32
+ ## Output
33
+ An array containing the elements `array[Length(array) - 1]` .. `array[0]`.
@@ -0,0 +1,41 @@
1
+ ---
2
+ uid: Qdk.Microsoft.Quantum.Arrays.SequenceI
3
+ title: SequenceI 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: SequenceI
9
+ qsharp.summary: Get an array of integers in a given interval.
10
+ ---
11
+
12
+ # SequenceI function
13
+
14
+ Namespace: Microsoft.Quantum.Arrays
15
+
16
+ ```qsharp
17
+ function SequenceI(from : Int, to : Int) : Int[]
18
+ ```
19
+
20
+ ## Summary
21
+ Get an array of integers in a given interval.
22
+
23
+ ## Input
24
+ ### from
25
+ An inclusive start index of the interval.
26
+ ### to
27
+ An inclusive end index of the interval that is not smaller than `from`.
28
+
29
+ ## Output
30
+ An array containing the sequence of numbers `from`, `from + 1`, ...,
31
+ `to`.
32
+
33
+ ## Example
34
+ ```qsharp
35
+ let arr1 = SequenceI(0, 3); // [0, 1, 2, 3]
36
+ let arr2 = SequenceI(23, 29); // [23, 24, 25, 26, 27, 28, 29]
37
+ let arr3 = SequenceI(-5, -2); // [-5, -4, -3, -2]
38
+
39
+ let numbers = SequenceI(0, _); // function to create sequence from 0 to `to`
40
+ let naturals = SequenceI(1, _); // function to create sequence from 1 to `to`
41
+ ```