qsharp-lang 1.4.0 → 1.4.2-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 (279) hide show
  1. package/dist/compiler/common.d.ts +1 -1
  2. package/dist/compiler/compiler.d.ts +6 -6
  3. package/dist/compiler/compiler.js +10 -6
  4. package/dist/compiler/events.d.ts +1 -1
  5. package/dist/katas-content.generated.js +2337 -788
  6. package/dist/samples.generated.js +7 -7
  7. package/docs/Microsoft.Quantum.Arrays/All.md +1 -1
  8. package/docs/Microsoft.Quantum.Arrays/Any.md +1 -1
  9. package/docs/Microsoft.Quantum.Arrays/Chunks.md +1 -1
  10. package/docs/Microsoft.Quantum.Arrays/CircularlyShifted.md +1 -1
  11. package/docs/Microsoft.Quantum.Arrays/ColumnAt.md +1 -1
  12. package/docs/Microsoft.Quantum.Arrays/Count.md +1 -1
  13. package/docs/Microsoft.Quantum.Arrays/Diagonal.md +1 -1
  14. package/docs/Microsoft.Quantum.Arrays/DrawMany.md +1 -1
  15. package/docs/Microsoft.Quantum.Arrays/Enumerated.md +1 -1
  16. package/docs/Microsoft.Quantum.Arrays/Excluding.md +1 -1
  17. package/docs/Microsoft.Quantum.Arrays/Filtered.md +1 -1
  18. package/docs/Microsoft.Quantum.Arrays/FlatMapped.md +1 -1
  19. package/docs/Microsoft.Quantum.Arrays/Flattened.md +1 -1
  20. package/docs/Microsoft.Quantum.Arrays/Fold.md +1 -1
  21. package/docs/Microsoft.Quantum.Arrays/ForEach.md +1 -1
  22. package/docs/Microsoft.Quantum.Arrays/Head.md +1 -1
  23. package/docs/Microsoft.Quantum.Arrays/HeadAndRest.md +1 -1
  24. package/docs/Microsoft.Quantum.Arrays/IndexOf.md +1 -1
  25. package/docs/Microsoft.Quantum.Arrays/IndexRange.md +1 -1
  26. package/docs/Microsoft.Quantum.Arrays/Interleaved.md +1 -1
  27. package/docs/Microsoft.Quantum.Arrays/IsEmpty.md +1 -1
  28. package/docs/Microsoft.Quantum.Arrays/IsRectangularArray.md +1 -1
  29. package/docs/Microsoft.Quantum.Arrays/IsSorted.md +1 -1
  30. package/docs/Microsoft.Quantum.Arrays/IsSquareArray.md +1 -1
  31. package/docs/Microsoft.Quantum.Arrays/Mapped.md +1 -1
  32. package/docs/Microsoft.Quantum.Arrays/MappedByIndex.md +1 -1
  33. package/docs/Microsoft.Quantum.Arrays/MappedOverRange.md +1 -1
  34. package/docs/Microsoft.Quantum.Arrays/Most.md +1 -1
  35. package/docs/Microsoft.Quantum.Arrays/MostAndTail.md +1 -1
  36. package/docs/Microsoft.Quantum.Arrays/Padded.md +1 -1
  37. package/docs/Microsoft.Quantum.Arrays/Partitioned.md +1 -1
  38. package/docs/Microsoft.Quantum.Arrays/Rest.md +1 -1
  39. package/docs/Microsoft.Quantum.Arrays/Reversed.md +1 -1
  40. package/docs/Microsoft.Quantum.Arrays/SequenceI.md +1 -1
  41. package/docs/Microsoft.Quantum.Arrays/SequenceL.md +1 -1
  42. package/docs/Microsoft.Quantum.Arrays/Sorted.md +1 -1
  43. package/docs/Microsoft.Quantum.Arrays/Subarray.md +1 -1
  44. package/docs/Microsoft.Quantum.Arrays/Swapped.md +1 -1
  45. package/docs/Microsoft.Quantum.Arrays/Tail.md +1 -1
  46. package/docs/Microsoft.Quantum.Arrays/Transposed.md +1 -1
  47. package/docs/Microsoft.Quantum.Arrays/Unzipped.md +1 -1
  48. package/docs/Microsoft.Quantum.Arrays/Where.md +1 -1
  49. package/docs/Microsoft.Quantum.Arrays/Windows.md +1 -1
  50. package/docs/Microsoft.Quantum.Arrays/Zipped.md +1 -1
  51. package/docs/Microsoft.Quantum.Canon/ApplyCNOTChain.md +1 -1
  52. package/docs/Microsoft.Quantum.Canon/ApplyControlledOnBitString.md +1 -1
  53. package/docs/Microsoft.Quantum.Canon/ApplyControlledOnInt.md +1 -1
  54. package/docs/Microsoft.Quantum.Canon/ApplyP.md +1 -1
  55. package/docs/Microsoft.Quantum.Canon/ApplyPauli.md +1 -1
  56. package/docs/Microsoft.Quantum.Canon/ApplyPauliFromBitString.md +1 -1
  57. package/docs/Microsoft.Quantum.Canon/ApplyPauliFromInt.md +1 -1
  58. package/docs/Microsoft.Quantum.Canon/ApplyQFT.md +1 -1
  59. package/docs/Microsoft.Quantum.Canon/ApplyToEach.md +1 -1
  60. package/docs/Microsoft.Quantum.Canon/ApplyToEachA.md +1 -1
  61. package/docs/Microsoft.Quantum.Canon/ApplyToEachC.md +1 -1
  62. package/docs/Microsoft.Quantum.Canon/ApplyToEachCA.md +1 -1
  63. package/docs/Microsoft.Quantum.Canon/ApplyXorInPlace.md +1 -1
  64. package/docs/Microsoft.Quantum.Canon/ApplyXorInPlaceL.md +1 -1
  65. package/docs/Microsoft.Quantum.Canon/CX.md +1 -1
  66. package/docs/Microsoft.Quantum.Canon/CY.md +1 -1
  67. package/docs/Microsoft.Quantum.Canon/CZ.md +1 -1
  68. package/docs/Microsoft.Quantum.Canon/Fst.md +1 -1
  69. package/docs/Microsoft.Quantum.Canon/Snd.md +1 -1
  70. package/docs/Microsoft.Quantum.Canon/SwapReverseRegister.md +1 -1
  71. package/docs/Microsoft.Quantum.Convert/BigIntAsBoolArray.md +1 -1
  72. package/docs/Microsoft.Quantum.Convert/BoolArrayAsBigInt.md +1 -1
  73. package/docs/Microsoft.Quantum.Convert/BoolArrayAsInt.md +1 -1
  74. package/docs/Microsoft.Quantum.Convert/ComplexAsComplexPolar.md +1 -1
  75. package/docs/Microsoft.Quantum.Convert/ComplexPolarAsComplex.md +1 -1
  76. package/docs/Microsoft.Quantum.Convert/IntAsBigInt.md +1 -1
  77. package/docs/Microsoft.Quantum.Convert/IntAsBoolArray.md +1 -1
  78. package/docs/Microsoft.Quantum.Convert/IntAsDouble.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.ResourceEstimation/AccountForEstimates.md +1 -1
  216. package/docs/Microsoft.Quantum.ResourceEstimation/AuxQubitCount.md +1 -1
  217. package/docs/Microsoft.Quantum.ResourceEstimation/BeginEstimateCaching.md +1 -1
  218. package/docs/Microsoft.Quantum.ResourceEstimation/BeginRepeatEstimates.md +1 -1
  219. package/docs/Microsoft.Quantum.ResourceEstimation/CczCount.md +1 -1
  220. package/docs/Microsoft.Quantum.ResourceEstimation/EndEstimateCaching.md +1 -1
  221. package/docs/Microsoft.Quantum.ResourceEstimation/EndRepeatEstimates.md +1 -1
  222. package/docs/Microsoft.Quantum.ResourceEstimation/MeasurementCount.md +1 -1
  223. package/docs/Microsoft.Quantum.ResourceEstimation/PSSPCLayout.md +1 -1
  224. package/docs/Microsoft.Quantum.ResourceEstimation/RepeatEstimates.md +1 -1
  225. package/docs/Microsoft.Quantum.ResourceEstimation/RotationCount.md +1 -1
  226. package/docs/Microsoft.Quantum.ResourceEstimation/RotationDepth.md +1 -1
  227. package/docs/Microsoft.Quantum.ResourceEstimation/SingleVariant.md +1 -1
  228. package/docs/Microsoft.Quantum.ResourceEstimation/TCount.md +1 -1
  229. package/docs/Microsoft.Quantum.Unstable.Arithmetic/AddLE.md +1 -1
  230. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfEqualL.md +1 -1
  231. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfEqualLE.md +1 -1
  232. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterL.md +1 -1
  233. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterLE.md +1 -1
  234. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterOrEqualL.md +1 -1
  235. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterOrEqualLE.md +1 -1
  236. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessL.md +1 -1
  237. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessLE.md +1 -1
  238. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessOrEqualL.md +1 -1
  239. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessOrEqualLE.md +1 -1
  240. package/docs/Microsoft.Quantum.Unstable.Arithmetic/FourierTDIncByLE.md +1 -1
  241. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByI.md +1 -1
  242. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByIUsingIncByLE.md +1 -1
  243. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByL.md +1 -1
  244. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLE.md +1 -1
  245. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLEUsingAddLE.md +1 -1
  246. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLUsingIncByLE.md +1 -1
  247. package/docs/Microsoft.Quantum.Unstable.Arithmetic/LookAheadDKRSAddLE.md +1 -1
  248. package/docs/Microsoft.Quantum.Unstable.Arithmetic/MAJ.md +1 -1
  249. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ReflectAboutInteger.md +1 -1
  250. package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryCGAddLE.md +1 -1
  251. package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryCGIncByLE.md +1 -1
  252. package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryTTKIncByLE.md +1 -1
  253. package/docs/Microsoft.Quantum.Unstable.StatePreparation/ApproximatelyPreparePureStateCP.md +1 -1
  254. package/docs/Microsoft.Quantum.Unstable.StatePreparation/PreparePureStateD.md +1 -1
  255. package/docs/toc.yml +1 -19
  256. package/lib/node/qsc_wasm.cjs +48 -25
  257. package/lib/node/qsc_wasm.d.cts +11 -5
  258. package/lib/node/qsc_wasm_bg.wasm +0 -0
  259. package/lib/web/qsc_wasm.d.ts +14 -8
  260. package/lib/web/qsc_wasm.js +48 -25
  261. package/lib/web/qsc_wasm_bg.wasm +0 -0
  262. package/package.json +1 -1
  263. package/ux/estimatesPanel.tsx +1 -2
  264. package/ux/index.ts +1 -0
  265. package/ux/qsharp-ux.css +8 -0
  266. package/ux/reTable.tsx +7 -11
  267. package/ux/renderers.tsx +32 -0
  268. package/docs/Microsoft.Quantum.Convert/BoolArrayAsResultArray.md +0 -29
  269. package/docs/Microsoft.Quantum.Convert/BoolAsResult.md +0 -29
  270. package/docs/Microsoft.Quantum.Convert/ResultArrayAsBoolArray.md +0 -29
  271. package/docs/Microsoft.Quantum.Convert/ResultArrayAsInt.md +0 -34
  272. package/docs/Microsoft.Quantum.Convert/ResultAsBool.md +0 -29
  273. package/docs/Microsoft.Quantum.Diagnostics/CheckAllZero.md +0 -18
  274. package/docs/Microsoft.Quantum.Diagnostics/CheckOperationsAreEqual.md +0 -47
  275. package/docs/Microsoft.Quantum.Diagnostics/CheckZero.md +0 -18
  276. package/docs/Microsoft.Quantum.Measurement/MeasureInteger.md +0 -34
  277. package/docs/Microsoft.Quantum.Random/DrawRandomDouble.md +0 -38
  278. package/docs/Microsoft.Quantum.Random/DrawRandomInt.md +0 -38
  279. package/docs/Microsoft.Quantum.Unstable.TableLookup/Select.md +0 -53
