qsharp-lang 1.0.34-dev → 1.1.0-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/browser.js +1 -0
- package/dist/compiler/common.d.ts +1 -1
- package/dist/compiler/compiler.d.ts +1 -1
- package/dist/compiler/compiler.js +1 -2
- package/dist/debug-service/debug-service.d.ts +0 -1
- package/dist/debug-service/debug-service.js +2 -44
- package/dist/katas-content.generated.js +18 -18
- package/dist/language-service/language-service.d.ts +15 -18
- package/dist/language-service/language-service.js +17 -189
- package/dist/main.d.ts +1 -0
- package/dist/main.js +1 -0
- package/dist/samples.generated.d.ts +8 -2
- package/dist/samples.generated.js +18 -0
- package/dist/utils.d.ts +24 -0
- package/dist/{ux/ticks.js → utils.js} +23 -0
- package/lib/node/qsc_wasm.cjs +23 -23
- package/lib/node/qsc_wasm.d.cts +36 -36
- package/lib/node/qsc_wasm_bg.wasm +0 -0
- package/lib/web/qsc_wasm.d.ts +36 -36
- package/lib/web/qsc_wasm.js +23 -23
- package/lib/web/qsc_wasm_bg.wasm +0 -0
- package/package.json +1 -1
- package/ux/data.ts +0 -3
- package/ux/estimatesOverview.tsx +148 -81
- package/ux/estimatesPanel.tsx +94 -0
- package/ux/generate_report_code.py +1 -1
- package/ux/histogram.tsx +0 -1
- package/ux/index.ts +1 -0
- package/ux/output_data.md +1 -1
- package/ux/qsharp-ux.css +63 -20
- package/ux/report.ts +3 -3
- package/ux/resultsTable.tsx +55 -32
- package/ux/scatterChart.tsx +216 -285
- package/ux/tsconfig.json +0 -1
- package/dist/ux/ticks.d.ts +0 -6
- package/dist/vsdiagnostic.d.ts +0 -19
- package/dist/vsdiagnostic.js +0 -127
package/ux/estimatesOverview.tsx
CHANGED
|
@@ -13,14 +13,7 @@ import {
|
|
|
13
13
|
SingleEstimateResult,
|
|
14
14
|
} from "./data.js";
|
|
15
15
|
import { ResultsTable, Row } from "./resultsTable.js";
|
|
16
|
-
import {
|
|
17
|
-
Axis,
|
|
18
|
-
HideTooltip,
|
|
19
|
-
PlotItem,
|
|
20
|
-
ScatterChart,
|
|
21
|
-
ScatterSeries,
|
|
22
|
-
SelectPoint,
|
|
23
|
-
} from "./scatterChart.js";
|
|
16
|
+
import { Axis, PlotItem, ScatterChart, ScatterSeries } from "./scatterChart.js";
|
|
24
17
|
|
|
25
18
|
const columnNames = [
|
|
26
19
|
"Run name",
|
|
@@ -39,7 +32,7 @@ const columnNames = [
|
|
|
39
32
|
"Physical qubits",
|
|
40
33
|
];
|
|
41
34
|
|
|
42
|
-
const initialColumns = [0,
|
|
35
|
+
const initialColumns = [0, 10, 13, 11, 12];
|
|
43
36
|
|
|
44
37
|
const xAxis: Axis = {
|
|
45
38
|
isTime: true,
|
|
@@ -77,7 +70,6 @@ function reDataToRow(input: ReData, color: string): Row {
|
|
|
77
70
|
},
|
|
78
71
|
data.physicalCounts.rqops,
|
|
79
72
|
data.physicalCounts.physicalQubits,
|
|
80
|
-
data.new ? "New" : "Cached",
|
|
81
73
|
],
|
|
82
74
|
color: color,
|
|
83
75
|
};
|
|
@@ -89,7 +81,7 @@ function frontierEntryToPlotEntry(entry: FrontierEntry): PlotItem {
|
|
|
89
81
|
y: entry.physicalCounts.physicalQubits,
|
|
90
82
|
label:
|
|
91
83
|
entry.physicalCountsFormatted.runtime +
|
|
92
|
-
" " +
|
|
84
|
+
", physical qubits: " +
|
|
93
85
|
entry.physicalCountsFormatted.physicalQubits,
|
|
94
86
|
};
|
|
95
87
|
}
|
|
@@ -104,7 +96,7 @@ function reDataToRowScatter(data: ReData, color: string): ScatterSeries {
|
|
|
104
96
|
y: data.physicalCounts.physicalQubits,
|
|
105
97
|
label:
|
|
106
98
|
data.physicalCountsFormatted.runtime +
|
|
107
|
-
" " +
|
|
99
|
+
", physical qubits: " +
|
|
108
100
|
data.physicalCountsFormatted.physicalQubits,
|
|
109
101
|
},
|
|
110
102
|
],
|
|
@@ -117,6 +109,63 @@ function reDataToRowScatter(data: ReData, color: string): ScatterSeries {
|
|
|
117
109
|
};
|
|
118
110
|
}
|
|
119
111
|
|
|
112
|
+
function createRunNames(estimatesData: ReData[]): string[] {
|
|
113
|
+
// If there's only 1 entry, use the shared run name
|
|
114
|
+
if (estimatesData.length === 1) {
|
|
115
|
+
return [estimatesData[0].jobParams.sharedRunName];
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const fields: string[][] = [];
|
|
119
|
+
|
|
120
|
+
estimatesData.forEach(() => {
|
|
121
|
+
fields.push([]);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
// Could be multiple runs, e.g. against different algorithms.
|
|
125
|
+
addIfDifferent(fields, estimatesData, (data) => data.jobParams.sharedRunName);
|
|
126
|
+
|
|
127
|
+
addIfDifferent(
|
|
128
|
+
fields,
|
|
129
|
+
estimatesData,
|
|
130
|
+
(data) => data.jobParams.qubitParams.name,
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
addIfDifferent(
|
|
134
|
+
fields,
|
|
135
|
+
estimatesData,
|
|
136
|
+
(data) => data.jobParams.qecScheme.name,
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
addIfDifferent(fields, estimatesData, (data) =>
|
|
140
|
+
String(data.jobParams.errorBudget),
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
const proposedRunNames = fields.map((field) => field.join(", "));
|
|
144
|
+
if (new Set(proposedRunNames).size != proposedRunNames.length) {
|
|
145
|
+
// If there are duplicates, add the run index to the name.
|
|
146
|
+
return proposedRunNames.map(
|
|
147
|
+
(runName, index) => runName + " (" + index + ")",
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return proposedRunNames;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function addIfDifferent(
|
|
155
|
+
fields: string[][],
|
|
156
|
+
estimatesData: ReData[],
|
|
157
|
+
fieldMethod: (data: ReData) => string,
|
|
158
|
+
): void {
|
|
159
|
+
const arr = estimatesData.map(fieldMethod);
|
|
160
|
+
|
|
161
|
+
const set = new Set(arr);
|
|
162
|
+
if (set.size > 1) {
|
|
163
|
+
arr.forEach((field, index) => {
|
|
164
|
+
fields[index].push(field);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
120
169
|
export function EstimatesOverview(props: {
|
|
121
170
|
estimatesData: ReData[];
|
|
122
171
|
colors: string[] | null;
|
|
@@ -126,36 +175,45 @@ export function EstimatesOverview(props: {
|
|
|
126
175
|
setEstimate: (estimate: SingleEstimateResult | null) => void;
|
|
127
176
|
}) {
|
|
128
177
|
const [selectedRow, setSelectedRow] = useState<string | null>(null);
|
|
178
|
+
const [selectedPoint, setSelectedPoint] = useState<[number, number]>();
|
|
179
|
+
|
|
180
|
+
const runNameRenderingError =
|
|
181
|
+
props.runNames != null &&
|
|
182
|
+
props.runNames.length > 0 &&
|
|
183
|
+
props.runNames.length != props.estimatesData.length
|
|
184
|
+
? "Warning: The number of runNames does not match the number of estimates. Ignoring provided runNames."
|
|
185
|
+
: "";
|
|
186
|
+
|
|
187
|
+
const runNames =
|
|
188
|
+
props.runNames != null &&
|
|
189
|
+
props.runNames.length == props.estimatesData.length
|
|
190
|
+
? props.runNames
|
|
191
|
+
: createRunNames(props.estimatesData);
|
|
129
192
|
|
|
130
193
|
props.estimatesData.forEach((item, idx) => {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
props.runNames.length == props.estimatesData.length
|
|
134
|
-
) {
|
|
135
|
-
item.jobParams.runName = props.runNames[idx];
|
|
136
|
-
} else {
|
|
137
|
-
if (item.jobParams.runName == null) {
|
|
138
|
-
// Start indexing with 0 to match with the original object indexing.
|
|
139
|
-
item.jobParams.runName = `(${idx})`;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
194
|
+
// Start indexing with 0 to match with the original object indexing.
|
|
195
|
+
item.jobParams.runName = runNames[idx];
|
|
142
196
|
});
|
|
143
197
|
|
|
144
198
|
function onPointSelected(seriesIndex: number, pointIndex: number): void {
|
|
199
|
+
if (seriesIndex < 0) {
|
|
200
|
+
// Point was deselected
|
|
201
|
+
onRowSelected("");
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
|
|
145
205
|
const data = props.estimatesData[seriesIndex];
|
|
146
206
|
props.setEstimate(CreateSingleEstimateResult(data, pointIndex));
|
|
147
207
|
const rowId = props.estimatesData[seriesIndex].jobParams.runName;
|
|
148
208
|
setSelectedRow(rowId);
|
|
209
|
+
setSelectedPoint([seriesIndex, pointIndex]);
|
|
149
210
|
}
|
|
150
211
|
|
|
151
212
|
function onRowSelected(rowId: string) {
|
|
152
213
|
setSelectedRow(rowId);
|
|
153
|
-
// On any selection, clear the "new" flag on all rows. This ensures that
|
|
154
|
-
// new rows do not steal focus from the user selected row.
|
|
155
|
-
props.estimatesData.forEach((data) => (data.new = false));
|
|
156
|
-
HideTooltip();
|
|
157
214
|
if (!rowId) {
|
|
158
215
|
props.setEstimate(null);
|
|
216
|
+
setSelectedPoint(undefined);
|
|
159
217
|
} else {
|
|
160
218
|
const index = props.estimatesData.findIndex(
|
|
161
219
|
(data) => data.jobParams.runName === rowId,
|
|
@@ -163,76 +221,85 @@ export function EstimatesOverview(props: {
|
|
|
163
221
|
|
|
164
222
|
if (index == -1) {
|
|
165
223
|
props.setEstimate(null);
|
|
224
|
+
setSelectedPoint(undefined);
|
|
166
225
|
} else {
|
|
167
226
|
const estimateFound = props.estimatesData[index];
|
|
227
|
+
setSelectedPoint([index, 0]);
|
|
168
228
|
props.setEstimate(CreateSingleEstimateResult(estimateFound, 0));
|
|
169
|
-
SelectPoint(index, 0);
|
|
170
229
|
}
|
|
171
230
|
}
|
|
172
231
|
}
|
|
173
232
|
|
|
233
|
+
const colorRenderingError =
|
|
234
|
+
props.colors != null &&
|
|
235
|
+
props.colors.length > 0 &&
|
|
236
|
+
props.colors.length != props.estimatesData.length
|
|
237
|
+
? "Warning: The number of colors does not match the number of estimates. Ignoring provided colors."
|
|
238
|
+
: "";
|
|
239
|
+
|
|
174
240
|
const colormap =
|
|
175
241
|
props.colors != null && props.colors.length == props.estimatesData.length
|
|
176
242
|
? props.colors
|
|
177
243
|
: ColorMap(props.estimatesData.length);
|
|
178
244
|
|
|
179
|
-
|
|
245
|
+
function getResultTable() {
|
|
246
|
+
return (
|
|
247
|
+
<ResultsTable
|
|
248
|
+
columnNames={columnNames}
|
|
249
|
+
rows={props.estimatesData.map((dataItem, index) =>
|
|
250
|
+
reDataToRow(dataItem, colormap[index]),
|
|
251
|
+
)}
|
|
252
|
+
initialColumns={initialColumns}
|
|
253
|
+
selectedRow={selectedRow}
|
|
254
|
+
onRowSelected={onRowSelected}
|
|
255
|
+
onRowDeleted={props.onRowDeleted}
|
|
256
|
+
/>
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function getScatterChart() {
|
|
180
261
|
return (
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
selectedRow={selectedRow}
|
|
191
|
-
setSelectedRow={onRowSelected}
|
|
192
|
-
/>
|
|
193
|
-
<ScatterChart
|
|
194
|
-
xAxis={xAxis}
|
|
195
|
-
yAxis={yAxis}
|
|
196
|
-
data={props.estimatesData.map((dataItem, index) =>
|
|
197
|
-
reDataToRowScatter(dataItem, colormap[index]),
|
|
198
|
-
)}
|
|
199
|
-
onPointSelected={onPointSelected}
|
|
200
|
-
/>
|
|
201
|
-
</>
|
|
262
|
+
<ScatterChart
|
|
263
|
+
xAxis={xAxis}
|
|
264
|
+
yAxis={yAxis}
|
|
265
|
+
data={props.estimatesData.map((dataItem, index) =>
|
|
266
|
+
reDataToRowScatter(dataItem, colormap[index]),
|
|
267
|
+
)}
|
|
268
|
+
onPointSelected={onPointSelected}
|
|
269
|
+
selectedPoint={selectedPoint}
|
|
270
|
+
/>
|
|
202
271
|
);
|
|
203
272
|
}
|
|
204
273
|
|
|
205
274
|
return (
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
<
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
<
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
</details>
|
|
236
|
-
</>
|
|
275
|
+
<div className="qs-estimatesOverview">
|
|
276
|
+
{runNameRenderingError != "" && (
|
|
277
|
+
<div class="qs-estimatesOverview-error">{runNameRenderingError}</div>
|
|
278
|
+
)}
|
|
279
|
+
{colorRenderingError != "" && (
|
|
280
|
+
<div class="qs-estimatesOverview-error">{colorRenderingError}</div>
|
|
281
|
+
)}
|
|
282
|
+
{!props.isSimplifiedView ? (
|
|
283
|
+
<>
|
|
284
|
+
<details open>
|
|
285
|
+
<summary style="font-size: 1.5em; font-weight: bold; margin: 24px 8px;">
|
|
286
|
+
Results
|
|
287
|
+
</summary>
|
|
288
|
+
{getResultTable()}
|
|
289
|
+
</details>
|
|
290
|
+
<details open>
|
|
291
|
+
<summary style="font-size: 1.5em; font-weight: bold; margin: 24px 8px;">
|
|
292
|
+
Space-time diagram
|
|
293
|
+
</summary>
|
|
294
|
+
{getScatterChart()}
|
|
295
|
+
</details>
|
|
296
|
+
</>
|
|
297
|
+
) : (
|
|
298
|
+
<>
|
|
299
|
+
{getResultTable()}
|
|
300
|
+
{getScatterChart()}
|
|
301
|
+
</>
|
|
302
|
+
)}
|
|
303
|
+
</div>
|
|
237
304
|
);
|
|
238
305
|
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import { useState } from "preact/hooks";
|
|
5
|
+
import { type ReData, SingleEstimateResult } from "./data.js";
|
|
6
|
+
import { EstimatesOverview } from "./estimatesOverview.js";
|
|
7
|
+
import { ReTable } from "./reTable.js";
|
|
8
|
+
import { SpaceChart } from "./spaceChart.js";
|
|
9
|
+
|
|
10
|
+
export function EstimatesPanel(props: {
|
|
11
|
+
estimatesData: ReData[];
|
|
12
|
+
colors: string[];
|
|
13
|
+
runNames: string[];
|
|
14
|
+
calculating: boolean;
|
|
15
|
+
renderer: (input: string) => string;
|
|
16
|
+
onRowDeleted: (rowId: string) => void;
|
|
17
|
+
}) {
|
|
18
|
+
const [estimate, setEstimate] = useState<SingleEstimateResult | null>(null);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<div style="display:flex; height:64px; align-items: center; position: relative">
|
|
23
|
+
<svg
|
|
24
|
+
width="48"
|
|
25
|
+
height="48"
|
|
26
|
+
viewBox="96 96 828 828"
|
|
27
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
28
|
+
>
|
|
29
|
+
<g fill="none" stroke="gray" stroke-width="8">
|
|
30
|
+
<path d="M 512 135 L 819 313 L 819 667 L 512 845 L 205 667 L 205 313 L 512 135 Z" />
|
|
31
|
+
<path d="M 205 580 L 742 890 L 819 845 L 818 756 L 205 402" />
|
|
32
|
+
<path d="M 204 579 L 743 268" />
|
|
33
|
+
<path d="M 664 224 L 207 489" />
|
|
34
|
+
<path d="M 206 400 L 588 180" />
|
|
35
|
+
<path d="M 205 667 L 818 313" />
|
|
36
|
+
<path d="M 205 490 L 820 845" />
|
|
37
|
+
<path d="M 207 314 L 818 667" />
|
|
38
|
+
<path d="M 282 269 L 820 580" />
|
|
39
|
+
<path d="M 820 490 L 357 223" />
|
|
40
|
+
<path d="M 435 180 L 818 400" />
|
|
41
|
+
<path d="M 281 710 L 281 271" />
|
|
42
|
+
<path d="M 357 755 L 357 223" />
|
|
43
|
+
<path d="M 283 711 L 820 400" />
|
|
44
|
+
<path d="M 434 797 L 434 181" />
|
|
45
|
+
<path d="M 511 136 L 511 844" />
|
|
46
|
+
<path d="M 588 799 L 588 182" />
|
|
47
|
+
<path d="M 665 223 L 665 845" />
|
|
48
|
+
<path d="M 742 887 L 742 267" />
|
|
49
|
+
<path d="M 665 845 L 816 758" />
|
|
50
|
+
<path d="M 433 801 L 820 577" />
|
|
51
|
+
<path d="M 820 489 L 360 755" />
|
|
52
|
+
</g>
|
|
53
|
+
</svg>
|
|
54
|
+
{props.calculating ? (
|
|
55
|
+
<svg
|
|
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>
|
|
65
|
+
) : null}
|
|
66
|
+
<h1>Azure Quantum Resource Estimator</h1>
|
|
67
|
+
</div>
|
|
68
|
+
<EstimatesOverview
|
|
69
|
+
estimatesData={props.estimatesData}
|
|
70
|
+
isSimplifiedView={false}
|
|
71
|
+
onRowDeleted={props.onRowDeleted}
|
|
72
|
+
setEstimate={setEstimate}
|
|
73
|
+
runNames={props.runNames}
|
|
74
|
+
colors={props.colors}
|
|
75
|
+
></EstimatesOverview>
|
|
76
|
+
{!estimate ? null : (
|
|
77
|
+
<>
|
|
78
|
+
<details open>
|
|
79
|
+
<summary style="font-size: 1.5em; font-weight: bold; margin: 24px 8px;">
|
|
80
|
+
Space diagram
|
|
81
|
+
</summary>
|
|
82
|
+
<SpaceChart estimatesData={estimate} />
|
|
83
|
+
</details>
|
|
84
|
+
<details open>
|
|
85
|
+
<summary style="font-size: 1.5em; font-weight: bold; margin: 24px 8px;">
|
|
86
|
+
Resource Estimates
|
|
87
|
+
</summary>
|
|
88
|
+
<ReTable mdRenderer={props.renderer} estimatesData={estimate} />
|
|
89
|
+
</details>
|
|
90
|
+
</>
|
|
91
|
+
)}
|
|
92
|
+
</>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
@@ -52,7 +52,7 @@ path_map = {
|
|
|
52
52
|
"logicalQubit/logicalCyclesPerSecond": "numberFormatF64.format(result.physicalCounts.breakdown.clockFrequency)",
|
|
53
53
|
"logicalQubit/logicalCycleTime": "numberFormat.format(result.logicalQubit.logicalCycleTime)",
|
|
54
54
|
"logicalQubit/physicalQubits": "numberFormat.format(result.logicalQubit.physicalQubits)",
|
|
55
|
-
"physicalCounts/breakdown/algorithmicLogicalDepth": "numberFormat.format(result.
|
|
55
|
+
"physicalCounts/breakdown/algorithmicLogicalDepth": "numberFormat.format(result.physicalCounts.breakdown.algorithmicLogicalDepth)",
|
|
56
56
|
"physicalCounts/breakdown/algorithmicLogicalQubits": "numberFormat.format(result.physicalCounts.breakdown.algorithmicLogicalQubits)",
|
|
57
57
|
"physicalCounts/breakdown/cliffordErrorRate": "result.physicalCounts.breakdown.cliffordErrorRate",
|
|
58
58
|
"physicalCounts/breakdown/logicalDepth": "numberFormat.format(result.physicalCounts.breakdown.logicalDepth)",
|
package/ux/histogram.tsx
CHANGED
|
@@ -35,7 +35,6 @@ function resultToKet(result: string): string {
|
|
|
35
35
|
// The result is a simple array of Zero and One
|
|
36
36
|
// The below will return an array of "Zero" or "One" in the order found
|
|
37
37
|
const matches = result.match(/(One|Zero)/g);
|
|
38
|
-
matches?.reverse();
|
|
39
38
|
let ket = "|";
|
|
40
39
|
matches?.forEach((digit) => (ket += digit == "One" ? "1" : "0"));
|
|
41
40
|
ket += "⟩";
|
package/ux/index.ts
CHANGED
package/ux/output_data.md
CHANGED
|
@@ -498,7 +498,7 @@ This is the probability in which executing a single T gate may fail.
|
|
|
498
498
|
|
|
499
499
|
[//]: # "physicalCountsFormatted/logicalDepthFactor"
|
|
500
500
|
|
|
501
|
-
_Factor
|
|
501
|
+
_Factor the initial number of logical cycles is multiplied by_
|
|
502
502
|
|
|
503
503
|
This is the factor takes into account a potential overhead to the initial number of logical cycles.
|
|
504
504
|
|
package/ux/qsharp-ux.css
CHANGED
|
@@ -28,7 +28,10 @@ modern-normalize (see https://mattbrictson.com/blog/css-normalize-and-reset for
|
|
|
28
28
|
/* TODO: Use the qs- prefixes and apply consistently */
|
|
29
29
|
:root {
|
|
30
30
|
--heading-background: #262679;
|
|
31
|
-
--main-background: var(
|
|
31
|
+
--main-background: var(
|
|
32
|
+
--vscode-editor-background,
|
|
33
|
+
var(--jp-layout-color0, #ececf0)
|
|
34
|
+
);
|
|
32
35
|
--main-color: var(
|
|
33
36
|
--vscode-editor-foreground,
|
|
34
37
|
var(--jp-widgets-color, #202020)
|
|
@@ -529,6 +532,7 @@ html {
|
|
|
529
532
|
.qs-resultsTable-sortedTable {
|
|
530
533
|
border-collapse: collapse;
|
|
531
534
|
margin: 12px 0px;
|
|
535
|
+
outline: none;
|
|
532
536
|
}
|
|
533
537
|
|
|
534
538
|
.qs-resultsTable-sortedTable th,
|
|
@@ -548,11 +552,11 @@ html {
|
|
|
548
552
|
}
|
|
549
553
|
|
|
550
554
|
.qs-resultsTable-sortedTable tbody tr:hover {
|
|
551
|
-
background: var(--vscode-list-hoverBackground);
|
|
555
|
+
background: var(--vscode-list-hoverBackground, var(--js-layout-color2));
|
|
552
556
|
}
|
|
553
557
|
|
|
554
558
|
.qs-resultsTable-sortedTableSelectedRow td {
|
|
555
|
-
background: var(--vscode-button-background);
|
|
559
|
+
background: var(--vscode-button-background, var(--jp-layout-color3));
|
|
556
560
|
color: var(--vscode-button-foreground);
|
|
557
561
|
font-weight: 600;
|
|
558
562
|
}
|
|
@@ -565,7 +569,7 @@ html {
|
|
|
565
569
|
.qs-resultsTable-showColumnMenu {
|
|
566
570
|
display: block;
|
|
567
571
|
position: absolute;
|
|
568
|
-
background-color: var(--vscode-menu-background);
|
|
572
|
+
background-color: var(--vscode-menu-background, var(--main-background));
|
|
569
573
|
border: 1px solid #8888;
|
|
570
574
|
padding: 4px;
|
|
571
575
|
z-index: 100;
|
|
@@ -574,7 +578,7 @@ html {
|
|
|
574
578
|
|
|
575
579
|
.qs-resultsTable-menuItem {
|
|
576
580
|
cursor: pointer;
|
|
577
|
-
background-color: var(--vscode-list-hoverBackground);
|
|
581
|
+
background-color: var(--vscode-list-hoverBackground, var(--jp-layout-color1));
|
|
578
582
|
padding: 4px;
|
|
579
583
|
margin: 2px;
|
|
580
584
|
font-size: 14px;
|
|
@@ -582,7 +586,7 @@ html {
|
|
|
582
586
|
}
|
|
583
587
|
|
|
584
588
|
.qs-resultsTable-menuItem:hover {
|
|
585
|
-
background-color: var(--vscode-menu-border);
|
|
589
|
+
background-color: var(--vscode-menu-border, var(--jp-layout-color2));
|
|
586
590
|
}
|
|
587
591
|
|
|
588
592
|
.qs-resultsTable-columnSelected {
|
|
@@ -590,8 +594,8 @@ html {
|
|
|
590
594
|
padding: 4px;
|
|
591
595
|
font-weight: 400;
|
|
592
596
|
font-size: 14px;
|
|
593
|
-
background-color: var(--vscode-button-background);
|
|
594
|
-
color: var(--vscode-button-foreground);
|
|
597
|
+
background-color: var(--vscode-button-background, var(--jp-brand-color1));
|
|
598
|
+
color: var(--vscode-button-foreground, var(--jp-ui-inverse-font-color0));
|
|
595
599
|
margin: 2px;
|
|
596
600
|
border-radius: 3px;
|
|
597
601
|
}
|
|
@@ -616,10 +620,6 @@ html {
|
|
|
616
620
|
animation: codicon-spin 1.5s steps(45) infinite;
|
|
617
621
|
}
|
|
618
622
|
|
|
619
|
-
.qs-scatterChart {
|
|
620
|
-
font-size: 14px;
|
|
621
|
-
}
|
|
622
|
-
|
|
623
623
|
.qs-scatterChart-x-axisTitle,
|
|
624
624
|
.qs-scatterChart-y-axisTitle {
|
|
625
625
|
text-anchor: middle;
|
|
@@ -632,19 +632,20 @@ html {
|
|
|
632
632
|
transform: rotate(180deg);
|
|
633
633
|
}
|
|
634
634
|
|
|
635
|
-
.qs-scatterChart-line {
|
|
636
|
-
stroke: var(--border-color);
|
|
637
|
-
}
|
|
638
|
-
|
|
639
635
|
.qs-scatterChart-point {
|
|
640
636
|
r: 2px;
|
|
641
637
|
stroke-width: 4px;
|
|
642
638
|
}
|
|
643
639
|
|
|
644
|
-
.qs-scatterChart-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
640
|
+
.qs-scatterChart-hover:hover {
|
|
641
|
+
r: 4px;
|
|
642
|
+
stroke-width: 4px;
|
|
643
|
+
fill: white;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
.qs-scatterChart-point-selected {
|
|
647
|
+
r: 8px;
|
|
648
|
+
stroke-width: 4px;
|
|
648
649
|
fill: white;
|
|
649
650
|
}
|
|
650
651
|
|
|
@@ -652,3 +653,45 @@ html {
|
|
|
652
653
|
font-size: 16px;
|
|
653
654
|
fill: var(--main-color);
|
|
654
655
|
}
|
|
656
|
+
|
|
657
|
+
.qs-scatterChart-tooltip,
|
|
658
|
+
.qs-scatterChart-selectedInfo {
|
|
659
|
+
position: absolute;
|
|
660
|
+
visibility: hidden;
|
|
661
|
+
background: var(--main-background);
|
|
662
|
+
color: var(--main-color);
|
|
663
|
+
border: var(--border-color) 1px solid;
|
|
664
|
+
padding: 4px;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
/* This rule adds the little triange pointer at the top */
|
|
668
|
+
.qs-scatterChart-tooltip::after,
|
|
669
|
+
.qs-scatterChart-selectedInfo::after {
|
|
670
|
+
content: "";
|
|
671
|
+
position: absolute;
|
|
672
|
+
bottom: 100%;
|
|
673
|
+
left: 50%;
|
|
674
|
+
margin-left: -5px;
|
|
675
|
+
border-width: 5px;
|
|
676
|
+
border-style: solid;
|
|
677
|
+
border-color: transparent transparent var(--border-color) transparent;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
.qs-scatterChart-axis,
|
|
681
|
+
.qs-scatterChart-tick-line {
|
|
682
|
+
stroke: var(--border-color);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
.qs-scatterChart-x-tick-text {
|
|
686
|
+
text-anchor: middle;
|
|
687
|
+
fill: var(--main-color);
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
.qs-scatterChart-y-tick-text {
|
|
691
|
+
text-anchor: end;
|
|
692
|
+
fill: var(--main-color);
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
.qs-estimatesOverview-error {
|
|
696
|
+
color: red;
|
|
697
|
+
}
|
package/ux/report.ts
CHANGED
|
@@ -39,7 +39,7 @@ export function CreateReport(result: SingleEstimateResult): ReportData {
|
|
|
39
39
|
explanation: `This is a runtime estimate for the execution time of the algorithm. In general, the execution time corresponds to the duration of one logical cycle (${numberFormat.format(
|
|
40
40
|
result.logicalQubit.logicalCycleTime,
|
|
41
41
|
)} nanosecs) multiplied by the ${numberFormat.format(
|
|
42
|
-
result.
|
|
42
|
+
result.physicalCounts.breakdown.algorithmicLogicalDepth,
|
|
43
43
|
)} logical cycles to run the algorithm. If however the duration of a single T factory (here: ${numberFormat.format(
|
|
44
44
|
result.tfactory == null ? 0 : result.tfactory.runtime,
|
|
45
45
|
)} nanosecs) is larger than the algorithm runtime, we extend the number of logical cycles artificially in order to exceed the runtime of a single T factory.`,
|
|
@@ -108,7 +108,7 @@ export function CreateReport(result: SingleEstimateResult): ReportData {
|
|
|
108
108
|
label: "Logical depth",
|
|
109
109
|
description: `Number of logical cycles performed`,
|
|
110
110
|
explanation: `This number is usually equal to the logical depth of the algorithm, which is ${numberFormat.format(
|
|
111
|
-
result.
|
|
111
|
+
result.physicalCounts.breakdown.algorithmicLogicalDepth,
|
|
112
112
|
)}. However, in the case in which a single T factory is slower than the execution time of the algorithm, we adjust the logical cycle depth to exceed the T factory's execution time.`,
|
|
113
113
|
});
|
|
114
114
|
entries.push({
|
|
@@ -553,7 +553,7 @@ export function CreateReport(result: SingleEstimateResult): ReportData {
|
|
|
553
553
|
entries.push({
|
|
554
554
|
path: "physicalCountsFormatted/logicalDepthFactor",
|
|
555
555
|
label: "Logical depth factor",
|
|
556
|
-
description: `Factor
|
|
556
|
+
description: `Factor the initial number of logical cycles is multiplied by`,
|
|
557
557
|
explanation: `This is the factor takes into account a potential overhead to the initial number of logical cycles.`,
|
|
558
558
|
});
|
|
559
559
|
entries.push({
|