qsharp-lang 1.3.6-dev → 1.4.1-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/compiler/compiler.d.ts +4 -4
- package/dist/compiler/compiler.js +4 -4
- package/dist/katas-content.generated.js +2078 -496
- package/dist/samples.generated.js +3 -3
- package/docs/Microsoft.Quantum.Arrays/All.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Any.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Chunks.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/CircularlyShifted.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/ColumnAt.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Count.md +2 -2
- package/docs/Microsoft.Quantum.Arrays/Diagonal.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/DrawMany.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Enumerated.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Excluding.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Filtered.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/FlatMapped.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Flattened.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Fold.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/ForEach.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Head.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/HeadAndRest.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/IndexOf.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/IndexRange.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Interleaved.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/IsEmpty.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/IsRectangularArray.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/IsSorted.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/IsSquareArray.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Mapped.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/MappedByIndex.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/MappedOverRange.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Most.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/MostAndTail.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Padded.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Partitioned.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Rest.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Reversed.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/SequenceI.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/SequenceL.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Sorted.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Subarray.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Swapped.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Tail.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Transposed.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Unzipped.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Where.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Windows.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Zipped.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyCNOTChain.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyControlledOnBitString.md +23 -12
- package/docs/Microsoft.Quantum.Canon/ApplyControlledOnInt.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyP.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyPauli.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyPauliFromBitString.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyPauliFromInt.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyQFT.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyToEach.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyToEachA.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyToEachC.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyToEachCA.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyXorInPlace.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyXorInPlaceL.md +1 -1
- package/docs/Microsoft.Quantum.Canon/CX.md +1 -1
- package/docs/Microsoft.Quantum.Canon/CY.md +7 -5
- package/docs/Microsoft.Quantum.Canon/CZ.md +7 -5
- package/docs/Microsoft.Quantum.Canon/Fst.md +1 -1
- package/docs/Microsoft.Quantum.Canon/Snd.md +1 -1
- package/docs/Microsoft.Quantum.Canon/SwapReverseRegister.md +1 -1
- package/docs/Microsoft.Quantum.Convert/BigIntAsBoolArray.md +1 -1
- package/docs/Microsoft.Quantum.Convert/BoolArrayAsBigInt.md +1 -1
- package/docs/Microsoft.Quantum.Convert/BoolArrayAsInt.md +4 -3
- package/docs/Microsoft.Quantum.Convert/BoolArrayAsResultArray.md +1 -1
- package/docs/Microsoft.Quantum.Convert/BoolAsResult.md +1 -1
- package/docs/Microsoft.Quantum.Convert/ComplexAsComplexPolar.md +1 -1
- package/docs/Microsoft.Quantum.Convert/ComplexPolarAsComplex.md +1 -1
- package/docs/Microsoft.Quantum.Convert/IntAsBigInt.md +3 -3
- package/docs/Microsoft.Quantum.Convert/IntAsBoolArray.md +1 -1
- package/docs/Microsoft.Quantum.Convert/IntAsDouble.md +17 -3
- package/docs/Microsoft.Quantum.Convert/ResultArrayAsBoolArray.md +1 -1
- package/docs/Microsoft.Quantum.Convert/ResultArrayAsInt.md +1 -1
- package/docs/Microsoft.Quantum.Convert/ResultAsBool.md +1 -1
- package/docs/Microsoft.Quantum.Core/IsRangeEmpty.md +1 -1
- package/docs/Microsoft.Quantum.Core/Length.md +9 -4
- package/docs/Microsoft.Quantum.Core/RangeEnd.md +1 -1
- package/docs/Microsoft.Quantum.Core/RangeReverse.md +1 -1
- package/docs/Microsoft.Quantum.Core/RangeStart.md +6 -1
- package/docs/Microsoft.Quantum.Core/RangeStep.md +1 -1
- package/docs/Microsoft.Quantum.Core/Repeated.md +11 -4
- package/docs/Microsoft.Quantum.Diagnostics/CheckAllZero.md +1 -1
- package/docs/Microsoft.Quantum.Diagnostics/CheckOperationsAreEqual.md +1 -1
- package/docs/Microsoft.Quantum.Diagnostics/CheckZero.md +1 -1
- package/docs/Microsoft.Quantum.Diagnostics/DumpMachine.md +1 -1
- package/docs/Microsoft.Quantum.Diagnostics/DumpRegister.md +1 -1
- package/docs/Microsoft.Quantum.Diagnostics/Fact.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/CCNOT.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/CNOT.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Exp.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/H.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/I.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/M.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Measure.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Message.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/R.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/R1.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/R1Frac.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/RFrac.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Reset.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/ResetAll.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Rx.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Rxx.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Ry.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Ryy.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Rz.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Rzz.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/S.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/SWAP.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/T.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/X.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Y.md +1 -1
- package/docs/Microsoft.Quantum.Intrinsic/Z.md +1 -1
- package/docs/Microsoft.Quantum.Logical/Xor.md +7 -4
- package/docs/Microsoft.Quantum.Math/AbsComplex.md +1 -1
- package/docs/Microsoft.Quantum.Math/AbsComplexPolar.md +1 -1
- package/docs/Microsoft.Quantum.Math/AbsD.md +1 -1
- package/docs/Microsoft.Quantum.Math/AbsI.md +1 -1
- package/docs/Microsoft.Quantum.Math/AbsL.md +1 -1
- package/docs/Microsoft.Quantum.Math/AbsSquaredComplex.md +1 -1
- package/docs/Microsoft.Quantum.Math/AbsSquaredComplexPolar.md +1 -1
- package/docs/Microsoft.Quantum.Math/ApproximateFactorial.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArcCos.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArcCosh.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArcSin.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArcSinh.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArcTan.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArcTan2.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArcTanh.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArgComplex.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArgComplexPolar.md +1 -1
- package/docs/Microsoft.Quantum.Math/Binom.md +1 -1
- package/docs/Microsoft.Quantum.Math/BitSizeI.md +1 -1
- package/docs/Microsoft.Quantum.Math/BitSizeL.md +1 -1
- package/docs/Microsoft.Quantum.Math/Ceiling.md +1 -1
- package/docs/Microsoft.Quantum.Math/Complex.md +1 -1
- package/docs/Microsoft.Quantum.Math/ComplexPolar.md +1 -1
- package/docs/Microsoft.Quantum.Math/ContinuedFractionConvergentI.md +1 -1
- package/docs/Microsoft.Quantum.Math/ContinuedFractionConvergentL.md +1 -1
- package/docs/Microsoft.Quantum.Math/Cos.md +1 -1
- package/docs/Microsoft.Quantum.Math/Cosh.md +1 -1
- package/docs/Microsoft.Quantum.Math/DivRemI.md +1 -1
- package/docs/Microsoft.Quantum.Math/DivRemL.md +1 -1
- package/docs/Microsoft.Quantum.Math/DividedByC.md +1 -1
- package/docs/Microsoft.Quantum.Math/DividedByCP.md +1 -1
- package/docs/Microsoft.Quantum.Math/E.md +10 -6
- package/docs/Microsoft.Quantum.Math/ExpModI.md +1 -1
- package/docs/Microsoft.Quantum.Math/ExpModL.md +1 -1
- package/docs/Microsoft.Quantum.Math/ExtendedGreatestCommonDivisorI.md +1 -1
- package/docs/Microsoft.Quantum.Math/ExtendedGreatestCommonDivisorL.md +1 -1
- package/docs/Microsoft.Quantum.Math/FactorialI.md +1 -1
- package/docs/Microsoft.Quantum.Math/FactorialL.md +1 -1
- package/docs/Microsoft.Quantum.Math/Floor.md +1 -1
- package/docs/Microsoft.Quantum.Math/GreatestCommonDivisorI.md +1 -1
- package/docs/Microsoft.Quantum.Math/GreatestCommonDivisorL.md +1 -1
- package/docs/Microsoft.Quantum.Math/HammingWeightI.md +1 -1
- package/docs/Microsoft.Quantum.Math/InverseModI.md +1 -1
- package/docs/Microsoft.Quantum.Math/InverseModL.md +1 -1
- package/docs/Microsoft.Quantum.Math/IsCoprimeI.md +1 -1
- package/docs/Microsoft.Quantum.Math/IsCoprimeL.md +1 -1
- package/docs/Microsoft.Quantum.Math/IsInfinite.md +1 -1
- package/docs/Microsoft.Quantum.Math/IsNaN.md +1 -1
- package/docs/Microsoft.Quantum.Math/LargestFixedPoint.md +1 -1
- package/docs/Microsoft.Quantum.Math/Lg.md +1 -1
- package/docs/Microsoft.Quantum.Math/Log.md +1 -1
- package/docs/Microsoft.Quantum.Math/Log10.md +1 -1
- package/docs/Microsoft.Quantum.Math/LogFactorialD.md +1 -1
- package/docs/Microsoft.Quantum.Math/LogGammaD.md +1 -1
- package/docs/Microsoft.Quantum.Math/LogOf2.md +9 -5
- package/docs/Microsoft.Quantum.Math/Max.md +1 -1
- package/docs/Microsoft.Quantum.Math/MaxD.md +1 -1
- package/docs/Microsoft.Quantum.Math/MaxI.md +1 -1
- package/docs/Microsoft.Quantum.Math/MaxL.md +1 -1
- package/docs/Microsoft.Quantum.Math/Min.md +1 -1
- package/docs/Microsoft.Quantum.Math/MinD.md +1 -1
- package/docs/Microsoft.Quantum.Math/MinI.md +1 -1
- package/docs/Microsoft.Quantum.Math/MinL.md +1 -1
- package/docs/Microsoft.Quantum.Math/MinusC.md +1 -1
- package/docs/Microsoft.Quantum.Math/MinusCP.md +1 -1
- package/docs/Microsoft.Quantum.Math/ModulusI.md +1 -1
- package/docs/Microsoft.Quantum.Math/ModulusL.md +1 -1
- package/docs/Microsoft.Quantum.Math/NegationC.md +1 -1
- package/docs/Microsoft.Quantum.Math/NegationCP.md +1 -1
- package/docs/Microsoft.Quantum.Math/PI.md +11 -6
- package/docs/Microsoft.Quantum.Math/PNorm.md +1 -1
- package/docs/Microsoft.Quantum.Math/PNormalized.md +1 -1
- package/docs/Microsoft.Quantum.Math/PlusC.md +1 -1
- package/docs/Microsoft.Quantum.Math/PlusCP.md +1 -1
- package/docs/Microsoft.Quantum.Math/PowC.md +1 -1
- package/docs/Microsoft.Quantum.Math/PowCP.md +1 -1
- package/docs/Microsoft.Quantum.Math/RealMod.md +1 -1
- package/docs/Microsoft.Quantum.Math/Round.md +3 -3
- package/docs/Microsoft.Quantum.Math/SignD.md +1 -1
- package/docs/Microsoft.Quantum.Math/SignI.md +1 -1
- package/docs/Microsoft.Quantum.Math/SignL.md +1 -1
- package/docs/Microsoft.Quantum.Math/Sin.md +1 -1
- package/docs/Microsoft.Quantum.Math/Sinh.md +1 -1
- package/docs/Microsoft.Quantum.Math/SmallestFixedPoint.md +1 -1
- package/docs/Microsoft.Quantum.Math/Sqrt.md +1 -1
- package/docs/Microsoft.Quantum.Math/SquaredNorm.md +1 -1
- package/docs/Microsoft.Quantum.Math/Tan.md +1 -1
- package/docs/Microsoft.Quantum.Math/Tanh.md +1 -1
- package/docs/Microsoft.Quantum.Math/TimesC.md +1 -1
- package/docs/Microsoft.Quantum.Math/TimesCP.md +1 -1
- package/docs/Microsoft.Quantum.Math/TrailingZeroCountI.md +1 -1
- package/docs/Microsoft.Quantum.Math/TrailingZeroCountL.md +1 -1
- package/docs/Microsoft.Quantum.Math/Truncate.md +1 -1
- package/docs/Microsoft.Quantum.Measurement/MResetEachZ.md +6 -1
- package/docs/Microsoft.Quantum.Measurement/MResetX.md +1 -1
- package/docs/Microsoft.Quantum.Measurement/MResetY.md +1 -1
- package/docs/Microsoft.Quantum.Measurement/MResetZ.md +1 -1
- package/docs/Microsoft.Quantum.Measurement/MeasureAllZ.md +7 -6
- package/docs/Microsoft.Quantum.Measurement/MeasureEachZ.md +19 -3
- package/docs/Microsoft.Quantum.Measurement/MeasureInteger.md +1 -1
- package/docs/Microsoft.Quantum.Random/DrawRandomDouble.md +4 -6
- package/docs/Microsoft.Quantum.Random/DrawRandomInt.md +4 -6
- package/docs/Microsoft.Quantum.ResourceEstimation/AccountForEstimates.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/AuxQubitCount.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/BeginEstimateCaching.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/BeginRepeatEstimates.md +1 -2
- package/docs/Microsoft.Quantum.ResourceEstimation/CczCount.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/EndEstimateCaching.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/EndRepeatEstimates.md +1 -2
- package/docs/Microsoft.Quantum.ResourceEstimation/MeasurementCount.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/PSSPCLayout.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/RepeatEstimates.md +1 -2
- package/docs/Microsoft.Quantum.ResourceEstimation/RotationCount.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/RotationDepth.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/SingleVariant.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/TCount.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/AddLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfEqualL.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfEqualLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterL.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterOrEqualL.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterOrEqualLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessL.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessOrEqualL.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessOrEqualLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/FourierTDIncByLE.md +3 -3
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByI.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByIUsingIncByLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByL.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLEUsingAddLE.md +4 -4
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLUsingIncByLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/LookAheadDKRSAddLE.md +4 -4
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/MAJ.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ReflectAboutInteger.md +3 -5
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryCGAddLE.md +3 -3
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryCGIncByLE.md +3 -3
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryTTKIncByLE.md +4 -5
- package/docs/Microsoft.Quantum.Unstable.StatePreparation/ApproximatelyPreparePureStateCP.md +3 -3
- package/docs/Microsoft.Quantum.Unstable.StatePreparation/PreparePureStateD.md +3 -3
- package/docs/Microsoft.Quantum.Unstable.TableLookup/Select.md +8 -8
- package/lib/node/qsc_wasm.cjs +35 -21
- package/lib/node/qsc_wasm.d.cts +7 -4
- package/lib/node/qsc_wasm_bg.wasm +0 -0
- package/lib/web/qsc_wasm.d.ts +9 -6
- package/lib/web/qsc_wasm.js +35 -21
- package/lib/web/qsc_wasm_bg.wasm +0 -0
- package/package.json +1 -1
- package/ux/estimatesPanel.tsx +1 -2
- package/ux/index.ts +1 -0
- package/ux/qsharp-ux.css +8 -0
- package/ux/reTable.tsx +7 -11
- package/ux/renderers.tsx +32 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
uid: Qdk.Microsoft.Quantum.Unstable.StatePreparation.ApproximatelyPreparePureStateCP
|
|
3
3
|
title: ApproximatelyPreparePureStateCP operation
|
|
4
|
-
ms.date:
|
|
4
|
+
ms.date: 05/06/2024 12:00:00 AM
|
|
5
5
|
ms.topic: managed-reference
|
|
6
6
|
qsharp.kind: operation
|
|
7
7
|
qsharp.namespace: Microsoft.Quantum.Unstable.StatePreparation
|
|
@@ -61,6 +61,6 @@ elements (rⱼ, tⱼ) = (0.0, 0.0) if fewer than 2ⁿ are
|
|
|
61
61
|
specified.
|
|
62
62
|
|
|
63
63
|
## References
|
|
64
|
-
-
|
|
64
|
+
- [arXiv:quant-ph/0406176](https://arxiv.org/abs/quant-ph/0406176)
|
|
65
|
+
"Synthesis of Quantum Logic Circuits",
|
|
65
66
|
Vivek V. Shende, Stephen S. Bullock, Igor L. Markov
|
|
66
|
-
https://arxiv.org/abs/quant-ph/0406176
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
uid: Qdk.Microsoft.Quantum.Unstable.StatePreparation.PreparePureStateD
|
|
3
3
|
title: PreparePureStateD operation
|
|
4
|
-
ms.date:
|
|
4
|
+
ms.date: 05/06/2024 12:00:00 AM
|
|
5
5
|
ms.topic: managed-reference
|
|
6
6
|
qsharp.kind: operation
|
|
7
7
|
qsharp.namespace: Microsoft.Quantum.Unstable.StatePreparation
|
|
@@ -56,9 +56,9 @@ PreparePureStateD(amplitudes, qubits);
|
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
## References
|
|
59
|
-
-
|
|
59
|
+
- [arXiv:quant-ph/0406176](https://arxiv.org/abs/quant-ph/0406176)
|
|
60
|
+
"Synthesis of Quantum Logic Circuits",
|
|
60
61
|
Vivek V. Shende, Stephen S. Bullock, Igor L. Markov
|
|
61
|
-
https://arxiv.org/abs/quant-ph/0406176
|
|
62
62
|
|
|
63
63
|
## See Also
|
|
64
64
|
- Microsoft.Quantum.Unstable.StatePreparation.ApproximatelyPreparePureStateCP
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
uid: Qdk.Microsoft.Quantum.Unstable.TableLookup.Select
|
|
3
3
|
title: Select operation
|
|
4
|
-
ms.date:
|
|
4
|
+
ms.date: 05/06/2024 12:00:00 AM
|
|
5
5
|
ms.topic: managed-reference
|
|
6
6
|
qsharp.kind: operation
|
|
7
7
|
qsharp.namespace: Microsoft.Quantum.Unstable.TableLookup
|
|
@@ -44,10 +44,10 @@ measurement-based unlookup operation [3]. The controlled adjoint variant
|
|
|
44
44
|
is not optimized using this technique.
|
|
45
45
|
|
|
46
46
|
## References
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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"
|
package/lib/node/qsc_wasm.cjs
CHANGED
|
@@ -455,60 +455,74 @@ module.exports.get_library_source_content = function(name) {
|
|
|
455
455
|
/**
|
|
456
456
|
* @param {string} code
|
|
457
457
|
* @param {(string)[]} language_features
|
|
458
|
+
* @param {string} profile
|
|
458
459
|
* @returns {string}
|
|
459
460
|
*/
|
|
460
|
-
module.exports.get_ast = function(code, language_features) {
|
|
461
|
-
let
|
|
462
|
-
let
|
|
461
|
+
module.exports.get_ast = function(code, language_features, profile) {
|
|
462
|
+
let deferred5_0;
|
|
463
|
+
let deferred5_1;
|
|
463
464
|
try {
|
|
464
465
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
465
466
|
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
466
467
|
const len0 = WASM_VECTOR_LEN;
|
|
467
468
|
const ptr1 = passArrayJsValueToWasm0(language_features, wasm.__wbindgen_export_0);
|
|
468
469
|
const len1 = WASM_VECTOR_LEN;
|
|
469
|
-
|
|
470
|
+
const ptr2 = passStringToWasm0(profile, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
471
|
+
const len2 = WASM_VECTOR_LEN;
|
|
472
|
+
wasm.get_ast(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
470
473
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
471
474
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
476
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
477
|
+
var ptr4 = r0;
|
|
478
|
+
var len4 = r1;
|
|
479
|
+
if (r3) {
|
|
480
|
+
ptr4 = 0; len4 = 0;
|
|
481
|
+
throw takeObject(r2);
|
|
482
|
+
}
|
|
483
|
+
deferred5_0 = ptr4;
|
|
484
|
+
deferred5_1 = len4;
|
|
485
|
+
return getStringFromWasm0(ptr4, len4);
|
|
475
486
|
} finally {
|
|
476
487
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
477
|
-
wasm.__wbindgen_export_4(
|
|
488
|
+
wasm.__wbindgen_export_4(deferred5_0, deferred5_1, 1);
|
|
478
489
|
}
|
|
479
490
|
};
|
|
480
491
|
|
|
481
492
|
/**
|
|
482
493
|
* @param {string} code
|
|
483
494
|
* @param {(string)[]} language_features
|
|
495
|
+
* @param {string} profile
|
|
484
496
|
* @returns {string}
|
|
485
497
|
*/
|
|
486
|
-
module.exports.get_hir = function(code, language_features) {
|
|
487
|
-
let
|
|
488
|
-
let
|
|
498
|
+
module.exports.get_hir = function(code, language_features, profile) {
|
|
499
|
+
let deferred5_0;
|
|
500
|
+
let deferred5_1;
|
|
489
501
|
try {
|
|
490
502
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
491
503
|
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
492
504
|
const len0 = WASM_VECTOR_LEN;
|
|
493
505
|
const ptr1 = passArrayJsValueToWasm0(language_features, wasm.__wbindgen_export_0);
|
|
494
506
|
const len1 = WASM_VECTOR_LEN;
|
|
495
|
-
|
|
507
|
+
const ptr2 = passStringToWasm0(profile, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
508
|
+
const len2 = WASM_VECTOR_LEN;
|
|
509
|
+
wasm.get_hir(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
496
510
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
497
511
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
498
512
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
499
513
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
500
|
-
var
|
|
501
|
-
var
|
|
514
|
+
var ptr4 = r0;
|
|
515
|
+
var len4 = r1;
|
|
502
516
|
if (r3) {
|
|
503
|
-
|
|
517
|
+
ptr4 = 0; len4 = 0;
|
|
504
518
|
throw takeObject(r2);
|
|
505
519
|
}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
return getStringFromWasm0(
|
|
520
|
+
deferred5_0 = ptr4;
|
|
521
|
+
deferred5_1 = len4;
|
|
522
|
+
return getStringFromWasm0(ptr4, len4);
|
|
509
523
|
} finally {
|
|
510
524
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
511
|
-
wasm.__wbindgen_export_4(
|
|
525
|
+
wasm.__wbindgen_export_4(deferred5_0, deferred5_1, 1);
|
|
512
526
|
}
|
|
513
527
|
};
|
|
514
528
|
|
|
@@ -1499,8 +1513,8 @@ module.exports.__wbindgen_memory = function() {
|
|
|
1499
1513
|
return addHeapObject(ret);
|
|
1500
1514
|
};
|
|
1501
1515
|
|
|
1502
|
-
module.exports.
|
|
1503
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1516
|
+
module.exports.__wbindgen_closure_wrapper747 = function(arg0, arg1, arg2) {
|
|
1517
|
+
const ret = makeMutClosure(arg0, arg1, 299, __wbg_adapter_54);
|
|
1504
1518
|
return addHeapObject(ret);
|
|
1505
1519
|
};
|
|
1506
1520
|
|
package/lib/node/qsc_wasm.d.cts
CHANGED
|
@@ -44,15 +44,17 @@ export function get_library_source_content(name: string): string | undefined;
|
|
|
44
44
|
/**
|
|
45
45
|
* @param {string} code
|
|
46
46
|
* @param {(string)[]} language_features
|
|
47
|
+
* @param {string} profile
|
|
47
48
|
* @returns {string}
|
|
48
49
|
*/
|
|
49
|
-
export function get_ast(code: string, language_features: (string)[]): string;
|
|
50
|
+
export function get_ast(code: string, language_features: (string)[], profile: string): string;
|
|
50
51
|
/**
|
|
51
52
|
* @param {string} code
|
|
52
53
|
* @param {(string)[]} language_features
|
|
54
|
+
* @param {string} profile
|
|
53
55
|
* @returns {string}
|
|
54
56
|
*/
|
|
55
|
-
export function get_hir(code: string, language_features: (string)[]): string;
|
|
57
|
+
export function get_hir(code: string, language_features: (string)[], profile: string): string;
|
|
56
58
|
/**
|
|
57
59
|
* @param {(Array<any>)[]} sources
|
|
58
60
|
* @param {string} expr
|
|
@@ -220,8 +222,9 @@ export interface ICell {
|
|
|
220
222
|
}
|
|
221
223
|
|
|
222
224
|
export interface INotebookMetadata {
|
|
223
|
-
targetProfile?: "base" | "
|
|
225
|
+
targetProfile?: "base" | "adaptive_ri" | "unrestricted";
|
|
224
226
|
languageFeatures?: "v2-preview-syntax"[];
|
|
227
|
+
manifest?: string;
|
|
225
228
|
}
|
|
226
229
|
|
|
227
230
|
export interface IPosition {
|
|
@@ -246,7 +249,7 @@ export interface IDocFile {
|
|
|
246
249
|
}
|
|
247
250
|
|
|
248
251
|
|
|
249
|
-
export type TargetProfile = "base" | "
|
|
252
|
+
export type TargetProfile = "base" | "adaptive_ri" |"unrestricted";
|
|
250
253
|
|
|
251
254
|
|
|
252
255
|
/**
|
|
Binary file
|
package/lib/web/qsc_wasm.d.ts
CHANGED
|
@@ -44,15 +44,17 @@ export function get_library_source_content(name: string): string | undefined;
|
|
|
44
44
|
/**
|
|
45
45
|
* @param {string} code
|
|
46
46
|
* @param {(string)[]} language_features
|
|
47
|
+
* @param {string} profile
|
|
47
48
|
* @returns {string}
|
|
48
49
|
*/
|
|
49
|
-
export function get_ast(code: string, language_features: (string)[]): string;
|
|
50
|
+
export function get_ast(code: string, language_features: (string)[], profile: string): string;
|
|
50
51
|
/**
|
|
51
52
|
* @param {string} code
|
|
52
53
|
* @param {(string)[]} language_features
|
|
54
|
+
* @param {string} profile
|
|
53
55
|
* @returns {string}
|
|
54
56
|
*/
|
|
55
|
-
export function get_hir(code: string, language_features: (string)[]): string;
|
|
57
|
+
export function get_hir(code: string, language_features: (string)[], profile: string): string;
|
|
56
58
|
/**
|
|
57
59
|
* @param {(Array<any>)[]} sources
|
|
58
60
|
* @param {string} expr
|
|
@@ -220,8 +222,9 @@ export interface ICell {
|
|
|
220
222
|
}
|
|
221
223
|
|
|
222
224
|
export interface INotebookMetadata {
|
|
223
|
-
targetProfile?: "base" | "
|
|
225
|
+
targetProfile?: "base" | "adaptive_ri" | "unrestricted";
|
|
224
226
|
languageFeatures?: "v2-preview-syntax"[];
|
|
227
|
+
manifest?: string;
|
|
225
228
|
}
|
|
226
229
|
|
|
227
230
|
export interface IPosition {
|
|
@@ -246,7 +249,7 @@ export interface IDocFile {
|
|
|
246
249
|
}
|
|
247
250
|
|
|
248
251
|
|
|
249
|
-
export type TargetProfile = "base" | "
|
|
252
|
+
export type TargetProfile = "base" | "adaptive_ri" |"unrestricted";
|
|
250
253
|
|
|
251
254
|
|
|
252
255
|
/**
|
|
@@ -470,8 +473,8 @@ export interface InitOutput {
|
|
|
470
473
|
readonly get_estimates: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
471
474
|
readonly get_circuit: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
472
475
|
readonly get_library_source_content: (a: number, b: number, c: number) => void;
|
|
473
|
-
readonly get_ast: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
474
|
-
readonly get_hir: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
476
|
+
readonly get_ast: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
477
|
+
readonly get_hir: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
475
478
|
readonly run: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
476
479
|
readonly check_exercise_solution: (a: number, b: number, c: number, d: number) => number;
|
|
477
480
|
readonly generate_docs: (a: number) => void;
|
package/lib/web/qsc_wasm.js
CHANGED
|
@@ -452,60 +452,74 @@ export function get_library_source_content(name) {
|
|
|
452
452
|
/**
|
|
453
453
|
* @param {string} code
|
|
454
454
|
* @param {(string)[]} language_features
|
|
455
|
+
* @param {string} profile
|
|
455
456
|
* @returns {string}
|
|
456
457
|
*/
|
|
457
|
-
export function get_ast(code, language_features) {
|
|
458
|
-
let
|
|
459
|
-
let
|
|
458
|
+
export function get_ast(code, language_features, profile) {
|
|
459
|
+
let deferred5_0;
|
|
460
|
+
let deferred5_1;
|
|
460
461
|
try {
|
|
461
462
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
462
463
|
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
463
464
|
const len0 = WASM_VECTOR_LEN;
|
|
464
465
|
const ptr1 = passArrayJsValueToWasm0(language_features, wasm.__wbindgen_export_0);
|
|
465
466
|
const len1 = WASM_VECTOR_LEN;
|
|
466
|
-
|
|
467
|
+
const ptr2 = passStringToWasm0(profile, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
468
|
+
const len2 = WASM_VECTOR_LEN;
|
|
469
|
+
wasm.get_ast(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
467
470
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
468
471
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
473
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
474
|
+
var ptr4 = r0;
|
|
475
|
+
var len4 = r1;
|
|
476
|
+
if (r3) {
|
|
477
|
+
ptr4 = 0; len4 = 0;
|
|
478
|
+
throw takeObject(r2);
|
|
479
|
+
}
|
|
480
|
+
deferred5_0 = ptr4;
|
|
481
|
+
deferred5_1 = len4;
|
|
482
|
+
return getStringFromWasm0(ptr4, len4);
|
|
472
483
|
} finally {
|
|
473
484
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
474
|
-
wasm.__wbindgen_export_4(
|
|
485
|
+
wasm.__wbindgen_export_4(deferred5_0, deferred5_1, 1);
|
|
475
486
|
}
|
|
476
487
|
}
|
|
477
488
|
|
|
478
489
|
/**
|
|
479
490
|
* @param {string} code
|
|
480
491
|
* @param {(string)[]} language_features
|
|
492
|
+
* @param {string} profile
|
|
481
493
|
* @returns {string}
|
|
482
494
|
*/
|
|
483
|
-
export function get_hir(code, language_features) {
|
|
484
|
-
let
|
|
485
|
-
let
|
|
495
|
+
export function get_hir(code, language_features, profile) {
|
|
496
|
+
let deferred5_0;
|
|
497
|
+
let deferred5_1;
|
|
486
498
|
try {
|
|
487
499
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
488
500
|
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
489
501
|
const len0 = WASM_VECTOR_LEN;
|
|
490
502
|
const ptr1 = passArrayJsValueToWasm0(language_features, wasm.__wbindgen_export_0);
|
|
491
503
|
const len1 = WASM_VECTOR_LEN;
|
|
492
|
-
|
|
504
|
+
const ptr2 = passStringToWasm0(profile, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
505
|
+
const len2 = WASM_VECTOR_LEN;
|
|
506
|
+
wasm.get_hir(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
493
507
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
494
508
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
495
509
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
496
510
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
497
|
-
var
|
|
498
|
-
var
|
|
511
|
+
var ptr4 = r0;
|
|
512
|
+
var len4 = r1;
|
|
499
513
|
if (r3) {
|
|
500
|
-
|
|
514
|
+
ptr4 = 0; len4 = 0;
|
|
501
515
|
throw takeObject(r2);
|
|
502
516
|
}
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
return getStringFromWasm0(
|
|
517
|
+
deferred5_0 = ptr4;
|
|
518
|
+
deferred5_1 = len4;
|
|
519
|
+
return getStringFromWasm0(ptr4, len4);
|
|
506
520
|
} finally {
|
|
507
521
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
508
|
-
wasm.__wbindgen_export_4(
|
|
522
|
+
wasm.__wbindgen_export_4(deferred5_0, deferred5_1, 1);
|
|
509
523
|
}
|
|
510
524
|
}
|
|
511
525
|
|
|
@@ -1447,8 +1461,8 @@ function __wbg_get_imports() {
|
|
|
1447
1461
|
const ret = wasm.memory;
|
|
1448
1462
|
return addHeapObject(ret);
|
|
1449
1463
|
};
|
|
1450
|
-
imports.wbg.
|
|
1451
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1464
|
+
imports.wbg.__wbindgen_closure_wrapper747 = function(arg0, arg1, arg2) {
|
|
1465
|
+
const ret = makeMutClosure(arg0, arg1, 299, __wbg_adapter_54);
|
|
1452
1466
|
return addHeapObject(ret);
|
|
1453
1467
|
};
|
|
1454
1468
|
|
package/lib/web/qsc_wasm_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/ux/estimatesPanel.tsx
CHANGED
|
@@ -13,7 +13,6 @@ export function EstimatesPanel(props: {
|
|
|
13
13
|
colors: string[];
|
|
14
14
|
runNames: string[];
|
|
15
15
|
calculating: boolean;
|
|
16
|
-
renderer: (input: string) => string;
|
|
17
16
|
onRowDeleted: (rowId: string) => void;
|
|
18
17
|
}) {
|
|
19
18
|
const [estimate, setEstimate] = useState<SingleEstimateResult | null>(null);
|
|
@@ -77,7 +76,7 @@ export function EstimatesPanel(props: {
|
|
|
77
76
|
<summary style="font-size: 1.5em; font-weight: bold; margin: 24px 8px;">
|
|
78
77
|
Resource Estimates
|
|
79
78
|
</summary>
|
|
80
|
-
<ReTable
|
|
79
|
+
<ReTable estimatesData={estimate} />
|
|
81
80
|
</details>
|
|
82
81
|
</>
|
|
83
82
|
)}
|
package/ux/index.ts
CHANGED
|
@@ -19,3 +19,4 @@ export { ScatterChart } from "./scatterChart.js";
|
|
|
19
19
|
export { EstimatesOverview } from "./estimatesOverview.js";
|
|
20
20
|
export { EstimatesPanel } from "./estimatesPanel.js";
|
|
21
21
|
export { Circuit, CircuitPanel } from "./circuit.js";
|
|
22
|
+
export { setRenderer, Markdown } from "./renderers.js";
|
package/ux/qsharp-ux.css
CHANGED
package/ux/reTable.tsx
CHANGED
|
@@ -4,11 +4,9 @@
|
|
|
4
4
|
import { useState } from "preact/hooks";
|
|
5
5
|
import { SingleEstimateResult } from "./data.js";
|
|
6
6
|
import { CreateReport } from "./report.js";
|
|
7
|
+
import { Markdown } from "./renderers.js";
|
|
7
8
|
|
|
8
|
-
export function ReTable(props: {
|
|
9
|
-
mdRenderer: (input: string) => string;
|
|
10
|
-
estimatesData: SingleEstimateResult;
|
|
11
|
-
}) {
|
|
9
|
+
export function ReTable(props: { estimatesData: SingleEstimateResult }) {
|
|
12
10
|
const [showDetail, setShowDetail] = useState(false);
|
|
13
11
|
const toggleDetail = () => {
|
|
14
12
|
setShowDetail(!showDetail);
|
|
@@ -45,9 +43,6 @@ export function ReTable(props: {
|
|
|
45
43
|
if (typeof value === "object") {
|
|
46
44
|
value = JSON.stringify(value);
|
|
47
45
|
}
|
|
48
|
-
const renderedExplanation = {
|
|
49
|
-
__html: props.mdRenderer(entry.explanation),
|
|
50
|
-
};
|
|
51
46
|
return (
|
|
52
47
|
<tr>
|
|
53
48
|
<td className="estimate-cell title-cell">{entry.label}</td>
|
|
@@ -57,9 +52,9 @@ export function ReTable(props: {
|
|
|
57
52
|
<>
|
|
58
53
|
<strong>{entry.description}</strong>
|
|
59
54
|
<hr />
|
|
60
|
-
<
|
|
55
|
+
<Markdown
|
|
61
56
|
className="estimate-explanation"
|
|
62
|
-
|
|
57
|
+
markdown={entry.explanation}
|
|
63
58
|
/>
|
|
64
59
|
</>
|
|
65
60
|
) : (
|
|
@@ -81,9 +76,10 @@ export function ReTable(props: {
|
|
|
81
76
|
</summary>
|
|
82
77
|
<ul className="estimate-table">
|
|
83
78
|
{reportData.assumptions.map((assumption) => (
|
|
84
|
-
<
|
|
79
|
+
<Markdown
|
|
85
80
|
className="estimate-assumption"
|
|
86
|
-
|
|
81
|
+
markdown={assumption}
|
|
82
|
+
tagName="li"
|
|
87
83
|
/>
|
|
88
84
|
))}
|
|
89
85
|
</ul>
|
package/ux/renderers.tsx
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import { createElement } from "preact";
|
|
5
|
+
|
|
6
|
+
// Default renderer to be replaced before components are first used.
|
|
7
|
+
// Expectation is that this will convert markdown and/or LaTeX to HTML.
|
|
8
|
+
let theRenderer = function (input: string): string {
|
|
9
|
+
const err = "ERROR: Rendered has not been set";
|
|
10
|
+
console.error(err);
|
|
11
|
+
return err + ". " + input;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export function setRenderer(renderer: (input: string) => string) {
|
|
15
|
+
theRenderer = renderer;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function Markdown(props: {
|
|
19
|
+
markdown: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
tagName?: string;
|
|
22
|
+
}) {
|
|
23
|
+
const tag = props.tagName || "div";
|
|
24
|
+
const nodeProps = {
|
|
25
|
+
className: props.className,
|
|
26
|
+
dangerouslySetInnerHTML: {
|
|
27
|
+
__html: theRenderer(props.markdown),
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return createElement(tag, nodeProps);
|
|
32
|
+
}
|