qsharp-lang 1.0.32-dev → 1.0.34-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/ux/report.ts ADDED
@@ -0,0 +1,591 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ import { SingleEstimateResult } from "./data.js";
5
+
6
+ type ReportData = {
7
+ groups: ReportGroup[];
8
+ assumptions: string[];
9
+ };
10
+
11
+ type ReportGroup = {
12
+ title: string;
13
+ alwaysVisible: boolean;
14
+ entries: ReportEntry[];
15
+ };
16
+
17
+ type ReportEntry = {
18
+ path: string;
19
+ label: string;
20
+ description: string;
21
+ explanation: string;
22
+ };
23
+
24
+ // THIS CODE HAS BEEN AUTOMATICALLY GENERATED WITH generate_report_code.py from output_data.md
25
+ export function CreateReport(result: SingleEstimateResult): ReportData {
26
+ const groups = [] as ReportGroup[];
27
+ let entries = [] as ReportEntry[];
28
+ const numberFormat = new Intl.NumberFormat();
29
+ const numberFormatF64 = new Intl.NumberFormat(undefined, {
30
+ maximumFractionDigits: 2,
31
+ minimumFractionDigits: 2,
32
+ });
33
+
34
+ entries = [];
35
+ entries.push({
36
+ path: "physicalCountsFormatted/runtime",
37
+ label: "Runtime",
38
+ description: `Total runtime`,
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
+ result.logicalQubit.logicalCycleTime,
41
+ )} nanosecs) multiplied by the ${numberFormat.format(
42
+ result.physicalCountsFormatted.algorithmicLogicalDepth,
43
+ )} logical cycles to run the algorithm. If however the duration of a single T factory (here: ${numberFormat.format(
44
+ result.tfactory == null ? 0 : result.tfactory.runtime,
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.`,
46
+ });
47
+ entries.push({
48
+ path: "physicalCountsFormatted/rqops",
49
+ label: "rQOPS",
50
+ description: `Reliable quantum operations per second`,
51
+ explanation: `The value is computed as the number of logical qubits after layout (${numberFormat.format(
52
+ result.physicalCounts.breakdown.algorithmicLogicalQubits,
53
+ )}) (with a logical error rate of ${
54
+ result.physicalCountsFormatted.requiredLogicalQubitErrorRate
55
+ }) multiplied by the clock frequency (${numberFormatF64.format(
56
+ result.physicalCounts.breakdown.clockFrequency,
57
+ )}), which is the number of logical cycles per second.`,
58
+ });
59
+ entries.push({
60
+ path: "physicalCountsFormatted/physicalQubits",
61
+ label: "Physical qubits",
62
+ description: `Number of physical qubits`,
63
+ explanation: `This value represents the total number of physical qubits, which is the sum of ${numberFormat.format(
64
+ result.physicalCounts.breakdown.physicalQubitsForAlgorithm,
65
+ )} physical qubits to implement the algorithm logic, and ${numberFormat.format(
66
+ result.physicalCounts.breakdown.physicalQubitsForTfactories,
67
+ )} physical qubits to execute the T factories that are responsible to produce the T states that are consumed by the algorithm.`,
68
+ });
69
+ groups.push({
70
+ title: "Physical resource estimates",
71
+ alwaysVisible: true,
72
+ entries: entries,
73
+ });
74
+
75
+ entries = [];
76
+ entries.push({
77
+ path: "physicalCountsFormatted/algorithmicLogicalQubits",
78
+ label: "Logical algorithmic qubits",
79
+ description: `Number of logical qubits for the algorithm after layout`,
80
+ explanation: `Laying out the logical qubits in the presence of nearest-neighbor constraints requires additional logical qubits. In particular, to layout the $Q_{\\rm alg} = ${numberFormat.format(
81
+ result.logicalCounts.numQubits,
82
+ )}$ logical qubits in the input algorithm, we require in total $2 \\cdot Q_{\\rm alg} + \\lceil \\sqrt{8 \\cdot Q_{\\rm alg}}\\rceil + 1 = ${numberFormat.format(
83
+ result.physicalCounts.breakdown.algorithmicLogicalQubits,
84
+ )}$ logical qubits.`,
85
+ });
86
+ entries.push({
87
+ path: "physicalCountsFormatted/algorithmicLogicalDepth",
88
+ label: "Algorithmic depth",
89
+ description: `Number of logical cycles for the algorithm`,
90
+ explanation: `To execute the algorithm using _Parallel Synthesis Sequential Pauli Computation_ (PSSPC), operations are scheduled in terms of multi-qubit Pauli measurements, for which assume an execution time of one logical cycle. Based on the input algorithm, we require one multi-qubit measurement for the ${numberFormat.format(
91
+ result.logicalCounts.measurementCount,
92
+ )} single-qubit measurements, the ${numberFormat.format(
93
+ result.logicalCounts.rotationCount,
94
+ )} arbitrary single-qubit rotations, and the ${numberFormat.format(
95
+ result.logicalCounts.tCount,
96
+ )} T gates, three multi-qubit measurements for each of the ${numberFormat.format(
97
+ result.logicalCounts.cczCount,
98
+ )} CCZ and ${numberFormat.format(
99
+ result.logicalCounts.ccixCount,
100
+ )} CCiX gates in the input program, as well as ${
101
+ result.physicalCountsFormatted.numTsPerRotation
102
+ } multi-qubit measurements for each of the ${numberFormat.format(
103
+ result.logicalCounts.rotationDepth,
104
+ )} non-Clifford layers in which there is at least one single-qubit rotation with an arbitrary angle rotation.`,
105
+ });
106
+ entries.push({
107
+ path: "physicalCountsFormatted/logicalDepth",
108
+ label: "Logical depth",
109
+ description: `Number of logical cycles performed`,
110
+ explanation: `This number is usually equal to the logical depth of the algorithm, which is ${numberFormat.format(
111
+ result.physicalCountsFormatted.algorithmicLogicalDepth,
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
+ });
114
+ entries.push({
115
+ path: "physicalCountsFormatted/clockFrequency",
116
+ label: "Clock frequency",
117
+ description: `Number of logical cycles per second`,
118
+ explanation: `This is the number of logical cycles that can be performed within one second. The logical cycle time is ${result.physicalCountsFormatted.logicalCycleTime}.`,
119
+ });
120
+ entries.push({
121
+ path: "physicalCountsFormatted/numTstates",
122
+ label: "Number of T states",
123
+ description: `Number of T states consumed by the algorithm`,
124
+ explanation: `To execute the algorithm, we require one T state for each of the ${numberFormat.format(
125
+ result.logicalCounts.tCount,
126
+ )} T gates, four T states for each of the ${numberFormat.format(
127
+ result.logicalCounts.cczCount,
128
+ )} CCZ and ${numberFormat.format(
129
+ result.logicalCounts.ccixCount,
130
+ )} CCiX gates, as well as ${
131
+ result.physicalCountsFormatted.numTsPerRotation
132
+ } for each of the ${numberFormat.format(
133
+ result.logicalCounts.rotationCount,
134
+ )} single-qubit rotation gates with arbitrary angle rotation.`,
135
+ });
136
+ entries.push({
137
+ path: "physicalCountsFormatted/numTfactories",
138
+ label: "Number of T factories",
139
+ description: `Number of T factories capable of producing the demanded ${numberFormat.format(
140
+ result.physicalCounts.breakdown.numTstates,
141
+ )} T states during the algorithm's runtime`,
142
+ explanation: `The total number of T factories ${numberFormat.format(
143
+ result.physicalCounts.breakdown.numTfactories,
144
+ )} that are executed in parallel is computed as $\\left\\lceil\\dfrac{\\text{T states}\\cdot\\text{T factory duration}}{\\text{T states per T factory}\\cdot\\text{algorithm runtime}}\\right\\rceil = \\left\\lceil\\dfrac{${numberFormat.format(
145
+ result.physicalCounts.breakdown.numTstates,
146
+ )} \\cdot ${numberFormat.format(
147
+ result.tfactory == null ? 0 : result.tfactory.runtime,
148
+ )}\\;\\text{ns}}{${numberFormat.format(
149
+ result.tfactory == null ? 0 : result.tfactory.numTstates,
150
+ )} \\cdot ${numberFormat.format(
151
+ result.physicalCounts.runtime,
152
+ )}\\;\\text{ns}}\\right\\rceil$`,
153
+ });
154
+ entries.push({
155
+ path: "physicalCountsFormatted/numTfactoryRuns",
156
+ label: "Number of T factory invocations",
157
+ description: `Number of times all T factories are invoked`,
158
+ explanation: `In order to prepare the ${numberFormat.format(
159
+ result.physicalCounts.breakdown.numTstates,
160
+ )} T states, the ${numberFormat.format(
161
+ result.physicalCounts.breakdown.numTfactories,
162
+ )} copies of the T factory are repeatedly invoked ${numberFormat.format(
163
+ result.physicalCounts.breakdown.numTfactoryRuns,
164
+ )} times.`,
165
+ });
166
+ entries.push({
167
+ path: "physicalCountsFormatted/physicalQubitsForAlgorithm",
168
+ label: "Physical algorithmic qubits",
169
+ description: `Number of physical qubits for the algorithm after layout`,
170
+ explanation: `The ${numberFormat.format(
171
+ result.physicalCounts.breakdown.physicalQubitsForAlgorithm,
172
+ )} are the product of the ${numberFormat.format(
173
+ result.physicalCounts.breakdown.algorithmicLogicalQubits,
174
+ )} logical qubits after layout and the ${numberFormat.format(
175
+ result.logicalQubit.physicalQubits,
176
+ )} physical qubits that encode a single logical qubit.`,
177
+ });
178
+ entries.push({
179
+ path: "physicalCountsFormatted/physicalQubitsForTfactories",
180
+ label: "Physical T factory qubits",
181
+ description: `Number of physical qubits for the T factories`,
182
+ explanation: `Each T factory requires ${numberFormat.format(
183
+ result.tfactory == null ? 0 : result.tfactory.physicalQubits,
184
+ )} physical qubits and we run ${numberFormat.format(
185
+ result.physicalCounts.breakdown.numTfactories,
186
+ )} in parallel, therefore we need $${numberFormat.format(
187
+ result.physicalCounts.breakdown.physicalQubitsForTfactories,
188
+ )} = ${numberFormat.format(
189
+ result.tfactory == null ? 0 : result.tfactory.physicalQubits,
190
+ )} \\cdot ${numberFormat.format(
191
+ result.physicalCounts.breakdown.numTfactories,
192
+ )}$ qubits.`,
193
+ });
194
+ entries.push({
195
+ path: "physicalCountsFormatted/requiredLogicalQubitErrorRate",
196
+ label: "Required logical qubit error rate",
197
+ description: `The minimum logical qubit error rate required to run the algorithm within the error budget`,
198
+ explanation: `The minimum logical qubit error rate is obtained by dividing the logical error probability ${
199
+ result.physicalCountsFormatted.errorBudgetLogical
200
+ } by the product of ${numberFormat.format(
201
+ result.physicalCounts.breakdown.algorithmicLogicalQubits,
202
+ )} logical qubits and the total cycle count ${numberFormat.format(
203
+ result.physicalCounts.breakdown.logicalDepth,
204
+ )}.`,
205
+ });
206
+ entries.push({
207
+ path: "physicalCountsFormatted/requiredLogicalTstateErrorRate",
208
+ label: "Required logical T state error rate",
209
+ description: `The minimum T state error rate required for distilled T states`,
210
+ explanation: `The minimum T state error rate is obtained by dividing the T distillation error probability ${
211
+ result.physicalCountsFormatted.errorBudgetTstates
212
+ } by the total number of T states ${numberFormat.format(
213
+ result.physicalCounts.breakdown.numTstates,
214
+ )}.`,
215
+ });
216
+ entries.push({
217
+ path: "physicalCountsFormatted/numTsPerRotation",
218
+ label: "Number of T states per rotation",
219
+ description: `Number of T states to implement a rotation with an arbitrary angle`,
220
+ explanation: `The number of T states to implement a rotation with an arbitrary angle is $\\lceil 0.53 \\log_2(${numberFormat.format(
221
+ result.logicalCounts.rotationCount,
222
+ )} / ${
223
+ result.errorBudget.rotations
224
+ }) + 5.3\\rceil$ [[arXiv:2203.10064](https://arxiv.org/abs/2203.10064)]. For simplicity, we use this formula for all single-qubit arbitrary angle rotations, and do not distinguish between best, worst, and average cases.`,
225
+ });
226
+ groups.push({
227
+ title: "Resource estimates breakdown",
228
+ alwaysVisible: false,
229
+ entries: entries,
230
+ });
231
+
232
+ entries = [];
233
+ entries.push({
234
+ path: "jobParams/qecScheme/name",
235
+ label: "QEC scheme",
236
+ description: `Name of QEC scheme`,
237
+ explanation: `You can load pre-defined QEC schemes by using the name \`surface_code\` or \`floquet_code\`. The latter only works with Majorana qubits.`,
238
+ });
239
+ entries.push({
240
+ path: "logicalQubit/codeDistance",
241
+ label: "Code distance",
242
+ description: `Required code distance for error correction`,
243
+ explanation: `The code distance is the smallest odd integer greater or equal to $\\dfrac{2\\log(${result.jobParams.qecScheme.crossingPrefactor} / ${result.physicalCounts.breakdown.requiredLogicalQubitErrorRate})}{\\log(${result.jobParams.qecScheme.errorCorrectionThreshold}/${result.physicalCounts.breakdown.cliffordErrorRate})} - 1$`,
244
+ });
245
+ entries.push({
246
+ path: "physicalCountsFormatted/physicalQubitsPerLogicalQubit",
247
+ label: "Physical qubits",
248
+ description: `Number of physical qubits per logical qubit`,
249
+ explanation: `The number of physical qubits per logical qubit are evaluated using the formula ${result.jobParams.qecScheme.physicalQubitsPerLogicalQubit} that can be user-specified.`,
250
+ });
251
+ entries.push({
252
+ path: "physicalCountsFormatted/logicalCycleTime",
253
+ label: "Logical cycle time",
254
+ description: `Duration of a logical cycle in nanoseconds`,
255
+ explanation: `The runtime of one logical cycle in nanoseconds is evaluated using the formula ${result.jobParams.qecScheme.logicalCycleTime} that can be user-specified.`,
256
+ });
257
+ entries.push({
258
+ path: "physicalCountsFormatted/logicalErrorRate",
259
+ label: "Logical qubit error rate",
260
+ description: `Logical qubit error rate`,
261
+ explanation: `The logical qubit error rate is computed as $${result.jobParams.qecScheme.crossingPrefactor} \\cdot \\left(\\dfrac{${result.physicalCounts.breakdown.cliffordErrorRate}}{${result.jobParams.qecScheme.errorCorrectionThreshold}}\\right)^\\frac{${result.logicalQubit.codeDistance} + 1}{2}$`,
262
+ });
263
+ entries.push({
264
+ path: "jobParams/qecScheme/crossingPrefactor",
265
+ label: "Crossing prefactor",
266
+ description: `Crossing prefactor used in QEC scheme`,
267
+ explanation: `The crossing prefactor is usually extracted numerically from simulations when fitting an exponential curve to model the relationship between logical and physical error rate.`,
268
+ });
269
+ entries.push({
270
+ path: "jobParams/qecScheme/errorCorrectionThreshold",
271
+ label: "Error correction threshold",
272
+ description: `Error correction threshold used in QEC scheme`,
273
+ explanation: `The error correction threshold is the physical error rate below which the error rate of the logical qubit is less than the error rate of the physical qubit that constitute it. This value is usually extracted numerically from simulations of the logical error rate.`,
274
+ });
275
+ entries.push({
276
+ path: "jobParams/qecScheme/logicalCycleTime",
277
+ label: "Logical cycle time formula",
278
+ description: `QEC scheme formula used to compute logical cycle time`,
279
+ explanation: `This is the formula that is used to compute the logical cycle time ${numberFormat.format(
280
+ result.logicalQubit.logicalCycleTime,
281
+ )} ns.`,
282
+ });
283
+ entries.push({
284
+ path: "jobParams/qecScheme/physicalQubitsPerLogicalQubit",
285
+ label: "Physical qubits formula",
286
+ description: `QEC scheme formula used to compute number of physical qubits per logical qubit`,
287
+ explanation: `This is the formula that is used to compute the number of physical qubits per logical qubits ${numberFormat.format(
288
+ result.logicalQubit.physicalQubits,
289
+ )}.`,
290
+ });
291
+ groups.push({
292
+ title: "Logical qubit parameters",
293
+ alwaysVisible: false,
294
+ entries: entries,
295
+ });
296
+
297
+ if (result.tfactory != null) {
298
+ entries = [];
299
+ entries.push({
300
+ path: "physicalCountsFormatted/tfactoryPhysicalQubits",
301
+ label: "Physical qubits",
302
+ description: `Number of physical qubits for a single T factory`,
303
+ explanation: `This corresponds to the maximum number of physical qubits over all rounds of T distillation units in a T factory. A round of distillation contains of multiple copies of distillation units to achieve the required success probability of producing a T state with the expected logical T state error rate.`,
304
+ });
305
+ entries.push({
306
+ path: "physicalCountsFormatted/tfactoryRuntime",
307
+ label: "Runtime",
308
+ description: `Runtime of a single T factory`,
309
+ explanation: `The runtime of a single T factory is the accumulated runtime of executing each round in a T factory.`,
310
+ });
311
+ entries.push({
312
+ path: "tfactory/numTstates",
313
+ label: "Number of output T states per run",
314
+ description: `Number of output T states produced in a single run of T factory`,
315
+ explanation: `The T factory takes as input ${numberFormat.format(
316
+ result.tfactory == null ? 0 : result.tfactory.numInputTstates,
317
+ )} noisy physical T states with an error rate of ${
318
+ result.jobParams.qubitParams.tGateErrorRate
319
+ } and produces ${numberFormat.format(
320
+ result.tfactory == null ? 0 : result.tfactory.numTstates,
321
+ )} T states with an error rate of ${
322
+ result.physicalCountsFormatted.tstateLogicalErrorRate
323
+ }.`,
324
+ });
325
+ entries.push({
326
+ path: "physicalCountsFormatted/numInputTstates",
327
+ label: "Number of input T states per run",
328
+ description: `Number of physical input T states consumed in a single run of a T factory`,
329
+ explanation: `This value includes the physical input T states of all copies of the distillation unit in the first round.`,
330
+ });
331
+ entries.push({
332
+ path: "tfactory/numRounds",
333
+ label: "Distillation rounds",
334
+ description: `The number of distillation rounds`,
335
+ explanation: `This is the number of distillation rounds. In each round one or multiple copies of some distillation unit is executed.`,
336
+ });
337
+ entries.push({
338
+ path: "physicalCountsFormatted/numUnitsPerRound",
339
+ label: "Distillation units per round",
340
+ description: `The number of units in each round of distillation`,
341
+ explanation: `This is the number of copies for the distillation units per round.`,
342
+ });
343
+ entries.push({
344
+ path: "physicalCountsFormatted/unitNamePerRound",
345
+ label: "Distillation units",
346
+ description: `The types of distillation units`,
347
+ explanation: `These are the types of distillation units that are executed in each round. The units can be either physical or logical, depending on what type of qubit they are operating. Space-efficient units require fewer qubits for the cost of longer runtime compared to Reed-Muller preparation units.`,
348
+ });
349
+ entries.push({
350
+ path: "physicalCountsFormatted/codeDistancePerRound",
351
+ label: "Distillation code distances",
352
+ description: `The code distance in each round of distillation`,
353
+ explanation: `This is the code distance used for the units in each round. If the code distance is 1, then the distillation unit operates on physical qubits instead of error-corrected logical qubits.`,
354
+ });
355
+ entries.push({
356
+ path: "physicalCountsFormatted/physicalQubitsPerRound",
357
+ label: "Number of physical qubits per round",
358
+ description: `The number of physical qubits used in each round of distillation`,
359
+ explanation: `The maximum number of physical qubits over all rounds is the number of physical qubits for the T factory, since qubits are reused by different rounds.`,
360
+ });
361
+ entries.push({
362
+ path: "physicalCountsFormatted/tfactoryRuntimePerRound",
363
+ label: "Runtime per round",
364
+ description: `The runtime of each distillation round`,
365
+ explanation: `The runtime of the T factory is the sum of the runtimes in all rounds.`,
366
+ });
367
+ entries.push({
368
+ path: "physicalCountsFormatted/tstateLogicalErrorRate",
369
+ label: "Logical T state error rate",
370
+ description: `Logical T state error rate`,
371
+ explanation: `This is the logical T state error rate achieved by the T factory which is equal or smaller than the required error rate ${result.physicalCountsFormatted.requiredLogicalTstateErrorRate}.`,
372
+ });
373
+ groups.push({
374
+ title: "T factory parameters",
375
+ alwaysVisible: false,
376
+ entries: entries,
377
+ });
378
+ }
379
+ entries = [];
380
+ entries.push({
381
+ path: "physicalCountsFormatted/logicalCountsNumQubits",
382
+ label: "Logical qubits (pre-layout)",
383
+ description: `Number of logical qubits in the input quantum program`,
384
+ explanation: `We determine ${numberFormat.format(
385
+ result.physicalCounts.breakdown.algorithmicLogicalQubits,
386
+ )} algorithmic logical qubits from this number by assuming to align them in a 2D grid. Auxiliary qubits are added to allow for sufficient space to execute multi-qubit Pauli measurements on all or a subset of the logical qubits.`,
387
+ });
388
+ entries.push({
389
+ path: "physicalCountsFormatted/logicalCountsTCount",
390
+ label: "T gates",
391
+ description: `Number of T gates in the input quantum program`,
392
+ explanation: `This includes all T gates and adjoint T gates, but not T gates used to implement rotation gates with arbitrary angle, CCZ gates, or CCiX gates.`,
393
+ });
394
+ entries.push({
395
+ path: "physicalCountsFormatted/logicalCountsRotationCount",
396
+ label: "Rotation gates",
397
+ description: `Number of rotation gates in the input quantum program`,
398
+ explanation: `This is the number of all rotation gates. If an angle corresponds to a Pauli, Clifford, or T gate, it is not accounted for in this number.`,
399
+ });
400
+ entries.push({
401
+ path: "physicalCountsFormatted/logicalCountsRotationDepth",
402
+ label: "Rotation depth",
403
+ description: `Depth of rotation gates in the input quantum program`,
404
+ explanation: `This is the number of all non-Clifford layers that include at least one single-qubit rotation gate with an arbitrary angle.`,
405
+ });
406
+ entries.push({
407
+ path: "physicalCountsFormatted/logicalCountsCczCount",
408
+ label: "CCZ gates",
409
+ description: `Number of CCZ-gates in the input quantum program`,
410
+ explanation: `This is the number of CCZ gates.`,
411
+ });
412
+ entries.push({
413
+ path: "physicalCountsFormatted/logicalCountsCcixCount",
414
+ label: "CCiX gates",
415
+ description: `Number of CCiX-gates in the input quantum program`,
416
+ explanation: `This is the number of CCiX gates, which applies $-iX$ controlled on two control qubits [[1212.5069](https://arxiv.org/abs/1212.5069)].`,
417
+ });
418
+ entries.push({
419
+ path: "physicalCountsFormatted/logicalCountsMeasurementCount",
420
+ label: "Measurement operations",
421
+ description: `Number of single qubit measurements in the input quantum program`,
422
+ explanation: `This is the number of single qubit measurements in Pauli basis that are used in the input program. Note that all measurements are counted, however, the measurement result is is determined randomly (with a fixed seed) to be 0 or 1 with a probability of 50%.`,
423
+ });
424
+ groups.push({
425
+ title: "Pre-layout logical resources",
426
+ alwaysVisible: false,
427
+ entries: entries,
428
+ });
429
+
430
+ entries = [];
431
+ entries.push({
432
+ path: "physicalCountsFormatted/errorBudget",
433
+ label: "Total error budget",
434
+ description: `Total error budget for the algorithm`,
435
+ explanation: `The total error budget sets the overall allowed error for the algorithm, i.e., the number of times it is allowed to fail. Its value must be between 0 and 1 and the default value is 0.001, which corresponds to 0.1%, and means that the algorithm is allowed to fail once in 1000 executions. This parameter is highly application specific. For example, if one is running Shor's algorithm for factoring integers, a large value for the error budget may be tolerated as one can check that the output are indeed the prime factors of the input. On the other hand, a much smaller error budget may be needed for an algorithm solving a problem with a solution which cannot be efficiently verified. This budget $\\epsilon = \\epsilon_{\\log} + \\epsilon_{\\rm dis} + \\epsilon_{\\rm syn}$ is uniformly distributed and applies to errors $\\epsilon_{\\log}$ to implement logical qubits, an error budget $\\epsilon_{\\rm dis}$ to produce T states through distillation, and an error budget $\\epsilon_{\\rm syn}$ to synthesize rotation gates with arbitrary angles. Note that for distillation and rotation synthesis, the respective error budgets $\\epsilon_{\\rm dis}$ and $\\epsilon_{\\rm syn}$ are uniformly distributed among all T states and all rotation gates, respectively. If there are no rotation gates in the input algorithm, the error budget is uniformly distributed to logical errors and T state errors.`,
436
+ });
437
+ entries.push({
438
+ path: "physicalCountsFormatted/errorBudgetLogical",
439
+ label: "Logical error probability",
440
+ description: `Probability of at least one logical error`,
441
+ explanation: `This is one third of the total error budget ${result.physicalCountsFormatted.errorBudget} if the input algorithm contains rotation with gates with arbitrary angles, or one half of it, otherwise.`,
442
+ });
443
+ entries.push({
444
+ path: "physicalCountsFormatted/errorBudgetTstates",
445
+ label: "T distillation error probability",
446
+ description: `Probability of at least one faulty T distillation`,
447
+ explanation: `This is one third of the total error budget ${result.physicalCountsFormatted.errorBudget} if the input algorithm contains rotation with gates with arbitrary angles, or one half of it, otherwise.`,
448
+ });
449
+ entries.push({
450
+ path: "physicalCountsFormatted/errorBudgetRotations",
451
+ label: "Rotation synthesis error probability",
452
+ description: `Probability of at least one failed rotation synthesis`,
453
+ explanation: `This is one third of the total error budget ${result.physicalCountsFormatted.errorBudget}.`,
454
+ });
455
+ groups.push({
456
+ title: "Assumed error budget",
457
+ alwaysVisible: false,
458
+ entries: entries,
459
+ });
460
+
461
+ entries = [];
462
+ entries.push({
463
+ path: "jobParams/qubitParams/name",
464
+ label: "Qubit name",
465
+ description: `Some descriptive name for the qubit model`,
466
+ explanation: `You can load pre-defined qubit parameters by using the names \`qubit_gate_ns_e3\`, \`qubit_gate_ns_e4\`, \`qubit_gate_us_e3\`, \`qubit_gate_us_e4\`, \`qubit_maj_ns_e4\`, or \`qubit_maj_ns_e6\`. The names of these pre-defined qubit parameters indicate the instruction set (gate-based or Majorana), the operation speed (ns or µs regime), as well as the fidelity (e.g., e3 for $10^{-3}$ gate error rates).`,
467
+ });
468
+ entries.push({
469
+ path: "jobParams/qubitParams/instructionSet",
470
+ label: "Instruction set",
471
+ description: `Underlying qubit technology (gate-based or Majorana)`,
472
+ explanation: `When modeling the physical qubit abstractions, we distinguish between two different physical instruction sets that are used to operate the qubits. The physical instruction set can be either _gate-based_ or _Majorana_. A gate-based instruction set provides single-qubit measurement, single-qubit gates (incl. T gates), and two-qubit gates. A Majorana instruction set provides a physical T gate, single-qubit measurement and two-qubit joint measurement operations.`,
473
+ });
474
+ entries.push({
475
+ path: "jobParams/qubitParams/oneQubitMeasurementTime",
476
+ label: "Single-qubit measurement time",
477
+ description: `Operation time for single-qubit measurement (t_meas) in ns`,
478
+ explanation: `This is the operation time in nanoseconds to perform a single-qubit measurement in the Pauli basis.`,
479
+ });
480
+ if (result.jobParams.qubitParams.instructionSet == "Majorana") {
481
+ entries.push({
482
+ path: "jobParams/qubitParams/twoQubitJointMeasurementTime",
483
+ label: "Two-qubit measurement time",
484
+ description: `Operation time for two-qubit measurement in ns`,
485
+ explanation: `This is the operation time in nanoseconds to perform a non-destructive two-qubit joint Pauli measurement.`,
486
+ });
487
+ }
488
+ if (result.jobParams.qubitParams.instructionSet == "GateBased") {
489
+ entries.push({
490
+ path: "jobParams/qubitParams/oneQubitGateTime",
491
+ label: "Single-qubit gate time",
492
+ description: `Operation time for single-qubit gate (t_gate) in ns`,
493
+ explanation: `This is the operation time in nanoseconds to perform a single-qubit Clifford operation, e.g., Hadamard or Phase gates.`,
494
+ });
495
+ }
496
+ if (result.jobParams.qubitParams.instructionSet == "GateBased") {
497
+ entries.push({
498
+ path: "jobParams/qubitParams/twoQubitGateTime",
499
+ label: "Two-qubit gate time",
500
+ description: `Operation time for two-qubit gate in ns`,
501
+ explanation: `This is the operation time in nanoseconds to perform a two-qubit Clifford operation, e.g., a CNOT or CZ gate.`,
502
+ });
503
+ }
504
+ entries.push({
505
+ path: "jobParams/qubitParams/tGateTime",
506
+ label: "T gate time",
507
+ description: `Operation time for a T gate`,
508
+ explanation: `This is the operation time in nanoseconds to execute a T gate.`,
509
+ });
510
+ entries.push({
511
+ path: "jobParams/qubitParams/oneQubitMeasurementErrorRate",
512
+ label: "Single-qubit measurement error rate",
513
+ description: `Error rate for single-qubit measurement`,
514
+ explanation: `This is the probability in which a single-qubit measurement in the Pauli basis may fail.`,
515
+ });
516
+ if (result.jobParams.qubitParams.instructionSet == "Majorana") {
517
+ entries.push({
518
+ path: "jobParams/qubitParams/twoQubitJointMeasurementErrorRate",
519
+ label: "Two-qubit measurement error rate",
520
+ description: `Error rate for two-qubit measurement`,
521
+ explanation: `This is the probability in which a non-destructive two-qubit joint Pauli measurement may fail.`,
522
+ });
523
+ }
524
+ if (result.jobParams.qubitParams.instructionSet == "GateBased") {
525
+ entries.push({
526
+ path: "jobParams/qubitParams/oneQubitGateErrorRate",
527
+ label: "Single-qubit error rate",
528
+ description: `Error rate for single-qubit Clifford gate (p)`,
529
+ explanation: `This is the probability in which a single-qubit Clifford operation, e.g., Hadamard or Phase gates, may fail.`,
530
+ });
531
+ }
532
+ if (result.jobParams.qubitParams.instructionSet == "GateBased") {
533
+ entries.push({
534
+ path: "jobParams/qubitParams/twoQubitGateErrorRate",
535
+ label: "Two-qubit error rate",
536
+ description: `Error rate for two-qubit Clifford gate`,
537
+ explanation: `This is the probability in which a two-qubit Clifford operation, e.g., CNOT or CZ gates, may fail.`,
538
+ });
539
+ }
540
+ entries.push({
541
+ path: "jobParams/qubitParams/tGateErrorRate",
542
+ label: "T gate error rate",
543
+ description: `Error rate to prepare single-qubit T state or apply a T gate (p_T)`,
544
+ explanation: `This is the probability in which executing a single T gate may fail.`,
545
+ });
546
+ groups.push({
547
+ title: "Physical qubit parameters",
548
+ alwaysVisible: false,
549
+ entries: entries,
550
+ });
551
+
552
+ entries = [];
553
+ entries.push({
554
+ path: "physicalCountsFormatted/logicalDepthFactor",
555
+ label: "Logical depth factor",
556
+ description: `Factor, the initial number of logical cycles is multiplied by`,
557
+ explanation: `This is the factor takes into account a potential overhead to the initial number of logical cycles.`,
558
+ });
559
+ entries.push({
560
+ path: "physicalCountsFormatted/maxTFactories",
561
+ label: "Maximum number of T factories",
562
+ description: `The maximum number of T factories can be utilized during the algorithm's runtime`,
563
+ explanation: `This is the maximum number of T factories used for producing the demanded T states, which can be created and executed by the algorithm in parallel.`,
564
+ });
565
+ entries.push({
566
+ path: "physicalCountsFormatted/maxDuration",
567
+ label: "Maximum runtime duration",
568
+ description: `The maximum runtime duration allowed for the algorithm runtime`,
569
+ explanation: `This is the maximum time allowed to the algorithm. If specified, the estimator targets to minimize the number of physical qubits consumed by the algorithm for runtimes under the maximum allowed.`,
570
+ });
571
+ entries.push({
572
+ path: "physicalCountsFormatted/maxPhysicalQubits",
573
+ label: "Maximum number of physical qubits",
574
+ description: `The maximum number of physical qubits allowed for utilization to the algorithm`,
575
+ explanation: `This is the maximum number of physical qubits available to the algorithm. If specified, the estimator targets to minimize the runtime of the algorithm with number of physical qubits consumed not exceeding this maximum.`,
576
+ });
577
+ groups.push({ title: "Constraints", alwaysVisible: false, entries: entries });
578
+
579
+ const assumptions = [
580
+ "_More details on the following lists of assumptions can be found in the paper [Accessing requirements for scaling quantum computers and their applications](https://aka.ms/AQ/RE/Paper)._",
581
+ "**Uniform independent physical noise.** We assume that the noise on physical qubits and physical qubit operations is the standard circuit noise model. In particular we assume error events at different space-time locations are independent and that error rates are uniform across the system in time and space.",
582
+ "**Efficient classical computation.** We assume that classical overhead (compilation, control, feedback, readout, decoding, etc.) does not dominate the overall cost of implementing the full quantum algorithm.",
583
+ "**Extraction circuits for planar quantum ISA.** We assume that stabilizer extraction circuits with similar depth and error correction performance to those for standard surface and Hastings-Haah code patches can be constructed to implement all operations of the planar quantum ISA (instruction set architecture).",
584
+ "**Uniform independent logical noise.** We assume that the error rate of a logical operation is approximately equal to its space-time volume (the number of tiles multiplied by the number of logical time steps) multiplied by the error rate of a logical qubit in a standard one-tile patch in one logical time step.",
585
+ "**Negligible Clifford costs for synthesis.** We assume that the space overhead for synthesis and space and time overhead for transport of magic states within magic state factories and to synthesis qubits are all negligible.",
586
+ "**Smooth magic state consumption rate.** We assume that the rate of T state consumption throughout the compiled algorithm is almost constant, or can be made almost constant without significantly increasing the number of logical time steps for the algorithm.",
587
+ ];
588
+
589
+ return { groups: groups, assumptions: assumptions };
590
+ }
591
+ // END OF AUTOMATICALLY GENERATED CODE