qsharp-lang 1.6.0 → 1.6.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 (288) hide show
  1. package/dist/browser.d.ts +4 -9
  2. package/dist/browser.js +4 -5
  3. package/dist/compiler/compiler.d.ts +20 -37
  4. package/dist/compiler/compiler.js +30 -50
  5. package/dist/debug-service/debug-service.d.ts +3 -3
  6. package/dist/debug-service/debug-service.js +4 -3
  7. package/dist/katas-content.generated.d.ts +5 -10
  8. package/dist/katas-content.generated.js +2722 -1849
  9. package/dist/katas-content.generated.md.d.ts +57 -0
  10. package/dist/katas-content.generated.md.js +7990 -0
  11. package/dist/katas-md.d.ts +6 -0
  12. package/dist/katas-md.js +14 -0
  13. package/dist/katas.d.ts +1 -2
  14. package/dist/language-service/language-service.d.ts +3 -4
  15. package/dist/language-service/language-service.js +8 -3
  16. package/dist/main.d.ts +3 -6
  17. package/dist/main.js +4 -4
  18. package/dist/samples.generated.js +1 -1
  19. package/docs/Microsoft.Quantum.Arrays/All.md +1 -1
  20. package/docs/Microsoft.Quantum.Arrays/Any.md +1 -1
  21. package/docs/Microsoft.Quantum.Arrays/Chunks.md +1 -1
  22. package/docs/Microsoft.Quantum.Arrays/CircularlyShifted.md +1 -1
  23. package/docs/Microsoft.Quantum.Arrays/ColumnAt.md +1 -1
  24. package/docs/Microsoft.Quantum.Arrays/Count.md +1 -1
  25. package/docs/Microsoft.Quantum.Arrays/Diagonal.md +1 -1
  26. package/docs/Microsoft.Quantum.Arrays/DrawMany.md +1 -1
  27. package/docs/Microsoft.Quantum.Arrays/Enumerated.md +1 -1
  28. package/docs/Microsoft.Quantum.Arrays/Excluding.md +1 -1
  29. package/docs/Microsoft.Quantum.Arrays/Filtered.md +1 -1
  30. package/docs/Microsoft.Quantum.Arrays/FlatMapped.md +1 -1
  31. package/docs/Microsoft.Quantum.Arrays/Flattened.md +1 -1
  32. package/docs/Microsoft.Quantum.Arrays/Fold.md +1 -1
  33. package/docs/Microsoft.Quantum.Arrays/ForEach.md +1 -1
  34. package/docs/Microsoft.Quantum.Arrays/Head.md +1 -1
  35. package/docs/Microsoft.Quantum.Arrays/HeadAndRest.md +1 -1
  36. package/docs/Microsoft.Quantum.Arrays/IndexOf.md +1 -1
  37. package/docs/Microsoft.Quantum.Arrays/IndexRange.md +1 -1
  38. package/docs/Microsoft.Quantum.Arrays/Interleaved.md +1 -1
  39. package/docs/Microsoft.Quantum.Arrays/IsEmpty.md +1 -1
  40. package/docs/Microsoft.Quantum.Arrays/IsRectangularArray.md +1 -1
  41. package/docs/Microsoft.Quantum.Arrays/IsSorted.md +1 -1
  42. package/docs/Microsoft.Quantum.Arrays/IsSquareArray.md +1 -1
  43. package/docs/Microsoft.Quantum.Arrays/Mapped.md +1 -1
  44. package/docs/Microsoft.Quantum.Arrays/MappedByIndex.md +1 -1
  45. package/docs/Microsoft.Quantum.Arrays/MappedOverRange.md +1 -1
  46. package/docs/Microsoft.Quantum.Arrays/Most.md +1 -1
  47. package/docs/Microsoft.Quantum.Arrays/MostAndTail.md +1 -1
  48. package/docs/Microsoft.Quantum.Arrays/Padded.md +1 -1
  49. package/docs/Microsoft.Quantum.Arrays/Partitioned.md +1 -1
  50. package/docs/Microsoft.Quantum.Arrays/Rest.md +1 -1
  51. package/docs/Microsoft.Quantum.Arrays/Reversed.md +1 -1
  52. package/docs/Microsoft.Quantum.Arrays/SequenceI.md +1 -1
  53. package/docs/Microsoft.Quantum.Arrays/SequenceL.md +1 -1
  54. package/docs/Microsoft.Quantum.Arrays/Sorted.md +1 -1
  55. package/docs/Microsoft.Quantum.Arrays/Subarray.md +1 -1
  56. package/docs/Microsoft.Quantum.Arrays/Swapped.md +1 -1
  57. package/docs/Microsoft.Quantum.Arrays/Tail.md +1 -1
  58. package/docs/Microsoft.Quantum.Arrays/Transposed.md +1 -1
  59. package/docs/Microsoft.Quantum.Arrays/Unzipped.md +1 -1
  60. package/docs/Microsoft.Quantum.Arrays/Where.md +1 -1
  61. package/docs/Microsoft.Quantum.Arrays/Windows.md +1 -1
  62. package/docs/Microsoft.Quantum.Arrays/Zipped.md +1 -1
  63. package/docs/Microsoft.Quantum.Canon/ApplyCNOTChain.md +1 -1
  64. package/docs/Microsoft.Quantum.Canon/ApplyControlledOnBitString.md +1 -1
  65. package/docs/Microsoft.Quantum.Canon/ApplyControlledOnInt.md +1 -1
  66. package/docs/Microsoft.Quantum.Canon/ApplyP.md +1 -1
  67. package/docs/Microsoft.Quantum.Canon/ApplyPauli.md +1 -1
  68. package/docs/Microsoft.Quantum.Canon/ApplyPauliFromBitString.md +1 -1
  69. package/docs/Microsoft.Quantum.Canon/ApplyPauliFromInt.md +1 -1
  70. package/docs/Microsoft.Quantum.Canon/ApplyQFT.md +1 -1
  71. package/docs/Microsoft.Quantum.Canon/ApplyToEach.md +1 -1
  72. package/docs/Microsoft.Quantum.Canon/ApplyToEachA.md +1 -1
  73. package/docs/Microsoft.Quantum.Canon/ApplyToEachC.md +1 -1
  74. package/docs/Microsoft.Quantum.Canon/ApplyToEachCA.md +1 -1
  75. package/docs/Microsoft.Quantum.Canon/ApplyXorInPlace.md +1 -1
  76. package/docs/Microsoft.Quantum.Canon/ApplyXorInPlaceL.md +1 -1
  77. package/docs/Microsoft.Quantum.Canon/CX.md +1 -1
  78. package/docs/Microsoft.Quantum.Canon/CY.md +1 -1
  79. package/docs/Microsoft.Quantum.Canon/CZ.md +1 -1
  80. package/docs/Microsoft.Quantum.Canon/Fst.md +1 -1
  81. package/docs/Microsoft.Quantum.Canon/Snd.md +1 -1
  82. package/docs/Microsoft.Quantum.Canon/SwapReverseRegister.md +1 -1
  83. package/docs/Microsoft.Quantum.Convert/BigIntAsBoolArray.md +1 -1
  84. package/docs/Microsoft.Quantum.Convert/BoolArrayAsBigInt.md +1 -1
  85. package/docs/Microsoft.Quantum.Convert/BoolArrayAsInt.md +1 -1
  86. package/docs/Microsoft.Quantum.Convert/BoolArrayAsResultArray.md +1 -1
  87. package/docs/Microsoft.Quantum.Convert/BoolAsResult.md +1 -1
  88. package/docs/Microsoft.Quantum.Convert/ComplexAsComplexPolar.md +1 -1
  89. package/docs/Microsoft.Quantum.Convert/ComplexPolarAsComplex.md +1 -1
  90. package/docs/Microsoft.Quantum.Convert/IntAsBigInt.md +1 -1
  91. package/docs/Microsoft.Quantum.Convert/IntAsBoolArray.md +1 -1
  92. package/docs/Microsoft.Quantum.Convert/IntAsDouble.md +1 -1
  93. package/docs/Microsoft.Quantum.Convert/ResultArrayAsBoolArray.md +1 -1
  94. package/docs/Microsoft.Quantum.Convert/ResultArrayAsInt.md +1 -1
  95. package/docs/Microsoft.Quantum.Convert/ResultAsBool.md +1 -1
  96. package/docs/Microsoft.Quantum.Core/IsRangeEmpty.md +1 -1
  97. package/docs/Microsoft.Quantum.Core/Length.md +1 -1
  98. package/docs/Microsoft.Quantum.Core/RangeEnd.md +1 -1
  99. package/docs/Microsoft.Quantum.Core/RangeReverse.md +1 -1
  100. package/docs/Microsoft.Quantum.Core/RangeStart.md +1 -1
  101. package/docs/Microsoft.Quantum.Core/RangeStep.md +1 -1
  102. package/docs/Microsoft.Quantum.Core/Repeated.md +1 -1
  103. package/docs/Microsoft.Quantum.Diagnostics/DumpMachine.md +1 -1
  104. package/docs/Microsoft.Quantum.Diagnostics/DumpRegister.md +1 -1
  105. package/docs/Microsoft.Quantum.Diagnostics/Fact.md +1 -1
  106. package/docs/Microsoft.Quantum.Intrinsic/AND.md +33 -0
  107. package/docs/Microsoft.Quantum.Intrinsic/CCNOT.md +1 -1
  108. package/docs/Microsoft.Quantum.Intrinsic/CNOT.md +1 -1
  109. package/docs/Microsoft.Quantum.Intrinsic/Exp.md +1 -1
  110. package/docs/Microsoft.Quantum.Intrinsic/H.md +1 -1
  111. package/docs/Microsoft.Quantum.Intrinsic/I.md +1 -1
  112. package/docs/Microsoft.Quantum.Intrinsic/M.md +1 -1
  113. package/docs/Microsoft.Quantum.Intrinsic/Measure.md +1 -1
  114. package/docs/Microsoft.Quantum.Intrinsic/Message.md +1 -1
  115. package/docs/Microsoft.Quantum.Intrinsic/R.md +1 -1
  116. package/docs/Microsoft.Quantum.Intrinsic/R1.md +1 -1
  117. package/docs/Microsoft.Quantum.Intrinsic/R1Frac.md +1 -1
  118. package/docs/Microsoft.Quantum.Intrinsic/RFrac.md +1 -1
  119. package/docs/Microsoft.Quantum.Intrinsic/Reset.md +1 -1
  120. package/docs/Microsoft.Quantum.Intrinsic/ResetAll.md +1 -1
  121. package/docs/Microsoft.Quantum.Intrinsic/Rx.md +1 -1
  122. package/docs/Microsoft.Quantum.Intrinsic/Rxx.md +1 -1
  123. package/docs/Microsoft.Quantum.Intrinsic/Ry.md +1 -1
  124. package/docs/Microsoft.Quantum.Intrinsic/Ryy.md +1 -1
  125. package/docs/Microsoft.Quantum.Intrinsic/Rz.md +1 -1
  126. package/docs/Microsoft.Quantum.Intrinsic/Rzz.md +1 -1
  127. package/docs/Microsoft.Quantum.Intrinsic/S.md +1 -1
  128. package/docs/Microsoft.Quantum.Intrinsic/SWAP.md +1 -1
  129. package/docs/Microsoft.Quantum.Intrinsic/T.md +1 -1
  130. package/docs/Microsoft.Quantum.Intrinsic/X.md +1 -1
  131. package/docs/Microsoft.Quantum.Intrinsic/Y.md +1 -1
  132. package/docs/Microsoft.Quantum.Intrinsic/Z.md +1 -1
  133. package/docs/Microsoft.Quantum.Logical/Xor.md +1 -1
  134. package/docs/Microsoft.Quantum.Math/AbsComplex.md +1 -1
  135. package/docs/Microsoft.Quantum.Math/AbsComplexPolar.md +1 -1
  136. package/docs/Microsoft.Quantum.Math/AbsD.md +1 -1
  137. package/docs/Microsoft.Quantum.Math/AbsI.md +1 -1
  138. package/docs/Microsoft.Quantum.Math/AbsL.md +1 -1
  139. package/docs/Microsoft.Quantum.Math/AbsSquaredComplex.md +1 -1
  140. package/docs/Microsoft.Quantum.Math/AbsSquaredComplexPolar.md +1 -1
  141. package/docs/Microsoft.Quantum.Math/ApproximateFactorial.md +1 -1
  142. package/docs/Microsoft.Quantum.Math/ArcCos.md +1 -1
  143. package/docs/Microsoft.Quantum.Math/ArcCosh.md +1 -1
  144. package/docs/Microsoft.Quantum.Math/ArcSin.md +1 -1
  145. package/docs/Microsoft.Quantum.Math/ArcSinh.md +1 -1
  146. package/docs/Microsoft.Quantum.Math/ArcTan.md +1 -1
  147. package/docs/Microsoft.Quantum.Math/ArcTan2.md +1 -1
  148. package/docs/Microsoft.Quantum.Math/ArcTanh.md +1 -1
  149. package/docs/Microsoft.Quantum.Math/ArgComplex.md +1 -1
  150. package/docs/Microsoft.Quantum.Math/ArgComplexPolar.md +1 -1
  151. package/docs/Microsoft.Quantum.Math/Binom.md +1 -1
  152. package/docs/Microsoft.Quantum.Math/BitSizeI.md +1 -1
  153. package/docs/Microsoft.Quantum.Math/BitSizeL.md +1 -1
  154. package/docs/Microsoft.Quantum.Math/Ceiling.md +1 -1
  155. package/docs/Microsoft.Quantum.Math/Complex.md +2 -2
  156. package/docs/Microsoft.Quantum.Math/ComplexPolar.md +2 -2
  157. package/docs/Microsoft.Quantum.Math/ContinuedFractionConvergentI.md +1 -1
  158. package/docs/Microsoft.Quantum.Math/ContinuedFractionConvergentL.md +1 -1
  159. package/docs/Microsoft.Quantum.Math/Cos.md +1 -1
  160. package/docs/Microsoft.Quantum.Math/Cosh.md +1 -1
  161. package/docs/Microsoft.Quantum.Math/DivRemI.md +1 -1
  162. package/docs/Microsoft.Quantum.Math/DivRemL.md +1 -1
  163. package/docs/Microsoft.Quantum.Math/DividedByC.md +1 -1
  164. package/docs/Microsoft.Quantum.Math/DividedByCP.md +1 -1
  165. package/docs/Microsoft.Quantum.Math/E.md +1 -1
  166. package/docs/Microsoft.Quantum.Math/ExpModI.md +1 -1
  167. package/docs/Microsoft.Quantum.Math/ExpModL.md +1 -1
  168. package/docs/Microsoft.Quantum.Math/ExtendedGreatestCommonDivisorI.md +1 -1
  169. package/docs/Microsoft.Quantum.Math/ExtendedGreatestCommonDivisorL.md +1 -1
  170. package/docs/Microsoft.Quantum.Math/FactorialI.md +1 -1
  171. package/docs/Microsoft.Quantum.Math/FactorialL.md +1 -1
  172. package/docs/Microsoft.Quantum.Math/Floor.md +1 -1
  173. package/docs/Microsoft.Quantum.Math/GreatestCommonDivisorI.md +1 -1
  174. package/docs/Microsoft.Quantum.Math/GreatestCommonDivisorL.md +1 -1
  175. package/docs/Microsoft.Quantum.Math/HammingWeightI.md +1 -1
  176. package/docs/Microsoft.Quantum.Math/InverseModI.md +1 -1
  177. package/docs/Microsoft.Quantum.Math/InverseModL.md +1 -1
  178. package/docs/Microsoft.Quantum.Math/IsCoprimeI.md +1 -1
  179. package/docs/Microsoft.Quantum.Math/IsCoprimeL.md +1 -1
  180. package/docs/Microsoft.Quantum.Math/IsInfinite.md +1 -1
  181. package/docs/Microsoft.Quantum.Math/IsNaN.md +1 -1
  182. package/docs/Microsoft.Quantum.Math/LargestFixedPoint.md +1 -1
  183. package/docs/Microsoft.Quantum.Math/Lg.md +1 -1
  184. package/docs/Microsoft.Quantum.Math/Log.md +1 -1
  185. package/docs/Microsoft.Quantum.Math/Log10.md +1 -1
  186. package/docs/Microsoft.Quantum.Math/LogFactorialD.md +1 -1
  187. package/docs/Microsoft.Quantum.Math/LogGammaD.md +1 -1
  188. package/docs/Microsoft.Quantum.Math/LogOf2.md +1 -1
  189. package/docs/Microsoft.Quantum.Math/Max.md +1 -1
  190. package/docs/Microsoft.Quantum.Math/MaxD.md +1 -1
  191. package/docs/Microsoft.Quantum.Math/MaxI.md +1 -1
  192. package/docs/Microsoft.Quantum.Math/MaxL.md +1 -1
  193. package/docs/Microsoft.Quantum.Math/Min.md +1 -1
  194. package/docs/Microsoft.Quantum.Math/MinD.md +1 -1
  195. package/docs/Microsoft.Quantum.Math/MinI.md +1 -1
  196. package/docs/Microsoft.Quantum.Math/MinL.md +1 -1
  197. package/docs/Microsoft.Quantum.Math/MinusC.md +1 -1
  198. package/docs/Microsoft.Quantum.Math/MinusCP.md +1 -1
  199. package/docs/Microsoft.Quantum.Math/ModulusI.md +1 -1
  200. package/docs/Microsoft.Quantum.Math/ModulusL.md +1 -1
  201. package/docs/Microsoft.Quantum.Math/NegationC.md +1 -1
  202. package/docs/Microsoft.Quantum.Math/NegationCP.md +1 -1
  203. package/docs/Microsoft.Quantum.Math/PI.md +1 -1
  204. package/docs/Microsoft.Quantum.Math/PNorm.md +1 -1
  205. package/docs/Microsoft.Quantum.Math/PNormalized.md +1 -1
  206. package/docs/Microsoft.Quantum.Math/PlusC.md +1 -1
  207. package/docs/Microsoft.Quantum.Math/PlusCP.md +1 -1
  208. package/docs/Microsoft.Quantum.Math/PowC.md +1 -1
  209. package/docs/Microsoft.Quantum.Math/PowCP.md +1 -1
  210. package/docs/Microsoft.Quantum.Math/RealMod.md +1 -1
  211. package/docs/Microsoft.Quantum.Math/Round.md +1 -1
  212. package/docs/Microsoft.Quantum.Math/SignD.md +1 -1
  213. package/docs/Microsoft.Quantum.Math/SignI.md +1 -1
  214. package/docs/Microsoft.Quantum.Math/SignL.md +1 -1
  215. package/docs/Microsoft.Quantum.Math/Sin.md +1 -1
  216. package/docs/Microsoft.Quantum.Math/Sinh.md +1 -1
  217. package/docs/Microsoft.Quantum.Math/SmallestFixedPoint.md +1 -1
  218. package/docs/Microsoft.Quantum.Math/Sqrt.md +1 -1
  219. package/docs/Microsoft.Quantum.Math/SquaredNorm.md +1 -1
  220. package/docs/Microsoft.Quantum.Math/Tan.md +1 -1
  221. package/docs/Microsoft.Quantum.Math/Tanh.md +1 -1
  222. package/docs/Microsoft.Quantum.Math/TimesC.md +1 -1
  223. package/docs/Microsoft.Quantum.Math/TimesCP.md +1 -1
  224. package/docs/Microsoft.Quantum.Math/TrailingZeroCountI.md +1 -1
  225. package/docs/Microsoft.Quantum.Math/TrailingZeroCountL.md +1 -1
  226. package/docs/Microsoft.Quantum.Math/Truncate.md +1 -1
  227. package/docs/Microsoft.Quantum.Measurement/MResetEachZ.md +1 -1
  228. package/docs/Microsoft.Quantum.Measurement/MResetX.md +1 -1
  229. package/docs/Microsoft.Quantum.Measurement/MResetY.md +1 -1
  230. package/docs/Microsoft.Quantum.Measurement/MResetZ.md +1 -1
  231. package/docs/Microsoft.Quantum.Measurement/MeasureAllZ.md +1 -1
  232. package/docs/Microsoft.Quantum.Measurement/MeasureEachZ.md +1 -1
  233. package/docs/Microsoft.Quantum.Measurement/MeasureInteger.md +1 -1
  234. package/docs/Microsoft.Quantum.ResourceEstimation/AccountForEstimates.md +1 -1
  235. package/docs/Microsoft.Quantum.ResourceEstimation/AuxQubitCount.md +1 -1
  236. package/docs/Microsoft.Quantum.ResourceEstimation/BeginEstimateCaching.md +1 -1
  237. package/docs/Microsoft.Quantum.ResourceEstimation/BeginRepeatEstimates.md +1 -1
  238. package/docs/Microsoft.Quantum.ResourceEstimation/CczCount.md +1 -1
  239. package/docs/Microsoft.Quantum.ResourceEstimation/EndEstimateCaching.md +1 -1
  240. package/docs/Microsoft.Quantum.ResourceEstimation/EndRepeatEstimates.md +1 -1
  241. package/docs/Microsoft.Quantum.ResourceEstimation/MeasurementCount.md +1 -1
  242. package/docs/Microsoft.Quantum.ResourceEstimation/PSSPCLayout.md +1 -1
  243. package/docs/Microsoft.Quantum.ResourceEstimation/RepeatEstimates.md +1 -1
  244. package/docs/Microsoft.Quantum.ResourceEstimation/RotationCount.md +1 -1
  245. package/docs/Microsoft.Quantum.ResourceEstimation/RotationDepth.md +1 -1
  246. package/docs/Microsoft.Quantum.ResourceEstimation/SingleVariant.md +1 -1
  247. package/docs/Microsoft.Quantum.ResourceEstimation/TCount.md +1 -1
  248. package/docs/Microsoft.Quantum.Unstable.Arithmetic/AddLE.md +1 -1
  249. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfEqualL.md +1 -1
  250. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfEqualLE.md +1 -1
  251. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterL.md +1 -1
  252. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterLE.md +1 -1
  253. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterOrEqualL.md +1 -1
  254. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterOrEqualLE.md +1 -1
  255. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessL.md +1 -1
  256. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessLE.md +1 -1
  257. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessOrEqualL.md +1 -1
  258. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessOrEqualLE.md +1 -1
  259. package/docs/Microsoft.Quantum.Unstable.Arithmetic/FourierTDIncByLE.md +1 -1
  260. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByI.md +1 -1
  261. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByIUsingIncByLE.md +1 -1
  262. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByL.md +1 -1
  263. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLE.md +1 -1
  264. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLEUsingAddLE.md +1 -1
  265. package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLUsingIncByLE.md +1 -1
  266. package/docs/Microsoft.Quantum.Unstable.Arithmetic/LookAheadDKRSAddLE.md +1 -1
  267. package/docs/Microsoft.Quantum.Unstable.Arithmetic/MAJ.md +1 -1
  268. package/docs/Microsoft.Quantum.Unstable.Arithmetic/ReflectAboutInteger.md +1 -1
  269. package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryCGAddLE.md +1 -1
  270. package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryCGIncByLE.md +1 -1
  271. package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryTTKIncByLE.md +1 -1
  272. package/docs/Microsoft.Quantum.Unstable.StatePreparation/ApproximatelyPreparePureStateCP.md +1 -1
  273. package/docs/Microsoft.Quantum.Unstable.StatePreparation/PreparePureStateD.md +1 -1
  274. package/docs/Microsoft.Quantum.Unstable.TableLookup/Select.md +1 -1
  275. package/docs/toc.yml +1 -0
  276. package/lib/node/qsc_wasm.cjs +140 -159
  277. package/lib/node/qsc_wasm.d.cts +63 -36
  278. package/lib/node/qsc_wasm_bg.wasm +0 -0
  279. package/lib/web/qsc_wasm.d.ts +72 -45
  280. package/lib/web/qsc_wasm.js +130 -154
  281. package/lib/web/qsc_wasm_bg.wasm +0 -0
  282. package/package.json +3 -1
  283. package/ux/estimatesOverview.tsx +2 -0
  284. package/ux/estimatesPanel.tsx +2 -0
  285. package/ux/qsharp-ux.css +30 -5
  286. package/ux/saveImage.tsx +107 -0
  287. package/ux/saveImageUtil.tsx +72 -0
  288. package/ux/scatterChart.tsx +31 -0
