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,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Unstable.Arithmetic.ApplyIfLessOrEqualL
|
|
3
|
+
title: ApplyIfLessOrEqualL 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.Unstable.Arithmetic
|
|
8
|
+
qsharp.name: ApplyIfLessOrEqualL
|
|
9
|
+
qsharp.summary: Computes `if (c <= x) { action(target) }`, that is, applies `action` to `target`
|
|
10
|
+
if a BigInt value `c` is less or equal to the little-endian qubit register `x`
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# ApplyIfLessOrEqualL operation
|
|
14
|
+
|
|
15
|
+
Namespace: [Microsoft.Quantum.Unstable.Arithmetic](xref:Microsoft.Quantum.Unstable.Arithmetic)
|
|
16
|
+
|
|
17
|
+
```qsharp
|
|
18
|
+
operation ApplyIfLessOrEqualL<'T>(action : ('T => Unit is Adj + Ctl), c : BigInt, x : Qubit[], target : 'T) : Unit is Adj + Ctl
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Summary
|
|
22
|
+
Computes `if (c <= x) { action(target) }`, that is, applies `action` to `target`
|
|
23
|
+
if a BigInt value `c` is less or equal to the little-endian qubit register `x`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Unstable.Arithmetic.ApplyIfLessOrEqualLE
|
|
3
|
+
title: ApplyIfLessOrEqualLE 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.Unstable.Arithmetic
|
|
8
|
+
qsharp.name: ApplyIfLessOrEqualLE
|
|
9
|
+
qsharp.summary: Computes `if x <= y { action(target) }`, that is, applies `action` to `target`
|
|
10
|
+
if register `x` is less or equal to the register `y`.
|
|
11
|
+
Both qubit registers should be in a little-endian format.
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# ApplyIfLessOrEqualLE operation
|
|
15
|
+
|
|
16
|
+
Namespace: [Microsoft.Quantum.Unstable.Arithmetic](xref:Microsoft.Quantum.Unstable.Arithmetic)
|
|
17
|
+
|
|
18
|
+
```qsharp
|
|
19
|
+
operation ApplyIfLessOrEqualLE<'T>(action : ('T => Unit is Adj + Ctl), x : Qubit[], y : Qubit[], target : 'T) : Unit is Adj + Ctl
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Summary
|
|
23
|
+
Computes `if x <= y { action(target) }`, that is, applies `action` to `target`
|
|
24
|
+
if register `x` is less or equal to the register `y`.
|
|
25
|
+
Both qubit registers should be in a little-endian format.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Unstable.Arithmetic.FourierTDIncByLE
|
|
3
|
+
title: FourierTDIncByLE 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.Unstable.Arithmetic
|
|
8
|
+
qsharp.name: FourierTDIncByLE
|
|
9
|
+
qsharp.summary: Increments a little-endian register ys by a little-endian register xs
|
|
10
|
+
using Quantum Fourier Transform.
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# FourierTDIncByLE operation
|
|
14
|
+
|
|
15
|
+
Namespace: [Microsoft.Quantum.Unstable.Arithmetic](xref:Microsoft.Quantum.Unstable.Arithmetic)
|
|
16
|
+
|
|
17
|
+
```qsharp
|
|
18
|
+
operation FourierTDIncByLE(xs : Qubit[], ys : Qubit[]) : Unit is Adj + Ctl
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Summary
|
|
22
|
+
Increments a little-endian register ys by a little-endian register xs
|
|
23
|
+
using Quantum Fourier Transform.
|
|
24
|
+
|
|
25
|
+
## Description
|
|
26
|
+
Computes ys += xs modulo 2ⁿ, where xs and ys are little-endian registers,
|
|
27
|
+
and Length(xs) = Length(ys) = n.
|
|
28
|
+
This operation uses Quantum Fourier Transform.
|
|
29
|
+
|
|
30
|
+
## Reference
|
|
31
|
+
- [arXiv:quant-ph/0008033](https://arxiv.org/abs/quant-ph/0008033)
|
|
32
|
+
"Addition on a Quantum Computer" by Thomas G. Draper
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Unstable.Arithmetic.IncByI
|
|
3
|
+
title: IncByI 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.Unstable.Arithmetic
|
|
8
|
+
qsharp.name: IncByI
|
|
9
|
+
qsharp.summary: Increments a little-endian register ys by an integer number c
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# IncByI operation
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Unstable.Arithmetic](xref:Microsoft.Quantum.Unstable.Arithmetic)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
operation IncByI(c : Int, ys : Qubit[]) : Unit is Adj + Ctl
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Increments a little-endian register ys by an integer number c
|
|
22
|
+
|
|
23
|
+
## Description
|
|
24
|
+
Computes ys += c modulo 2ⁿ, where ys is a little-endian register,
|
|
25
|
+
Length(ys) = n > 0, c is a Int number, 0 ≤ c < 2ⁿ.
|
|
26
|
+
NOTE: Use IncByIUsingIncByLE directly if the choice of implementation
|
|
27
|
+
is important.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Unstable.Arithmetic.IncByIUsingIncByLE
|
|
3
|
+
title: IncByIUsingIncByLE 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.Unstable.Arithmetic
|
|
8
|
+
qsharp.name: IncByIUsingIncByLE
|
|
9
|
+
qsharp.summary: Increments a little-endian register ys by an Int number c
|
|
10
|
+
using provided adder.
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# IncByIUsingIncByLE operation
|
|
14
|
+
|
|
15
|
+
Namespace: [Microsoft.Quantum.Unstable.Arithmetic](xref:Microsoft.Quantum.Unstable.Arithmetic)
|
|
16
|
+
|
|
17
|
+
```qsharp
|
|
18
|
+
operation IncByIUsingIncByLE(adder : ((Qubit[], Qubit[]) => Unit is Adj + Ctl), c : Int, ys : Qubit[]) : Unit is Adj + Ctl
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Summary
|
|
22
|
+
Increments a little-endian register ys by an Int number c
|
|
23
|
+
using provided adder.
|
|
24
|
+
|
|
25
|
+
## Description
|
|
26
|
+
Computes ys += c modulo 2ⁿ, where ys is a little-endian register
|
|
27
|
+
Length(ys) = n > 0, c is an Int number, 0 ≤ c < 2ⁿ.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Unstable.Arithmetic.IncByL
|
|
3
|
+
title: IncByL 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.Unstable.Arithmetic
|
|
8
|
+
qsharp.name: IncByL
|
|
9
|
+
qsharp.summary: Increments a little-endian register ys by a BigInt number c
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# IncByL operation
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Unstable.Arithmetic](xref:Microsoft.Quantum.Unstable.Arithmetic)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
operation IncByL(c : BigInt, ys : Qubit[]) : Unit is Adj + Ctl
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Increments a little-endian register ys by a BigInt number c
|
|
22
|
+
|
|
23
|
+
## Description
|
|
24
|
+
Computes ys += c modulo 2ⁿ, where ys is a little-endian register,
|
|
25
|
+
Length(ys) = n > 0, c is a BigInt number, 0 ≤ c < 2ⁿ.
|
|
26
|
+
NOTE: Use IncByLUsingIncByLE directly if the choice of implementation
|
|
27
|
+
is important.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Unstable.Arithmetic.IncByLE
|
|
3
|
+
title: IncByLE 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.Unstable.Arithmetic
|
|
8
|
+
qsharp.name: IncByLE
|
|
9
|
+
qsharp.summary: Increments a little-endian register ys by a little-endian register xs
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# IncByLE operation
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Unstable.Arithmetic](xref:Microsoft.Quantum.Unstable.Arithmetic)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
operation IncByLE(xs : Qubit[], ys : Qubit[]) : Unit is Adj + Ctl
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Increments a little-endian register ys by a little-endian register xs
|
|
22
|
+
|
|
23
|
+
## Description
|
|
24
|
+
Computes ys += xs modulo 2ⁿ, where xs and ys are little-endian registers,
|
|
25
|
+
and Length(xs) ≤ Length(ys) = n.
|
|
26
|
+
NOTE: Use operations like RippleCarryCGIncByLE directly if
|
|
27
|
+
the choice of implementation is important.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Unstable.Arithmetic.IncByLEUsingAddLE
|
|
3
|
+
title: IncByLEUsingAddLE 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.Unstable.Arithmetic
|
|
8
|
+
qsharp.name: IncByLEUsingAddLE
|
|
9
|
+
qsharp.summary: Generic operation to turn two out-place adders into one in-place adder
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# IncByLEUsingAddLE operation
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Unstable.Arithmetic](xref:Microsoft.Quantum.Unstable.Arithmetic)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
operation IncByLEUsingAddLE(forwardAdder : ((Qubit[], Qubit[], Qubit[]) => Unit is Adj), backwardAdder : ((Qubit[], Qubit[], Qubit[]) => Unit is Adj), xs : Qubit[], ys : Qubit[]) : Unit is Adj + Ctl
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Generic operation to turn two out-place adders into one in-place adder
|
|
22
|
+
|
|
23
|
+
## Description
|
|
24
|
+
This implementation allows to specify two distinct adders for forward
|
|
25
|
+
and backward direction. The forward adder is always applied in its
|
|
26
|
+
body variant, whereas the backward adder is always applied in its adjoint
|
|
27
|
+
variant. Therefore, it's possible to, for example, use the ripple-carry
|
|
28
|
+
out-of-place adder in backwards direction to require no T gates.
|
|
29
|
+
|
|
30
|
+
The controlled variant is also optimized in a way that everything but
|
|
31
|
+
the adders is controlled,
|
|
32
|
+
|
|
33
|
+
## Reference
|
|
34
|
+
- [arXiv:2012.01624](https://arxiv.org/abs/2012.01624)
|
|
35
|
+
"Quantum block lookahead adders and the wait for magic states"
|
|
36
|
+
by by Craig Gidney.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Unstable.Arithmetic.IncByLUsingIncByLE
|
|
3
|
+
title: IncByLUsingIncByLE 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.Unstable.Arithmetic
|
|
8
|
+
qsharp.name: IncByLUsingIncByLE
|
|
9
|
+
qsharp.summary: Increments a little-endian register ys by a BigInt number c
|
|
10
|
+
using provided adder.
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# IncByLUsingIncByLE operation
|
|
14
|
+
|
|
15
|
+
Namespace: [Microsoft.Quantum.Unstable.Arithmetic](xref:Microsoft.Quantum.Unstable.Arithmetic)
|
|
16
|
+
|
|
17
|
+
```qsharp
|
|
18
|
+
operation IncByLUsingIncByLE(adder : ((Qubit[], Qubit[]) => Unit is Adj + Ctl), c : BigInt, ys : Qubit[]) : Unit is Adj + Ctl
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Summary
|
|
22
|
+
Increments a little-endian register ys by a BigInt number c
|
|
23
|
+
using provided adder.
|
|
24
|
+
|
|
25
|
+
## Description
|
|
26
|
+
Computes ys += c modulo 2ⁿ, where ys is a little-endian register
|
|
27
|
+
Length(ys) = n > 0, c is a BigInt number, 0 ≤ c < 2ⁿ.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Unstable.Arithmetic.LookAheadDKRSAddLE
|
|
3
|
+
title: LookAheadDKRSAddLE 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.Unstable.Arithmetic
|
|
8
|
+
qsharp.name: LookAheadDKRSAddLE
|
|
9
|
+
qsharp.summary: Sets a zero-initialized little-endian register zs to the sum of
|
|
10
|
+
little-endian registers xs and ys using the carry-lookahead algorithm.
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# LookAheadDKRSAddLE operation
|
|
14
|
+
|
|
15
|
+
Namespace: [Microsoft.Quantum.Unstable.Arithmetic](xref:Microsoft.Quantum.Unstable.Arithmetic)
|
|
16
|
+
|
|
17
|
+
```qsharp
|
|
18
|
+
operation LookAheadDKRSAddLE(xs : Qubit[], ys : Qubit[], zs : Qubit[]) : Unit is Adj
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Summary
|
|
22
|
+
Sets a zero-initialized little-endian register zs to the sum of
|
|
23
|
+
little-endian registers xs and ys using the carry-lookahead algorithm.
|
|
24
|
+
|
|
25
|
+
## Description
|
|
26
|
+
Computes zs := xs + ys + zs[0] modulo 2ⁿ, where xs, ys, and zs are
|
|
27
|
+
little-endian registers, Length(xs) = Length(ys) ≤ Length(zs) = n,
|
|
28
|
+
assuming zs is 0-initialized, except for maybe zs[0], which can be
|
|
29
|
+
in |0> or |1> state and can be used as carry-in.
|
|
30
|
+
NOTE: `zs[Length(xs)]` can be used as carry-out, if `zs` is longer than `xs`.
|
|
31
|
+
This operation uses the carry-lookahead algorithm.
|
|
32
|
+
|
|
33
|
+
## Reference
|
|
34
|
+
- [arXiv:quant-ph/0406142](https://arxiv.org/abs/quant-ph/0406142)
|
|
35
|
+
"A logarithmic-depth quantum carry-lookahead adder" by
|
|
36
|
+
Thomas G. Draper, Samuel A. Kutin, Eric M. Rains, Krysta M. Svore
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Unstable.Arithmetic.MAJ
|
|
3
|
+
title: MAJ 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.Unstable.Arithmetic
|
|
8
|
+
qsharp.name: MAJ
|
|
9
|
+
qsharp.summary: This applies the in-place majority operation to 3 qubits.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# MAJ operation
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Unstable.Arithmetic](xref:Microsoft.Quantum.Unstable.Arithmetic)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
operation MAJ(x : Qubit, y : Qubit, z : Qubit) : Unit is Adj + Ctl
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
This applies the in-place majority operation to 3 qubits.
|
|
22
|
+
|
|
23
|
+
## Description
|
|
24
|
+
Assuming the state of the input qubits are |x⟩, |y⟩ and |z⟩, then
|
|
25
|
+
this operation performs the following transformation:
|
|
26
|
+
|x⟩|y⟩|z⟩ ↦ |x ⊕ z⟩|y ⊕ z⟩MAJ(x, y, z).
|
|
27
|
+
|
|
28
|
+
## Input
|
|
29
|
+
### x
|
|
30
|
+
The first input qubit.
|
|
31
|
+
### y
|
|
32
|
+
The second input qubit.
|
|
33
|
+
### z
|
|
34
|
+
A qubit onto which the majority function will be applied.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Unstable.Arithmetic.ReflectAboutInteger
|
|
3
|
+
title: ReflectAboutInteger 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.Unstable.Arithmetic
|
|
8
|
+
qsharp.name: ReflectAboutInteger
|
|
9
|
+
qsharp.summary: Reflects a quantum register about a given classical integer.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# ReflectAboutInteger operation
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Unstable.Arithmetic](xref:Microsoft.Quantum.Unstable.Arithmetic)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
operation ReflectAboutInteger(index : Int, reg : Qubit[]) : Unit is Adj + Ctl
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Reflects a quantum register about a given classical integer.
|
|
22
|
+
|
|
23
|
+
## Description
|
|
24
|
+
Given a quantum register initially in the state ∑ᵢ(αᵢ|i⟩),
|
|
25
|
+
where each |i⟩ is a basis state representing an integer i,
|
|
26
|
+
reflects the state of the register about the basis state |j⟩
|
|
27
|
+
for a given integer j: ∑ᵢ(-1)^(δᵢⱼ)(αᵢ|i⟩)
|
|
28
|
+
|
|
29
|
+
## Input
|
|
30
|
+
### index
|
|
31
|
+
The classical integer j indexing the basis state about which to reflect.
|
|
32
|
+
### reg
|
|
33
|
+
Little-endian quantum register to reflect.
|
|
34
|
+
|
|
35
|
+
## Remarks
|
|
36
|
+
This operation is implemented in-place, without explicit allocation of
|
|
37
|
+
additional auxiliary qubits.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Unstable.Arithmetic.RippleCarryCGAddLE
|
|
3
|
+
title: RippleCarryCGAddLE 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.Unstable.Arithmetic
|
|
8
|
+
qsharp.name: RippleCarryCGAddLE
|
|
9
|
+
qsharp.summary: Sets a zero-initialized little-endian register zs to the sum of
|
|
10
|
+
little-endian registers xs and ys using the ripple-carry algorithm.
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# RippleCarryCGAddLE operation
|
|
14
|
+
|
|
15
|
+
Namespace: [Microsoft.Quantum.Unstable.Arithmetic](xref:Microsoft.Quantum.Unstable.Arithmetic)
|
|
16
|
+
|
|
17
|
+
```qsharp
|
|
18
|
+
operation RippleCarryCGAddLE(xs : Qubit[], ys : Qubit[], zs : Qubit[]) : Unit is Adj
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Summary
|
|
22
|
+
Sets a zero-initialized little-endian register zs to the sum of
|
|
23
|
+
little-endian registers xs and ys using the ripple-carry algorithm.
|
|
24
|
+
|
|
25
|
+
## Description
|
|
26
|
+
Computes zs := xs + ys + zs[0] modulo 2ⁿ, where xs, ys, and zs are
|
|
27
|
+
little-endian registers, Length(xs) = Length(ys) ≤ Length(zs) = n,
|
|
28
|
+
assuming zs is 0-initialized, except for maybe zs[0], which can be
|
|
29
|
+
This operation uses the ripple-carry algorithm.
|
|
30
|
+
NOTE: `zs[Length(xs)]` can be used as carry-out, if `zs` is longer than `xs`.
|
|
31
|
+
|
|
32
|
+
## Reference
|
|
33
|
+
- [arXiv:1709.06648](https://arxiv.org/pdf/1709.06648.pdf)
|
|
34
|
+
"Halving the cost of quantum addition" by Craig Gidney.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Unstable.Arithmetic.RippleCarryCGIncByLE
|
|
3
|
+
title: RippleCarryCGIncByLE 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.Unstable.Arithmetic
|
|
8
|
+
qsharp.name: RippleCarryCGIncByLE
|
|
9
|
+
qsharp.summary: Increments a little-endian register ys by a little-endian register xs
|
|
10
|
+
using the ripple-carry algorithm.
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# RippleCarryCGIncByLE operation
|
|
14
|
+
|
|
15
|
+
Namespace: [Microsoft.Quantum.Unstable.Arithmetic](xref:Microsoft.Quantum.Unstable.Arithmetic)
|
|
16
|
+
|
|
17
|
+
```qsharp
|
|
18
|
+
operation RippleCarryCGIncByLE(xs : Qubit[], ys : Qubit[]) : Unit is Adj + Ctl
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Summary
|
|
22
|
+
Increments a little-endian register ys by a little-endian register xs
|
|
23
|
+
using the ripple-carry algorithm.
|
|
24
|
+
|
|
25
|
+
## Description
|
|
26
|
+
Computes ys += xs modulo 2ⁿ, where xs and ys are little-endian registers,
|
|
27
|
+
and Length(xs) ≤ Length(ys) = n.
|
|
28
|
+
Note that if Length(xs) != Length(ys), xs is padded with 0-initialized
|
|
29
|
+
qubits to match ys's length.
|
|
30
|
+
This operation uses the ripple-carry algorithm.
|
|
31
|
+
|
|
32
|
+
## Reference
|
|
33
|
+
- [arXiv:1709.06648](https://arxiv.org/pdf/1709.06648.pdf)
|
|
34
|
+
"Halving the cost of quantum addition" by Craig Gidney.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Unstable.Arithmetic.RippleCarryTTKIncByLE
|
|
3
|
+
title: RippleCarryTTKIncByLE 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.Unstable.Arithmetic
|
|
8
|
+
qsharp.name: RippleCarryTTKIncByLE
|
|
9
|
+
qsharp.summary: Reversible, in-place ripple-carry addition of two integers.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# RippleCarryTTKIncByLE operation
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Unstable.Arithmetic](xref:Microsoft.Quantum.Unstable.Arithmetic)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
operation RippleCarryTTKIncByLE(xs : Qubit[], ys : Qubit[]) : Unit is Adj + Ctl
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Reversible, in-place ripple-carry addition of two integers.
|
|
22
|
+
|
|
23
|
+
## Description
|
|
24
|
+
Computes ys += xs modulo 2ⁿ, where xs and ys are little-endian registers,
|
|
25
|
+
and Length(xs) ≤ Length(ys) = n.
|
|
26
|
+
This operation uses the ripple-carry algorithm.
|
|
27
|
+
Note that if Length(ys) >= Length(xs)+2, xs is padded with 0-initialized
|
|
28
|
+
qubits to match ys's length. The operation doesn't use any auxilliary
|
|
29
|
+
qubits otherwise.
|
|
30
|
+
|
|
31
|
+
## References
|
|
32
|
+
- [arXiv:0910.2530](https://arxiv.org/abs/0910.2530)
|
|
33
|
+
"Quantum Addition Circuits and Unbounded Fan-Out"
|
|
34
|
+
by Yasuhiro Takahashi, Seiichiro Tani, Noboru Kunihiro
|
|
35
|
+
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Unstable.StatePreparation.ApproximatelyPreparePureStateCP
|
|
3
|
+
title: ApproximatelyPreparePureStateCP 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.Unstable.StatePreparation
|
|
8
|
+
qsharp.name: ApproximatelyPreparePureStateCP
|
|
9
|
+
qsharp.summary: Given a set of coefficients and a big-endian quantum register,
|
|
10
|
+
prepares a state on that register described by the given coefficients,
|
|
11
|
+
up to a given approximation tolerance.
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# ApproximatelyPreparePureStateCP operation
|
|
15
|
+
|
|
16
|
+
Namespace: [Microsoft.Quantum.Unstable.StatePreparation](xref:Microsoft.Quantum.Unstable.StatePreparation)
|
|
17
|
+
|
|
18
|
+
```qsharp
|
|
19
|
+
operation ApproximatelyPreparePureStateCP(tolerance : Double, coefficients : ComplexPolar[], qubits : Qubit[]) : Unit is Adj + Ctl
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Summary
|
|
23
|
+
Given a set of coefficients and a big-endian quantum register,
|
|
24
|
+
prepares a state on that register described by the given coefficients,
|
|
25
|
+
up to a given approximation tolerance.
|
|
26
|
+
|
|
27
|
+
## Description
|
|
28
|
+
This operation prepares an arbitrary quantum
|
|
29
|
+
state |𝜓⟩ with complex coefficients rⱼ·𝒆^(𝒊·tⱼ) from
|
|
30
|
+
the n-qubit computational basis state |0...0⟩.
|
|
31
|
+
In particular, the action of this operation can be simulated by the
|
|
32
|
+
a unitary transformation U which acts on the all-zeros state as
|
|
33
|
+
|
|
34
|
+
$$
|
|
35
|
+
\begin{align}
|
|
36
|
+
U\ket{0...0}
|
|
37
|
+
& = \ket{\psi} \\\\
|
|
38
|
+
& = \frac{
|
|
39
|
+
\sum_{j=0}^{2^n-1} r_j e^{i t_j} \ket{j}
|
|
40
|
+
}{
|
|
41
|
+
\sqrt{\sum_{j=0}^{2^n-1} |r_j|^2}
|
|
42
|
+
}.
|
|
43
|
+
\end{align}
|
|
44
|
+
$$
|
|
45
|
+
|
|
46
|
+
## Input
|
|
47
|
+
### tolerance
|
|
48
|
+
The approximation tolerance to be used when preparing the given state.
|
|
49
|
+
|
|
50
|
+
### coefficients
|
|
51
|
+
Array of up to 2ⁿ complex coefficients represented by their
|
|
52
|
+
absolute value and phase (rⱼ, tⱼ). The j-th coefficient
|
|
53
|
+
indexes the number state |j⟩ encoded in a big-endian format.
|
|
54
|
+
|
|
55
|
+
### qubits
|
|
56
|
+
Qubit register encoding number states in a big-endian format. This is
|
|
57
|
+
expected to be initialized in the computational basis state
|
|
58
|
+
|0...0⟩.
|
|
59
|
+
|
|
60
|
+
## Remarks
|
|
61
|
+
`coefficients` will be padded with
|
|
62
|
+
elements (rⱼ, tⱼ) = (0.0, 0.0) if fewer than 2ⁿ are
|
|
63
|
+
specified.
|
|
64
|
+
|
|
65
|
+
## References
|
|
66
|
+
- Synthesis of Quantum Logic Circuits
|
|
67
|
+
Vivek V. Shende, Stephen S. Bullock, Igor L. Markov
|
|
68
|
+
https://arxiv.org/abs/quant-ph/0406176
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Unstable.StatePreparation.PreparePureStateD
|
|
3
|
+
title: PreparePureStateD 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.Unstable.StatePreparation
|
|
8
|
+
qsharp.name: PreparePureStateD
|
|
9
|
+
qsharp.summary: Given a set of coefficients and a big-endian quantum register,
|
|
10
|
+
prepares a state on that register described by the given coefficients.
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# PreparePureStateD operation
|
|
14
|
+
|
|
15
|
+
Namespace: [Microsoft.Quantum.Unstable.StatePreparation](xref:Microsoft.Quantum.Unstable.StatePreparation)
|
|
16
|
+
|
|
17
|
+
```qsharp
|
|
18
|
+
operation PreparePureStateD(coefficients : Double[], qubits : Qubit[]) : Unit is Adj + Ctl
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Summary
|
|
22
|
+
Given a set of coefficients and a big-endian quantum register,
|
|
23
|
+
prepares a state on that register described by the given coefficients.
|
|
24
|
+
|
|
25
|
+
## Description
|
|
26
|
+
This operation prepares an arbitrary quantum
|
|
27
|
+
state |𝜓⟩ with coefficients 𝑎ⱼ from
|
|
28
|
+
the n-qubit computational basis state |0...0⟩.
|
|
29
|
+
|
|
30
|
+
The action of U on the all-zeros state is given by
|
|
31
|
+
$$
|
|
32
|
+
\begin{align}
|
|
33
|
+
U \ket{0\cdots 0} = \ket{\psi} = \frac{\sum_{j=0}^{2^n-1}\alpha_j \ket{j}}{\sqrt{\sum_{j=0}^{2^n-1}|\alpha_j|^2}}.
|
|
34
|
+
\end{align}
|
|
35
|
+
$$
|
|
36
|
+
|
|
37
|
+
## Input
|
|
38
|
+
### coefficients
|
|
39
|
+
Array of up to 2ⁿ real coefficients. The j-th coefficient
|
|
40
|
+
indexes the number state |j⟩ encoded in big-endian format.
|
|
41
|
+
|
|
42
|
+
### qubits
|
|
43
|
+
Qubit register encoding number states in a big-endian format. This is
|
|
44
|
+
expected to be initialized in the computational basis state |0...0⟩.
|
|
45
|
+
|
|
46
|
+
## Remarks
|
|
47
|
+
`coefficients` will be normalized and padded with
|
|
48
|
+
elements 𝑎ⱼ = 0.0 if fewer than 2ⁿ are specified.
|
|
49
|
+
|
|
50
|
+
## Example
|
|
51
|
+
The following snippet prepares the quantum state |𝜓⟩=√(1/8)|0⟩+√(7/8)|2⟩=√(1/8)|00⟩+√(7/8)|10⟩
|
|
52
|
+
in the qubit register `qubits`.
|
|
53
|
+
```qsharp
|
|
54
|
+
let amplitudes = [Sqrt(0.125), 0.0, Sqrt(0.875), 0.0];
|
|
55
|
+
use qubits = Qubit[2];
|
|
56
|
+
PreparePureStateD(amplitudes, qubits);
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## References
|
|
60
|
+
- Synthesis of Quantum Logic Circuits
|
|
61
|
+
Vivek V. Shende, Stephen S. Bullock, Igor L. Markov
|
|
62
|
+
https://arxiv.org/abs/quant-ph/0406176
|
|
63
|
+
|
|
64
|
+
## See Also
|
|
65
|
+
- Microsoft.Quantum.Unstable.StatePreparation.ApproximatelyPreparePureStateCP
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
uid: Microsoft.Quantum.Unstable.TableLookup.Select
|
|
3
|
+
title: Select 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.Unstable.TableLookup
|
|
8
|
+
qsharp.name: Select
|
|
9
|
+
qsharp.summary: Performs table lookup using a SELECT network
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Select operation
|
|
13
|
+
|
|
14
|
+
Namespace: [Microsoft.Quantum.Unstable.TableLookup](xref:Microsoft.Quantum.Unstable.TableLookup)
|
|
15
|
+
|
|
16
|
+
```qsharp
|
|
17
|
+
operation Select(data : Bool[][], address : Qubit[], target : Qubit[]) : Unit is Adj + Ctl
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
Performs table lookup using a SELECT network
|
|
22
|
+
|
|
23
|
+
## Description
|
|
24
|
+
Assuming a zero-initialized `target` register, this operation will
|
|
25
|
+
initialize it with the bitstrings in `data` at indices according to the
|
|
26
|
+
computational values of the `address` register.
|
|
27
|
+
|
|
28
|
+
## Input
|
|
29
|
+
### data
|
|
30
|
+
The classical table lookup data which is prepared in `target` with
|
|
31
|
+
respect to the state in `address`. The length of data must be less than
|
|
32
|
+
2ⁿ, where 𝑛 is the length of `address`. Each entry in data must have
|
|
33
|
+
the same length that must be equal to the length of `target`.
|
|
34
|
+
### address
|
|
35
|
+
Address register
|
|
36
|
+
### target
|
|
37
|
+
Zero-initialized target register
|
|
38
|
+
|
|
39
|
+
## Remarks
|
|
40
|
+
The implementation of the SELECT network is based on unary encoding as
|
|
41
|
+
presented in [1]. The recursive implementation of that algorithm is
|
|
42
|
+
presented in [3]. The adjoint variant is optimized using a
|
|
43
|
+
measurement-based unlookup operation [3]. The controlled adjoint variant
|
|
44
|
+
is not optimized using this technique.
|
|
45
|
+
|
|
46
|
+
## References
|
|
47
|
+
[1] [arXiv:1805.03662](https://arxiv.org/abs/1805.03662)
|
|
48
|
+
"Encoding Electronic Spectra in Quantum Circuits with Linear T
|
|
49
|
+
Complexity"
|
|
50
|
+
[2] [arXiv:1905.07682](https://arxiv.org/abs/1905.07682)
|
|
51
|
+
"Windowed arithmetic"
|
|
52
|
+
[3] [arXiv:2211.01133](https://arxiv.org/abs/2211.01133)
|
|
53
|
+
"Space-time optimized table lookup"
|