qsharp-lang 1.1.3 → 1.1.5-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +12 -58
- package/dist/compiler/compiler.d.ts +4 -2
- package/dist/compiler/compiler.js +14 -1
- package/dist/compiler/events.d.ts +1 -1
- package/dist/compiler/worker-browser.d.ts +1 -1
- package/dist/compiler/worker-browser.js +3 -40
- package/dist/compiler/worker-node.js +3 -39
- package/dist/debug-service/debug-service.d.ts +5 -3
- package/dist/debug-service/debug-service.js +18 -1
- package/dist/debug-service/worker-browser.d.ts +1 -1
- package/dist/debug-service/worker-browser.js +3 -29
- package/dist/debug-service/worker-node.js +3 -28
- package/dist/katas-content.generated.js +419 -408
- package/dist/language-service/language-service.d.ts +10 -2
- package/dist/language-service/language-service.js +30 -0
- package/dist/language-service/worker-browser.d.ts +1 -1
- package/dist/language-service/worker-browser.js +3 -29
- package/dist/language-service/worker-node.js +3 -28
- package/dist/main.d.ts +2 -2
- package/dist/main.js +7 -42
- package/dist/samples.generated.js +1 -1
- package/dist/workers/browser.d.ts +21 -0
- package/dist/workers/browser.js +67 -0
- package/dist/{worker-proxy.d.ts → workers/common.d.ts} +26 -9
- package/dist/{worker-proxy.js → workers/common.js} +33 -4
- package/dist/workers/node.d.ts +20 -0
- package/dist/workers/node.js +55 -0
- package/docs/Microsoft.Quantum.Arrays/All.md +42 -0
- package/docs/Microsoft.Quantum.Arrays/Any.md +41 -0
- package/docs/Microsoft.Quantum.Arrays/Chunks.md +34 -0
- package/docs/Microsoft.Quantum.Arrays/CircularlyShifted.md +46 -0
- package/docs/Microsoft.Quantum.Arrays/ColumnAt.md +47 -0
- package/docs/Microsoft.Quantum.Arrays/Count.md +42 -0
- package/docs/Microsoft.Quantum.Arrays/Diagonal.md +43 -0
- package/docs/Microsoft.Quantum.Arrays/DrawMany.md +43 -0
- package/docs/Microsoft.Quantum.Arrays/Enumerated.md +44 -0
- package/docs/Microsoft.Quantum.Arrays/Excluding.md +46 -0
- package/docs/Microsoft.Quantum.Arrays/Filtered.md +42 -0
- package/docs/Microsoft.Quantum.Arrays/FlatMapped.md +45 -0
- package/docs/Microsoft.Quantum.Arrays/Flattened.md +38 -0
- package/docs/Microsoft.Quantum.Arrays/Fold.md +46 -0
- package/docs/Microsoft.Quantum.Arrays/ForEach.md +41 -0
- package/docs/Microsoft.Quantum.Arrays/Head.md +32 -0
- package/docs/Microsoft.Quantum.Arrays/HeadAndRest.md +32 -0
- package/docs/Microsoft.Quantum.Arrays/IndexOf.md +39 -0
- package/docs/Microsoft.Quantum.Arrays/IndexRange.md +40 -0
- package/docs/Microsoft.Quantum.Arrays/Interleaved.md +49 -0
- package/docs/Microsoft.Quantum.Arrays/IsEmpty.md +28 -0
- package/docs/Microsoft.Quantum.Arrays/IsRectangularArray.md +42 -0
- package/docs/Microsoft.Quantum.Arrays/IsSorted.md +42 -0
- package/docs/Microsoft.Quantum.Arrays/IsSquareArray.md +42 -0
- package/docs/Microsoft.Quantum.Arrays/Mapped.md +41 -0
- package/docs/Microsoft.Quantum.Arrays/MappedByIndex.md +52 -0
- package/docs/Microsoft.Quantum.Arrays/MappedOverRange.md +46 -0
- package/docs/Microsoft.Quantum.Arrays/Most.md +33 -0
- package/docs/Microsoft.Quantum.Arrays/MostAndTail.md +32 -0
- package/docs/Microsoft.Quantum.Arrays/Padded.md +49 -0
- package/docs/Microsoft.Quantum.Arrays/Partitioned.md +44 -0
- package/docs/Microsoft.Quantum.Arrays/Rest.md +33 -0
- package/docs/Microsoft.Quantum.Arrays/Reversed.md +33 -0
- package/docs/Microsoft.Quantum.Arrays/SequenceI.md +41 -0
- package/docs/Microsoft.Quantum.Arrays/SequenceL.md +41 -0
- package/docs/Microsoft.Quantum.Arrays/Sorted.md +51 -0
- package/docs/Microsoft.Quantum.Arrays/Subarray.md +49 -0
- package/docs/Microsoft.Quantum.Arrays/Swapped.md +40 -0
- package/docs/Microsoft.Quantum.Arrays/Tail.md +32 -0
- package/docs/Microsoft.Quantum.Arrays/Transposed.md +46 -0
- package/docs/Microsoft.Quantum.Arrays/Unzipped.md +45 -0
- package/docs/Microsoft.Quantum.Arrays/Where.md +35 -0
- package/docs/Microsoft.Quantum.Arrays/Windows.md +47 -0
- package/docs/Microsoft.Quantum.Arrays/Zipped.md +49 -0
- package/docs/Microsoft.Quantum.Canon/ApplyCNOTChain.md +35 -0
- package/docs/Microsoft.Quantum.Canon/ApplyControlledOnBitString.md +41 -0
- package/docs/Microsoft.Quantum.Canon/ApplyControlledOnInt.md +40 -0
- package/docs/Microsoft.Quantum.Canon/ApplyP.md +38 -0
- package/docs/Microsoft.Quantum.Canon/ApplyPauli.md +40 -0
- package/docs/Microsoft.Quantum.Canon/ApplyPauliFromBitString.md +46 -0
- package/docs/Microsoft.Quantum.Canon/ApplyPauliFromInt.md +44 -0
- package/docs/Microsoft.Quantum.Canon/ApplyQFT.md +34 -0
- package/docs/Microsoft.Quantum.Canon/ApplyToEach.md +38 -0
- package/docs/Microsoft.Quantum.Canon/ApplyToEachA.md +42 -0
- package/docs/Microsoft.Quantum.Canon/ApplyToEachC.md +42 -0
- package/docs/Microsoft.Quantum.Canon/ApplyToEachCA.md +42 -0
- package/docs/Microsoft.Quantum.Canon/ApplyXorInPlace.md +30 -0
- package/docs/Microsoft.Quantum.Canon/ApplyXorInPlaceL.md +30 -0
- package/docs/Microsoft.Quantum.Canon/CX.md +50 -0
- package/docs/Microsoft.Quantum.Canon/CY.md +44 -0
- package/docs/Microsoft.Quantum.Canon/CZ.md +44 -0
- package/docs/Microsoft.Quantum.Canon/Fst.md +20 -0
- package/docs/Microsoft.Quantum.Canon/Snd.md +20 -0
- package/docs/Microsoft.Quantum.Canon/SwapReverseRegister.md +25 -0
- package/docs/Microsoft.Quantum.Convert/BigIntAsBoolArray.md +35 -0
- package/docs/Microsoft.Quantum.Convert/BoolArrayAsBigInt.md +34 -0
- package/docs/Microsoft.Quantum.Convert/BoolArrayAsInt.md +25 -0
- 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 +29 -0
- package/docs/Microsoft.Quantum.Convert/ComplexPolarAsComplex.md +29 -0
- package/docs/Microsoft.Quantum.Convert/IntAsBigInt.md +21 -0
- package/docs/Microsoft.Quantum.Convert/IntAsBoolArray.md +35 -0
- package/docs/Microsoft.Quantum.Convert/IntAsDouble.md +21 -0
- 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 +32 -0
- package/docs/Microsoft.Quantum.Core/Length.md +28 -0
- package/docs/Microsoft.Quantum.Core/RangeEnd.md +37 -0
- package/docs/Microsoft.Quantum.Core/RangeReverse.md +32 -0
- package/docs/Microsoft.Quantum.Core/RangeStart.md +36 -0
- package/docs/Microsoft.Quantum.Core/RangeStep.md +33 -0
- package/docs/Microsoft.Quantum.Core/Repeated.md +36 -0
- package/docs/Microsoft.Quantum.Diagnostics/CheckAllZero.md +18 -0
- package/docs/Microsoft.Quantum.Diagnostics/CheckOperationsAreEqual.md +47 -0
- package/docs/Microsoft.Quantum.Diagnostics/CheckZero.md +18 -0
- package/docs/Microsoft.Quantum.Diagnostics/DumpMachine.md +18 -0
- package/docs/Microsoft.Quantum.Diagnostics/Fact.md +20 -0
- package/docs/Microsoft.Quantum.Intrinsic/CCNOT.md +35 -0
- package/docs/Microsoft.Quantum.Intrinsic/CNOT.md +47 -0
- package/docs/Microsoft.Quantum.Intrinsic/Exp.md +40 -0
- package/docs/Microsoft.Quantum.Intrinsic/H.md +34 -0
- package/docs/Microsoft.Quantum.Intrinsic/I.md +25 -0
- package/docs/Microsoft.Quantum.Intrinsic/M.md +45 -0
- package/docs/Microsoft.Quantum.Intrinsic/Measure.md +55 -0
- package/docs/Microsoft.Quantum.Intrinsic/Message.md +30 -0
- package/docs/Microsoft.Quantum.Intrinsic/R.md +42 -0
- package/docs/Microsoft.Quantum.Intrinsic/R1.md +41 -0
- package/docs/Microsoft.Quantum.Intrinsic/R1Frac.md +51 -0
- package/docs/Microsoft.Quantum.Intrinsic/RFrac.md +53 -0
- package/docs/Microsoft.Quantum.Intrinsic/Reset.md +26 -0
- package/docs/Microsoft.Quantum.Intrinsic/ResetAll.md +26 -0
- package/docs/Microsoft.Quantum.Intrinsic/Rx.md +44 -0
- package/docs/Microsoft.Quantum.Intrinsic/Rxx.md +42 -0
- package/docs/Microsoft.Quantum.Intrinsic/Ry.md +44 -0
- package/docs/Microsoft.Quantum.Intrinsic/Ryy.md +42 -0
- package/docs/Microsoft.Quantum.Intrinsic/Rz.md +44 -0
- package/docs/Microsoft.Quantum.Intrinsic/Rzz.md +42 -0
- package/docs/Microsoft.Quantum.Intrinsic/S.md +36 -0
- package/docs/Microsoft.Quantum.Intrinsic/SWAP.md +49 -0
- package/docs/Microsoft.Quantum.Intrinsic/T.md +36 -0
- package/docs/Microsoft.Quantum.Intrinsic/X.md +36 -0
- package/docs/Microsoft.Quantum.Intrinsic/Y.md +36 -0
- package/docs/Microsoft.Quantum.Intrinsic/Z.md +36 -0
- package/docs/Microsoft.Quantum.Logical/Xor.md +38 -0
- package/docs/Microsoft.Quantum.Math/AbsComplex.md +29 -0
- package/docs/Microsoft.Quantum.Math/AbsComplexPolar.md +29 -0
- package/docs/Microsoft.Quantum.Math/AbsD.md +21 -0
- package/docs/Microsoft.Quantum.Math/AbsI.md +21 -0
- package/docs/Microsoft.Quantum.Math/AbsL.md +20 -0
- package/docs/Microsoft.Quantum.Math/AbsSquaredComplex.md +29 -0
- package/docs/Microsoft.Quantum.Math/AbsSquaredComplexPolar.md +29 -0
- package/docs/Microsoft.Quantum.Math/ApproximateFactorial.md +40 -0
- package/docs/Microsoft.Quantum.Math/ArcCos.md +21 -0
- package/docs/Microsoft.Quantum.Math/ArcCosh.md +21 -0
- package/docs/Microsoft.Quantum.Math/ArcSin.md +21 -0
- package/docs/Microsoft.Quantum.Math/ArcSinh.md +21 -0
- package/docs/Microsoft.Quantum.Math/ArcTan.md +21 -0
- package/docs/Microsoft.Quantum.Math/ArcTan2.md +21 -0
- package/docs/Microsoft.Quantum.Math/ArcTanh.md +21 -0
- package/docs/Microsoft.Quantum.Math/ArgComplex.md +29 -0
- package/docs/Microsoft.Quantum.Math/ArgComplexPolar.md +28 -0
- package/docs/Microsoft.Quantum.Math/Binom.md +34 -0
- package/docs/Microsoft.Quantum.Math/BitSizeI.md +22 -0
- package/docs/Microsoft.Quantum.Math/BitSizeL.md +22 -0
- package/docs/Microsoft.Quantum.Math/Ceiling.md +22 -0
- package/docs/Microsoft.Quantum.Math/Complex.md +29 -0
- package/docs/Microsoft.Quantum.Math/ComplexPolar.md +28 -0
- package/docs/Microsoft.Quantum.Math/ContinuedFractionConvergentI.md +23 -0
- package/docs/Microsoft.Quantum.Math/ContinuedFractionConvergentL.md +23 -0
- package/docs/Microsoft.Quantum.Math/Cos.md +21 -0
- package/docs/Microsoft.Quantum.Math/Cosh.md +21 -0
- package/docs/Microsoft.Quantum.Math/DivRemI.md +21 -0
- package/docs/Microsoft.Quantum.Math/DivRemL.md +21 -0
- package/docs/Microsoft.Quantum.Math/DividedByC.md +30 -0
- package/docs/Microsoft.Quantum.Math/DividedByCP.md +30 -0
- package/docs/Microsoft.Quantum.Math/E.md +28 -0
- package/docs/Microsoft.Quantum.Math/ExpModI.md +22 -0
- package/docs/Microsoft.Quantum.Math/ExpModL.md +22 -0
- package/docs/Microsoft.Quantum.Math/ExtendedGreatestCommonDivisorI.md +22 -0
- package/docs/Microsoft.Quantum.Math/ExtendedGreatestCommonDivisorL.md +22 -0
- package/docs/Microsoft.Quantum.Math/FactorialI.md +38 -0
- package/docs/Microsoft.Quantum.Math/FactorialL.md +32 -0
- package/docs/Microsoft.Quantum.Math/Floor.md +22 -0
- package/docs/Microsoft.Quantum.Math/GreatestCommonDivisorI.md +22 -0
- package/docs/Microsoft.Quantum.Math/GreatestCommonDivisorL.md +22 -0
- package/docs/Microsoft.Quantum.Math/HammingWeightI.md +21 -0
- package/docs/Microsoft.Quantum.Math/InverseModI.md +25 -0
- package/docs/Microsoft.Quantum.Math/InverseModL.md +25 -0
- package/docs/Microsoft.Quantum.Math/IsCoprimeI.md +34 -0
- package/docs/Microsoft.Quantum.Math/IsCoprimeL.md +34 -0
- package/docs/Microsoft.Quantum.Math/IsInfinite.md +48 -0
- package/docs/Microsoft.Quantum.Math/IsNaN.md +29 -0
- package/docs/Microsoft.Quantum.Math/LargestFixedPoint.md +31 -0
- package/docs/Microsoft.Quantum.Math/Lg.md +21 -0
- package/docs/Microsoft.Quantum.Math/Log.md +21 -0
- package/docs/Microsoft.Quantum.Math/Log10.md +21 -0
- package/docs/Microsoft.Quantum.Math/LogFactorialD.md +34 -0
- package/docs/Microsoft.Quantum.Math/LogGammaD.md +38 -0
- package/docs/Microsoft.Quantum.Math/LogOf2.md +24 -0
- package/docs/Microsoft.Quantum.Math/Max.md +28 -0
- package/docs/Microsoft.Quantum.Math/MaxD.md +21 -0
- package/docs/Microsoft.Quantum.Math/MaxI.md +21 -0
- package/docs/Microsoft.Quantum.Math/MaxL.md +21 -0
- package/docs/Microsoft.Quantum.Math/Min.md +28 -0
- package/docs/Microsoft.Quantum.Math/MinD.md +21 -0
- package/docs/Microsoft.Quantum.Math/MinI.md +21 -0
- package/docs/Microsoft.Quantum.Math/MinL.md +21 -0
- package/docs/Microsoft.Quantum.Math/MinusC.md +30 -0
- package/docs/Microsoft.Quantum.Math/MinusCP.md +30 -0
- package/docs/Microsoft.Quantum.Math/ModulusI.md +22 -0
- package/docs/Microsoft.Quantum.Math/ModulusL.md +22 -0
- package/docs/Microsoft.Quantum.Math/NegationC.md +28 -0
- package/docs/Microsoft.Quantum.Math/NegationCP.md +28 -0
- package/docs/Microsoft.Quantum.Math/PI.md +28 -0
- package/docs/Microsoft.Quantum.Math/PNorm.md +31 -0
- package/docs/Microsoft.Quantum.Math/PNormalized.md +35 -0
- package/docs/Microsoft.Quantum.Math/PlusC.md +30 -0
- package/docs/Microsoft.Quantum.Math/PlusCP.md +30 -0
- package/docs/Microsoft.Quantum.Math/PowC.md +31 -0
- package/docs/Microsoft.Quantum.Math/PowCP.md +31 -0
- package/docs/Microsoft.Quantum.Math/RealMod.md +38 -0
- package/docs/Microsoft.Quantum.Math/Round.md +22 -0
- package/docs/Microsoft.Quantum.Math/SignD.md +21 -0
- package/docs/Microsoft.Quantum.Math/SignI.md +21 -0
- package/docs/Microsoft.Quantum.Math/SignL.md +21 -0
- package/docs/Microsoft.Quantum.Math/Sin.md +21 -0
- package/docs/Microsoft.Quantum.Math/Sinh.md +21 -0
- package/docs/Microsoft.Quantum.Math/SmallestFixedPoint.md +30 -0
- package/docs/Microsoft.Quantum.Math/Sqrt.md +21 -0
- package/docs/Microsoft.Quantum.Math/SquaredNorm.md +32 -0
- package/docs/Microsoft.Quantum.Math/Tan.md +21 -0
- package/docs/Microsoft.Quantum.Math/Tanh.md +21 -0
- package/docs/Microsoft.Quantum.Math/TimesC.md +30 -0
- package/docs/Microsoft.Quantum.Math/TimesCP.md +30 -0
- package/docs/Microsoft.Quantum.Math/TrailingZeroCountI.md +22 -0
- package/docs/Microsoft.Quantum.Math/TrailingZeroCountL.md +22 -0
- package/docs/Microsoft.Quantum.Math/Truncate.md +22 -0
- package/docs/Microsoft.Quantum.Measurement/MResetEachZ.md +27 -0
- package/docs/Microsoft.Quantum.Measurement/MResetX.md +35 -0
- package/docs/Microsoft.Quantum.Measurement/MResetY.md +35 -0
- package/docs/Microsoft.Quantum.Measurement/MResetZ.md +35 -0
- package/docs/Microsoft.Quantum.Measurement/MeasureAllZ.md +36 -0
- package/docs/Microsoft.Quantum.Measurement/MeasureEachZ.md +30 -0
- package/docs/Microsoft.Quantum.Measurement/MeasureInteger.md +34 -0
- package/docs/Microsoft.Quantum.Random/DrawRandomDouble.md +40 -0
- package/docs/Microsoft.Quantum.Random/DrawRandomInt.md +40 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/AccountForEstimates.md +33 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/AuxQubitCount.md +22 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/BeginEstimateCaching.md +37 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/BeginRepeatEstimates.md +31 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/CczCount.md +22 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/EndEstimateCaching.md +23 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/EndRepeatEstimates.md +22 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/MeasurementCount.md +22 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/PSSPCLayout.md +23 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/RepeatEstimates.md +29 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/RotationCount.md +22 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/RotationDepth.md +22 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/SingleVariant.md +22 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/TCount.md +22 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/AddLE.md +28 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfEqualL.md +22 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfEqualLE.md +23 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterL.md +22 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterLE.md +23 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterOrEqualL.md +22 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterOrEqualLE.md +23 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessL.md +22 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessLE.md +23 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessOrEqualL.md +22 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessOrEqualLE.md +23 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/FourierTDIncByLE.md +31 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByI.md +27 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByIUsingIncByLE.md +26 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByL.md +27 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLE.md +27 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLEUsingAddLE.md +36 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLUsingIncByLE.md +26 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/LookAheadDKRSAddLE.md +35 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/MAJ.md +34 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ReflectAboutInteger.md +37 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryCGAddLE.md +33 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryCGIncByLE.md +33 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryTTKIncByLE.md +35 -0
- package/docs/Microsoft.Quantum.Unstable.StatePreparation/ApproximatelyPreparePureStateCP.md +66 -0
- package/docs/Microsoft.Quantum.Unstable.StatePreparation/PreparePureStateD.md +64 -0
- package/docs/Microsoft.Quantum.Unstable.TableLookup/Select.md +53 -0
- package/docs/toc.yml +307 -0
- package/lib/node/qsc_wasm.cjs +40 -13
- package/lib/node/qsc_wasm.d.cts +15 -0
- package/lib/node/qsc_wasm_bg.wasm +0 -0
- package/lib/web/qsc_wasm.d.ts +17 -0
- package/lib/web/qsc_wasm.js +38 -11
- package/lib/web/qsc_wasm_bg.wasm +0 -0
- package/package.json +4 -2
- package/dist/compiler/worker-proxy.d.ts +0 -7
- package/dist/compiler/worker-proxy.js +0 -18
- package/dist/debug-service/worker-proxy.d.ts +0 -7
- package/dist/debug-service/worker-proxy.js +0 -22
- package/dist/language-service/worker-proxy.d.ts +0 -6
- package/dist/language-service/worker-proxy.js +0 -27
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Convert.ComplexAsComplexPolar
|
|
3
|
+
title: ComplexAsComplexPolar function
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Convert
|
|
8
|
+
qsharp.name: ComplexAsComplexPolar
|
|
9
|
+
qsharp.summary: Converts a complex number of type `Complex` to a complex number of type `ComplexPolar`.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# ComplexAsComplexPolar function
|
|
13
|
+
|
|
14
|
+
Namespace: Microsoft.Quantum.Convert
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function ComplexAsComplexPolar(input : Complex) : ComplexPolar
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Converts a complex number of type `Complex` to a complex
|
|
22
|
+
number of type `ComplexPolar`.
|
|
23
|
+
|
|
24
|
+
## Input
|
|
25
|
+
### input
|
|
26
|
+
Complex number c = x + y𝑖.
|
|
27
|
+
|
|
28
|
+
## Output
|
|
29
|
+
Complex number c = r⋅e^(t𝑖).
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Convert.ComplexPolarAsComplex
|
|
3
|
+
title: ComplexPolarAsComplex function
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Convert
|
|
8
|
+
qsharp.name: ComplexPolarAsComplex
|
|
9
|
+
qsharp.summary: Converts a complex number of type `ComplexPolar` to a complex number of type `Complex`.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# ComplexPolarAsComplex function
|
|
13
|
+
|
|
14
|
+
Namespace: Microsoft.Quantum.Convert
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function ComplexPolarAsComplex(input : ComplexPolar) : Complex
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Converts a complex number of type `ComplexPolar` to a complex
|
|
22
|
+
number of type `Complex`.
|
|
23
|
+
|
|
24
|
+
## Input
|
|
25
|
+
### input
|
|
26
|
+
Complex number c = r⋅e^(t𝑖).
|
|
27
|
+
|
|
28
|
+
## Output
|
|
29
|
+
Complex number c = x + y𝑖.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Convert.IntAsBigInt
|
|
3
|
+
title: IntAsBigInt function
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Convert
|
|
8
|
+
qsharp.name: IntAsBigInt
|
|
9
|
+
qsharp.summary: Converts a given integer to an equivalent big integer.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# IntAsBigInt function
|
|
13
|
+
|
|
14
|
+
Namespace: Microsoft.Quantum.Convert
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function IntAsBigInt(number : Int) : BigInt
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Converts a given integer to an equivalent big integer.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Convert.IntAsBoolArray
|
|
3
|
+
title: IntAsBoolArray function
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Convert
|
|
8
|
+
qsharp.name: IntAsBoolArray
|
|
9
|
+
qsharp.summary: Produces a binary representation of a non-negative integer, using the little-endian representation for the returned array.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# IntAsBoolArray function
|
|
13
|
+
|
|
14
|
+
Namespace: Microsoft.Quantum.Convert
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function IntAsBoolArray(number : Int, bits : Int) : Bool[]
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Produces a binary representation of a non-negative integer, using the
|
|
22
|
+
little-endian representation for the returned array.
|
|
23
|
+
|
|
24
|
+
## Input
|
|
25
|
+
### number
|
|
26
|
+
A non-negative integer to be converted to an array of Boolean values.
|
|
27
|
+
### bits
|
|
28
|
+
The number of bits in the binary representation of `number`.
|
|
29
|
+
|
|
30
|
+
## Output
|
|
31
|
+
An array of Boolean values representing `number`.
|
|
32
|
+
|
|
33
|
+
## Remarks
|
|
34
|
+
The input `bits` must be non-negative.
|
|
35
|
+
The input `number` must be between 0 and 2^bits - 1.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Convert.IntAsDouble
|
|
3
|
+
title: IntAsDouble function
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Convert
|
|
8
|
+
qsharp.name: IntAsDouble
|
|
9
|
+
qsharp.summary: Converts a given integer to an equivalent double-precision floating-point number.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# IntAsDouble function
|
|
13
|
+
|
|
14
|
+
Namespace: Microsoft.Quantum.Convert
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function IntAsDouble(number : Int) : Double
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Converts a given integer to an equivalent double-precision floating-point number.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Convert.ResultArrayAsBoolArray
|
|
3
|
+
title: ResultArrayAsBoolArray function
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.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`.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Convert.ResultArrayAsInt
|
|
3
|
+
title: ResultArrayAsInt function
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.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
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Convert.ResultAsBool
|
|
3
|
+
title: ResultAsBool function
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.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`.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Core.IsRangeEmpty
|
|
3
|
+
title: IsRangeEmpty function
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Core
|
|
8
|
+
qsharp.name: IsRangeEmpty
|
|
9
|
+
qsharp.summary: Returns true if and only if the input range is empty.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# IsRangeEmpty function
|
|
13
|
+
|
|
14
|
+
Namespace: Microsoft.Quantum.Core
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function IsRangeEmpty(rng : Range) : Bool
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Returns true if and only if the input range is empty.
|
|
22
|
+
|
|
23
|
+
## Input
|
|
24
|
+
### rng
|
|
25
|
+
Any range
|
|
26
|
+
|
|
27
|
+
## Output
|
|
28
|
+
True, if and only if `rng` is empty
|
|
29
|
+
|
|
30
|
+
## Remark
|
|
31
|
+
This function needs to check at most one range index
|
|
32
|
+
to determine whether the range is empty.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Core.Length
|
|
3
|
+
title: Length function
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Core
|
|
8
|
+
qsharp.name: Length
|
|
9
|
+
qsharp.summary: Returns the number of elements in an array.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Length function
|
|
13
|
+
|
|
14
|
+
Namespace: Microsoft.Quantum.Core
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function Length<'T>(a : 'T[]) : Int
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Returns the number of elements in an array.
|
|
22
|
+
|
|
23
|
+
## Input
|
|
24
|
+
### a
|
|
25
|
+
Input array.
|
|
26
|
+
|
|
27
|
+
## Output
|
|
28
|
+
The total count of elements in an array.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Core.RangeEnd
|
|
3
|
+
title: RangeEnd function
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Core
|
|
8
|
+
qsharp.name: RangeEnd
|
|
9
|
+
qsharp.summary: Returns the defined end value of the given range, which is not necessarily the last element in the sequence.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# RangeEnd function
|
|
13
|
+
|
|
14
|
+
Namespace: Microsoft.Quantum.Core
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function RangeEnd(r : Range) : Int
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Returns the defined end value of the given range,
|
|
22
|
+
which is not necessarily the last element in the sequence.
|
|
23
|
+
|
|
24
|
+
## Input
|
|
25
|
+
### r
|
|
26
|
+
Input range.
|
|
27
|
+
|
|
28
|
+
## Output
|
|
29
|
+
The defined end value of the given range.
|
|
30
|
+
|
|
31
|
+
## Remarks
|
|
32
|
+
A range expression's first element is `start`,
|
|
33
|
+
its second element is `start+step`, third element is `start+step+step`, etc.,
|
|
34
|
+
until `end` is passed.
|
|
35
|
+
|
|
36
|
+
Note that the defined end value of a range can differ from the last element in the sequence specified by the range;
|
|
37
|
+
for example, in a range 0 .. 2 .. 5 the last element is 4 but the end value is 5.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Core.RangeReverse
|
|
3
|
+
title: RangeReverse function
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Core
|
|
8
|
+
qsharp.name: RangeReverse
|
|
9
|
+
qsharp.summary: Returns a new range which is the reverse of the input range.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# RangeReverse function
|
|
13
|
+
|
|
14
|
+
Namespace: Microsoft.Quantum.Core
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function RangeReverse(r : Range) : Range
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Returns a new range which is the reverse of the input range.
|
|
22
|
+
|
|
23
|
+
## Input
|
|
24
|
+
### r
|
|
25
|
+
Input range.
|
|
26
|
+
|
|
27
|
+
## Output
|
|
28
|
+
A new range that is the reverse of the given range.
|
|
29
|
+
|
|
30
|
+
## Remarks
|
|
31
|
+
Note that the reverse of a range is not simply `end`..`-step`..`start`, because
|
|
32
|
+
the actual last element of a range may not be the same as `end`.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Core.RangeStart
|
|
3
|
+
title: RangeStart function
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Core
|
|
8
|
+
qsharp.name: RangeStart
|
|
9
|
+
qsharp.summary: Returns the defined start value of the given range.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# RangeStart function
|
|
13
|
+
|
|
14
|
+
Namespace: Microsoft.Quantum.Core
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function RangeStart(r : Range) : Int
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Returns the defined start value of the given range.
|
|
22
|
+
|
|
23
|
+
## Input
|
|
24
|
+
### r
|
|
25
|
+
Input range.
|
|
26
|
+
|
|
27
|
+
## Output
|
|
28
|
+
The defined start value of the given range.
|
|
29
|
+
|
|
30
|
+
## Remarks
|
|
31
|
+
A range expression's first element is `start`,
|
|
32
|
+
its second element is `start+step`, third element is `start+step+step`, etc.,
|
|
33
|
+
until `end` is passed.
|
|
34
|
+
|
|
35
|
+
Note that the defined start value of a range is the same as the first element of the sequence,
|
|
36
|
+
unless the range specifies an empty sequence (for example, 2 .. 1).
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Core.RangeStep
|
|
3
|
+
title: RangeStep function
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Core
|
|
8
|
+
qsharp.name: RangeStep
|
|
9
|
+
qsharp.summary: Returns the integer that specifies how the next value of a range is calculated.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# RangeStep function
|
|
13
|
+
|
|
14
|
+
Namespace: Microsoft.Quantum.Core
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function RangeStep(r : Range) : Int
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Returns the integer that specifies how the next value of a range is calculated.
|
|
22
|
+
|
|
23
|
+
## Input
|
|
24
|
+
### r
|
|
25
|
+
Input range.
|
|
26
|
+
|
|
27
|
+
## Output
|
|
28
|
+
The defined step value of the given range.
|
|
29
|
+
|
|
30
|
+
## Remarks
|
|
31
|
+
A range expression's first element is `start`,
|
|
32
|
+
its second element is `start+step`, third element is `start+step+step`, etc.,
|
|
33
|
+
until `end` is passed.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Core.Repeated
|
|
3
|
+
title: Repeated function
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Core
|
|
8
|
+
qsharp.name: Repeated
|
|
9
|
+
qsharp.summary: Creates an array of given length with all elements equal to given value.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Repeated function
|
|
13
|
+
|
|
14
|
+
Namespace: Microsoft.Quantum.Core
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function Repeated<'T>(value : 'T, length : Int) : 'T[]
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Creates an array of given length with all elements equal to given value.
|
|
22
|
+
|
|
23
|
+
## Input
|
|
24
|
+
### value
|
|
25
|
+
The value of each element of the new array.
|
|
26
|
+
### length
|
|
27
|
+
Length of the new array.
|
|
28
|
+
|
|
29
|
+
## Output
|
|
30
|
+
A new array of length `length`, such that every element is `value`.
|
|
31
|
+
|
|
32
|
+
## Example
|
|
33
|
+
The following code creates an array of 3 Boolean values, each equal to `true`:
|
|
34
|
+
```qsharp
|
|
35
|
+
let array = Repeated(true, 3);
|
|
36
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Diagnostics.CheckAllZero
|
|
3
|
+
title: CheckAllZero operation
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: operation
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.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
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Diagnostics.CheckOperationsAreEqual
|
|
3
|
+
title: CheckOperationsAreEqual operation
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: operation
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.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.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Diagnostics.CheckZero
|
|
3
|
+
title: CheckZero operation
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: operation
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.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
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Diagnostics.DumpMachine
|
|
3
|
+
title: DumpMachine function
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Diagnostics
|
|
8
|
+
qsharp.name: DumpMachine
|
|
9
|
+
qsharp.summary:
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# DumpMachine function
|
|
13
|
+
|
|
14
|
+
Namespace: Microsoft.Quantum.Diagnostics
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function DumpMachine() : Unit
|
|
18
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Diagnostics.Fact
|
|
3
|
+
title: Fact function
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Diagnostics
|
|
8
|
+
qsharp.name: Fact
|
|
9
|
+
qsharp.summary: Checks whether a classical condition is true, and throws an exception if it is not.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Fact function
|
|
13
|
+
|
|
14
|
+
Namespace: Microsoft.Quantum.Diagnostics
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function Fact(actual : Bool, message : String) : Unit
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Checks whether a classical condition is true, and throws an exception if it is not.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Intrinsic.CCNOT
|
|
3
|
+
title: CCNOT operation
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: operation
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Intrinsic
|
|
8
|
+
qsharp.name: CCNOT
|
|
9
|
+
qsharp.summary: Applies the doubly controlled–NOT (CCNOT) gate to three qubits.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# CCNOT operation
|
|
13
|
+
|
|
14
|
+
Namespace: Microsoft.Quantum.Intrinsic
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
operation CCNOT(control1 : Qubit, control2 : Qubit, target : Qubit) : Unit is Adj + Ctl
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Applies the doubly controlled–NOT (CCNOT) gate to three qubits.
|
|
22
|
+
|
|
23
|
+
## Input
|
|
24
|
+
### control1
|
|
25
|
+
First control qubit for the CCNOT gate.
|
|
26
|
+
### control2
|
|
27
|
+
Second control qubit for the CCNOT gate.
|
|
28
|
+
### target
|
|
29
|
+
Target qubit for the CCNOT gate.
|
|
30
|
+
|
|
31
|
+
## Remarks
|
|
32
|
+
Equivalent to:
|
|
33
|
+
```qsharp
|
|
34
|
+
Controlled X([control1, control2], target);
|
|
35
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Qdk.Microsoft.Quantum.Intrinsic.CNOT
|
|
3
|
+
title: CNOT operation
|
|
4
|
+
ms.date: 02/23/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: operation
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Intrinsic
|
|
8
|
+
qsharp.name: CNOT
|
|
9
|
+
qsharp.summary: Applies the controlled-NOT (CNOT) gate to a pair of qubits.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# CNOT operation
|
|
13
|
+
|
|
14
|
+
Namespace: Microsoft.Quantum.Intrinsic
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
operation CNOT(control : Qubit, target : Qubit) : Unit is Adj + Ctl
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Applies the controlled-NOT (CNOT) gate to a pair of qubits.
|
|
22
|
+
|
|
23
|
+
## Input
|
|
24
|
+
### control
|
|
25
|
+
Control qubit for the CNOT gate.
|
|
26
|
+
### target
|
|
27
|
+
Target qubit for the CNOT gate.
|
|
28
|
+
|
|
29
|
+
## Remarks
|
|
30
|
+
$$
|
|
31
|
+
\begin{align}
|
|
32
|
+
\operatorname{CNOT} \mathrel{:=}
|
|
33
|
+
\begin{bmatrix}
|
|
34
|
+
1 & 0 & 0 & 0 \\\\
|
|
35
|
+
0 & 1 & 0 & 0 \\\\
|
|
36
|
+
0 & 0 & 0 & 1 \\\\
|
|
37
|
+
0 & 0 & 1 & 0
|
|
38
|
+
\end{bmatrix},
|
|
39
|
+
\end{align}
|
|
40
|
+
$$
|
|
41
|
+
|
|
42
|
+
where rows and columns are ordered as in the quantum concepts guide.
|
|
43
|
+
|
|
44
|
+
Equivalent to:
|
|
45
|
+
```qsharp
|
|
46
|
+
Controlled X([control], target);
|
|
47
|
+
```
|