package/dist/browser.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as wasm from "../lib/web/qsc_wasm.js";
2
- import { TargetProfile } from "../lib/web/qsc_wasm.js";
2
+ import { IProjectHost, TargetProfile } from "../lib/web/qsc_wasm.js";
3
3
  import { ICompiler, ICompilerWorker } from "./compiler/compiler.js";
4
4
  import { IDebugService, IDebugServiceWorker } from "./debug-service/debug-service.js";
5
5
  import { ILanguageService, ILanguageServiceWorker, qsharpLibraryUriScheme } from "./language-service/language-service.js";
@@ -8,22 +8,17 @@ export { qsharpLibraryUriScheme };
8
8
  export declare function loadWasmModule(uriOrBuffer: string | ArrayBuffer): Promise<void>;
9
9
  export declare function getLibrarySourceContent(path: string): Promise<string | undefined>;
10
10
  export declare function getDebugService(): Promise<IDebugService>;
11
- export declare function getProjectLoader(readFile: (path: string) => Promise<string | null>, loadDirectory: (path: string) => Promise<[string, number][]>, getManifest: (path: string) => Promise<{
12
- manifestDirectory: string;
13
- } | null>): Promise<wasm.ProjectLoader>;
11
+ export declare function getProjectLoader(host: IProjectHost): Promise<wasm.ProjectLoader>;
14
12
  export declare function getDebugServiceWorker(worker: string | Worker): IDebugServiceWorker;
