qsharp-lang 1.1.2-dev → 1.1.4-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/katas-content.generated.js +133 -122
- package/dist/language-service/language-service.d.ts +3 -1
- package/dist/language-service/language-service.js +3 -0
- package/dist/language-service/worker-proxy.js +1 -0
- package/docs/Microsoft.Quantum.Arrays/All.md +44 -0
- package/docs/Microsoft.Quantum.Arrays/Any.md +43 -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 +44 -0
- package/docs/Microsoft.Quantum.Arrays/Diagonal.md +43 -0
- package/docs/Microsoft.Quantum.Arrays/DrawMany.md +44 -0
- package/docs/Microsoft.Quantum.Arrays/Enumerated.md +45 -0
- package/docs/Microsoft.Quantum.Arrays/Excluding.md +47 -0
- package/docs/Microsoft.Quantum.Arrays/Filtered.md +44 -0
- package/docs/Microsoft.Quantum.Arrays/FlatMapped.md +46 -0
- package/docs/Microsoft.Quantum.Arrays/Flattened.md +38 -0
- package/docs/Microsoft.Quantum.Arrays/Fold.md +47 -0
- package/docs/Microsoft.Quantum.Arrays/ForEach.md +43 -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 +40 -0
- package/docs/Microsoft.Quantum.Arrays/IndexRange.md +41 -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 +43 -0
- package/docs/Microsoft.Quantum.Arrays/IsSquareArray.md +42 -0
- package/docs/Microsoft.Quantum.Arrays/Mapped.md +43 -0
- package/docs/Microsoft.Quantum.Arrays/MappedByIndex.md +54 -0
- package/docs/Microsoft.Quantum.Arrays/MappedOverRange.md +48 -0
- package/docs/Microsoft.Quantum.Arrays/Most.md +34 -0
- package/docs/Microsoft.Quantum.Arrays/MostAndTail.md +32 -0
- package/docs/Microsoft.Quantum.Arrays/Padded.md +50 -0
- package/docs/Microsoft.Quantum.Arrays/Partitioned.md +44 -0
- package/docs/Microsoft.Quantum.Arrays/Rest.md +34 -0
- package/docs/Microsoft.Quantum.Arrays/Reversed.md +34 -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 +52 -0
- package/docs/Microsoft.Quantum.Arrays/Subarray.md +51 -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 +47 -0
- package/docs/Microsoft.Quantum.Arrays/Unzipped.md +46 -0
- package/docs/Microsoft.Quantum.Arrays/Where.md +36 -0
- package/docs/Microsoft.Quantum.Arrays/Windows.md +47 -0
- package/docs/Microsoft.Quantum.Arrays/Zipped.md +50 -0
- package/docs/Microsoft.Quantum.Canon/ApplyCNOTChain.md +35 -0
- package/docs/Microsoft.Quantum.Canon/ApplyControlledOnBitString.md +42 -0
- package/docs/Microsoft.Quantum.Canon/ApplyControlledOnInt.md +41 -0
- package/docs/Microsoft.Quantum.Canon/ApplyP.md +39 -0
- package/docs/Microsoft.Quantum.Canon/ApplyPauli.md +41 -0
- package/docs/Microsoft.Quantum.Canon/ApplyPauliFromBitString.md +47 -0
- package/docs/Microsoft.Quantum.Canon/ApplyPauliFromInt.md +45 -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 +43 -0
- package/docs/Microsoft.Quantum.Canon/ApplyToEachC.md +43 -0
- package/docs/Microsoft.Quantum.Canon/ApplyToEachCA.md +43 -0
- package/docs/Microsoft.Quantum.Canon/ApplyXorInPlace.md +31 -0
- package/docs/Microsoft.Quantum.Canon/ApplyXorInPlaceL.md +31 -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 +36 -0
- package/docs/Microsoft.Quantum.Convert/BoolArrayAsBigInt.md +35 -0
- package/docs/Microsoft.Quantum.Convert/BoolArrayAsInt.md +25 -0
- package/docs/Microsoft.Quantum.Convert/BoolArrayAsResultArray.md +30 -0
- package/docs/Microsoft.Quantum.Convert/BoolAsResult.md +30 -0
- package/docs/Microsoft.Quantum.Convert/ComplexAsComplexPolar.md +30 -0
- package/docs/Microsoft.Quantum.Convert/ComplexPolarAsComplex.md +30 -0
- package/docs/Microsoft.Quantum.Convert/IntAsBigInt.md +21 -0
- package/docs/Microsoft.Quantum.Convert/IntAsBoolArray.md +36 -0
- package/docs/Microsoft.Quantum.Convert/IntAsDouble.md +21 -0
- package/docs/Microsoft.Quantum.Convert/ResultArrayAsBoolArray.md +30 -0
- package/docs/Microsoft.Quantum.Convert/ResultArrayAsInt.md +34 -0
- package/docs/Microsoft.Quantum.Convert/ResultAsBool.md +30 -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 +38 -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 +46 -0
- package/docs/Microsoft.Quantum.Intrinsic/Measure.md +56 -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 +57 -0
- package/docs/Microsoft.Quantum.Intrinsic/RFrac.md +58 -0
- package/docs/Microsoft.Quantum.Intrinsic/Reset.md +27 -0
- package/docs/Microsoft.Quantum.Intrinsic/ResetAll.md +27 -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 +30 -0
- package/docs/Microsoft.Quantum.Math/AbsComplexPolar.md +30 -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 +30 -0
- package/docs/Microsoft.Quantum.Math/AbsSquaredComplexPolar.md +30 -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 +30 -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 +23 -0
- package/docs/Microsoft.Quantum.Math/BitSizeL.md +23 -0
- package/docs/Microsoft.Quantum.Math/Ceiling.md +23 -0
- package/docs/Microsoft.Quantum.Math/Complex.md +31 -0
- package/docs/Microsoft.Quantum.Math/ComplexPolar.md +29 -0
- package/docs/Microsoft.Quantum.Math/ContinuedFractionConvergentI.md +25 -0
- package/docs/Microsoft.Quantum.Math/ContinuedFractionConvergentL.md +25 -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 +23 -0
- package/docs/Microsoft.Quantum.Math/ExpModL.md +23 -0
- package/docs/Microsoft.Quantum.Math/ExtendedGreatestCommonDivisorI.md +23 -0
- package/docs/Microsoft.Quantum.Math/ExtendedGreatestCommonDivisorL.md +23 -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 +23 -0
- package/docs/Microsoft.Quantum.Math/GreatestCommonDivisorI.md +23 -0
- package/docs/Microsoft.Quantum.Math/GreatestCommonDivisorL.md +23 -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 +49 -0
- package/docs/Microsoft.Quantum.Math/IsNaN.md +30 -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 +35 -0
- package/docs/Microsoft.Quantum.Math/LogGammaD.md +39 -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 +23 -0
- package/docs/Microsoft.Quantum.Math/ModulusL.md +23 -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 +34 -0
- package/docs/Microsoft.Quantum.Math/PNormalized.md +39 -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 +32 -0
- package/docs/Microsoft.Quantum.Math/PowCP.md +32 -0
- package/docs/Microsoft.Quantum.Math/RealMod.md +38 -0
- package/docs/Microsoft.Quantum.Math/Round.md +23 -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 +23 -0
- package/docs/Microsoft.Quantum.Math/TrailingZeroCountL.md +23 -0
- package/docs/Microsoft.Quantum.Math/Truncate.md +23 -0
- package/docs/Microsoft.Quantum.Measurement/MResetEachZ.md +28 -0
- package/docs/Microsoft.Quantum.Measurement/MResetX.md +37 -0
- package/docs/Microsoft.Quantum.Measurement/MResetY.md +37 -0
- package/docs/Microsoft.Quantum.Measurement/MResetZ.md +37 -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 +36 -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 +35 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/AuxQubitCount.md +23 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/BeginEstimateCaching.md +39 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/BeginRepeatEstimates.md +36 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/CczCount.md +23 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/EndEstimateCaching.md +25 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/EndRepeatEstimates.md +22 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/MeasurementCount.md +23 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/PSSPCLayout.md +25 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/RepeatEstimates.md +32 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/RotationCount.md +23 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/RotationDepth.md +23 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/SingleVariant.md +23 -0
- package/docs/Microsoft.Quantum.ResourceEstimation/TCount.md +23 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/AddLE.md +29 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfEqualL.md +23 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfEqualLE.md +25 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterL.md +23 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterLE.md +25 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterOrEqualL.md +23 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterOrEqualLE.md +25 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessL.md +23 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessLE.md +25 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessOrEqualL.md +23 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessOrEqualLE.md +25 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/FourierTDIncByLE.md +32 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByI.md +27 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByIUsingIncByLE.md +27 -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 +27 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/LookAheadDKRSAddLE.md +36 -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 +34 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryCGIncByLE.md +34 -0
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryTTKIncByLE.md +35 -0
- package/docs/Microsoft.Quantum.Unstable.StatePreparation/ApproximatelyPreparePureStateCP.md +68 -0
- package/docs/Microsoft.Quantum.Unstable.StatePreparation/PreparePureStateD.md +65 -0
- package/docs/Microsoft.Quantum.Unstable.TableLookup/Select.md +53 -0
- package/docs/toc.yml +305 -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
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Math.SignD
|
|
3
|
+
title: SignD function
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Math
|
|
8
|
+
qsharp.name: SignD
|
|
9
|
+
qsharp.summary: Returns -1, 0 or +1 that indicates the sign of a number.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# SignD function
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Math](xref:Microsoft.Quantum.Math)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function SignD(a : Double) : Int
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Returns -1, 0 or +1 that indicates the sign of a number.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Math.SignI
|
|
3
|
+
title: SignI function
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Math
|
|
8
|
+
qsharp.name: SignI
|
|
9
|
+
qsharp.summary: Returns -1, 0 or +1 that indicates the sign of a number.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# SignI function
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Math](xref:Microsoft.Quantum.Math)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function SignI(a : Int) : Int
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Returns -1, 0 or +1 that indicates the sign of a number.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Math.SignL
|
|
3
|
+
title: SignL function
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Math
|
|
8
|
+
qsharp.name: SignL
|
|
9
|
+
qsharp.summary: Returns -1, 0 or +1 that indicates the sign of a number.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# SignL function
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Math](xref:Microsoft.Quantum.Math)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function SignL(a : BigInt) : Int
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Returns -1, 0 or +1 that indicates the sign of a number.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Math.Sin
|
|
3
|
+
title: Sin function
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Math
|
|
8
|
+
qsharp.name: Sin
|
|
9
|
+
qsharp.summary: Returns the sine of the specified angle.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Sin function
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Math](xref:Microsoft.Quantum.Math)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function Sin(theta : Double) : Double
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Returns the sine of the specified angle.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Math.Sinh
|
|
3
|
+
title: Sinh function
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Math
|
|
8
|
+
qsharp.name: Sinh
|
|
9
|
+
qsharp.summary: Returns the hyperbolic sine of the specified angle.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Sinh function
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Math](xref:Microsoft.Quantum.Math)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function Sinh(d : Double) : Double
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Returns the hyperbolic sine of the specified angle.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Math.SmallestFixedPoint
|
|
3
|
+
title: SmallestFixedPoint function
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Math
|
|
8
|
+
qsharp.name: SmallestFixedPoint
|
|
9
|
+
qsharp.summary: Returns the smallest representable number for specific fixed point dimensions.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# SmallestFixedPoint function
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Math](xref:Microsoft.Quantum.Math)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function SmallestFixedPoint(integerBits : Int, fractionalBits : Int) : Double
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Returns the smallest representable number for specific fixed point dimensions.
|
|
22
|
+
|
|
23
|
+
## Input
|
|
24
|
+
### integerBits
|
|
25
|
+
Number of integer bits (including the sign bit).
|
|
26
|
+
### fractionalBits
|
|
27
|
+
Number of fractional bits.
|
|
28
|
+
|
|
29
|
+
## Remark
|
|
30
|
+
The value can be computed as -2^(p-1), where p is the number of integer bits.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Math.Sqrt
|
|
3
|
+
title: Sqrt function
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Math
|
|
8
|
+
qsharp.name: Sqrt
|
|
9
|
+
qsharp.summary: Returns the square root of a specified number.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Sqrt function
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Math](xref:Microsoft.Quantum.Math)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function Sqrt(d : Double) : Double
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Returns the square root of a specified number.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Math.SquaredNorm
|
|
3
|
+
title: SquaredNorm function
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Math
|
|
8
|
+
qsharp.name: SquaredNorm
|
|
9
|
+
qsharp.summary: Returns the squared 2-norm of a vector.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# SquaredNorm function
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Math](xref:Microsoft.Quantum.Math)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function SquaredNorm(array : Double[]) : Double
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Returns the squared 2-norm of a vector.
|
|
22
|
+
|
|
23
|
+
## Description
|
|
24
|
+
Returns the squared 2-norm of a vector; that is, given an input
|
|
25
|
+
x̄, returns ∑xᵢ.
|
|
26
|
+
|
|
27
|
+
## Input
|
|
28
|
+
### array
|
|
29
|
+
The vector whose squared 2-norm is to be returned.
|
|
30
|
+
|
|
31
|
+
## Output
|
|
32
|
+
The squared 2-norm of `array`.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Math.Tan
|
|
3
|
+
title: Tan function
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Math
|
|
8
|
+
qsharp.name: Tan
|
|
9
|
+
qsharp.summary: Returns the tangent of the specified angle.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Tan function
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Math](xref:Microsoft.Quantum.Math)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function Tan(d : Double) : Double
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Returns the tangent of the specified angle.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Math.Tanh
|
|
3
|
+
title: Tanh function
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Math
|
|
8
|
+
qsharp.name: Tanh
|
|
9
|
+
qsharp.summary: Returns the hyperbolic tangent of the specified angle.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Tanh function
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Math](xref:Microsoft.Quantum.Math)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function Tanh(d : Double) : Double
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Returns the hyperbolic tangent of the specified angle.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Math.TimesC
|
|
3
|
+
title: TimesC function
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Math
|
|
8
|
+
qsharp.name: TimesC
|
|
9
|
+
qsharp.summary: Returns the product of two inputs of type `Complex`.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# TimesC function
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Math](xref:Microsoft.Quantum.Math)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function TimesC(a : Complex, b : Complex) : Complex
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Returns the product of two inputs of type `Complex`.
|
|
22
|
+
|
|
23
|
+
## Input
|
|
24
|
+
### a
|
|
25
|
+
The first input a to be multiplied.
|
|
26
|
+
### b
|
|
27
|
+
The second input b to be multiplied.
|
|
28
|
+
|
|
29
|
+
## Output
|
|
30
|
+
The product a⋅b.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Math.TimesCP
|
|
3
|
+
title: TimesCP function
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Math
|
|
8
|
+
qsharp.name: TimesCP
|
|
9
|
+
qsharp.summary: Returns the product of two inputs of type `ComplexPolar`.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# TimesCP function
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Math](xref:Microsoft.Quantum.Math)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
function TimesCP(a : ComplexPolar, b : ComplexPolar) : ComplexPolar
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Returns the product of two inputs of type `ComplexPolar`.
|
|
22
|
+
|
|
23
|
+
## Input
|
|
24
|
+
### a
|
|
25
|
+
The first input a to be multiplied.
|
|
26
|
+
### b
|
|
27
|
+
The second input b to be multiplied.
|
|
28
|
+
|
|
29
|
+
## Output
|
|
30
|
+
The product a⋅b.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Math.TrailingZeroCountI
|
|
3
|
+
title: TrailingZeroCountI function
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Math
|
|
8
|
+
qsharp.name: TrailingZeroCountI
|
|
9
|
+
qsharp.summary: For a non-zero integer `a`, returns the number of trailing zero bits
|
|
10
|
+
in the binary representation of `a`.
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# TrailingZeroCountI function
|
|
14
|
+
|
|
15
|
+
Namespace: [Microsoft.Quantum.Math](xref:Microsoft.Quantum.Math)
|
|
16
|
+
|
|
17
|
+
```qsharp
|
|
18
|
+
function TrailingZeroCountI(a : Int) : Int
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Summary
|
|
22
|
+
For a non-zero integer `a`, returns the number of trailing zero bits
|
|
23
|
+
in the binary representation of `a`.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Math.TrailingZeroCountL
|
|
3
|
+
title: TrailingZeroCountL function
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Math
|
|
8
|
+
qsharp.name: TrailingZeroCountL
|
|
9
|
+
qsharp.summary: For a non-zero integer `a`, returns the number of trailing zero bits
|
|
10
|
+
in the binary representation of `a`.
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# TrailingZeroCountL function
|
|
14
|
+
|
|
15
|
+
Namespace: [Microsoft.Quantum.Math](xref:Microsoft.Quantum.Math)
|
|
16
|
+
|
|
17
|
+
```qsharp
|
|
18
|
+
function TrailingZeroCountL(a : BigInt) : Int
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Summary
|
|
22
|
+
For a non-zero integer `a`, returns the number of trailing zero bits
|
|
23
|
+
in the binary representation of `a`.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Math.Truncate
|
|
3
|
+
title: Truncate function
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: function
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Math
|
|
8
|
+
qsharp.name: Truncate
|
|
9
|
+
qsharp.summary: Returns the integral part of a number.
|
|
10
|
+
For example: Truncate(3.7) = 3; Truncate(-3.7) = -3
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Truncate function
|
|
14
|
+
|
|
15
|
+
Namespace: [Microsoft.Quantum.Math](xref:Microsoft.Quantum.Math)
|
|
16
|
+
|
|
17
|
+
```qsharp
|
|
18
|
+
function Truncate(value : Double) : Int
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Summary
|
|
22
|
+
Returns the integral part of a number.
|
|
23
|
+
For example: Truncate(3.7) = 3; Truncate(-3.7) = -3
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Measurement.MResetEachZ
|
|
3
|
+
title: MResetEachZ operation
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: opeartion
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Measurement
|
|
8
|
+
qsharp.name: MResetEachZ
|
|
9
|
+
qsharp.summary: Measures each qubit in a given array in the Z basis
|
|
10
|
+
and resets them to a fixed initial state.
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# MResetEachZ operation
|
|
14
|
+
|
|
15
|
+
Namespace: [Microsoft.Quantum.Measurement](xref:Microsoft.Quantum.Measurement)
|
|
16
|
+
|
|
17
|
+
```qsharp
|
|
18
|
+
operation MResetEachZ(register : Qubit[]) : Result[]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Summary
|
|
22
|
+
Measures each qubit in a given array in the Z basis
|
|
23
|
+
and resets them to a fixed initial state.
|
|
24
|
+
## Input
|
|
25
|
+
### targets
|
|
26
|
+
An array of qubits to be measured.
|
|
27
|
+
## Output
|
|
28
|
+
An array of measurement results.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Measurement.MResetX
|
|
3
|
+
title: MResetX operation
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: opeartion
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Measurement
|
|
8
|
+
qsharp.name: MResetX
|
|
9
|
+
qsharp.summary: Measures a single qubit in the X basis,
|
|
10
|
+
and resets it to a fixed initial state
|
|
11
|
+
following the measurement.
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# MResetX operation
|
|
15
|
+
|
|
16
|
+
Namespace: [Microsoft.Quantum.Measurement](xref:Microsoft.Quantum.Measurement)
|
|
17
|
+
|
|
18
|
+
```qsharp
|
|
19
|
+
operation MResetX(target : Qubit) : Result
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Summary
|
|
23
|
+
Measures a single qubit in the X basis,
|
|
24
|
+
and resets it to a fixed initial state
|
|
25
|
+
following the measurement.
|
|
26
|
+
|
|
27
|
+
## Description
|
|
28
|
+
Performs a single-qubit measurement in the X-basis,
|
|
29
|
+
and ensures that the qubit is returned to |0⟩
|
|
30
|
+
following the measurement.
|
|
31
|
+
|
|
32
|
+
## Input
|
|
33
|
+
### target
|
|
34
|
+
A single qubit to be measured.
|
|
35
|
+
|
|
36
|
+
## Output
|
|
37
|
+
The result of measuring `target` in the Pauli X basis.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Measurement.MResetY
|
|
3
|
+
title: MResetY operation
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: opeartion
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Measurement
|
|
8
|
+
qsharp.name: MResetY
|
|
9
|
+
qsharp.summary: Measures a single qubit in the Y basis,
|
|
10
|
+
and resets it to a fixed initial state
|
|
11
|
+
following the measurement.
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# MResetY operation
|
|
15
|
+
|
|
16
|
+
Namespace: [Microsoft.Quantum.Measurement](xref:Microsoft.Quantum.Measurement)
|
|
17
|
+
|
|
18
|
+
```qsharp
|
|
19
|
+
operation MResetY(target : Qubit) : Result
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Summary
|
|
23
|
+
Measures a single qubit in the Y basis,
|
|
24
|
+
and resets it to a fixed initial state
|
|
25
|
+
following the measurement.
|
|
26
|
+
|
|
27
|
+
## Description
|
|
28
|
+
Performs a single-qubit measurement in the Y-basis,
|
|
29
|
+
and ensures that the qubit is returned to |0⟩
|
|
30
|
+
following the measurement.
|
|
31
|
+
|
|
32
|
+
## Input
|
|
33
|
+
### target
|
|
34
|
+
A single qubit to be measured.
|
|
35
|
+
|
|
36
|
+
## Output
|
|
37
|
+
The result of measuring `target` in the Pauli Y basis.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Measurement.MResetZ
|
|
3
|
+
title: MResetZ operation
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: opeartion
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Measurement
|
|
8
|
+
qsharp.name: MResetZ
|
|
9
|
+
qsharp.summary: Measures a single qubit in the Z basis,
|
|
10
|
+
and resets it to a fixed initial state
|
|
11
|
+
following the measurement.
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# MResetZ operation
|
|
15
|
+
|
|
16
|
+
Namespace: [Microsoft.Quantum.Measurement](xref:Microsoft.Quantum.Measurement)
|
|
17
|
+
|
|
18
|
+
```qsharp
|
|
19
|
+
operation MResetZ(target : Qubit) : Result
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Summary
|
|
23
|
+
Measures a single qubit in the Z basis,
|
|
24
|
+
and resets it to a fixed initial state
|
|
25
|
+
following the measurement.
|
|
26
|
+
|
|
27
|
+
## Description
|
|
28
|
+
Performs a single-qubit measurement in the Z-basis,
|
|
29
|
+
and ensures that the qubit is returned to |0⟩
|
|
30
|
+
following the measurement.
|
|
31
|
+
|
|
32
|
+
## Input
|
|
33
|
+
### target
|
|
34
|
+
A single qubit to be measured.
|
|
35
|
+
|
|
36
|
+
## Output
|
|
37
|
+
The result of measuring `target` in the Pauli Z basis.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Measurement.MeasureAllZ
|
|
3
|
+
title: MeasureAllZ operation
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: opeartion
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Measurement
|
|
8
|
+
qsharp.name: MeasureAllZ
|
|
9
|
+
qsharp.summary: Jointly measures a register of qubits in the Pauli Z basis.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# MeasureAllZ operation
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Measurement](xref:Microsoft.Quantum.Measurement)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
operation MeasureAllZ(register : Qubit[]) : Result
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Jointly measures a register of qubits in the Pauli Z basis.
|
|
22
|
+
|
|
23
|
+
## Description
|
|
24
|
+
Measures a register of qubits in the `Z ⊗ Z ⊗ ••• ⊗ Z`
|
|
25
|
+
basis, representing the parity of the entire register.
|
|
26
|
+
|
|
27
|
+
## Input
|
|
28
|
+
### register
|
|
29
|
+
The register to be measured.
|
|
30
|
+
|
|
31
|
+
## Output
|
|
32
|
+
The result of measuring `Z ⊗ Z ⊗ ••• ⊗ Z`.
|
|
33
|
+
|
|
34
|
+
## Remarks
|
|
35
|
+
This operation does not reset the measured qubits to the |0⟩ state,
|
|
36
|
+
leaving them in the state that corresponds to the measurement result.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Measurement.MeasureEachZ
|
|
3
|
+
title: MeasureEachZ operation
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: opeartion
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Measurement
|
|
8
|
+
qsharp.name: MeasureEachZ
|
|
9
|
+
qsharp.summary: Measures each qubit in a given array in the standard basis.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# MeasureEachZ operation
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Measurement](xref:Microsoft.Quantum.Measurement)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
operation MeasureEachZ(register : Qubit[]) : Result[]
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Measures each qubit in a given array in the standard basis.
|
|
22
|
+
## Input
|
|
23
|
+
### targets
|
|
24
|
+
An array of qubits to be measured.
|
|
25
|
+
## Output
|
|
26
|
+
An array of measurement results.
|
|
27
|
+
|
|
28
|
+
## Remarks
|
|
29
|
+
This operation does not reset the measured qubits to the |0⟩ state,
|
|
30
|
+
leaving them in the state that corresponds to the measurement results.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Measurement.MeasureInteger
|
|
3
|
+
title: MeasureInteger operation
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: opeartion
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Measurement
|
|
8
|
+
qsharp.name: MeasureInteger
|
|
9
|
+
qsharp.summary: Measures the content of a quantum register and converts
|
|
10
|
+
it to an integer. The measurement is performed with respect
|
|
11
|
+
to the standard computational basis, i.e., the eigenbasis of `PauliZ`.
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# MeasureInteger operation
|
|
15
|
+
|
|
16
|
+
Namespace: [Microsoft.Quantum.Measurement](xref:Microsoft.Quantum.Measurement)
|
|
17
|
+
|
|
18
|
+
```qsharp
|
|
19
|
+
operation MeasureInteger(target : Qubit[]) : Int
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Summary
|
|
23
|
+
Measures the content of a quantum register and converts
|
|
24
|
+
it to an integer. The measurement is performed with respect
|
|
25
|
+
to the standard computational basis, i.e., the eigenbasis of `PauliZ`.
|
|
26
|
+
|
|
27
|
+
## Input
|
|
28
|
+
### target
|
|
29
|
+
A quantum register in the little-endian encoding.
|
|
30
|
+
|
|
31
|
+
## Output
|
|
32
|
+
An unsigned integer that contains the measured value of `target`.
|
|
33
|
+
|
|
34
|
+
## Remarks
|
|
35
|
+
This operation resets its input register to the |00...0> state,
|
|
36
|
+
suitable for releasing back to a target machine.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Random.DrawRandomDouble
|
|
3
|
+
title: DrawRandomDouble operation
|
|
4
|
+
ms.date: 02/16/2024 12:00:00 AM
|
|
5
|
+
ms.topic: managed-reference
|
|
6
|
+
qsharp.kind: opeartion
|
|
7
|
+
qsharp.namespace: Microsoft.Quantum.Random
|
|
8
|
+
qsharp.name: DrawRandomDouble
|
|
9
|
+
qsharp.summary: Draws a random real number in a given inclusive interval.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# DrawRandomDouble operation
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Random](xref:Microsoft.Quantum.Random)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
operation DrawRandomDouble(min : Double, max : Double) : Double
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Draws a random real number in a given inclusive interval.
|
|
22
|
+
|
|
23
|
+
## Input
|
|
24
|
+
### min
|
|
25
|
+
The smallest real number to be drawn.
|
|
26
|
+
### max
|
|
27
|
+
The largest real number to be drawn.
|
|
28
|
+
|
|
29
|
+
## Output
|
|
30
|
+
A random real number in the inclusive interval from `min` to `max` with
|
|
31
|
+
uniform probability.
|
|
32
|
+
|
|
33
|
+
## Remarks
|
|
34
|
+
Fails if `max < min`.
|
|
35
|
+
|
|
36
|
+
## Example
|
|
37
|
+
The following Q# snippet randomly draws an angle between 0 and 2π:
|
|
38
|
+
```qsharp
|
|
39
|
+
let angle = DrawRandomDouble(0.0, 2.0 * PI());
|
|
40
|
+
```
|