qsharp-lang 1.5.4-dev → 1.5.6-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.
- package/dist/browser.d.ts +1 -1
- package/dist/compiler/compiler.d.ts +1 -1
- package/dist/compiler/compiler.js +6 -4
- package/dist/katas-content.generated.d.ts +1 -0
- package/dist/katas-content.generated.js +952 -64
- package/dist/katas.d.ts +4 -1
- package/dist/katas.js +3 -3
- package/dist/language-service/language-service.d.ts +3 -1
- package/dist/language-service/language-service.js +4 -0
- package/dist/samples.generated.js +3 -3
- package/docs/Microsoft.Quantum.Arrays/All.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Any.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Chunks.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/CircularlyShifted.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/ColumnAt.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Count.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Diagonal.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/DrawMany.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Enumerated.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Excluding.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Filtered.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/FlatMapped.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Flattened.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Fold.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/ForEach.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Head.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/HeadAndRest.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/IndexOf.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/IndexRange.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Interleaved.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/IsEmpty.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/IsRectangularArray.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/IsSorted.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/IsSquareArray.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Mapped.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/MappedByIndex.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/MappedOverRange.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Most.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/MostAndTail.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Padded.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Partitioned.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Rest.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Reversed.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/SequenceI.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/SequenceL.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Sorted.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Subarray.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Swapped.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Tail.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Transposed.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Unzipped.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Where.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Windows.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Zipped.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyCNOTChain.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyControlledOnBitString.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyControlledOnInt.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyP.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyPauli.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyPauliFromBitString.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyPauliFromInt.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyQFT.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyToEach.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyToEachA.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyToEachC.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyToEachCA.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyXorInPlace.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyXorInPlaceL.md +1 -1
- package/docs/Microsoft.Quantum.Canon/CX.md +1 -1
- package/docs/Microsoft.Quantum.Canon/CY.md +1 -1
- package/docs/Microsoft.Quantum.Canon/CZ.md +1 -1
- package/docs/Microsoft.Quantum.Canon/Fst.md +1 -1
- package/docs/Microsoft.Quantum.Canon/Snd.md +1 -1
- package/docs/Microsoft.Quantum.Canon/SwapReverseRegister.md +1 -1
- package/docs/Microsoft.Quantum.Convert/BigIntAsBoolArray.md +1 -1
- package/docs/Microsoft.Quantum.Convert/BoolArrayAsBigInt.md +1 -1
- package/docs/Microsoft.Quantum.Convert/BoolArrayAsInt.md +1 -1
- package/docs/Microsoft.Quantum.Convert/BoolArrayAsResultArray.md +29 -0
- package/docs/Microsoft.Quantum.Convert/BoolAsResult.md +29 -0
- package/docs/Microsoft.Quantum.Convert/ComplexAsComplexPolar.md +1 -1
- package/docs/Microsoft.Quantum.Convert/ComplexPolarAsComplex.md +1 -1
- package/docs/Microsoft.Quantum.Convert/IntAsBigInt.md +1 -1
- package/docs/Microsoft.Quantum.Convert/IntAsBoolArray.md +1 -1
- package/docs/Microsoft.Quantum.Convert/IntAsDouble.md +1 -1
- package/docs/Microsoft.Quantum.Convert/ResultArrayAsBoolArray.md +29 -0
- package/docs/Microsoft.Quantum.Convert/ResultArrayAsInt.md +34 -0
- package/docs/Microsoft.Quantum.Convert/ResultAsBool.md +29 -0
- package/docs/Microsoft.Quantum.Core/IsRangeEmpty.md +1 -1
- package/docs/Microsoft.Quantum.Core/Length.md +1 -1
- package/docs/Microsoft.Quantum.Core/RangeEnd.md +1 -1
- package/docs/Microsoft.Quantum.Core/RangeReverse.md +1 -1
- package/docs/Microsoft.Quantum.Core/RangeStart.md +1 -1
- package/docs/Microsoft.Quantum.Core/RangeStep.md +1 -1
- package/docs/Microsoft.Quantum.Core/Repeated.md +1 -1
- package/docs/Microsoft.Quantum.Diagnostics/DumpMachine.md +1 -1
- package/docs/Microsoft.Quantum.Diagnostics/DumpRegister.md +1 -1
- package/docs/Microsoft.Quantum.Diagnostics/Fact.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/CCNOT.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/CNOT.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Exp.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/H.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/I.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/M.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Measure.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Message.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/R.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/R1.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/R1Frac.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/RFrac.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Reset.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/ResetAll.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Rx.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Rxx.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Ry.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Ryy.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Rz.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Rzz.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/S.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/SWAP.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/T.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/X.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Y.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Z.md +1 -1
- package/docs/Microsoft.Quantum.Logical/Xor.md +1 -1
- package/docs/Microsoft.Quantum.Math/AbsComplex.md +1 -1
- package/docs/Microsoft.Quantum.Math/AbsComplexPolar.md +1 -1
- package/docs/Microsoft.Quantum.Math/AbsD.md +1 -1
- package/docs/Microsoft.Quantum.Math/AbsI.md +1 -1
- package/docs/Microsoft.Quantum.Math/AbsL.md +1 -1
- package/docs/Microsoft.Quantum.Math/AbsSquaredComplex.md +1 -1
- package/docs/Microsoft.Quantum.Math/AbsSquaredComplexPolar.md +1 -1
- package/docs/Microsoft.Quantum.Math/ApproximateFactorial.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArcCos.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArcCosh.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArcSin.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArcSinh.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArcTan.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArcTan2.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArcTanh.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArgComplex.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArgComplexPolar.md +1 -1
- package/docs/Microsoft.Quantum.Math/Binom.md +1 -1
- package/docs/Microsoft.Quantum.Math/BitSizeI.md +1 -1
- package/docs/Microsoft.Quantum.Math/BitSizeL.md +1 -1
- package/docs/Microsoft.Quantum.Math/Ceiling.md +1 -1
- package/docs/Microsoft.Quantum.Math/Complex.md +1 -1
- package/docs/Microsoft.Quantum.Math/ComplexPolar.md +1 -1
- package/docs/Microsoft.Quantum.Math/ContinuedFractionConvergentI.md +1 -1
- package/docs/Microsoft.Quantum.Math/ContinuedFractionConvergentL.md +1 -1
- package/docs/Microsoft.Quantum.Math/Cos.md +1 -1
- package/docs/Microsoft.Quantum.Math/Cosh.md +1 -1
- package/docs/Microsoft.Quantum.Math/DivRemI.md +1 -1
- package/docs/Microsoft.Quantum.Math/DivRemL.md +1 -1
- package/docs/Microsoft.Quantum.Math/DividedByC.md +1 -1
- package/docs/Microsoft.Quantum.Math/DividedByCP.md +1 -1
- package/docs/Microsoft.Quantum.Math/E.md +1 -1
- package/docs/Microsoft.Quantum.Math/ExpModI.md +1 -1
- package/docs/Microsoft.Quantum.Math/ExpModL.md +1 -1
- package/docs/Microsoft.Quantum.Math/ExtendedGreatestCommonDivisorI.md +1 -1
- package/docs/Microsoft.Quantum.Math/ExtendedGreatestCommonDivisorL.md +1 -1
- package/docs/Microsoft.Quantum.Math/FactorialI.md +1 -1
- package/docs/Microsoft.Quantum.Math/FactorialL.md +1 -1
- package/docs/Microsoft.Quantum.Math/Floor.md +1 -1
- package/docs/Microsoft.Quantum.Math/GreatestCommonDivisorI.md +1 -1
- package/docs/Microsoft.Quantum.Math/GreatestCommonDivisorL.md +1 -1
- package/docs/Microsoft.Quantum.Math/HammingWeightI.md +1 -1
- package/docs/Microsoft.Quantum.Math/InverseModI.md +1 -1
- package/docs/Microsoft.Quantum.Math/InverseModL.md +1 -1
- package/docs/Microsoft.Quantum.Math/IsCoprimeI.md +1 -1
- package/docs/Microsoft.Quantum.Math/IsCoprimeL.md +1 -1
- package/docs/Microsoft.Quantum.Math/IsInfinite.md +1 -1
- package/docs/Microsoft.Quantum.Math/IsNaN.md +1 -1
- package/docs/Microsoft.Quantum.Math/LargestFixedPoint.md +1 -1
- package/docs/Microsoft.Quantum.Math/Lg.md +1 -1
- package/docs/Microsoft.Quantum.Math/Log.md +1 -1
- package/docs/Microsoft.Quantum.Math/Log10.md +1 -1
- package/docs/Microsoft.Quantum.Math/LogFactorialD.md +1 -1
- package/docs/Microsoft.Quantum.Math/LogGammaD.md +1 -1
- package/docs/Microsoft.Quantum.Math/LogOf2.md +1 -1
- package/docs/Microsoft.Quantum.Math/Max.md +1 -1
- package/docs/Microsoft.Quantum.Math/MaxD.md +1 -1
- package/docs/Microsoft.Quantum.Math/MaxI.md +1 -1
- package/docs/Microsoft.Quantum.Math/MaxL.md +1 -1
- package/docs/Microsoft.Quantum.Math/Min.md +1 -1
- package/docs/Microsoft.Quantum.Math/MinD.md +1 -1
- package/docs/Microsoft.Quantum.Math/MinI.md +1 -1
- package/docs/Microsoft.Quantum.Math/MinL.md +1 -1
- package/docs/Microsoft.Quantum.Math/MinusC.md +1 -1
- package/docs/Microsoft.Quantum.Math/MinusCP.md +1 -1
- package/docs/Microsoft.Quantum.Math/ModulusI.md +1 -1
- package/docs/Microsoft.Quantum.Math/ModulusL.md +1 -1
- package/docs/Microsoft.Quantum.Math/NegationC.md +1 -1
- package/docs/Microsoft.Quantum.Math/NegationCP.md +1 -1
- package/docs/Microsoft.Quantum.Math/PI.md +1 -1
- package/docs/Microsoft.Quantum.Math/PNorm.md +1 -1
- package/docs/Microsoft.Quantum.Math/PNormalized.md +1 -1
- package/docs/Microsoft.Quantum.Math/PlusC.md +1 -1
- package/docs/Microsoft.Quantum.Math/PlusCP.md +1 -1
- package/docs/Microsoft.Quantum.Math/PowC.md +1 -1
- package/docs/Microsoft.Quantum.Math/PowCP.md +1 -1
- package/docs/Microsoft.Quantum.Math/RealMod.md +1 -1
- package/docs/Microsoft.Quantum.Math/Round.md +1 -1
- package/docs/Microsoft.Quantum.Math/SignD.md +1 -1
- package/docs/Microsoft.Quantum.Math/SignI.md +1 -1
- package/docs/Microsoft.Quantum.Math/SignL.md +1 -1
- package/docs/Microsoft.Quantum.Math/Sin.md +1 -1
- package/docs/Microsoft.Quantum.Math/Sinh.md +1 -1
- package/docs/Microsoft.Quantum.Math/SmallestFixedPoint.md +1 -1
- package/docs/Microsoft.Quantum.Math/Sqrt.md +1 -1
- package/docs/Microsoft.Quantum.Math/SquaredNorm.md +1 -1
- package/docs/Microsoft.Quantum.Math/Tan.md +1 -1
- package/docs/Microsoft.Quantum.Math/Tanh.md +1 -1
- package/docs/Microsoft.Quantum.Math/TimesC.md +1 -1
- package/docs/Microsoft.Quantum.Math/TimesCP.md +1 -1
- package/docs/Microsoft.Quantum.Math/TrailingZeroCountI.md +1 -1
- package/docs/Microsoft.Quantum.Math/TrailingZeroCountL.md +1 -1
- package/docs/Microsoft.Quantum.Math/Truncate.md +1 -1
- package/docs/Microsoft.Quantum.Measurement/MResetEachZ.md +1 -1
- package/docs/Microsoft.Quantum.Measurement/MResetX.md +1 -1
- package/docs/Microsoft.Quantum.Measurement/MResetY.md +1 -1
- package/docs/Microsoft.Quantum.Measurement/MResetZ.md +1 -1
- package/docs/Microsoft.Quantum.Measurement/MeasureAllZ.md +1 -1
- package/docs/Microsoft.Quantum.Measurement/MeasureEachZ.md +1 -1
- package/docs/Microsoft.Quantum.Measurement/MeasureInteger.md +34 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/AccountForEstimates.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/AuxQubitCount.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/BeginEstimateCaching.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/BeginRepeatEstimates.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/CczCount.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/EndEstimateCaching.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/EndRepeatEstimates.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/MeasurementCount.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/PSSPCLayout.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/RepeatEstimates.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/RotationCount.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/RotationDepth.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/SingleVariant.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/TCount.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/AddLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfEqualL.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfEqualLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterL.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterOrEqualL.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterOrEqualLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessL.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessOrEqualL.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessOrEqualLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/FourierTDIncByLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByI.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByIUsingIncByLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByL.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLEUsingAddLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLUsingIncByLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/LookAheadDKRSAddLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/MAJ.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ReflectAboutInteger.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryCGAddLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryCGIncByLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryTTKIncByLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.StatePreparation/ApproximatelyPreparePureStateCP.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.StatePreparation/PreparePureStateD.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.TableLookup/Select.md +53 -0
- package/docs/toc.yml +11 -1
- package/lib/node/qsc_wasm.cjs +55 -29
- package/lib/node/qsc_wasm.d.cts +18 -2
- package/lib/node/qsc_wasm_bg.wasm +0 -0
- package/lib/web/qsc_wasm.d.ts +21 -4
- package/lib/web/qsc_wasm.js +54 -28
- package/lib/web/qsc_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/dist/katas.d.ts
CHANGED
|
@@ -49,7 +49,10 @@ export type Kata = {
|
|
|
49
49
|
id: string;
|
|
50
50
|
title: string;
|
|
51
51
|
sections: KataSection[];
|
|
52
|
+
published: boolean;
|
|
52
53
|
};
|
|
53
|
-
export declare function getAllKatas(
|
|
54
|
+
export declare function getAllKatas(options?: {
|
|
55
|
+
includeUnpublished?: boolean;
|
|
56
|
+
}): Promise<Kata[]>;
|
|
54
57
|
export declare function getKata(id: string): Promise<Kata>;
|
|
55
58
|
export declare function getExerciseSources(exercise: Exercise): Promise<string[]>;
|
package/dist/katas.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { default as katasContent } from "./katas-content.generated.js";
|
|
4
|
-
export async function getAllKatas() {
|
|
5
|
-
return katasContent.katas;
|
|
4
|
+
export async function getAllKatas(options = { includeUnpublished: false }) {
|
|
5
|
+
return katasContent.katas.filter((k) => options.includeUnpublished || k.published);
|
|
6
6
|
}
|
|
7
7
|
export async function getKata(id) {
|
|
8
|
-
const katas = await getAllKatas();
|
|
8
|
+
const katas = await getAllKatas({ includeUnpublished: true });
|
|
9
9
|
return (katas.find((k) => k.id === id) ||
|
|
10
10
|
Promise.reject(`Failed to get kata with id: ${id}`));
|
|
11
11
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ICodeLens, ICompletionList, IHover, ILocation, INotebookMetadata, IPosition, ISignatureHelp, ITextEdit, IWorkspaceConfiguration, IWorkspaceEdit, VSDiagnostic } from "../../lib/web/qsc_wasm.js";
|
|
1
|
+
import type { ICodeAction, ICodeLens, ICompletionList, IHover, ILocation, INotebookMetadata, IPosition, IRange, ISignatureHelp, ITextEdit, IWorkspaceConfiguration, IWorkspaceEdit, VSDiagnostic } from "../../lib/web/qsc_wasm.js";
|
|
2
2
|
import { IServiceProxy, ServiceProtocol } from "../workers/common.js";
|
|
3
3
|
type QscWasm = typeof import("../../lib/web/qsc_wasm.js");
|
|
4
4
|
export type LanguageServiceEvent = {
|
|
@@ -19,6 +19,7 @@ export interface ILanguageService {
|
|
|
19
19
|
}[]): Promise<void>;
|
|
20
20
|
closeDocument(uri: string): Promise<void>;
|
|
21
21
|
closeNotebookDocument(notebookUri: string): Promise<void>;
|
|
22
|
+
getCodeActions(documentUri: string, range: IRange): Promise<ICodeAction[]>;
|
|
22
23
|
getCompletions(documentUri: string, position: IPosition): Promise<ICompletionList>;
|
|
23
24
|
getFormatChanges(documentUri: string): Promise<ITextEdit[]>;
|
|
24
25
|
getHover(documentUri: string, position: IPosition): Promise<IHover | undefined>;
|
|
@@ -55,6 +56,7 @@ export declare class QSharpLanguageService implements ILanguageService {
|
|
|
55
56
|
}[]): Promise<void>;
|
|
56
57
|
closeDocument(documentUri: string): Promise<void>;
|
|
57
58
|
closeNotebookDocument(documentUri: string): Promise<void>;
|
|
59
|
+
getCodeActions(documentUri: string, range: IRange): Promise<ICodeAction[]>;
|
|
58
60
|
getCompletions(documentUri: string, position: IPosition): Promise<ICompletionList>;
|
|
59
61
|
getFormatChanges(documentUri: string): Promise<ITextEdit[]>;
|
|
60
62
|
getHover(documentUri: string, position: IPosition): Promise<IHover | undefined>;
|
|
@@ -25,6 +25,9 @@ export class QSharpLanguageService {
|
|
|
25
25
|
async closeNotebookDocument(documentUri) {
|
|
26
26
|
this.languageService.close_notebook_document(documentUri);
|
|
27
27
|
}
|
|
28
|
+
async getCodeActions(documentUri, range) {
|
|
29
|
+
return this.languageService.get_code_actions(documentUri, range);
|
|
30
|
+
}
|
|
28
31
|
async getCompletions(documentUri, position) {
|
|
29
32
|
return this.languageService.get_completions(documentUri, position);
|
|
30
33
|
}
|
|
@@ -91,6 +94,7 @@ export const languageServiceProtocol = {
|
|
|
91
94
|
updateNotebookDocument: "request",
|
|
92
95
|
closeDocument: "request",
|
|
93
96
|
closeNotebookDocument: "request",
|
|
97
|
+
getCodeActions: "request",
|
|
94
98
|
getCompletions: "request",
|
|
95
99
|
getFormatChanges: "request",
|
|
96
100
|
getHover: "request",
|
|
@@ -7,7 +7,7 @@ export default [
|
|
|
7
7
|
{
|
|
8
8
|
"title": "Superposition",
|
|
9
9
|
"shots": 100,
|
|
10
|
-
"code": "/// # Sample\n/// Superposition\n///\n/// # Description\n/// This Q# program sets a qubit in a superposition of the computational basis\n/// states |0〉 and |1〉 by applying a Hadamard transformation.\nnamespace Sample {\n\n @EntryPoint()\n operation Superposition() : Result {\n // Qubits are only
|
|
10
|
+
"code": "/// # Sample\n/// Superposition\n///\n/// # Description\n/// This Q# program sets a qubit in a superposition of the computational basis\n/// states |0〉 and |1〉 by applying a Hadamard transformation.\nnamespace Sample {\n\n @EntryPoint()\n operation Superposition() : Result {\n // Qubits are only accessible for the duration of the scope where they\n // are allocated and are automatically released at the end of the scope.\n use qubit = Qubit();\n\n // Set the qubit in superposition by applying a Hadamard transformation.\n H(qubit);\n\n // Measure the qubit. There is a 50% probability of measuring either\n // `Zero` or `One`.\n let result = M(qubit);\n\n // Reset the qubit so it can be safely released.\n Reset(qubit);\n return result;\n }\n}\n"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"title": "Entanglement",
|
|
@@ -27,7 +27,7 @@ export default [
|
|
|
27
27
|
{
|
|
28
28
|
"title": "Random Bit",
|
|
29
29
|
"shots": 100,
|
|
30
|
-
"code": "/// # Sample\n/// Random Bit\n///\n/// # Description\n/// This Q# program generates a random bit by setting a qubit in a superposition\n/// of the computational basis states |0〉 and |1〉, and returning the measurement\n/// result.\nnamespace Sample {\n\n @EntryPoint()\n operation RandomBit() : Result {\n // Qubits are only
|
|
30
|
+
"code": "/// # Sample\n/// Random Bit\n///\n/// # Description\n/// This Q# program generates a random bit by setting a qubit in a superposition\n/// of the computational basis states |0〉 and |1〉, and returning the measurement\n/// result.\nnamespace Sample {\n\n @EntryPoint()\n operation RandomBit() : Result {\n // Qubits are only accessible for the duration of the scope where they\n // are allocated and are automatically released at the end of the scope.\n use qubit = Qubit();\n\n // Set the qubit in superposition by applying a Hadamard transformation.\n H(qubit);\n\n // Measure the qubit. There is a 50% probability of measuring either\n // `Zero` or `One`.\n let result = M(qubit);\n\n // Reset the qubit so it can be safely released.\n Reset(qubit);\n return result;\n }\n}\n"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"title": "Random Number Generator",
|
|
@@ -42,7 +42,7 @@ export default [
|
|
|
42
42
|
{
|
|
43
43
|
"title": "Deutsch-Jozsa",
|
|
44
44
|
"shots": 1,
|
|
45
|
-
"code": "/// # Sample\n/// Deutsch–Jozsa algorithm\n///\n/// # Description\n/// Deutsch–Jozsa is a quantum algorithm that determines whether a given Boolean\n/// function 𝑓 is constant (0 on all inputs or 1 on all inputs) or balanced\n/// (1 for exactly half of the input domain and 0 for the other half).\n///\n/// This Q# program implements the Deutsch–Jozsa algorithm.\nnamespace Sample {\n open Microsoft.Quantum.Measurement;\n\n @EntryPoint()\n operation Main() : (Result[], Result[]) {\n // A Boolean function is a function that maps bitstrings to a bit:\n // 𝑓 : {0, 1}^n → {0, 1}.\n\n // We say that 𝑓 is constant if 𝑓(𝑥⃗) = 𝑓(𝑦⃗) for all bitstrings 𝑥⃗ and\n // 𝑦⃗, and that 𝑓 is balanced if 𝑓 evaluates to true for exactly half of\n // its inputs.\n\n // If we are given a function 𝑓 as a quantum operation 𝑈 |𝑥〉|𝑦〉 =\n // |𝑥〉|𝑦 ⊕ 𝑓(𝑥)〉, and are promised that 𝑓 is either constant or is\n // balanced, then the Deutsch–Jozsa algorithm decides between these\n // cases with a single application of 𝑈.\n\n // Here, we demonstrate the use of the Deutsch-Jozsa algorithm by\n // determining the type (constant or balanced) of a couple of functions.\n let balancedResults = DeutschJozsa(SimpleBalancedBoolF, 5);\n let constantResults = DeutschJozsa(SimpleConstantBoolF, 5);\n return (balancedResults, constantResults);\n }\n\n /// # Summary\n /// This operation implements the DeutschJozsa algorithm.\n /// It returns the query register measurement results. If all the measurement\n /// results are `Zero`, the function is constant. If at least one measurement\n /// result is `One`, the function is balanced.\n /// It is assumed that the function is either constant or balanced.\n ///\n /// # Input\n /// ## Uf\n /// A quantum operation that implements |𝑥〉|𝑦〉 ↦ |𝑥〉|𝑦 ⊕ 𝑓(𝑥)〉, where 𝑓 is a\n /// Boolean function, 𝑥 is an 𝑛 bit register and 𝑦 is a single qubit.\n /// ## n\n /// The number of bits in the input register |𝑥〉.\n ///\n /// # Output\n /// An array of measurement results for the query
|
|
45
|
+
"code": "/// # Sample\n/// Deutsch–Jozsa algorithm\n///\n/// # Description\n/// Deutsch–Jozsa is a quantum algorithm that determines whether a given Boolean\n/// function 𝑓 is constant (0 on all inputs or 1 on all inputs) or balanced\n/// (1 for exactly half of the input domain and 0 for the other half).\n///\n/// This Q# program implements the Deutsch–Jozsa algorithm.\nnamespace Sample {\n open Microsoft.Quantum.Measurement;\n\n @EntryPoint()\n operation Main() : (Result[], Result[]) {\n // A Boolean function is a function that maps bitstrings to a bit:\n // 𝑓 : {0, 1}^n → {0, 1}.\n\n // We say that 𝑓 is constant if 𝑓(𝑥⃗) = 𝑓(𝑦⃗) for all bitstrings 𝑥⃗ and\n // 𝑦⃗, and that 𝑓 is balanced if 𝑓 evaluates to true for exactly half of\n // its inputs.\n\n // If we are given a function 𝑓 as a quantum operation 𝑈 |𝑥〉|𝑦〉 =\n // |𝑥〉|𝑦 ⊕ 𝑓(𝑥)〉, and are promised that 𝑓 is either constant or is\n // balanced, then the Deutsch–Jozsa algorithm decides between these\n // cases with a single application of 𝑈.\n\n // Here, we demonstrate the use of the Deutsch-Jozsa algorithm by\n // determining the type (constant or balanced) of a couple of functions.\n let balancedResults = DeutschJozsa(SimpleBalancedBoolF, 5);\n let constantResults = DeutschJozsa(SimpleConstantBoolF, 5);\n return (balancedResults, constantResults);\n }\n\n /// # Summary\n /// This operation implements the DeutschJozsa algorithm.\n /// It returns the query register measurement results. If all the measurement\n /// results are `Zero`, the function is constant. If at least one measurement\n /// result is `One`, the function is balanced.\n /// It is assumed that the function is either constant or balanced.\n ///\n /// # Input\n /// ## Uf\n /// A quantum operation that implements |𝑥〉|𝑦〉 ↦ |𝑥〉|𝑦 ⊕ 𝑓(𝑥)〉, where 𝑓 is a\n /// Boolean function, 𝑥 is an 𝑛 bit register and 𝑦 is a single qubit.\n /// ## n\n /// The number of bits in the input register |𝑥〉.\n ///\n /// # Output\n /// An array of measurement results for the query register.\n /// All `Zero` measurement results indicate that the function is constant.\n /// At least one `One` measurement result in the array indicates that the\n /// function is balanced.\n ///\n /// # See Also\n /// - For details see Section 1.4.3 of Nielsen & Chuang.\n ///\n /// # References\n /// - [ *Michael A. Nielsen , Isaac L. Chuang*,\n /// Quantum Computation and Quantum Information ]\n /// (http://doi.org/10.1017/CBO9780511976667)\n operation DeutschJozsa(Uf : ((Qubit[], Qubit) => Unit), n : Int) : Result[] {\n // We allocate n + 1 clean qubits. Note that the function `Uf` is defined\n // on inputs of the form (x, y), where x has n bits and y has 1 bit.\n use queryRegister = Qubit[n];\n use target = Qubit();\n\n // The last qubit needs to be flipped so that the function will actually\n // be computed into the phase when Uf is applied.\n X(target);\n\n // Now, a Hadamard transform is applied to each of the qubits.\n H(target);\n // We use a within-apply block to ensure that the Hadamard transform is\n // correctly inverted on the |𝑥〉 register.\n within {\n for q in queryRegister {\n H(q);\n }\n } apply {\n // We apply Uf to the n+1 qubits, computing |𝑥, 𝑦〉 ↦ |𝑥, 𝑦 ⊕ 𝑓(𝑥)〉.\n Uf(queryRegister, target);\n }\n\n // Measure the query register and reset all qubits so they can be safely\n // deallocated.\n let results = MResetEachZ(queryRegister);\n Reset(target);\n return results;\n }\n\n // Simple constant Boolean function\n operation SimpleConstantBoolF(args : Qubit[], target : Qubit) : Unit {\n X(target);\n }\n\n // Simple balanced Boolean function\n operation SimpleBalancedBoolF(args : Qubit[], target : Qubit) : Unit {\n CX(args[0], target);\n }\n}\n\n"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"title": "Deutsch-Jozsa (Advanced)",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
uid: Qdk.Microsoft.Quantum.Canon.ApplyControlledOnBitString
|
|
3
3
|
title: ApplyControlledOnBitString operation
|
|
4
|
-
ms.date:
|
|
4
|
+
ms.date: 06/03/2024 12:00:00 AM
|
|
5
5
|
ms.topic: managed-reference
|
|
6
6
|
qsharp.kind: operation
|
|
7
7
|
qsharp.namespace: Microsoft.Quantum.Canon
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
uid: Qdk.Microsoft.Quantum.Canon.ApplyControlledOnInt
|
|
3
3
|
title: ApplyControlledOnInt operation
|
|
4
|
-
ms.date:
|
|
4
|
+
ms.date: 06/03/2024 12:00:00 AM
|
|
5
5
|
ms.topic: managed-reference
|
|
6
6
|
qsharp.kind: operation
|
|
7
7
|
qsharp.namespace: Microsoft.Quantum.Canon
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
uid: Qdk.Microsoft.Quantum.Canon.ApplyPauliFromBitString
|
|
3
3
|
title: ApplyPauliFromBitString operation
|
|
4
|
-
ms.date:
|
|
4
|
+
ms.date: 06/03/2024 12:00:00 AM
|
|
5
5
|
ms.topic: managed-reference
|
|
6
6
|
qsharp.kind: operation
|
|
7
7
|
qsharp.namespace: Microsoft.Quantum.Canon
|