15
13
  export declare function getCompiler(): Promise<ICompiler>;
16
14
  export declare function getCompilerWorker(worker: string | Worker): ICompilerWorker;
17
- export declare function getLanguageService(readFile?: (uri: string) => Promise<string | null>, listDir?: (uri: string) => Promise<[string, number][]>, getManifest?: (uri: string) => Promise<{
18
- manifestDirectory: string;
19
- } | null>): Promise<ILanguageService>;
15
+ export declare function getLanguageService(host?: IProjectHost): Promise<ILanguageService>;
20
16
  export declare function getLanguageServiceWorker(worker: string | Worker): ILanguageServiceWorker;
21
17
  export { StepResultId } from "../lib/web/qsc_wasm.js";
22
- export type { IBreakpointSpan, ICodeAction, ICodeLens, IDocFile, ILocation, IOperationInfo, IPosition, IQSharpError, IRange, IStackFrame, IWorkspaceEdit, IStructStepResult, VSDiagnostic, } from "../lib/web/qsc_wasm.js";
18
+ export type { IBreakpointSpan, ICodeAction, ICodeLens, IDocFile, ILocation, IOperationInfo, IPosition, IProjectConfig, IProjectHost, IQSharpError, IRange, IStackFrame, IStructStepResult, IWorkspaceEdit, ProjectLoader, VSDiagnostic, } from "../lib/web/qsc_wasm.js";
23
19
  export { type Dump, type ShotResult } from "./compiler/common.js";
