diff --git a/src/draw/MathPainter.js b/src/draw/MathPainter.js index 26521b6a..54823876 100644 --- a/src/draw/MathPainter.js +++ b/src/draw/MathPainter.js @@ -622,8 +622,8 @@ class MathPainter { let n = Math.round(Math.log2(numRows)); MathPainter.paintMatrixTooltip(painter, matrix, drawArea, focusPoints, (c, r) => c === r ? - `Probability of |${Util.bin(c, n)}⟩` : - `Coupling of |${Util.bin(r, n)}⟩ to ⟨${Util.bin(c, n)}|`, + `Probability of |${Util.bin(c, n)}⟩ (decimal ${c})` : + `Coupling of |${Util.bin(r, n)}⟩ to ⟨${Util.bin(c, n)}| (decimal ${r} to ${c})`, (c, r, v) => c === r ? (matrix.cell(c, r).real*100).toFixed(4) + "%" : matrix.cell(c, r).toString(new Format(false, 0, 6, ", "))); diff --git a/src/gates/AllGates.js b/src/gates/AllGates.js index 190b4b10..563758ca 100644 --- a/src/gates/AllGates.js +++ b/src/gates/AllGates.js @@ -198,7 +198,7 @@ Gates.TopToolboxGroups = [ { hint: "Displays", gates: [ - SampleDisplayFamily.ofSize(3), undefined, + undefined, undefined, DensityMatrixDisplayFamily.ofSize(1), BlochSphereDisplay, ProbabilityDisplayFamily.ofSize(1), AmplitudeDisplayFamily.ofSize(2) ] diff --git a/src/gates/AmplitudeDisplay.js b/src/gates/AmplitudeDisplay.js index 24a1c777..862166c9 100644 --- a/src/gates/AmplitudeDisplay.js +++ b/src/gates/AmplitudeDisplay.js @@ -261,12 +261,12 @@ const AMPLITUDE_DRAWER_FROM_CUSTOM_STATS = GatePainting.makeDisplayDrawer(args = let forceSign = v => (v >= 0 ? '+' : '') + v.toFixed(2); if (isIncoherent) { MathPainter.paintMatrixTooltip(args.painter, matrix, drawRect, args.focusPoints, - (c, r) => `Chance of |${Util.bin(r*matrix.width() + c, args.gate.height)}⟩ [amplitude not defined]`, + (c, r) => `Chance of |${Util.bin(r*matrix.width() + c, args.gate.height)}⟩ (decimal ${r*matrix.width() + c}) [amplitude not defined]`, (c, r, v) => `raw: ${(v.norm2()*100).toFixed(4)}%, log: ${(Math.log10(v.norm2())*10).toFixed(1)} dB`, (c, r, v) => '[entangled with other qubits]'); } else { MathPainter.paintMatrixTooltip(args.painter, matrix, drawRect, args.focusPoints, - (c, r) => `Amplitude of |${Util.bin(r*matrix.width() + c, args.gate.height)}⟩`, + (c, r) => `Amplitude of |${Util.bin(r*matrix.width() + c, args.gate.height)}⟩ (decimal ${r*matrix.width() + c})`, (c, r, v) => 'val:' + v.toString(new Format(false, 0, 5, ", ")), (c, r, v) => `mag²:${(v.norm2()*100).toFixed(4)}%, phase:${forceSign(v.phase() * 180 / Math.PI)}°`); if (phaseLockIndex !== undefined) { diff --git a/src/gates/ProbabilityDisplay.js b/src/gates/ProbabilityDisplay.js index 7866c771..cc47b9cb 100644 --- a/src/gates/ProbabilityDisplay.js +++ b/src/gates/ProbabilityDisplay.js @@ -207,7 +207,7 @@ function _paintMultiProbabilityDisplay_tooltips(args) { painter, x + w, y + k * d, - `Chance of |${Util.bin(k, args.gate.height)}⟩ if measured`, + `Chance of |${Util.bin(k, args.gate.height)}⟩ (decimal ${k}) if measured`, 'raw: ' + (p * 100).toFixed(4) + "%", 'log: ' + (Math.log10(p) * 10).toFixed(1) + " dB"); } diff --git a/src/ui/DisplayedCircuit.js b/src/ui/DisplayedCircuit.js index d643045a..5b3792fd 100644 --- a/src/ui/DisplayedCircuit.js +++ b/src/ui/DisplayedCircuit.js @@ -1341,7 +1341,7 @@ class DisplayedCircuit { Config.SUPERPOSITION_BACK_COLOR); let forceSign = v => (v >= 0 ? '+' : '') + v.toFixed(2); MathPainter.paintMatrixTooltip(painter, amplitudeGrid, gridRect, hand.hoverPoints(), - (c, r) => `Amplitude of |${Util.bin(r*amplitudeGrid.width() + c, numWire)}⟩`, + (c, r) => `Amplitude of |${Util.bin(r*amplitudeGrid.width() + c, numWire)}⟩ (decimal ${r*amplitudeGrid.width() + c})`, (c, r, v) => 'val:' + v.toString(new Format(false, 0, 5, ", ")), (c, r, v) => `mag²:${(v.norm2()*100).toFixed(4)}%, phase:${forceSign(v.phase() * 180 / Math.PI)}°`);