qsharp-lang 1.3.4-dev → 1.3.6-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.d.ts +2 -2
- package/dist/compiler/compiler.d.ts +11 -5
- package/dist/compiler/compiler.js +15 -6
- package/dist/debug-service/debug-service.d.ts +2 -2
- package/dist/katas-content.generated.js +306 -76
- package/dist/language-service/language-service.d.ts +2 -2
- package/dist/main.d.ts +1 -1
- package/dist/main.js +12 -18
- package/dist/workers/common.d.ts +1 -1
- package/dist/workers/node.js +2 -1
- package/docs/Microsoft.Quantum.Arrays/All.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Any.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Chunks.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/CircularlyShifted.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/ColumnAt.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Count.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Diagonal.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/DrawMany.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Enumerated.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Excluding.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Filtered.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/FlatMapped.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Flattened.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Fold.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/ForEach.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Head.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/HeadAndRest.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/IndexOf.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/IndexRange.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Interleaved.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/IsEmpty.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/IsRectangularArray.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/IsSorted.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/IsSquareArray.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Mapped.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/MappedByIndex.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/MappedOverRange.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Most.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/MostAndTail.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Padded.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Partitioned.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Rest.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Reversed.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/SequenceI.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/SequenceL.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Sorted.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Subarray.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Swapped.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Tail.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Transposed.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Unzipped.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Where.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Windows.md +1 -1
- package/docs/Microsoft.Quantum.Arrays/Zipped.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyCNOTChain.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyControlledOnBitString.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyControlledOnInt.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyP.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyPauli.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyPauliFromBitString.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyPauliFromInt.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyQFT.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyToEach.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyToEachA.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyToEachC.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyToEachCA.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyXorInPlace.md +1 -1
- package/docs/Microsoft.Quantum.Canon/ApplyXorInPlaceL.md +1 -1
- package/docs/Microsoft.Quantum.Canon/CX.md +1 -1
- package/docs/Microsoft.Quantum.Canon/CY.md +1 -1
- package/docs/Microsoft.Quantum.Canon/CZ.md +1 -1
- package/docs/Microsoft.Quantum.Canon/Fst.md +1 -1
- package/docs/Microsoft.Quantum.Canon/Snd.md +1 -1
- package/docs/Microsoft.Quantum.Canon/SwapReverseRegister.md +1 -1
- package/docs/Microsoft.Quantum.Convert/BigIntAsBoolArray.md +1 -1
- package/docs/Microsoft.Quantum.Convert/BoolArrayAsBigInt.md +1 -1
- package/docs/Microsoft.Quantum.Convert/BoolArrayAsInt.md +1 -1
- package/docs/Microsoft.Quantum.Convert/BoolArrayAsResultArray.md +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 +1 -1
- package/docs/Microsoft.Quantum.Convert/IntAsBoolArray.md +1 -1
- package/docs/Microsoft.Quantum.Convert/IntAsDouble.md +1 -1
- package/docs/Microsoft.Quantum.Convert/ResultArrayAsBoolArray.md +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 +1 -1
- package/docs/Microsoft.Quantum.Core/RangeEnd.md +1 -1
- package/docs/Microsoft.Quantum.Core/RangeReverse.md +1 -1
- package/docs/Microsoft.Quantum.Core/RangeStart.md +1 -1
- package/docs/Microsoft.Quantum.Core/RangeStep.md +1 -1
- package/docs/Microsoft.Quantum.Core/Repeated.md +1 -1
- package/docs/Microsoft.Quantum.Diagnostics/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 +1 -1
- package/docs/Microsoft.Quantum.Math/AbsComplex.md +1 -1
- package/docs/Microsoft.Quantum.Math/AbsComplexPolar.md +1 -1
- package/docs/Microsoft.Quantum.Math/AbsD.md +1 -1
- package/docs/Microsoft.Quantum.Math/AbsI.md +1 -1
- package/docs/Microsoft.Quantum.Math/AbsL.md +1 -1
- package/docs/Microsoft.Quantum.Math/AbsSquaredComplex.md +1 -1
- package/docs/Microsoft.Quantum.Math/AbsSquaredComplexPolar.md +1 -1
- package/docs/Microsoft.Quantum.Math/ApproximateFactorial.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArcCos.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArcCosh.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArcSin.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArcSinh.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArcTan.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArcTan2.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArcTanh.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArgComplex.md +1 -1
- package/docs/Microsoft.Quantum.Math/ArgComplexPolar.md +1 -1
- package/docs/Microsoft.Quantum.Math/Binom.md +1 -1
- package/docs/Microsoft.Quantum.Math/BitSizeI.md +1 -1
- package/docs/Microsoft.Quantum.Math/BitSizeL.md +1 -1
- package/docs/Microsoft.Quantum.Math/Ceiling.md +1 -1
- package/docs/Microsoft.Quantum.Math/Complex.md +1 -1
- package/docs/Microsoft.Quantum.Math/ComplexPolar.md +1 -1
- package/docs/Microsoft.Quantum.Math/ContinuedFractionConvergentI.md +1 -1
- package/docs/Microsoft.Quantum.Math/ContinuedFractionConvergentL.md +1 -1
- package/docs/Microsoft.Quantum.Math/Cos.md +1 -1
- package/docs/Microsoft.Quantum.Math/Cosh.md +1 -1
- package/docs/Microsoft.Quantum.Math/DivRemI.md +1 -1
- package/docs/Microsoft.Quantum.Math/DivRemL.md +1 -1
- package/docs/Microsoft.Quantum.Math/DividedByC.md +1 -1
- package/docs/Microsoft.Quantum.Math/DividedByCP.md +1 -1
- package/docs/Microsoft.Quantum.Math/E.md +1 -1
- package/docs/Microsoft.Quantum.Math/ExpModI.md +1 -1
- package/docs/Microsoft.Quantum.Math/ExpModL.md +1 -1
- package/docs/Microsoft.Quantum.Math/ExtendedGreatestCommonDivisorI.md +1 -1
- package/docs/Microsoft.Quantum.Math/ExtendedGreatestCommonDivisorL.md +1 -1
- package/docs/Microsoft.Quantum.Math/FactorialI.md +1 -1
- package/docs/Microsoft.Quantum.Math/FactorialL.md +1 -1
- package/docs/Microsoft.Quantum.Math/Floor.md +1 -1
- package/docs/Microsoft.Quantum.Math/GreatestCommonDivisorI.md +1 -1
- package/docs/Microsoft.Quantum.Math/GreatestCommonDivisorL.md +1 -1
- package/docs/Microsoft.Quantum.Math/HammingWeightI.md +1 -1
- package/docs/Microsoft.Quantum.Math/InverseModI.md +1 -1
- package/docs/Microsoft.Quantum.Math/InverseModL.md +1 -1
- package/docs/Microsoft.Quantum.Math/IsCoprimeI.md +1 -1
- package/docs/Microsoft.Quantum.Math/IsCoprimeL.md +1 -1
- package/docs/Microsoft.Quantum.Math/IsInfinite.md +1 -1
- package/docs/Microsoft.Quantum.Math/IsNaN.md +1 -1
- package/docs/Microsoft.Quantum.Math/LargestFixedPoint.md +1 -1
- package/docs/Microsoft.Quantum.Math/Lg.md +1 -1
- package/docs/Microsoft.Quantum.Math/Log.md +1 -1
- package/docs/Microsoft.Quantum.Math/Log10.md +1 -1
- package/docs/Microsoft.Quantum.Math/LogFactorialD.md +1 -1
- package/docs/Microsoft.Quantum.Math/LogGammaD.md +1 -1
- package/docs/Microsoft.Quantum.Math/LogOf2.md +1 -1
- package/docs/Microsoft.Quantum.Math/Max.md +1 -1
- package/docs/Microsoft.Quantum.Math/MaxD.md +1 -1
- package/docs/Microsoft.Quantum.Math/MaxI.md +1 -1
- package/docs/Microsoft.Quantum.Math/MaxL.md +1 -1
- package/docs/Microsoft.Quantum.Math/Min.md +1 -1
- package/docs/Microsoft.Quantum.Math/MinD.md +1 -1
- package/docs/Microsoft.Quantum.Math/MinI.md +1 -1
- package/docs/Microsoft.Quantum.Math/MinL.md +1 -1
- package/docs/Microsoft.Quantum.Math/MinusC.md +1 -1
- package/docs/Microsoft.Quantum.Math/MinusCP.md +1 -1
- package/docs/Microsoft.Quantum.Math/ModulusI.md +1 -1
- package/docs/Microsoft.Quantum.Math/ModulusL.md +1 -1
- package/docs/Microsoft.Quantum.Math/NegationC.md +1 -1
- package/docs/Microsoft.Quantum.Math/NegationCP.md +1 -1
- package/docs/Microsoft.Quantum.Math/PI.md +1 -1
- package/docs/Microsoft.Quantum.Math/PNorm.md +1 -1
- package/docs/Microsoft.Quantum.Math/PNormalized.md +1 -1
- package/docs/Microsoft.Quantum.Math/PlusC.md +1 -1
- package/docs/Microsoft.Quantum.Math/PlusCP.md +1 -1
- package/docs/Microsoft.Quantum.Math/PowC.md +1 -1
- package/docs/Microsoft.Quantum.Math/PowCP.md +1 -1
- package/docs/Microsoft.Quantum.Math/RealMod.md +1 -1
- package/docs/Microsoft.Quantum.Math/Round.md +1 -1
- package/docs/Microsoft.Quantum.Math/SignD.md +1 -1
- package/docs/Microsoft.Quantum.Math/SignI.md +1 -1
- package/docs/Microsoft.Quantum.Math/SignL.md +1 -1
- package/docs/Microsoft.Quantum.Math/Sin.md +1 -1
- package/docs/Microsoft.Quantum.Math/Sinh.md +1 -1
- package/docs/Microsoft.Quantum.Math/SmallestFixedPoint.md +1 -1
- package/docs/Microsoft.Quantum.Math/Sqrt.md +1 -1
- package/docs/Microsoft.Quantum.Math/SquaredNorm.md +1 -1
- package/docs/Microsoft.Quantum.Math/Tan.md +1 -1
- package/docs/Microsoft.Quantum.Math/Tanh.md +1 -1
- package/docs/Microsoft.Quantum.Math/TimesC.md +1 -1
- package/docs/Microsoft.Quantum.Math/TimesCP.md +1 -1
- package/docs/Microsoft.Quantum.Math/TrailingZeroCountI.md +1 -1
- package/docs/Microsoft.Quantum.Math/TrailingZeroCountL.md +1 -1
- package/docs/Microsoft.Quantum.Math/Truncate.md +1 -1
- package/docs/Microsoft.Quantum.Measurement/MResetEachZ.md +1 -1
- package/docs/Microsoft.Quantum.Measurement/MResetX.md +1 -1
- package/docs/Microsoft.Quantum.Measurement/MResetY.md +1 -1
- package/docs/Microsoft.Quantum.Measurement/MResetZ.md +1 -1
- package/docs/Microsoft.Quantum.Measurement/MeasureAllZ.md +1 -1
- package/docs/Microsoft.Quantum.Measurement/MeasureEachZ.md +1 -1
- package/docs/Microsoft.Quantum.Measurement/MeasureInteger.md +1 -1
- package/docs/Microsoft.Quantum.Random/DrawRandomDouble.md +1 -1
- package/docs/Microsoft.Quantum.Random/DrawRandomInt.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/AccountForEstimates.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/AuxQubitCount.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/BeginEstimateCaching.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/BeginRepeatEstimates.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/CczCount.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/EndEstimateCaching.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/EndRepeatEstimates.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/MeasurementCount.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/PSSPCLayout.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/RepeatEstimates.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/RotationCount.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/RotationDepth.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/SingleVariant.md +1 -1
- package/docs/Microsoft.Quantum.ResourceEstimation/TCount.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/AddLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfEqualL.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfEqualLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterL.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterOrEqualL.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfGreaterOrEqualLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessL.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessOrEqualL.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ApplyIfLessOrEqualLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/FourierTDIncByLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByI.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByIUsingIncByLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByL.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLEUsingAddLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/IncByLUsingIncByLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/LookAheadDKRSAddLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/MAJ.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/ReflectAboutInteger.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryCGAddLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryCGIncByLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.Arithmetic/RippleCarryTTKIncByLE.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.StatePreparation/ApproximatelyPreparePureStateCP.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.StatePreparation/PreparePureStateD.md +1 -1
- package/docs/Microsoft.Quantum.Unstable.TableLookup/Select.md +1 -1
- package/lib/node/qsc_wasm.cjs +60 -21
- package/lib/node/qsc_wasm.d.cts +21 -7
- package/lib/node/qsc_wasm_bg.wasm +0 -0
- package/lib/web/qsc_wasm.d.ts +25 -10
- package/lib/web/qsc_wasm.js +60 -21
- package/lib/web/qsc_wasm_bg.wasm +0 -0
- package/package.json +3 -3
- package/ux/circuit.tsx +157 -59
- package/ux/data.ts +4 -1
- package/ux/estimatesPanel.tsx +2 -10
- package/ux/qsharp-ux.css +8 -0
- package/ux/spinner.tsx +17 -0
- package/ux/tsconfig.json +2 -1
package/lib/web/qsc_wasm.js
CHANGED
|
@@ -325,34 +325,37 @@ export function git_hash() {
|
|
|
325
325
|
/**
|
|
326
326
|
* @param {(Array<any>)[]} sources
|
|
327
327
|
* @param {(string)[]} language_features
|
|
328
|
+
* @param {string} profile
|
|
328
329
|
* @returns {string}
|
|
329
330
|
*/
|
|
330
|
-
export function get_qir(sources, language_features) {
|
|
331
|
-
let
|
|
332
|
-
let
|
|
331
|
+
export function get_qir(sources, language_features, profile) {
|
|
332
|
+
let deferred5_0;
|
|
333
|
+
let deferred5_1;
|
|
333
334
|
try {
|
|
334
335
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
335
336
|
const ptr0 = passArrayJsValueToWasm0(sources, wasm.__wbindgen_export_0);
|
|
336
337
|
const len0 = WASM_VECTOR_LEN;
|
|
337
338
|
const ptr1 = passArrayJsValueToWasm0(language_features, wasm.__wbindgen_export_0);
|
|
338
339
|
const len1 = WASM_VECTOR_LEN;
|
|
339
|
-
|
|
340
|
+
const ptr2 = passStringToWasm0(profile, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
341
|
+
const len2 = WASM_VECTOR_LEN;
|
|
342
|
+
wasm.get_qir(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
340
343
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
341
344
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
342
345
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
343
346
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
344
|
-
var
|
|
345
|
-
var
|
|
347
|
+
var ptr4 = r0;
|
|
348
|
+
var len4 = r1;
|
|
346
349
|
if (r3) {
|
|
347
|
-
|
|
350
|
+
ptr4 = 0; len4 = 0;
|
|
348
351
|
throw takeObject(r2);
|
|
349
352
|
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
return getStringFromWasm0(
|
|
353
|
+
deferred5_0 = ptr4;
|
|
354
|
+
deferred5_1 = len4;
|
|
355
|
+
return getStringFromWasm0(ptr4, len4);
|
|
353
356
|
} finally {
|
|
354
357
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
355
|
-
wasm.__wbindgen_export_4(
|
|
358
|
+
wasm.__wbindgen_export_4(deferred5_0, deferred5_1, 1);
|
|
356
359
|
}
|
|
357
360
|
}
|
|
358
361
|
|
|
@@ -396,11 +399,12 @@ export function get_estimates(sources, params, language_features) {
|
|
|
396
399
|
/**
|
|
397
400
|
* @param {(Array<any>)[]} sources
|
|
398
401
|
* @param {string} targetProfile
|
|
399
|
-
* @param {IOperationInfo | undefined} operation
|
|
400
402
|
* @param {(string)[]} language_features
|
|
403
|
+
* @param {boolean} simulate
|
|
404
|
+
* @param {IOperationInfo | undefined} [operation]
|
|
401
405
|
* @returns {any}
|
|
402
406
|
*/
|
|
403
|
-
export function get_circuit(sources, targetProfile,
|
|
407
|
+
export function get_circuit(sources, targetProfile, language_features, simulate, operation) {
|
|
404
408
|
try {
|
|
405
409
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
406
410
|
const ptr0 = passArrayJsValueToWasm0(sources, wasm.__wbindgen_export_0);
|
|
@@ -409,7 +413,7 @@ export function get_circuit(sources, targetProfile, operation, language_features
|
|
|
409
413
|
const len1 = WASM_VECTOR_LEN;
|
|
410
414
|
const ptr2 = passArrayJsValueToWasm0(language_features, wasm.__wbindgen_export_0);
|
|
411
415
|
const len2 = WASM_VECTOR_LEN;
|
|
412
|
-
wasm.get_circuit(retptr, ptr0, len0, ptr1, len1, isLikeNone(operation) ? 0 : addHeapObject(operation)
|
|
416
|
+
wasm.get_circuit(retptr, ptr0, len0, ptr1, len1, ptr2, len2, simulate, isLikeNone(operation) ? 0 : addHeapObject(operation));
|
|
413
417
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
414
418
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
415
419
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -445,6 +449,32 @@ export function get_library_source_content(name) {
|
|
|
445
449
|
}
|
|
446
450
|
}
|
|
447
451
|
|
|
452
|
+
/**
|
|
453
|
+
* @param {string} code
|
|
454
|
+
* @param {(string)[]} language_features
|
|
455
|
+
* @returns {string}
|
|
456
|
+
*/
|
|
457
|
+
export function get_ast(code, language_features) {
|
|
458
|
+
let deferred3_0;
|
|
459
|
+
let deferred3_1;
|
|
460
|
+
try {
|
|
461
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
462
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
463
|
+
const len0 = WASM_VECTOR_LEN;
|
|
464
|
+
const ptr1 = passArrayJsValueToWasm0(language_features, wasm.__wbindgen_export_0);
|
|
465
|
+
const len1 = WASM_VECTOR_LEN;
|
|
466
|
+
wasm.get_ast(retptr, ptr0, len0, ptr1, len1);
|
|
467
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
468
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
469
|
+
deferred3_0 = r0;
|
|
470
|
+
deferred3_1 = r1;
|
|
471
|
+
return getStringFromWasm0(r0, r1);
|
|
472
|
+
} finally {
|
|
473
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
474
|
+
wasm.__wbindgen_export_4(deferred3_0, deferred3_1, 1);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
|
|
448
478
|
/**
|
|
449
479
|
* @param {string} code
|
|
450
480
|
* @param {(string)[]} language_features
|
|
@@ -528,11 +558,20 @@ export function check_exercise_solution(solution_code, exercise_sources_js, even
|
|
|
528
558
|
}
|
|
529
559
|
|
|
530
560
|
/**
|
|
531
|
-
* @returns {
|
|
561
|
+
* @returns {(IDocFile)[]}
|
|
532
562
|
*/
|
|
533
563
|
export function generate_docs() {
|
|
534
|
-
|
|
535
|
-
|
|
564
|
+
try {
|
|
565
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
566
|
+
wasm.generate_docs(retptr);
|
|
567
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
568
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
569
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
570
|
+
wasm.__wbindgen_export_4(r0, r1 * 4, 4);
|
|
571
|
+
return v1;
|
|
572
|
+
} finally {
|
|
573
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
574
|
+
}
|
|
536
575
|
}
|
|
537
576
|
|
|
538
577
|
function handleError(f, args) {
|
|
@@ -542,7 +581,7 @@ function handleError(f, args) {
|
|
|
542
581
|
wasm.__wbindgen_export_5(addHeapObject(e));
|
|
543
582
|
}
|
|
544
583
|
}
|
|
545
|
-
function
|
|
584
|
+
function __wbg_adapter_175(arg0, arg1, arg2, arg3) {
|
|
546
585
|
wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
547
586
|
}
|
|
548
587
|
|
|
@@ -1316,7 +1355,7 @@ function __wbg_get_imports() {
|
|
|
1316
1355
|
const a = state0.a;
|
|
1317
1356
|
state0.a = 0;
|
|
1318
1357
|
try {
|
|
1319
|
-
return
|
|
1358
|
+
return __wbg_adapter_175(a, state0.b, arg0, arg1);
|
|
1320
1359
|
} finally {
|
|
1321
1360
|
state0.a = a;
|
|
1322
1361
|
}
|
|
@@ -1408,8 +1447,8 @@ function __wbg_get_imports() {
|
|
|
1408
1447
|
const ret = wasm.memory;
|
|
1409
1448
|
return addHeapObject(ret);
|
|
1410
1449
|
};
|
|
1411
|
-
imports.wbg.
|
|
1412
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1450
|
+
imports.wbg.__wbindgen_closure_wrapper710 = function(arg0, arg1, arg2) {
|
|
1451
|
+
const ret = makeMutClosure(arg0, arg1, 298, __wbg_adapter_54);
|
|
1413
1452
|
return addHeapObject(ret);
|
|
1414
1453
|
};
|
|
1415
1454
|
|
package/lib/web/qsc_wasm_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qsharp-lang",
|
|
3
3
|
"description": "qsharp language package for quantum development",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.6-dev",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=16.17.0"
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"build": "npm run docs && npm run generate && npm run build:tsc",
|
|
27
27
|
"generate": "node generate_katas_content.js && node generate_samples_content.js",
|
|
28
28
|
"docs": "node generate_docs.js",
|
|
29
|
-
"build:tsc": "node
|
|
30
|
-
"tsc:watch": "node
|
|
29
|
+
"build:tsc": "node ../../node_modules/typescript/bin/tsc -p ./src/tsconfig.json",
|
|
30
|
+
"tsc:watch": "node ../../node_modules/typescript/bin/tsc -p ./src/tsconfig.json --watch --preserveWatchOutput",
|
|
31
31
|
"test": "node --test"
|
|
32
32
|
},
|
|
33
33
|
"type": "module",
|
package/ux/circuit.tsx
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
4
|
import * as qviz from "@microsoft/quantum-viz.js/lib";
|
|
5
|
-
import { useEffect, useRef } from "preact/hooks";
|
|
5
|
+
import { useEffect, useRef, useState } from "preact/hooks";
|
|
6
6
|
import { CircuitProps } from "./data.js";
|
|
7
|
+
import { Spinner } from "./spinner.js";
|
|
7
8
|
|
|
8
9
|
// For perf reasons we set a limit on how many gates/qubits
|
|
9
10
|
// we attempt to render. This is still a lot higher than a human would
|
|
@@ -12,56 +13,165 @@ import { CircuitProps } from "./data.js";
|
|
|
12
13
|
const MAX_OPERATIONS = 10000;
|
|
13
14
|
const MAX_QUBITS = 1000;
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
// This component is shared by the Python widget and the VS Code panel
|
|
16
17
|
export function Circuit(props: { circuit: qviz.Circuit }) {
|
|
18
|
+
const circuit = props.circuit;
|
|
19
|
+
const unrenderable =
|
|
20
|
+
circuit.qubits.length === 0 ||
|
|
21
|
+
circuit.operations.length > MAX_OPERATIONS ||
|
|
22
|
+
circuit.qubits.length > MAX_QUBITS;
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div>
|
|
26
|
+
{unrenderable ? (
|
|
27
|
+
<Unrenderable
|
|
28
|
+
qubits={props.circuit.qubits.length}
|
|
29
|
+
operations={props.circuit.operations.length}
|
|
30
|
+
/>
|
|
31
|
+
) : (
|
|
32
|
+
<ZoomableCircuit circuit={props.circuit} />
|
|
33
|
+
)}
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function ZoomableCircuit(props: { circuit: qviz.Circuit }) {
|
|
17
39
|
const circuitDiv = useRef<HTMLDivElement>(null);
|
|
40
|
+
const [zoomLevel, setZoomLevel] = useState(100);
|
|
41
|
+
const [rendering, setRendering] = useState(true);
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
// Enable "rendering" text while the circuit is being drawn
|
|
45
|
+
setRendering(true);
|
|
46
|
+
const container = circuitDiv.current!;
|
|
47
|
+
container.innerHTML = "";
|
|
48
|
+
}, [props.circuit]);
|
|
49
|
+
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (rendering) {
|
|
52
|
+
const container = circuitDiv.current!;
|
|
53
|
+
// Draw the circuit - may take a while for large circuits
|
|
54
|
+
const svg = renderCircuit(props.circuit, container);
|
|
55
|
+
// Calculate the initial zoom level based on the container width
|
|
56
|
+
const initialZoom = calculateZoomToFit(container, svg as SVGElement);
|
|
57
|
+
// Set the initial zoom level
|
|
58
|
+
setZoomLevel(initialZoom);
|
|
59
|
+
// Resize the SVG to fit
|
|
60
|
+
updateWidth();
|
|
61
|
+
// Disable "rendering" text
|
|
62
|
+
setRendering(false);
|
|
63
|
+
}
|
|
64
|
+
}, [rendering]);
|
|
65
|
+
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
updateWidth();
|
|
68
|
+
}, [zoomLevel]);
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<div>
|
|
72
|
+
<div>
|
|
73
|
+
{rendering ? null : (
|
|
74
|
+
<ZoomControl zoom={zoomLevel} onChange={setZoomLevel} />
|
|
75
|
+
)}
|
|
76
|
+
</div>
|
|
77
|
+
<div>
|
|
78
|
+
{rendering
|
|
79
|
+
? `Rendering diagram with ${props.circuit.operations.length} gates...`
|
|
80
|
+
: ""}
|
|
81
|
+
</div>
|
|
82
|
+
<div class="qs-circuit" ref={circuitDiv}></div>
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
function updateWidth() {
|
|
87
|
+
const svg = circuitDiv.current?.querySelector(".qviz");
|
|
88
|
+
if (svg) {
|
|
89
|
+
// The width attribute contains the true width, generated by qviz.
|
|
90
|
+
// We'll leave this attribute untouched, so we can use it again if the
|
|
91
|
+
// zoom level is ever updated.
|
|
92
|
+
const width = svg.getAttribute("width")!;
|
|
93
|
+
|
|
94
|
+
// We'll set the width in the style attribute to (true width * zoom level).
|
|
95
|
+
// This value takes precedence over the true width in the width attribute.
|
|
96
|
+
svg.setAttribute(
|
|
97
|
+
"style",
|
|
98
|
+
`max-width: ${width}; width: ${(parseInt(width) * (zoomLevel || 100)) / 100}; height: auto`,
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function renderCircuit(circuit: qviz.Circuit, container: HTMLDivElement) {
|
|
104
|
+
qviz.draw(circuit, container);
|
|
18
105
|
|
|
106
|
+
// quantum-viz hardcodes the styles in the SVG.
|
|
107
|
+
// Remove the style elements -- we'll define the styles in our own CSS.
|
|
108
|
+
const styleElements = container.querySelectorAll("style");
|
|
109
|
+
styleElements?.forEach((tag) => tag.remove());
|
|
110
|
+
|
|
111
|
+
return container.getElementsByClassName("qviz")[0]!;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function calculateZoomToFit(container: HTMLDivElement, svg: SVGElement) {
|
|
115
|
+
const containerWidth = container.clientWidth;
|
|
116
|
+
// width and height are the true dimensions generated by qviz
|
|
117
|
+
const width = parseInt(svg.getAttribute("width")!);
|
|
118
|
+
const height = svg.getAttribute("height")!;
|
|
119
|
+
|
|
120
|
+
svg.setAttribute("viewBox", `0 0 ${width} ${height}`);
|
|
121
|
+
const zoom = Math.min(Math.ceil((containerWidth / width) * 100), 100);
|
|
122
|
+
return zoom;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function Unrenderable(props: { qubits: number; operations: number }) {
|
|
19
127
|
const errorDiv =
|
|
20
|
-
props.
|
|
128
|
+
props.qubits === 0 ? (
|
|
21
129
|
<div>
|
|
22
130
|
<p>No circuit to display. No qubits have been allocated.</p>
|
|
23
131
|
</div>
|
|
24
|
-
) : props.
|
|
132
|
+
) : props.operations > MAX_OPERATIONS ? (
|
|
25
133
|
<div>
|
|
26
134
|
<p>
|
|
27
|
-
This circuit has too many gates to display. It has{" "}
|
|
28
|
-
|
|
29
|
-
{MAX_OPERATIONS}.
|
|
135
|
+
This circuit has too many gates to display. It has {props.operations}{" "}
|
|
136
|
+
gates, but the maximum supported is {MAX_OPERATIONS}.
|
|
30
137
|
</p>
|
|
31
138
|
</div>
|
|
32
|
-
) : props.
|
|
139
|
+
) : props.qubits > MAX_QUBITS ? (
|
|
33
140
|
<div>
|
|
34
141
|
<p>
|
|
35
|
-
This circuit has too many qubits to display. It has{" "}
|
|
36
|
-
|
|
37
|
-
{MAX_QUBITS}.
|
|
142
|
+
This circuit has too many qubits to display. It has {props.qubits}{" "}
|
|
143
|
+
qubits, but the maximum supported is {MAX_QUBITS}.
|
|
38
144
|
</p>
|
|
39
145
|
</div>
|
|
40
146
|
) : undefined;
|
|
41
147
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
circuitDiv.current!.innerHTML = "";
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
qviz.draw(props.circuit, circuitDiv.current!);
|
|
49
|
-
|
|
50
|
-
// quantum-viz hardcodes the styles in the SVG.
|
|
51
|
-
// Remove the style elements -- we'll define the styles in our own CSS.
|
|
52
|
-
const styleElements = circuitDiv.current?.querySelectorAll("style");
|
|
53
|
-
styleElements?.forEach((tag) => tag.remove());
|
|
54
|
-
}, [props.circuit]);
|
|
148
|
+
return <div class="qs-circuit-error">{errorDiv}</div>;
|
|
149
|
+
}
|
|
55
150
|
|
|
151
|
+
function ZoomControl(props: {
|
|
152
|
+
zoom: number;
|
|
153
|
+
onChange: (zoom: number) => void;
|
|
154
|
+
}) {
|
|
56
155
|
return (
|
|
57
|
-
<
|
|
58
|
-
<
|
|
59
|
-
<
|
|
60
|
-
|
|
156
|
+
<p>
|
|
157
|
+
<label htmlFor="qs-circuit-zoom">Zoom </label>
|
|
158
|
+
<input
|
|
159
|
+
id="qs-circuit-zoom"
|
|
160
|
+
type="number"
|
|
161
|
+
min="10"
|
|
162
|
+
max="100"
|
|
163
|
+
step="10"
|
|
164
|
+
value={props.zoom}
|
|
165
|
+
onInput={(e) =>
|
|
166
|
+
props.onChange(parseInt((e.target as HTMLInputElement).value) || 0)
|
|
167
|
+
}
|
|
168
|
+
/>
|
|
169
|
+
%
|
|
170
|
+
</p>
|
|
61
171
|
);
|
|
62
172
|
}
|
|
63
173
|
|
|
64
|
-
|
|
174
|
+
// This component is exclusive to the VS Code panel
|
|
65
175
|
export function CircuitPanel(props: CircuitProps) {
|
|
66
176
|
const error = props.errorHtml ? (
|
|
67
177
|
<div>
|
|
@@ -78,41 +188,29 @@ export function CircuitPanel(props: CircuitProps) {
|
|
|
78
188
|
return (
|
|
79
189
|
<div class="qs-circuit-panel">
|
|
80
190
|
<div>
|
|
81
|
-
<h1>
|
|
191
|
+
<h1>
|
|
192
|
+
{props.title} {props.simulated ? "(Trace)" : ""}
|
|
193
|
+
</h1>
|
|
82
194
|
</div>
|
|
83
|
-
{props.circuit ? <Circuit circuit={props.circuit}></Circuit> : null}
|
|
84
195
|
<div class="qs-circuit-error">{error}</div>
|
|
85
196
|
<p>{props.targetProfile}</p>
|
|
86
|
-
{props.simulating ? (
|
|
87
|
-
<p>
|
|
88
|
-
This circuit diagram was generated while running the program in the
|
|
89
|
-
simulator.
|
|
90
|
-
<br />
|
|
91
|
-
<br />
|
|
92
|
-
If your program contains behavior that is conditional on a qubit
|
|
93
|
-
measurement result, note that this circuit only shows the outcome that
|
|
94
|
-
was encountered during this simulation. Running the program again may
|
|
95
|
-
result in a different circuit being generated.
|
|
96
|
-
</p>
|
|
97
|
-
) : null}
|
|
98
|
-
{
|
|
99
|
-
// show tip when the circuit is empty and we didn't run under the simulator (i.e. debugging)
|
|
100
|
-
!props.simulating &&
|
|
101
|
-
!props.errorHtml &&
|
|
102
|
-
props.circuit?.qubits.length === 0 ? (
|
|
103
|
-
<p>
|
|
104
|
-
<em>
|
|
105
|
-
Tip: you can generate a circuit diagram for any operation that
|
|
106
|
-
takes qubits or arrays of qubits as input.
|
|
107
|
-
</em>
|
|
108
|
-
</p>
|
|
109
|
-
) : null
|
|
110
|
-
}
|
|
111
197
|
<p>
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
198
|
+
{
|
|
199
|
+
props.simulated
|
|
200
|
+
? "WARNING: This diagram shows the result of tracing a dynamic circuit, and may change from run to run."
|
|
201
|
+
: "\xa0" // nbsp to keep line height consistent
|
|
202
|
+
}
|
|
115
203
|
</p>
|
|
204
|
+
<p>
|
|
205
|
+
Learn more at{" "}
|
|
206
|
+
<a href="https://aka.ms/qdk.circuits">https://aka.ms/qdk.circuits</a>
|
|
207
|
+
</p>
|
|
208
|
+
{props.calculating ? (
|
|
209
|
+
<div>
|
|
210
|
+
<Spinner />
|
|
211
|
+
</div>
|
|
212
|
+
) : null}
|
|
213
|
+
{props.circuit ? <Circuit circuit={props.circuit}></Circuit> : null}
|
|
116
214
|
</div>
|
|
117
215
|
);
|
|
118
216
|
}
|
package/ux/data.ts
CHANGED
|
@@ -69,7 +69,10 @@ export type CircuitProps = {
|
|
|
69
69
|
circuit?: CircuitData;
|
|
70
70
|
errorHtml?: string;
|
|
71
71
|
targetProfile: string;
|
|
72
|
-
|
|
72
|
+
/** Circuit was generated by running the simulator */
|
|
73
|
+
simulated: boolean;
|
|
74
|
+
/** Circuit is still being generated */
|
|
75
|
+
calculating: boolean;
|
|
73
76
|
};
|
|
74
77
|
|
|
75
78
|
export type CircuitData = import("@microsoft/quantum-viz.js/lib").Circuit;
|
package/ux/estimatesPanel.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import { type ReData, SingleEstimateResult } from "./data.js";
|
|
|
6
6
|
import { EstimatesOverview } from "./estimatesOverview.js";
|
|
7
7
|
import { ReTable } from "./reTable.js";
|
|
8
8
|
import { SpaceChart } from "./spaceChart.js";
|
|
9
|
+
import { Spinner } from "./spinner.js";
|
|
9
10
|
|
|
10
11
|
export function EstimatesPanel(props: {
|
|
11
12
|
estimatesData: ReData[];
|
|
@@ -52,16 +53,7 @@ export function EstimatesPanel(props: {
|
|
|
52
53
|
</g>
|
|
53
54
|
</svg>
|
|
54
55
|
{props.calculating ? (
|
|
55
|
-
<
|
|
56
|
-
width="40"
|
|
57
|
-
height="40"
|
|
58
|
-
viewBox="0 0 16 16"
|
|
59
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
60
|
-
class="codicon-modifier-spin"
|
|
61
|
-
style="position: absolute; top: 11px; left: 4px;"
|
|
62
|
-
>
|
|
63
|
-
<path d="M2.006 8.267L.78 9.5 0 8.73l2.09-2.07.76.01 2.09 2.12-.76.76-1.167-1.18a5 5 0 0 0 9.4 1.983l.813.597a6 6 0 0 1-11.22-2.683zm10.99-.466L11.76 6.55l-.76.76 2.09 2.11.76.01 2.09-2.07-.75-.76-1.194 1.18a6 6 0 0 0-11.11-2.92l.81.594a5 5 0 0 1 9.3 2.346z"></path>
|
|
64
|
-
</svg>
|
|
56
|
+
<Spinner style="position: absolute; top: 11px; left: 4px;" />
|
|
65
57
|
) : null}
|
|
66
58
|
<h1>Azure Quantum Resource Estimator</h1>
|
|
67
59
|
</div>
|
package/ux/qsharp-ux.css
CHANGED
package/ux/spinner.tsx
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
export function Spinner(props: { style?: string }) {
|
|
5
|
+
return (
|
|
6
|
+
<svg
|
|
7
|
+
width="40"
|
|
8
|
+
height="40"
|
|
9
|
+
viewBox="0 0 16 16"
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
class="codicon-modifier-spin"
|
|
12
|
+
style={props.style}
|
|
13
|
+
>
|
|
14
|
+
<path d="M2.006 8.267L.78 9.5 0 8.73l2.09-2.07.76.01 2.09 2.12-.76.76-1.167-1.18a5 5 0 0 0 9.4 1.983l.813.597a6 6 0 0 1-11.22-2.683zm10.99-.466L11.76 6.55l-.76.76 2.09 2.11.76.01 2.09-2.07-.75-.76-1.194 1.18a6 6 0 0 0-11.11-2.92l.81.594a5 5 0 0 1 9.3 2.346z"></path>
|
|
15
|
+
</svg>
|
|
16
|
+
);
|
|
17
|
+
}
|