24
20
  export { type CompilerState, type ProgramConfig } from "./compiler/compiler.js";
25
21
  export { QscEventTarget } from "./compiler/events.js";
26
- export { getAllKatas, getExerciseSources, getKata, type ContentItem, type Example, type Exercise, type ExplainedSolution, type ExplainedSolutionItem, type Kata, type KataSection, type Lesson, type LessonItem, type Question, } from "./katas.js";
27
22
  export { type LanguageServiceEvent } from "./language-service/language-service.js";
28
23
  export { default as samples } from "./samples.generated.js";
29
24
  export { log, type LogLevel, type TargetProfile };
package/dist/browser.js CHANGED
@@ -71,9 +71,9 @@ export async function getDebugService() {
71
71
  await instantiateWasm();
72
72
  return new QSharpDebugService(wasm);
73
73
  }
74
- export async function getProjectLoader(readFile, loadDirectory, getManifest) {
74
+ export async function getProjectLoader(host) {
75
75
  await instantiateWasm();
76
- return new wasm.ProjectLoader(readFile, loadDirectory, getManifest);
76
+ return new wasm.ProjectLoader(host);
77
77
  }
78
78
  // Create the debugger inside a WebWorker and proxy requests.
79
79
  // If the Worker was already created via other means and is ready to receive
@@ -95,9 +95,9 @@ export function getCompilerWorker(worker) {
95
95
  throw "Wasm module must be loaded first";
96
96
  return createProxy(worker, wasmModule, compilerProtocol);
97
97
  }
98
- export async function getLanguageService(readFile, listDir, getManifest) {
98
+ export async function getLanguageService(host) {
99
99
  await instantiateWasm();
100
- return new QSharpLanguageService(wasm, readFile, listDir, getManifest);
100
+ return new QSharpLanguageService(wasm, host);
101
101
  }
102
102
  // Create the compiler inside a WebWorker and proxy requests.
103
103
  // If the Worker was already created via other means and is ready to receive
@@ -109,7 +109,6 @@ export function getLanguageServiceWorker(worker) {
109
109
  }
110
110
  export { StepResultId } from "../lib/web/qsc_wasm.js";
111
111
  export { QscEventTarget } from "./compiler/events.js";
112
- export { getAllKatas, getExerciseSources, getKata, } from "./katas.js";
113
112
  export { default as samples } from "./samples.generated.js";
114
113
  export { log };
115
114
  export * as utils from "./utils.js";
@@ -1,5 +1,5 @@
1
1
  import { type Circuit as CircuitData } from "@microsoft/quantum-viz.js/lib/circuit.js";
2
- import { IDocFile, IOperationInfo, TargetProfile, type VSDiagnostic } from "../../lib/web/qsc_wasm.js";
2
+ import { IDocFile, IOperationInfo, IProgramConfig as wasmIProgramConfig, TargetProfile, type VSDiagnostic } from "../../lib/web/qsc_wasm.js";
3
3
  import { IServiceProxy, ServiceProtocol, ServiceState } from "../workers/common.js";
4
4
  import { IQscEventTarget, QscEventData } from "./events.js";
5
5
  type Wasm = typeof import("../../lib/web/qsc_wasm.js");
@@ -7,35 +7,17 @@ export interface ICompiler {
7
7
  checkCode(code: string): Promise<VSDiagnostic[]>;
8
8
  getAst(code: string, languageFeatures?: string[], profile?: TargetProfile): Promise<string>;
9
9
  getHir(code: string, languageFeatures?: string[], profile?: TargetProfile): Promise<string>;
10
- /** @deprecated -- switch to using `ProgramConfig`-based overload. Instead of passing
11
- * sources and language features separately, pass an object with named properties. This change was made
12
- * for the sake of extensibility and future-compatibility. Note that only the new API
13
- * supports passing language features. If you need to pass language features, you must use
14
- * the new API.
15
- **/
16
- run(sources: [string, string][], expr: string, shots: number, eventHandler: IQscEventTarget): Promise<void>;
17
- run(config: ProgramConfig, expr: string, shots: number, eventHandler: IQscEventTarget): Promise<void>;
18
- /** @deprecated -- switch to using `ProgramConfig`-based overload. Instead of passing
19
- * sources and language features separately, pass an object with named properties. This change was made
20
- * for the sake of extensibility and future-compatibility. Note that only the new API
21
- * supports passing language features. If you need to pass language features, you must use
22
- * the new API.
23
- **/
24
- getQir(sources: [string, string][], languageFeatures?: string[]): Promise<string>;
25
- getQir(config: ProgramConfig): Promise<string>;
26
- /** @deprecated -- switch to using `ProgramConfig`-based overload. Instead of passing
27
- * sources and language features separately, pass an object with named properties. This change was made
28
- * for the sake of extensibility and future-compatibility. Note that only the new API
29
- * supports passing language features. If you need to pass language features, you must use
30
- * the new API.
31
- **/
32
- getEstimates(sources: [string, string][], params: string, languageFeatures?: string[]): Promise<string>;
33
- getEstimates(config: ProgramConfig, params: string): Promise<string>;
34
- getCircuit(config: ProgramConfig, target: TargetProfile, simulate: boolean, operation?: IOperationInfo): Promise<CircuitData>;
35
- getDocumentation(additionalSources?: [string, string][], targetProfile?: string, languageFeatures?: string[]): Promise<IDocFile[]>;
10
+ run(program: ProgramConfig, expr: string, shots: number, eventHandler: IQscEventTarget): Promise<void>;
11
+ getQir(program: ProgramConfig): Promise<string>;
12
+ getEstimates(program: ProgramConfig, params: string): Promise<string>;
13
+ getCircuit(program: ProgramConfig, simulate: boolean, operation?: IOperationInfo): Promise<CircuitData>;
14
+ getDocumentation(additionalProgram?: ProgramConfig): Promise<IDocFile[]>;
36
15
  checkExerciseSolution(userCode: string, exerciseSources: string[], eventHandler: IQscEventTarget): Promise<boolean>;
37
16
  }
38
- /** Type definition for the configuration of a program. */
17
+ /**
18
+ * Type definition for the configuration of a program.
19
+ * If adding new properties, make them optional to maintain backward compatibility.
20
+ */
39
21
  export type ProgramConfig = {
40
22
  /** An array of source objects, each containing a name and contents. */
41
23
  sources: [string, string][];
@@ -50,19 +32,20 @@ export declare class Compiler implements ICompiler {
50
32
  private wasm;
51
33
  constructor(wasm: Wasm);
52
34
  checkCode(code: string): Promise<VSDiagnostic[]>;
53
- getQir(sourcesOrConfig: [string, string][] | ProgramConfig, languageFeatures?: string[]): Promise<string>;
54
- newGetQir({ sources, languageFeatures, profile, }: ProgramConfig): Promise<string>;
55
- deprecatedGetQir(sources: [string, string][], languageFeatures: string[]): Promise<string>;
56
- getEstimates(sourcesOrConfig: [string, string][] | ProgramConfig, params: string, languageFeatures?: string[]): Promise<string>;
57
- newGetEstimates({ sources, languageFeatures, profile }: ProgramConfig, params: string): Promise<string>;
58
- deprecatedGetEstimates(sources: [string, string][], params: string, languageFeatures: string[]): Promise<string>;
59
35
  getAst(code: string, languageFeatures?: string[], profile?: TargetProfile): Promise<string>;
60
36
  getHir(code: string, languageFeatures: string[], profile: TargetProfile): Promise<string>;
61
- run(sourcesOrConfig: [string, string][] | ProgramConfig, expr: string, shots: number, eventHandler: IQscEventTarget): Promise<void>;
62
- getCircuit(config: ProgramConfig, target: TargetProfile, simulate: boolean, operation?: IOperationInfo): Promise<CircuitData>;
63
- getDocumentation(additionalSources?: [string, string][], targetProfile?: string, languageFeatures?: string[]): Promise<IDocFile[]>;
37
+ run(program: ProgramConfig, expr: string, shots: number, eventHandler: IQscEventTarget): Promise<void>;
38
+ getQir(program: ProgramConfig): Promise<string>;
39
+ getEstimates(program: ProgramConfig, params: string): Promise<string>;
40
+ getCircuit(program: ProgramConfig, simulate: boolean, operation?: IOperationInfo): Promise<CircuitData>;
41
+ getDocumentation(additionalProgram?: ProgramConfig): Promise<IDocFile[]>;
64
42
  checkExerciseSolution(userCode: string, exerciseSources: string[], eventHandler: IQscEventTarget): Promise<boolean>;
65
43
  }
44
+ /**
45
+ * Fills in the defaults, to convert from the backwards-compatible ProgramConfig,
46
+ * to the IProgramConfig type that the wasm layer expects
47
+ */
48
+ export declare function toWasmProgramConfig(program: ProgramConfig, defaultProfile: TargetProfile): Required<wasmIProgramConfig>;
66
49
  export declare function onCompilerEvent(msg: string, eventTarget: IQscEventTarget): void;
67
50
  /** The protocol definition to allow running the compiler in a worker. */
68
51
  export declare const compilerProtocol: ServiceProtocol<ICompiler, QscEventData>;
@@ -16,7 +16,12 @@ export class Compiler {
16
16
  const languageService = new this.wasm.LanguageService();
17
17
  const work = languageService.start_background_work((uri, version, errors) => {
18
18
  diags = errors;
19
- }, () => Promise.resolve(null), () => Promise.resolve([]), () => Promise.resolve(null));
19
+ }, {
20
+ readFile: async () => null,
21
+ listDirectory: async () => [],
22
+ resolvePath: async () => null,
23
+ findManifestDirectory: async () => null,
24
+ });
20
25
  languageService.update_document("code", 1, code);
21
26
  // Yield to let the language service background worker handle the update
22
27
  await Promise.resolve();
@@ -25,75 +30,50 @@ export class Compiler {
25
30
  languageService.free();
26
31
  return diags;
27
32
  }
28
- async getQir(sourcesOrConfig, languageFeatures) {
29
- if (Array.isArray(sourcesOrConfig)) {
30
- return this.deprecatedGetQir(sourcesOrConfig, languageFeatures || []);
31
- }
32
- else {
33
- const config = sourcesOrConfig;
34
- return this.newGetQir(config);
35
- }
36
- }
37
- async newGetQir({ sources, languageFeatures = [], profile = "base", }) {
38
- return this.wasm.get_qir(sources, languageFeatures, profile);
39
- }
40
- async deprecatedGetQir(sources, languageFeatures) {
41
- return this.wasm.get_qir(sources, languageFeatures, "base");
42
- }
43
- async getEstimates(sourcesOrConfig, params, languageFeatures = []) {
44
- if (Array.isArray(sourcesOrConfig)) {
45
- return this.deprecatedGetEstimates(sourcesOrConfig, params, languageFeatures);
46
- }
47
- else {
48
- return this.newGetEstimates(sourcesOrConfig, params);
49
- }
50
- }
51
- async newGetEstimates({ sources, languageFeatures, profile = "unrestricted" }, params) {
52
- return this.wasm.get_estimates(sources, params, languageFeatures || [], profile);
53
- }
54
- async deprecatedGetEstimates(sources, params, languageFeatures) {
55
- return this.wasm.get_estimates(sources, params, languageFeatures, "unrestricted");
56
- }
57
33
  async getAst(code, languageFeatures, profile) {
58
34
  return this.wasm.get_ast(code, languageFeatures ?? [], profile ?? "adaptive_ri");
59
35
  }
60
36
  async getHir(code, languageFeatures, profile) {
61
37
  return this.wasm.get_hir(code, languageFeatures ?? [], profile ?? "adaptive_ri");
62
38
  }
63
- async run(sourcesOrConfig, expr, shots, eventHandler) {
64
- let sources;
65
- let profile = "unrestricted";
66
- let languageFeatures = [];
67
- if (Array.isArray(sourcesOrConfig)) {
68
- // this is the deprecated API
69
- sources = sourcesOrConfig;
70
- }
71
- else {
72
- // this is the new API
73
- sources = sourcesOrConfig.sources;
74
- languageFeatures = sourcesOrConfig.languageFeatures || [];
75
- profile = sourcesOrConfig.profile || "unrestricted";
76
- }
39
+ async run(program, expr, shots, eventHandler) {
77
40
  // All results are communicated as events, but if there is a compiler error (e.g. an invalid
78
41
  // entry expression or similar), it may throw on run. The caller should expect this promise
79
42
  // may reject without all shots running or events firing.
80
- this.wasm.run(sources, expr, (msg) => onCompilerEvent(msg, eventHandler), shots, languageFeatures, profile);
43
+ this.wasm.run(toWasmProgramConfig(program, "unrestricted"), expr, (msg) => onCompilerEvent(msg, eventHandler), shots);
44
+ }
45
+ async getQir(program) {
46
+ return this.wasm.get_qir(toWasmProgramConfig(program, "base"));
81
47
  }
82
- async getCircuit(config, target, simulate, operation) {
83
- return this.wasm.get_circuit(config.sources, target, config.languageFeatures || [], simulate, operation);
48
+ async getEstimates(program, params) {
49
+ return this.wasm.get_estimates(toWasmProgramConfig(program, "unrestricted"), params);
50
+ }
51
+ async getCircuit(program, simulate, operation) {
52
+ return this.wasm.get_circuit(toWasmProgramConfig(program, "unrestricted"), simulate, operation);
84
53
  }
85
54
  // Returns all autogenerated documentation files for the standard library
86
55
  // and loaded project (if requested). This include file names and metadata,
87
56
  // including specially formatted table of content file.
88
- async getDocumentation(additionalSources, targetProfile, languageFeatures) {
89
- // Get documentation from wasm layer
90
- return this.wasm.generate_docs(additionalSources, targetProfile, languageFeatures);
57
+ async getDocumentation(additionalProgram) {
58
+ return this.wasm.generate_docs(additionalProgram &&
59
+ toWasmProgramConfig(additionalProgram, "unrestricted"));
91
60
  }
92
61
  async checkExerciseSolution(userCode, exerciseSources, eventHandler) {
93
62
  const success = this.wasm.check_exercise_solution(userCode, exerciseSources, (msg) => onCompilerEvent(msg, eventHandler));
94
63
  return success;
95
64
  }
96
65
  }
66
+ /**
67
+ * Fills in the defaults, to convert from the backwards-compatible ProgramConfig,
68
+ * to the IProgramConfig type that the wasm layer expects
69
+ */
70
+ export function toWasmProgramConfig(program, defaultProfile) {
71
+ return {
72
+ sources: program.sources,
73
+ languageFeatures: program.languageFeatures || [],
74
+ profile: program.profile || defaultProfile,
75
+ };
76
+ }
97
77
  export function onCompilerEvent(msg, eventTarget) {
98
78
  const qscMsg = eventStringToMsg(msg);
99
79
  if (!qscMsg) {
@@ -1,11 +1,11 @@
1
1
  import { type Circuit as CircuitData } from "@microsoft/quantum-viz.js/lib/circuit.js";
2
2
  import type { IBreakpointSpan, IQuantumState, IStackFrame, IStructStepResult, IVariable } from "../../lib/web/qsc_wasm.js";
3
- import { TargetProfile } from "../browser.js";
3
+ import { ProgramConfig } from "../browser.js";
4
4
  import { IQscEventTarget, QscEventData } from "../compiler/events.js";
5
5
  import { IServiceProxy, ServiceProtocol } from "../workers/common.js";
6
6
  type QscWasm = typeof import("../../lib/web/qsc_wasm.js");
7
7
  export interface IDebugService {
8
- loadSource(sources: [string, string][], target: TargetProfile, entry: string | undefined, language_features: string[]): Promise<string>;
8
+ loadProgram(program: ProgramConfig, entry: string | undefined): Promise<string>;
9
9
  getBreakpoints(path: string): Promise<IBreakpointSpan[]>;
10
10
  getLocalVariables(): Promise<Array<IVariable>>;
11
11
  captureQuantumState(): Promise<Array<IQuantumState>>;
@@ -22,7 +22,7 @@ export declare class QSharpDebugService implements IDebugService {
22
22
  private wasm;
23
23
  private debugService;
24
24
  constructor(wasm: QscWasm);
25
- loadSource(sources: [string, string][], target: TargetProfile, entry: string | undefined, language_features: string[]): Promise<string>;
25
+ loadProgram(program: ProgramConfig, entry: string | undefined): Promise<string>;
26
26
  getBreakpoints(path: string): Promise<IBreakpointSpan[]>;
27
27
  getLocalVariables(): Promise<Array<IVariable>>;
28
28
  captureQuantumState(): Promise<Array<IQuantumState>>;
@@ -3,14 +3,15 @@
3
3
  import { eventStringToMsg } from "../compiler/common.js";
4
4
  import { makeEvent, } from "../compiler/events.js";
5
5
  import { log } from "../log.js";
6
+ import { toWasmProgramConfig } from "../compiler/compiler.js";
6
7
  export class QSharpDebugService {
7
8
  constructor(wasm) {
8
9
  log.info("Constructing a QSharpDebugService instance");
9
10
  this.wasm = wasm;
10
11
  this.debugService = new wasm.DebugService();
11
12
  }
12
- async loadSource(sources, target, entry, language_features) {
13
- return this.debugService.load_source(sources, target, entry, language_features);
13
+ async loadProgram(program, entry) {
14
+ return this.debugService.load_program(toWasmProgramConfig(program, "unrestricted"), entry);
14
15
  }
15
16
  async getBreakpoints(path) {
16
17
  return this.debugService.get_breakpoints(path).spans;
@@ -85,7 +86,7 @@ export function onCompilerEvent(msg, eventTarget) {
85
86
  export const debugServiceProtocol = {
86
87
  class: QSharpDebugService,
87
88
  methods: {
88
- loadSource: "request",
89
+ loadProgram: "request",
89
90
  getBreakpoints: "request",
90
91
  getLocalVariables: "request",
91
92
  captureQuantumState: "request",
@@ -8,16 +8,14 @@ declare const _default: {
8
8
  title: string;
9
9
  items: ({
10
10
  type: string;
11
- asHtml: string;
12
- asMarkdown: string;
11
+ content: string;
13
12
  id?: undefined;
14
13
  code?: undefined;
15
14
  } | {
16
15
  type: string;
17
16
  id: string;
18
17
  code: string;
19
- asHtml?: undefined;
20
- asMarkdown?: undefined;
18
+ content?: undefined;
21
19
  })[];
22
20
  description?: undefined;
23
21
  sourceIds?: undefined;
@@ -29,8 +27,7 @@ declare const _default: {
29
27
  title: string;
30
28
  description: {
31
29
  type: string;
32
- asHtml: string;
33
- asMarkdown: string;
30
+ content: string;
34
31
  };
35
32
  sourceIds: string[];
36
33
  placeholderCode: string;
@@ -38,16 +35,14 @@ declare const _default: {
38
35
  type: string;
39
36
  items: ({
40
37
  type: string;
41
- asHtml: string;
42
- asMarkdown: string;
38
+ content: string;
43
39
  id?: undefined;
44
40
  code?: undefined;
45
41
  } | {
46
42
  type: string;
47
43
  id: string;
48
44
  code: string;
49
- asHtml?: undefined;
50
- asMarkdown?: undefined;
45
+ content?: undefined;
51
46
  })[];
52
47
  };
53
48
  items?: undefined;