@@ -452,60 +452,74 @@ export function get_library_source_content(name) {
452
452
  /**
453
453
  * @param {string} code
454
454
  * @param {(string)[]} language_features
455
+ * @param {string} profile
455
456
  * @returns {string}
456
457
  */
457
- export function get_ast(code, language_features) {
458
- let deferred3_0;
459
- let deferred3_1;
458
+ export function get_ast(code, language_features, profile) {
459
+ let deferred5_0;
460
+ let deferred5_1;
460
461
  try {
461
462
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
462
463
  const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
463
464
  const len0 = WASM_VECTOR_LEN;
464
465
  const ptr1 = passArrayJsValueToWasm0(language_features, wasm.__wbindgen_export_0);
465
466
  const len1 = WASM_VECTOR_LEN;
466
- wasm.get_ast(retptr, ptr0, len0, ptr1, len1);
467
+ const ptr2 = passStringToWasm0(profile, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
468
+ const len2 = WASM_VECTOR_LEN;
469
+ wasm.get_ast(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
467
470
  var r0 = getInt32Memory0()[retptr / 4 + 0];
468
471
  var r1 = getInt32Memory0()[retptr / 4 + 1];
469
- deferred3_0 = r0;
470
- deferred3_1 = r1;
471
- return getStringFromWasm0(r0, r1);
472
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
473
+ var r3 = getInt32Memory0()[retptr / 4 + 3];
474
+ var ptr4 = r0;
475
+ var len4 = r1;
476
+ if (r3) {
477
+ ptr4 = 0; len4 = 0;
478
+ throw takeObject(r2);
479
+ }
480
+ deferred5_0 = ptr4;
481
+ deferred5_1 = len4;
482
+ return getStringFromWasm0(ptr4, len4);
472
483
  } finally {
473
484
  wasm.__wbindgen_add_to_stack_pointer(16);
474
- wasm.__wbindgen_export_4(deferred3_0, deferred3_1, 1);
485
+ wasm.__wbindgen_export_4(deferred5_0, deferred5_1, 1);
475
486
  }
476
487
  }
477
488
 
478
489
  /**
479
490
  * @param {string} code
480
491
  * @param {(string)[]} language_features
492
+ * @param {string} profile
481
493
  * @returns {string}
482
494
  */
483
- export function get_hir(code, language_features) {
484
- let deferred4_0;
485
- let deferred4_1;
495
+ export function get_hir(code, language_features, profile) {
496
+ let deferred5_0;
497
+ let deferred5_1;
486
498
  try {
487
499
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
488
500
  const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
489
501
  const len0 = WASM_VECTOR_LEN;
490
502
  const ptr1 = passArrayJsValueToWasm0(language_features, wasm.__wbindgen_export_0);
491
503
  const len1 = WASM_VECTOR_LEN;
492
- wasm.get_hir(retptr, ptr0, len0, ptr1, len1);
504
+ const ptr2 = passStringToWasm0(profile, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
505
+ const len2 = WASM_VECTOR_LEN;
506
+ wasm.get_hir(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
493
507
  var r0 = getInt32Memory0()[retptr / 4 + 0];
494
508
  var r1 = getInt32Memory0()[retptr / 4 + 1];
495
509
  var r2 = getInt32Memory0()[retptr / 4 + 2];
496
510
  var r3 = getInt32Memory0()[retptr / 4 + 3];
497
- var ptr3 = r0;
498
- var len3 = r1;
511
+ var ptr4 = r0;
512
+ var len4 = r1;
499
513
  if (r3) {
500
- ptr3 = 0; len3 = 0;
514
+ ptr4 = 0; len4 = 0;
501
515
  throw takeObject(r2);
502
516
  }
503
- deferred4_0 = ptr3;
504
- deferred4_1 = len3;
505
- return getStringFromWasm0(ptr3, len3);
517
+ deferred5_0 = ptr4;
518
+ deferred5_1 = len4;
519
+ return getStringFromWasm0(ptr4, len4);
506
520
  } finally {
507
521
  wasm.__wbindgen_add_to_stack_pointer(16);
508
- wasm.__wbindgen_export_4(deferred4_0, deferred4_1, 1);
522
+ wasm.__wbindgen_export_4(deferred5_0, deferred5_1, 1);
509
523
  }
510
524
  }
511
525
 
@@ -558,17 +572,26 @@ export function check_exercise_solution(solution_code, exercise_sources_js, even
558
572
  }
559
573
 
560
574
  /**
575
+ * @param {(Array<any>)[] | undefined} [additionalSources]
576
+ * @param {string | undefined} [targetProfile]
577
+ * @param {(string)[] | undefined} [languageFeatures]
561
578
  * @returns {(IDocFile)[]}
562
579
  */
563
- export function generate_docs() {
580
+ export function generate_docs(additionalSources, targetProfile, languageFeatures) {
564
581
  try {
565
582
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
566
- wasm.generate_docs(retptr);
583
+ var ptr0 = isLikeNone(additionalSources) ? 0 : passArrayJsValueToWasm0(additionalSources, wasm.__wbindgen_export_0);
584
+ var len0 = WASM_VECTOR_LEN;
585
+ var ptr1 = isLikeNone(targetProfile) ? 0 : passStringToWasm0(targetProfile, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
586
+ var len1 = WASM_VECTOR_LEN;
587
+ var ptr2 = isLikeNone(languageFeatures) ? 0 : passArrayJsValueToWasm0(languageFeatures, wasm.__wbindgen_export_0);
588
+ var len2 = WASM_VECTOR_LEN;
589
+ wasm.generate_docs(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
567
590
  var r0 = getInt32Memory0()[retptr / 4 + 0];
568
591
  var r1 = getInt32Memory0()[retptr / 4 + 1];
569
- var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
592
+ var v4 = getArrayJsValueFromWasm0(r0, r1).slice();
570
593
  wasm.__wbindgen_export_4(r0, r1 * 4, 4);
571
- return v1;
594
+ return v4;
572
595
  } finally {
573
596
  wasm.__wbindgen_add_to_stack_pointer(16);
574
597
  }
@@ -1447,8 +1470,8 @@ function __wbg_get_imports() {
1447
1470
  const ret = wasm.memory;
1448
1471
  return addHeapObject(ret);
1449
1472
  };
1450
- imports.wbg.__wbindgen_closure_wrapper710 = function(arg0, arg1, arg2) {
1451
- const ret = makeMutClosure(arg0, arg1, 298, __wbg_adapter_54);
1473
+ imports.wbg.__wbindgen_closure_wrapper747 = function(arg0, arg1, arg2) {
1474
+ const ret = makeMutClosure(arg0, arg1, 299, __wbg_adapter_54);
1452
1475
  return addHeapObject(ret);
1453
1476
  };
1454
1477
 
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "qsharp-lang",
3
3
  "description": "qsharp language package for quantum development",
4
- "version": "1.4.0",
4
+ "version": "1.4.2-dev",
5
5
  "license": "MIT",
6
6
  "engines": {
7
7
  "node": ">=16.17.0"
@@ -13,7 +13,6 @@ export function EstimatesPanel(props: {
13
13
  colors: string[];
14
14
  runNames: string[];
15
15
  calculating: boolean;
16
- renderer: (input: string) => string;
17
16
  onRowDeleted: (rowId: string) => void;
18
17
  }) {
19
18
  const [estimate, setEstimate] = useState<SingleEstimateResult | null>(null);
@@ -77,7 +76,7 @@ export function EstimatesPanel(props: {
77
76
  <summary style="font-size: 1.5em; font-weight: bold; margin: 24px 8px;">
78
77
  Resource Estimates
79
78
  </summary>
80
- <ReTable mdRenderer={props.renderer} estimatesData={estimate} />
79
+ <ReTable estimatesData={estimate} />
81
80
  </details>
82
81
  </>
83
82
  )}
package/ux/index.ts CHANGED
@@ -19,3 +19,4 @@ export { ScatterChart } from "./scatterChart.js";
19
19
  export { EstimatesOverview } from "./estimatesOverview.js";
20
20
  export { EstimatesPanel } from "./estimatesPanel.js";
21
21
  export { Circuit, CircuitPanel } from "./circuit.js";
22
+ export { setRenderer, Markdown } from "./renderers.js";
package/ux/qsharp-ux.css CHANGED
@@ -275,6 +275,14 @@ html {
275
275
  white-space: pre;
276
276
  }
277
277
 
278
+ .qir-output {
279
+ height: 40vh;
280
+ min-height: 400px;
281
+ width: 100%;
282
+ resize: none;
283
+ white-space: pre;
284
+ }
285
+
278
286
  /* Results output */
279
287
 
280
288
  .output-header {
package/ux/reTable.tsx CHANGED
@@ -4,11 +4,9 @@
4
4
  import { useState } from "preact/hooks";
5
5
  import { SingleEstimateResult } from "./data.js";
6
6
  import { CreateReport } from "./report.js";
7
+ import { Markdown } from "./renderers.js";
7
8
 
8
- export function ReTable(props: {
9
- mdRenderer: (input: string) => string;
10
- estimatesData: SingleEstimateResult;
11
- }) {
9
+ export function ReTable(props: { estimatesData: SingleEstimateResult }) {
12
10
  const [showDetail, setShowDetail] = useState(false);
13
11
  const toggleDetail = () => {
14
12
  setShowDetail(!showDetail);
@@ -45,9 +43,6 @@ export function ReTable(props: {
45
43
  if (typeof value === "object") {
46
44
  value = JSON.stringify(value);
47
45
  }
48
- const renderedExplanation = {
49
- __html: props.mdRenderer(entry.explanation),
50
- };
51
46
  return (
52
47
  <tr>
53
48
  <td className="estimate-cell title-cell">{entry.label}</td>
@@ -57,9 +52,9 @@ export function ReTable(props: {
57
52
  <>
58
53
  <strong>{entry.description}</strong>
59
54
  <hr />
60
- <div
55
+ <Markdown
61
56
  className="estimate-explanation"
62
- dangerouslySetInnerHTML={renderedExplanation}
57
+ markdown={entry.explanation}
63
58
  />
64
59
  </>
65
60
  ) : (
@@ -81,9 +76,10 @@ export function ReTable(props: {
81
76
  </summary>
82
77
  <ul className="estimate-table">
83
78
  {reportData.assumptions.map((assumption) => (
84
- <li
79
+ <Markdown
85
80
  className="estimate-assumption"
86
- dangerouslySetInnerHTML={{ __html: props.mdRenderer(assumption) }}
81
+ markdown={assumption}
82
+ tagName="li"
87
83
  />
88
84
  ))}
89
85
  </ul>
@@ -0,0 +1,32 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ import { createElement } from "preact";
5
+
6
+ // Default renderer to be replaced before components are first used.
7
+ // Expectation is that this will convert markdown and/or LaTeX to HTML.
8
+ let theRenderer = function (input: string): string {
9
+ const err = "ERROR: Rendered has not been set";
10
+ console.error(err);
11
+ return err + ". " + input;
12
+ };
13
+
14
+ export function setRenderer(renderer: (input: string) => string) {
15
+ theRenderer = renderer;
16
+ }
17
+
18
+ export function Markdown(props: {
19
+ markdown: string;
20
+ className?: string;
21
+ tagName?: string;
22
+ }) {
23
+ const tag = props.tagName || "div";
24
+ const nodeProps = {
25
+ className: props.className,
26
+ dangerouslySetInnerHTML: {
27
+ __html: theRenderer(props.markdown),
28
+ },
29
+ };
30
+
31
+ return createElement(tag, nodeProps);
32
+ }
@@ -1,29 +0,0 @@
1
- ---
2
- uid: Qdk.Microsoft.Quantum.Convert.BoolArrayAsResultArray
3
- title: BoolArrayAsResultArray function
4
- ms.date: 04/23/2024 12:00:00 AM
5
- ms.topic: managed-reference
6
- qsharp.kind: function
7
- qsharp.namespace: Microsoft.Quantum.Convert
8
- qsharp.name: BoolArrayAsResultArray
9
- qsharp.summary: "Converts a `Bool[]` type to a `Result[]` type, where `true` is mapped to `One` and `false` is mapped to `Zero`."
10
- ---
11
-
12
- # BoolArrayAsResultArray function
13
-
14
- Namespace: Microsoft.Quantum.Convert
15
-
16
- ```qsharp
17
- function BoolArrayAsResultArray(input : Bool[]) : Result[]
18
- ```
19
-
20
- ## Summary
21
- Converts a `Bool[]` type to a `Result[]` type, where `true`
22
- is mapped to `One` and `false` is mapped to `Zero`.
23
-
24
- ## Input
25
- ### input
26
- `Bool[]` to be converted.
27
-
28
- ## Output
29
- A `Result[]` representing the `input`.
@@ -1,29 +0,0 @@
1
- ---
2
- uid: Qdk.Microsoft.Quantum.Convert.BoolAsResult
3
- title: BoolAsResult function
4
- ms.date: 04/23/2024 12:00:00 AM
5
- ms.topic: managed-reference
6
- qsharp.kind: function
7
- qsharp.namespace: Microsoft.Quantum.Convert
8
- qsharp.name: BoolAsResult
9
- qsharp.summary: "Converts a `Bool` type to a `Result` type, where `true` is mapped to `One` and `false` is mapped to `Zero`."
10
- ---
11
-
12
- # BoolAsResult function
13
-
14
- Namespace: Microsoft.Quantum.Convert
15
-
16
- ```qsharp
17
- function BoolAsResult(input : Bool) : Result
18
- ```
19
-
20
- ## Summary
21
- Converts a `Bool` type to a `Result` type, where `true` is mapped to
22
- `One` and `false` is mapped to `Zero`.
23
-
24
- ## Input
25
- ### input
26
- `Bool` to be converted.
27
-
28
- ## Output
29
- A `Result` representing the `input`.
@@ -1,29 +0,0 @@
1
- ---
2
- uid: Qdk.Microsoft.Quantum.Convert.ResultArrayAsBoolArray
3
- title: ResultArrayAsBoolArray function
4
- ms.date: 04/23/2024 12:00:00 AM
5
- ms.topic: managed-reference
6
- qsharp.kind: function
7
- qsharp.namespace: Microsoft.Quantum.Convert
8
- qsharp.name: ResultArrayAsBoolArray
9
- qsharp.summary: "Converts a `Result[]` type to a `Bool[]` type, where `One` is mapped to `true` and `Zero` is mapped to `false`."
10
- ---
11
-
12
- # ResultArrayAsBoolArray function
13
-
14
- Namespace: Microsoft.Quantum.Convert
15
-
16
- ```qsharp
17
- function ResultArrayAsBoolArray(input : Result[]) : Bool[]
18
- ```
19
-
20
- ## Summary
21
- Converts a `Result[]` type to a `Bool[]` type, where `One`
22
- is mapped to `true` and `Zero` is mapped to `false`.
23
-
24
- ## Input
25
- ### input
26
- `Result[]` to be converted.
27
-
28
- ## Output
29
- A `Bool[]` representing the `input`.
@@ -1,34 +0,0 @@
1
- ---
2
- uid: Qdk.Microsoft.Quantum.Convert.ResultArrayAsInt
3
- title: ResultArrayAsInt function
4
- ms.date: 04/23/2024 12:00:00 AM
5
- ms.topic: managed-reference
6
- qsharp.kind: function
7
- qsharp.namespace: Microsoft.Quantum.Convert
8
- qsharp.name: ResultArrayAsInt
9
- qsharp.summary: "Produces a non-negative integer from a string of Results in little-endian format."
10
- ---
11
-
12
- # ResultArrayAsInt function
13
-
14
- Namespace: Microsoft.Quantum.Convert
15
-
16
- ```qsharp
17
- function ResultArrayAsInt(results : Result[]) : Int
18
- ```
19
-
20
- ## Summary
21
- Produces a non-negative integer from a string of Results in little-endian format.
22
-
23
- ## Input
24
- ### results
25
- Results in binary representation of number.
26
-
27
- ## Output
28
- A non-negative integer
29
-
30
- ## Example
31
- ```qsharp
32
- // The following returns 1
33
- let int1 = ResultArrayAsInt([One,Zero])
34
- ```
@@ -1,29 +0,0 @@
1
- ---
2
- uid: Qdk.Microsoft.Quantum.Convert.ResultAsBool
3
- title: ResultAsBool function
4
- ms.date: 04/23/2024 12:00:00 AM
5
- ms.topic: managed-reference
6
- qsharp.kind: function
7
- qsharp.namespace: Microsoft.Quantum.Convert
8
- qsharp.name: ResultAsBool
9
- qsharp.summary: "Converts a `Result` type to a `Bool` type, where `One` is mapped to `true` and `Zero` is mapped to `false`."
10
- ---
11
-
12
- # ResultAsBool function
13
-
14
- Namespace: Microsoft.Quantum.Convert
15
-
16
- ```qsharp
17
- function ResultAsBool(input : Result) : Bool
18
- ```
19
-
20
- ## Summary
21
- Converts a `Result` type to a `Bool` type, where `One` is mapped to
22
- `true` and `Zero` is mapped to `false`.
23
-
24
- ## Input
25
- ### input
26
- `Result` to be converted.
27
-
28
- ## Output
29
- A `Bool` representing the `input`.
@@ -1,18 +0,0 @@
1
- ---
2
- uid: Qdk.Microsoft.Quantum.Diagnostics.CheckAllZero
3
- title: CheckAllZero operation
4
- ms.date: 04/23/2024 12:00:00 AM
5
- ms.topic: managed-reference
6
- qsharp.kind: operation
7
- qsharp.namespace: Microsoft.Quantum.Diagnostics
8
- qsharp.name: CheckAllZero
9
- qsharp.summary: ""
10
- ---
11
-
12
- # CheckAllZero operation
13
-
14
- Namespace: Microsoft.Quantum.Diagnostics
15
-
16
- ```qsharp
17
- operation CheckAllZero(qubits : Qubit[]) : Bool
18
- ```
@@ -1,47 +0,0 @@
1
- ---
2
- uid: Qdk.Microsoft.Quantum.Diagnostics.CheckOperationsAreEqual
3
- title: CheckOperationsAreEqual operation
4
- ms.date: 04/23/2024 12:00:00 AM
5
- ms.topic: managed-reference
6
- qsharp.kind: operation
7
- qsharp.namespace: Microsoft.Quantum.Diagnostics
8
- qsharp.name: CheckOperationsAreEqual
9
- qsharp.summary: "Given two operations, checks that they act identically for all input states."
10
- ---
11
-
12
- # CheckOperationsAreEqual operation
13
-
14
- Namespace: Microsoft.Quantum.Diagnostics
15
-
16
- ```qsharp
17
- operation CheckOperationsAreEqual(nQubits : Int, actual : (Qubit[] => Unit), expected : (Qubit[] => Unit is Adj)) : Bool
18
- ```
19
-
20
- ## Summary
21
- Given two operations, checks that they act identically for all input states.
22
-
23
- ## Description
24
- This check is implemented by using the Choi–Jamiołkowski isomorphism to reduce
25
- this check to a check on two entangled registers.
26
- Thus, this operation needs only a single call to each operation being tested,
27
- but requires twice as many qubits to be allocated.
28
- This check can be used to ensure, for instance, that an optimized version of an
29
- operation acts identically to its naïve implementation, or that an operation
30
- which acts on a range of non-quantum inputs agrees with known cases.
31
-
32
- ## Remarks
33
- This operation requires that the operation modeling the expected behavior is
34
- adjointable, so that the inverse can be performed on the target register alone.
35
- Formally, one can specify a transpose operation, which relaxes this requirement,
36
- but the transpose operation is not in general physically realizable for arbitrary
37
- quantum operations and thus is not included here as an option.
38
-
39
- ## Input
40
- ### nQubits
41
- Number of qubits to pass to each operation.
42
- ### actual
43
- Operation to be tested.
44
- ### expected
45
- Operation defining the expected behavior for the operation under test.
46
- ## Output
47
- True if operations are equal, false otherwise.
@@ -1,18 +0,0 @@
1
- ---
2
- uid: Qdk.Microsoft.Quantum.Diagnostics.CheckZero
3
- title: CheckZero operation
4
- ms.date: 04/23/2024 12:00:00 AM
5
- ms.topic: managed-reference
6
- qsharp.kind: operation
7
- qsharp.namespace: Microsoft.Quantum.Diagnostics
8
- qsharp.name: CheckZero
9
- qsharp.summary: ""
10
- ---
11
-
12
- # CheckZero operation
13
-
14
- Namespace: Microsoft.Quantum.Diagnostics
15
-
16
- ```qsharp
17
- operation CheckZero(qubit : Qubit) : Bool
18
- ```
@@ -1,34 +0,0 @@
1
- ---
2
- uid: Qdk.Microsoft.Quantum.Measurement.MeasureInteger
3
- title: MeasureInteger operation
4
- ms.date: 04/23/2024 12:00:00 AM
5
- ms.topic: managed-reference
6
- qsharp.kind: operation
7
- qsharp.namespace: Microsoft.Quantum.Measurement
8
- qsharp.name: MeasureInteger
9
- qsharp.summary: "Measures the content of a quantum register and converts it to an integer. The measurement is performed with respect to the standard computational basis, i.e., the eigenbasis of `PauliZ`."
10
- ---
11
-
12
- # MeasureInteger operation
13
-
14
- Namespace: Microsoft.Quantum.Measurement
15
-
16
- ```qsharp
17
- operation MeasureInteger(target : Qubit[]) : Int
18
- ```
19
-
20
- ## Summary
21
- Measures the content of a quantum register and converts
22
- it to an integer. The measurement is performed with respect
23
- to the standard computational basis, i.e., the eigenbasis of `PauliZ`.
24
-
25
- ## Input
26
- ### target
27
- A quantum register in the little-endian encoding.
28
-
29
- ## Output
30
- An unsigned integer that contains the measured value of `target`.
31
-
32
- ## Remarks
33
- This operation resets its input register to the |00...0> state,
34
- suitable for releasing back to a target machine.
@@ -1,38 +0,0 @@
1
- ---
2
- uid: Qdk.Microsoft.Quantum.Random.DrawRandomDouble
3
- title: DrawRandomDouble operation
4
- ms.date: 04/23/2024 12:00:00 AM
5
- ms.topic: managed-reference
6
- qsharp.kind: operation
7
- qsharp.namespace: Microsoft.Quantum.Random
8
- qsharp.name: DrawRandomDouble
9
- qsharp.summary: "Draws a random real number from a uniform distribution in a given inclusive interval. Fails if `max < min`."
10
- ---
11
-
12
- # DrawRandomDouble operation
13
-
14
- Namespace: Microsoft.Quantum.Random
15
-
16
- ```qsharp
17
- operation DrawRandomDouble(min : Double, max : Double) : Double
18
- ```
19
-
20
- ## Summary
21
- Draws a random real number from a uniform distribution
22
- in a given inclusive interval. Fails if `max < min`.
23
-
24
- ## Input
25
- ### min
26
- The smallest real number to be drawn.
27
- ### max
28
- The largest real number to be drawn.
29
-
30
- ## Output
31
- A random real number in the inclusive interval from `min` to `max` with
32
- uniform probability.
33
-
34
- ## Example
35
- The following Q# snippet randomly draws an angle between 0 and 2π:
36
- ```qsharp
37
- let angle = DrawRandomDouble(0.0, 2.0 * PI());
38
- ```
@@ -1,38 +0,0 @@
1
- ---
2
- uid: Qdk.Microsoft.Quantum.Random.DrawRandomInt
3
- title: DrawRandomInt operation
4
- ms.date: 04/23/2024 12:00:00 AM
5
- ms.topic: managed-reference
6
- qsharp.kind: operation
7
- qsharp.namespace: Microsoft.Quantum.Random
8
- qsharp.name: DrawRandomInt
9
- qsharp.summary: "Draws a random integer from a uniform distribution in a given inclusive range. Fails if `max < min`."
10
- ---
11
-
12
- # DrawRandomInt operation
13
-
14
- Namespace: Microsoft.Quantum.Random
15
-
16
- ```qsharp
17
- operation DrawRandomInt(min : Int, max : Int) : Int
18
- ```
19
-
20
- ## Summary
21
- Draws a random integer from a uniform distribution
22
- in a given inclusive range. Fails if `max < min`.
23
-
24
- ## Input
25
- ### min
26
- The smallest integer to be drawn.
27
- ### max
28
- The largest integer to be drawn.
29
-
30
- ## Output
31
- An integer in the inclusive range from `min` to `max` with uniform
32
- probability.
33
-
34
- ## Example
35
- The following Q# snippet randomly rolls a six-sided die:
36
- ```qsharp
37
- let roll = DrawRandomInt(1, 6);
38
- ```
@@ -1,53 +0,0 @@
1
- ---
2
- uid: Qdk.Microsoft.Quantum.Unstable.TableLookup.Select
3
- title: Select operation
4
- ms.date: 04/23/2024 12:00:00 AM
5
- ms.topic: managed-reference
6
- qsharp.kind: operation
7
- qsharp.namespace: Microsoft.Quantum.Unstable.TableLookup
8
- qsharp.name: Select
9
- qsharp.summary: "Performs table lookup using a SELECT network"
10
- ---
11
-
12
- # Select operation
13
-
14
- Namespace: Microsoft.Quantum.Unstable.TableLookup
15
-
16
- ```qsharp
17
- operation Select(data : Bool[][], address : Qubit[], target : Qubit[]) : Unit is Adj + Ctl
18
- ```
19
-
20
- ## Summary
21
- Performs table lookup using a SELECT network
22
-
23
- ## Description
24
- Assuming a zero-initialized `target` register, this operation will
25
- initialize it with the bitstrings in `data` at indices according to the
26
- computational values of the `address` register.
27
-
28
- ## Input
29
- ### data
30
- The classical table lookup data which is prepared in `target` with
31
- respect to the state in `address`. The length of data must be less than
32
- 2ⁿ, where 𝑛 is the length of `address`. Each entry in data must have
33
- the same length that must be equal to the length of `target`.
34
- ### address
35
- Address register
36
- ### target
37
- Zero-initialized target register
38
-
39
- ## Remarks
40
- The implementation of the SELECT network is based on unary encoding as
41
- presented in [1]. The recursive implementation of that algorithm is
42
- presented in [3]. The adjoint variant is optimized using a
43
- measurement-based unlookup operation [3]. The controlled adjoint variant
44
- is not optimized using this technique.
45
-
46
- ## References
47
- 1. [arXiv:1805.03662](https://arxiv.org/abs/1805.03662)
48
- "Encoding Electronic Spectra in Quantum Circuits with Linear T
49
- Complexity"
50
- 2. [arXiv:1905.07682](https://arxiv.org/abs/1905.07682)
51
- "Windowed arithmetic"
52
- 3. [arXiv:2211.01133](https://arxiv.org/abs/2211.01133)
53
- "Space-time optimized table lookup"