diff --git a/3_QuantumResourceEstimator/ShorRE.ipynb b/3_QuantumResourceEstimator/ShorRE.ipynb
new file mode 100644
index 0000000..05f6492
--- /dev/null
+++ b/3_QuantumResourceEstimator/ShorRE.ipynb
@@ -0,0 +1,1846 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "application/javascript": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// This file provides CodeMirror syntax highlighting for Q# magic cells\n// in classic Jupyter Notebooks. It does nothing in other (Jupyter Notebook 7,\n// VS Code, Azure Notebooks, etc.) environments.\n\n// Detect the prerequisites and do nothing if they don't exist.\nif (window.require && window.CodeMirror && window.Jupyter) {\n // The simple mode plugin for CodeMirror is not loaded by default, so require it.\n window.require([\"codemirror/addon/mode/simple\"], function defineMode() {\n let rules = [\n {\n token: \"comment\",\n regex: /(\\/\\/).*/,\n beginWord: false,\n },\n {\n token: \"string\",\n regex: String.raw`^\\\"(?:[^\\\"\\\\]|\\\\[\\s\\S])*(?:\\\"|$)`,\n beginWord: false,\n },\n {\n token: \"keyword\",\n regex: String.raw`(namespace|open|as|operation|function|body|adjoint|newtype|controlled|internal)\\b`,\n beginWord: true,\n },\n {\n token: \"keyword\",\n regex: String.raw`(if|elif|else|repeat|until|fixup|for|in|return|fail|within|apply)\\b`,\n beginWord: true,\n },\n {\n token: \"keyword\",\n regex: String.raw`(Adjoint|Controlled|Adj|Ctl|is|self|auto|distribute|invert|intrinsic)\\b`,\n beginWord: true,\n },\n {\n token: \"keyword\",\n regex: String.raw`(let|set|use|borrow|mutable)\\b`,\n beginWord: true,\n },\n {\n token: \"operatorKeyword\",\n regex: String.raw`(not|and|or)\\b|(w/)`,\n beginWord: true,\n },\n {\n token: \"operatorKeyword\",\n regex: String.raw`(=)|(!)|(<)|(>)|(\\+)|(-)|(\\*)|(/)|(\\^)|(%)|(\\|)|(&&&)|(~~~)|(\\.\\.\\.)|(\\.\\.)|(\\?)`,\n beginWord: false,\n },\n {\n token: \"meta\",\n regex: String.raw`(Int|BigInt|Double|Bool|Qubit|Pauli|Result|Range|String|Unit)\\b`,\n beginWord: true,\n },\n {\n token: \"atom\",\n regex: String.raw`(true|false|Pauli(I|X|Y|Z)|One|Zero)\\b`,\n beginWord: true,\n },\n ];\n let simpleRules = [];\n for (let rule of rules) {\n simpleRules.push({\n token: rule.token,\n regex: new RegExp(rule.regex, \"g\"),\n sol: rule.beginWord,\n });\n if (rule.beginWord) {\n // Need an additional rule due to the fact that CodeMirror simple mode doesn't work with ^ token\n simpleRules.push({\n token: rule.token,\n regex: new RegExp(String.raw`\\W` + rule.regex, \"g\"),\n sol: false,\n });\n }\n }\n\n // Register the mode defined above with CodeMirror\n window.CodeMirror.defineSimpleMode(\"qsharp\", { start: simpleRules });\n window.CodeMirror.defineMIME(\"text/x-qsharp\", \"qsharp\");\n\n // Tell Jupyter to associate %%qsharp magic cells with the qsharp mode\n window.Jupyter.CodeCell.options_default.highlight_modes[\"qsharp\"] = {\n reg: [/^%%qsharp/],\n };\n\n // Force re-highlighting of all cells the first time this code runs\n for (const cell of window.Jupyter.notebook.get_cells()) {\n cell.auto_highlight();\n }\n });\n}\n",
+ "text/plain": []
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "import qsharp"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "vscode": {
+ "languageId": "qsharp"
+ }
+ },
+ "outputs": [],
+ "source": [
+ "%%qsharp\n",
+ "open Microsoft.Quantum.Arrays;\n",
+ "open Microsoft.Quantum.Canon;\n",
+ "open Microsoft.Quantum.Convert;\n",
+ "open Microsoft.Quantum.Diagnostics;\n",
+ "open Microsoft.Quantum.Intrinsic;\n",
+ "open Microsoft.Quantum.Math;\n",
+ "open Microsoft.Quantum.Measurement;\n",
+ "open Microsoft.Quantum.Unstable.Arithmetic;\n",
+ "open Microsoft.Quantum.ResourceEstimation;\n",
+ "\n",
+ "operation RunProgram() : Unit {\n",
+ " let bitsize = 31;\n",
+ "\n",
+ " // When choosing parameters for `EstimateFrequency`, make sure that\n",
+ " // generator and modules are not co-prime\n",
+ " let _ = EstimateFrequency(11, 2^bitsize - 1, bitsize);\n",
+ "}\n",
+ "\n",
+ "\n",
+ "// In this sample we concentrate on costing the `EstimateFrequency`\n",
+ "// operation, which is the core quantum operation in Shors algorithm, and\n",
+ "// we omit the classical pre- and post-processing.\n",
+ "\n",
+ "/// # Summary\n",
+ "/// Estimates the frequency of a generator\n",
+ "/// in the residue ring Z mod `modulus`.\n",
+ "///\n",
+ "/// # Input\n",
+ "/// ## generator\n",
+ "/// The unsigned integer multiplicative order (period)\n",
+ "/// of which is being estimated. Must be co-prime to `modulus`.\n",
+ "/// ## modulus\n",
+ "/// The modulus which defines the residue ring Z mod `modulus`\n",
+ "/// in which the multiplicative order of `generator` is being estimated.\n",
+ "/// ## bitsize\n",
+ "/// Number of bits needed to represent the modulus.\n",
+ "///\n",
+ "/// # Output\n",
+ "/// The numerator k of dyadic fraction k/2^bitsPrecision\n",
+ "/// approximating s/r.\n",
+ "operation EstimateFrequency(\n",
+ " generator : Int,\n",
+ " modulus : Int,\n",
+ " bitsize : Int\n",
+ ")\n",
+ ": Int {\n",
+ " mutable frequencyEstimate = 0;\n",
+ " let bitsPrecision = 2 * bitsize + 1;\n",
+ "\n",
+ " // Allocate qubits for the superposition of eigenstates of\n",
+ " // the oracle that is used in period finding.\n",
+ " use eigenstateRegister = Qubit[bitsize];\n",
+ "\n",
+ " // Initialize eigenstateRegister to 1, which is a superposition of\n",
+ " // the eigenstates we are estimating the phases of.\n",
+ " // We first interpret the register as encoding an unsigned integer\n",
+ " // in little endian encoding.\n",
+ " ApplyXorInPlace(1, eigenstateRegister);\n",
+ " let oracle = ApplyOrderFindingOracle(generator, modulus, _, _);\n",
+ "\n",
+ " // Use phase estimation with a semiclassical Fourier transform to\n",
+ " // estimate the frequency.\n",
+ " use c = Qubit();\n",
+ " for idx in bitsPrecision - 1..-1..0 {\n",
+ " within {\n",
+ " H(c);\n",
+ " } apply {\n",
+ " // `BeginEstimateCaching` and `EndEstimateCaching` are the operations\n",
+ " // exposed by Azure Quantum Resource Estimator. These will instruct\n",
+ " // resource counting such that the if-block will be executed\n",
+ " // only once, its resources will be cached, and appended in\n",
+ " // every other iteration.\n",
+ " if BeginEstimateCaching(\"ControlledOracle\", SingleVariant()) {\n",
+ " Controlled oracle([c], (1 <<< idx, eigenstateRegister));\n",
+ " EndEstimateCaching();\n",
+ " }\n",
+ " R1Frac(frequencyEstimate, bitsPrecision - 1 - idx, c);\n",
+ " }\n",
+ " if MResetZ(c) == One {\n",
+ " set frequencyEstimate += 1 <<< (bitsPrecision - 1 - idx);\n",
+ " }\n",
+ " }\n",
+ "\n",
+ " // Return all the qubits used for oracles eigenstate back to 0 state\n",
+ " // using Microsoft.Quantum.Intrinsic.ResetAll.\n",
+ " ResetAll(eigenstateRegister);\n",
+ "\n",
+ " return frequencyEstimate;\n",
+ "}\n",
+ "\n",
+ "/// # Summary\n",
+ "/// Interprets `target` as encoding unsigned little-endian integer k\n",
+ "/// and performs transformation |k⟩ ↦ |gᵖ⋅k mod N ⟩ where\n",
+ "/// p is `power`, g is `generator` and N is `modulus`.\n",
+ "///\n",
+ "/// # Input\n",
+ "/// ## generator\n",
+ "/// The unsigned integer multiplicative order ( period )\n",
+ "/// of which is being estimated. Must be co-prime to `modulus`.\n",
+ "/// ## modulus\n",
+ "/// The modulus which defines the residue ring Z mod `modulus`\n",
+ "/// in which the multiplicative order of `generator` is being estimated.\n",
+ "/// ## power\n",
+ "/// Power of `generator` by which `target` is multiplied.\n",
+ "/// ## target\n",
+ "/// Register interpreted as LittleEndian which is multiplied by\n",
+ "/// given power of the generator. The multiplication is performed modulo\n",
+ "/// `modulus`.\n",
+ "internal operation ApplyOrderFindingOracle(\n",
+ " generator : Int, modulus : Int, power : Int, target : Qubit[]\n",
+ ")\n",
+ ": Unit\n",
+ "is Adj + Ctl {\n",
+ " // The oracle we use for order finding implements |x⟩ ↦ |x⋅a mod N⟩. We\n",
+ " // also use `ExpModI` to compute a by which x must be multiplied. Also\n",
+ " // note that we interpret target as unsigned integer in little-endian\n",
+ " // encoding by using the `LittleEndian` type.\n",
+ " ModularMultiplyByConstant(modulus,\n",
+ " ExpModI(generator, power, modulus),\n",
+ " target);\n",
+ "}\n",
+ "\n",
+ "/// # Summary\n",
+ "/// Performs modular in-place multiplication by a classical constant.\n",
+ "///\n",
+ "/// # Description\n",
+ "/// Given the classical constants `c` and `modulus`, and an input\n",
+ "/// quantum register (as LittleEndian) |𝑦⟩, this operation\n",
+ "/// computes `(c*x) % modulus` into |𝑦⟩.\n",
+ "///\n",
+ "/// # Input\n",
+ "/// ## modulus\n",
+ "/// Modulus to use for modular multiplication\n",
+ "/// ## c\n",
+ "/// Constant by which to multiply |𝑦⟩\n",
+ "/// ## y\n",
+ "/// Quantum register of target\n",
+ "internal operation ModularMultiplyByConstant(modulus : Int, c : Int, y : Qubit[])\n",
+ ": Unit is Adj + Ctl {\n",
+ " use qs = Qubit[Length(y)];\n",
+ " for (idx, yq) in Enumerated(y) {\n",
+ " let shiftedC = (c <<< idx) % modulus;\n",
+ " Controlled ModularAddConstant([yq], (modulus, shiftedC, qs));\n",
+ " }\n",
+ " ApplyToEachCA(SWAP, Zipped(y, qs));\n",
+ " let invC = InverseModI(c, modulus);\n",
+ " for (idx, yq) in Enumerated(y) {\n",
+ " let shiftedC = (invC <<< idx) % modulus;\n",
+ " Controlled ModularAddConstant([yq], (modulus, modulus - shiftedC, qs));\n",
+ " }\n",
+ "}\n",
+ "\n",
+ "/// # Summary\n",
+ "/// Performs modular in-place addition of a classical constant into a\n",
+ "/// quantum register.\n",
+ "///\n",
+ "/// # Description\n",
+ "/// Given the classical constants `c` and `modulus`, and an input\n",
+ "/// quantum register (as LittleEndian) |𝑦⟩, this operation\n",
+ "/// computes `(x+c) % modulus` into |𝑦⟩.\n",
+ "///\n",
+ "/// # Input\n",
+ "/// ## modulus\n",
+ "/// Modulus to use for modular addition\n",
+ "/// ## c\n",
+ "/// Constant to add to |𝑦⟩\n",
+ "/// ## y\n",
+ "/// Quantum register of target\n",
+ "internal operation ModularAddConstant(modulus : Int, c : Int, y : Qubit[])\n",
+ ": Unit is Adj + Ctl {\n",
+ " body (...) {\n",
+ " Controlled ModularAddConstant([], (modulus, c, y));\n",
+ " }\n",
+ " controlled (ctrls, ...) {\n",
+ " // We apply a custom strategy to control this operation instead of\n",
+ " // letting the compiler create the controlled variant for us in which\n",
+ " // the `Controlled` functor would be distributed over each operation\n",
+ " // in the body.\n",
+ " //\n",
+ " // Here we can use some scratch memory to save ensure that at most one\n",
+ " // control qubit is used for costly operations such as `AddConstant`\n",
+ " // and `CompareGreaterThenOrEqualConstant`.\n",
+ " if Length(ctrls) >= 2 {\n",
+ " use control = Qubit();\n",
+ " within {\n",
+ " Controlled X(ctrls, control);\n",
+ " } apply {\n",
+ " Controlled ModularAddConstant([control], (modulus, c, y));\n",
+ " }\n",
+ " } else {\n",
+ " use carry = Qubit();\n",
+ " Controlled AddConstant(ctrls, (c, y + [carry]));\n",
+ " Controlled Adjoint AddConstant(ctrls, (modulus, y + [carry]));\n",
+ " Controlled AddConstant([carry], (modulus, y));\n",
+ " Controlled CompareGreaterThanOrEqualConstant(ctrls, (c, y, carry));\n",
+ " }\n",
+ " }\n",
+ "}\n",
+ "\n",
+ "/// # Summary\n",
+ "/// Performs in-place addition of a constant into a quantum register.\n",
+ "///\n",
+ "/// # Description\n",
+ "/// Given a non-empty quantum register |𝑦⟩ of length 𝑛+1 and a positive\n",
+ "/// constant 𝑐 < 2ⁿ, computes |𝑦 + c⟩ into |𝑦⟩.\n",
+ "///\n",
+ "/// # Input\n",
+ "/// ## c\n",
+ "/// Constant number to add to |𝑦⟩.\n",
+ "/// ## y\n",
+ "/// Quantum register of second summand and target; must not be empty.\n",
+ "internal operation AddConstant(c : Int, y : Qubit[]) : Unit is Adj + Ctl {\n",
+ " // We are using this version instead of the library version that is based\n",
+ " // on Fourier angles to show an advantage of sparse simulation in this sample.\n",
+ "\n",
+ " let n = Length(y);\n",
+ " Fact(n > 0, \"Bit width must be at least 1\");\n",
+ "\n",
+ " Fact(c >= 0, \"constant must not be negative\");\n",
+ " Fact(c < 2 ^ n, $\"constant must be smaller than {2L ^ n}\");\n",
+ "\n",
+ " if c != 0 {\n",
+ " // If c has j trailing zeroes than the j least significant bits\n",
+ " // of y will not be affected by the addition and can therefore be\n",
+ " // ignored by applying the addition only to the other qubits and\n",
+ " // shifting c accordingly.\n",
+ " let j = NTrailingZeroes(c);\n",
+ " use x = Qubit[n - j];\n",
+ " within {\n",
+ " ApplyXorInPlace(c >>> j, x);\n",
+ " } apply {\n",
+ " IncByLE(x, y[j...]);\n",
+ " }\n",
+ " }\n",
+ "}\n",
+ "\n",
+ "/// # Summary\n",
+ "/// Performs greater-than-or-equals comparison to a constant.\n",
+ "///\n",
+ "/// # Description\n",
+ "/// Toggles output qubit `target` if and only if input register `x`\n",
+ "/// is greater than or equal to `c`.\n",
+ "///\n",
+ "/// # Input\n",
+ "/// ## c\n",
+ "/// Constant value for comparison.\n",
+ "/// ## x\n",
+ "/// Quantum register to compare against.\n",
+ "/// ## target\n",
+ "/// Target qubit for comparison result.\n",
+ "///\n",
+ "/// # Reference\n",
+ "/// This construction is described in [Lemma 3, arXiv:2201.10200]\n",
+ "/// https://arxiv.org/pdf/2201.10200\n",
+ "internal operation CompareGreaterThanOrEqualConstant(c : Int, x : Qubit[], target : Qubit)\n",
+ ": Unit is Adj+Ctl {\n",
+ " let bitWidth = Length(x);\n",
+ "\n",
+ " if c == 0 {\n",
+ " X(target);\n",
+ " } elif c >= 2 ^ bitWidth {\n",
+ " // do nothing\n",
+ " } elif c == 2 ^ (bitWidth - 1) {\n",
+ " ApplyLowTCNOT(Tail(x), target);\n",
+ " } else {\n",
+ " // normalize constant\n",
+ " let l = NTrailingZeroes(c);\n",
+ "\n",
+ " let cNormalized = c >>> l;\n",
+ " let xNormalized = x[l...];\n",
+ " let bitWidthNormalized = Length(xNormalized);\n",
+ " let gates = Rest(IntAsBoolArray(cNormalized, bitWidthNormalized));\n",
+ "\n",
+ " use qs = Qubit[bitWidthNormalized - 1];\n",
+ " let cs1 = [Head(xNormalized)] + Most(qs);\n",
+ " let cs2 = Rest(xNormalized);\n",
+ "\n",
+ " within {\n",
+ " for i in IndexRange(gates) {\n",
+ " (gates[i] ? ApplyAnd | ApplyOr)(cs1[i], cs2[i], qs[i]);\n",
+ " }\n",
+ " } apply {\n",
+ " ApplyLowTCNOT(Tail(qs), target);\n",
+ " }\n",
+ " }\n",
+ "}\n",
+ "\n",
+ "/// # Summary\n",
+ "/// Internal operation used in the implementation of GreaterThanOrEqualConstant.\n",
+ "internal operation ApplyOr(control1 : Qubit, control2 : Qubit, target : Qubit) : Unit is Adj {\n",
+ " within {\n",
+ " ApplyToEachA(X, [control1, control2]);\n",
+ " } apply {\n",
+ " ApplyAnd(control1, control2, target);\n",
+ " X(target);\n",
+ " }\n",
+ "}\n",
+ "\n",
+ "internal operation ApplyAnd(control1 : Qubit, control2 : Qubit, target : Qubit)\n",
+ ": Unit is Adj {\n",
+ " body (...) {\n",
+ " CCNOT(control1, control2, target);\n",
+ " }\n",
+ " adjoint (...) {\n",
+ " H(target);\n",
+ " if (M(target) == One) {\n",
+ " X(target);\n",
+ " CZ(control1, control2);\n",
+ " }\n",
+ " }\n",
+ "}\n",
+ "\n",
+ "\n",
+ "/// # Summary\n",
+ "/// Returns the number of trailing zeroes of a number\n",
+ "///\n",
+ "/// ## Example\n",
+ "/// ```qsharp\n",
+ "/// let zeroes = NTrailingZeroes(21); // = NTrailingZeroes(0b1101) = 0\n",
+ "/// let zeroes = NTrailingZeroes(20); // = NTrailingZeroes(0b1100) = 2\n",
+ "/// ```\n",
+ "internal function NTrailingZeroes(number : Int) : Int {\n",
+ " mutable nZeroes = 0;\n",
+ " mutable copy = number;\n",
+ " while (copy % 2 == 0) {\n",
+ " set nZeroes += 1;\n",
+ " set copy /= 2;\n",
+ " }\n",
+ " return nZeroes;\n",
+ "}\n",
+ "\n",
+ "/// # Summary\n",
+ "/// An implementation for `CNOT` that when controlled using a single control uses\n",
+ "/// a helper qubit and uses `ApplyAnd` to reduce the T-count to 4 instead of 7.\n",
+ "internal operation ApplyLowTCNOT(a : Qubit, b : Qubit) : Unit is Adj+Ctl {\n",
+ " body (...) {\n",
+ " CNOT(a, b);\n",
+ " }\n",
+ "\n",
+ " adjoint self;\n",
+ "\n",
+ " controlled (ctls, ...) {\n",
+ " // In this application this operation is used in a way that\n",
+ " // it is controlled by at most one qubit.\n",
+ " Fact(Length(ctls) <= 1, \"At most one control line allowed\");\n",
+ "\n",
+ " if IsEmpty(ctls) {\n",
+ " CNOT(a, b);\n",
+ " } else {\n",
+ " use q = Qubit();\n",
+ " within {\n",
+ " ApplyAnd(Head(ctls), a, q);\n",
+ " } apply {\n",
+ " CNOT(q, b);\n",
+ " }\n",
+ " }\n",
+ " }\n",
+ "\n",
+ " controlled adjoint self;\n",
+ "}"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {},
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ " \n",
+ " \n",
+ " Physical resource estimates\n",
+ "
\n",
+ " \n",
+ " \n",
+ " Runtime | \n",
+ " 31 secs | \n",
+ " \n",
+ " Total runtime\n",
+ " \n",
+ " 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 (8,400 nanosecs) multiplied by the 3,635,730 logical cycles to run the algorithm. If however the duration of a single T factory (here: 120,000 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.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " rQOPS | \n",
+ " 26.55M | \n",
+ " \n",
+ " Reliable quantum operations per second\n",
+ " \n",
+ " The value is computed as the number of logical qubits after layout (223) (with a logical error rate of 4.11e-13) multiplied by the clock frequency (119,047.62), which is the number of logical cycles per second.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Physical qubits | \n",
+ " 829.77k | \n",
+ " \n",
+ " Number of physical qubits\n",
+ " \n",
+ " This value represents the total number of physical qubits, which is the sum of 196,686 physical qubits to implement the algorithm logic, and 633,080 physical qubits to execute the T factories that are responsible to produce the T states that are consumed by the algorithm.\n",
+ " | \n",
+ "
\n",
+ "
\n",
+ " \n",
+ " \n",
+ " Resource estimates breakdown\n",
+ "
\n",
+ " \n",
+ " \n",
+ " Logical algorithmic qubits | \n",
+ " 223 | \n",
+ " \n",
+ " Number of logical qubits for the algorithm after layout\n",
+ " \n",
+ " Laying out the logical qubits in the presence of nearest-neighbor constraints requires additional logical qubits. In particular, to layout the $Q_{\\rm alg} = 97$ logical qubits in the input algorithm, we require in total $2 \\cdot Q_{\\rm alg} + \\lceil \\sqrt{8 \\cdot Q_{\\rm alg}}\\rceil + 1 = 223$ logical qubits.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Algorithmic depth | \n",
+ " 3.64M | \n",
+ " \n",
+ " Number of logical cycles for the algorithm\n",
+ " \n",
+ " 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 109,746 single-qubit measurements, the 59 arbitrary single-qubit rotations, and the 1 T gates, three multi-qubit measurements for each of the 1,175,013 CCZ and 0 CCiX gates in the input program, as well as 15 multi-qubit measurements for each of the 59 non-Clifford layers in which there is at least one single-qubit rotation with an arbitrary angle rotation.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Logical depth | \n",
+ " 3.64M | \n",
+ " \n",
+ " Number of logical cycles performed\n",
+ " \n",
+ " This number is usually equal to the logical depth of the algorithm, which is 3,635,730. 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.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Clock frequency | \n",
+ " 119.05k | \n",
+ " \n",
+ " Number of logical cycles per second\n",
+ " \n",
+ " This is the number of logical cycles that can be performed within one second. The logical cycle time is 8 microsecs.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Number of T states | \n",
+ " 4.70M | \n",
+ " \n",
+ " Number of T states consumed by the algorithm\n",
+ " \n",
+ " To execute the algorithm, we require one T state for each of the 1 T gates, four T states for each of the 1,175,013 CCZ and 0 CCiX gates, as well as 15 for each of the 59 single-qubit rotation gates with arbitrary angle rotation.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Number of T factories | \n",
+ " 19 | \n",
+ " \n",
+ " Number of T factories capable of producing the demanded 4,700,938 T states during the algorithm's runtime\n",
+ " \n",
+ " The total number of T factories 19 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{4,700,938 \\cdot 120,000\\;\\text{ns}}{1 \\cdot 30,540,132,000\\;\\text{ns}}\\right\\rceil$\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Number of T factory invocations | \n",
+ " 247.42k | \n",
+ " \n",
+ " Number of times all T factories are invoked\n",
+ " \n",
+ " In order to prepare the 4,700,938 T states, the 19 copies of the T factory are repeatedly invoked 247,418 times.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Physical algorithmic qubits | \n",
+ " 196.69k | \n",
+ " \n",
+ " Number of physical qubits for the algorithm after layout\n",
+ " \n",
+ " The 196,686 are the product of the 223 logical qubits after layout and the 882 physical qubits that encode a single logical qubit.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Physical T factory qubits | \n",
+ " 633.08k | \n",
+ " \n",
+ " Number of physical qubits for the T factories\n",
+ " \n",
+ " Each T factory requires 33,320 physical qubits and we run 19 in parallel, therefore we need $633,080 = 33,320 \\cdot 19$ qubits.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Required logical qubit error rate | \n",
+ " 4.11e-13 | \n",
+ " \n",
+ " The minimum logical qubit error rate required to run the algorithm within the error budget\n",
+ " \n",
+ " The minimum logical qubit error rate is obtained by dividing the logical error probability 3.33e-4 by the product of 223 logical qubits and the total cycle count 3,635,730.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Required logical T state error rate | \n",
+ " 7.09e-11 | \n",
+ " \n",
+ " The minimum T state error rate required for distilled T states\n",
+ " \n",
+ " The minimum T state error rate is obtained by dividing the T distillation error probability 3.33e-4 by the total number of T states 4,700,938.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Number of T states per rotation | \n",
+ " 15 | \n",
+ " \n",
+ " Number of T states to implement a rotation with an arbitrary angle\n",
+ " \n",
+ " The number of T states to implement a rotation with an arbitrary angle is $\\lceil 0.53 \\log_2(59 / 0.0003333333333333333) + 4.86\\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.\n",
+ " | \n",
+ "
\n",
+ "
\n",
+ " \n",
+ " \n",
+ " Logical qubit parameters\n",
+ "
\n",
+ " \n",
+ " \n",
+ " QEC scheme | \n",
+ " surface_code | \n",
+ " \n",
+ " Name of QEC scheme\n",
+ " \n",
+ " You can load pre-defined QEC schemes by using the name `surface_code` or `floquet_code`. The latter only works with Majorana qubits.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Code distance | \n",
+ " 21 | \n",
+ " \n",
+ " Required code distance for error correction\n",
+ " \n",
+ " The code distance is the smallest odd integer greater or equal to $\\dfrac{2\\log(0.03 / 0.0000000000004111329254130006)}{\\log(0.01/0.001)} - 1$\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Physical qubits | \n",
+ " 882 | \n",
+ " \n",
+ " Number of physical qubits per logical qubit\n",
+ " \n",
+ " The number of physical qubits per logical qubit are evaluated using the formula 2 * codeDistance * codeDistance that can be user-specified.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Logical cycle time | \n",
+ " 8 microsecs | \n",
+ " \n",
+ " Duration of a logical cycle in nanoseconds\n",
+ " \n",
+ " The runtime of one logical cycle in nanoseconds is evaluated using the formula (4 * twoQubitGateTime + 2 * oneQubitMeasurementTime) * codeDistance that can be user-specified.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Logical qubit error rate | \n",
+ " 3.00e-13 | \n",
+ " \n",
+ " Logical qubit error rate\n",
+ " \n",
+ " The logical qubit error rate is computed as $0.03 \\cdot \\left(\\dfrac{0.001}{0.01}\\right)^\\frac{21 + 1}{2}$\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Crossing prefactor | \n",
+ " 0.03 | \n",
+ " \n",
+ " Crossing prefactor used in QEC scheme\n",
+ " \n",
+ " The crossing prefactor is usually extracted numerically from simulations when fitting an exponential curve to model the relationship between logical and physical error rate.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Error correction threshold | \n",
+ " 0.01 | \n",
+ " \n",
+ " Error correction threshold used in QEC scheme\n",
+ " \n",
+ " 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.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Logical cycle time formula | \n",
+ " (4 * twoQubitGateTime + 2 * oneQubitMeasurementTime) * codeDistance | \n",
+ " \n",
+ " QEC scheme formula used to compute logical cycle time\n",
+ " \n",
+ " This is the formula that is used to compute the logical cycle time 8,400 ns.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Physical qubits formula | \n",
+ " 2 * codeDistance * codeDistance | \n",
+ " \n",
+ " QEC scheme formula used to compute number of physical qubits per logical qubit\n",
+ " \n",
+ " This is the formula that is used to compute the number of physical qubits per logical qubits 882.\n",
+ " | \n",
+ "
\n",
+ "
\n",
+ " \n",
+ " \n",
+ " T factory parameters\n",
+ "
\n",
+ " \n",
+ " \n",
+ " Physical qubits | \n",
+ " 33.32k | \n",
+ " \n",
+ " Number of physical qubits for a single T factory\n",
+ " \n",
+ " 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.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Runtime | \n",
+ " 120 microsecs | \n",
+ " \n",
+ " Runtime of a single T factory\n",
+ " \n",
+ " The runtime of a single T factory is the accumulated runtime of executing each round in a T factory.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Number of output T states per run | \n",
+ " 1 | \n",
+ " \n",
+ " Number of output T states produced in a single run of T factory\n",
+ " \n",
+ " The T factory takes as input 255 noisy physical T states with an error rate of 0.001 and produces 1 T states with an error rate of 2.16e-11.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Number of input T states per run | \n",
+ " 255 | \n",
+ " \n",
+ " Number of physical input T states consumed in a single run of a T factory\n",
+ " \n",
+ " This value includes the physical input T states of all copies of the distillation unit in the first round.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Distillation rounds | \n",
+ " 2 | \n",
+ " \n",
+ " The number of distillation rounds\n",
+ " \n",
+ " This is the number of distillation rounds. In each round one or multiple copies of some distillation unit is executed.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Distillation units per round | \n",
+ " 17, 1 | \n",
+ " \n",
+ " The number of units in each round of distillation\n",
+ " \n",
+ " This is the number of copies for the distillation units per round.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Distillation units | \n",
+ " 15-to-1 space efficient, 15-to-1 RM prep | \n",
+ " \n",
+ " The types of distillation units\n",
+ " \n",
+ " 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.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Distillation code distances | \n",
+ " 7, 19 | \n",
+ " \n",
+ " The code distance in each round of distillation\n",
+ " \n",
+ " 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.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Number of physical qubits per round | \n",
+ " 33.32k, 22.38k | \n",
+ " \n",
+ " The number of physical qubits used in each round of distillation\n",
+ " \n",
+ " 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.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Runtime per round | \n",
+ " 36 microsecs, 84 microsecs | \n",
+ " \n",
+ " The runtime of each distillation round\n",
+ " \n",
+ " The runtime of the T factory is the sum of the runtimes in all rounds.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Logical T state error rate | \n",
+ " 2.16e-11 | \n",
+ " \n",
+ " Logical T state error rate\n",
+ " \n",
+ " This is the logical T state error rate achieved by the T factory which is equal or smaller than the required error rate 7.09e-11.\n",
+ " | \n",
+ "
\n",
+ "
\n",
+ " \n",
+ " \n",
+ " Pre-layout logical resources\n",
+ "
\n",
+ " \n",
+ " \n",
+ " Logical qubits (pre-layout) | \n",
+ " 97 | \n",
+ " \n",
+ " Number of logical qubits in the input quantum program\n",
+ " \n",
+ " We determine 223 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.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " T gates | \n",
+ " 1 | \n",
+ " \n",
+ " Number of T gates in the input quantum program\n",
+ " \n",
+ " 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.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Rotation gates | \n",
+ " 59 | \n",
+ " \n",
+ " Number of rotation gates in the input quantum program\n",
+ " \n",
+ " 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.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Rotation depth | \n",
+ " 59 | \n",
+ " \n",
+ " Depth of rotation gates in the input quantum program\n",
+ " \n",
+ " This is the number of all non-Clifford layers that include at least one single-qubit rotation gate with an arbitrary angle.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " CCZ gates | \n",
+ " 1.18M | \n",
+ " \n",
+ " Number of CCZ-gates in the input quantum program\n",
+ " \n",
+ " This is the number of CCZ gates.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " CCiX gates | \n",
+ " 0 | \n",
+ " \n",
+ " Number of CCiX-gates in the input quantum program\n",
+ " \n",
+ " This is the number of CCiX gates, which applies $-iX$ controlled on two control qubits [[1212.5069](https://arxiv.org/abs/1212.5069)].\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Measurement operations | \n",
+ " 109.75k | \n",
+ " \n",
+ " Number of single qubit measurements in the input quantum program\n",
+ " \n",
+ " 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%.\n",
+ " | \n",
+ "
\n",
+ "
\n",
+ " \n",
+ " \n",
+ " Assumed error budget\n",
+ "
\n",
+ " \n",
+ " \n",
+ " Total error budget | \n",
+ " 1.00e-3 | \n",
+ " \n",
+ " Total error budget for the algorithm\n",
+ " \n",
+ " 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.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Logical error probability | \n",
+ " 3.33e-4 | \n",
+ " \n",
+ " Probability of at least one logical error\n",
+ " \n",
+ " This is one third of the total error budget 1.00e-3 if the input algorithm contains rotation with gates with arbitrary angles, or one half of it, otherwise.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " T distillation error probability | \n",
+ " 3.33e-4 | \n",
+ " \n",
+ " Probability of at least one faulty T distillation\n",
+ " \n",
+ " This is one third of the total error budget 1.00e-3 if the input algorithm contains rotation with gates with arbitrary angles, or one half of it, otherwise.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Rotation synthesis error probability | \n",
+ " 3.33e-4 | \n",
+ " \n",
+ " Probability of at least one failed rotation synthesis\n",
+ " \n",
+ " This is one third of the total error budget 1.00e-3.\n",
+ " | \n",
+ "
\n",
+ "
\n",
+ " \n",
+ " \n",
+ " Physical qubit parameters\n",
+ "
\n",
+ " \n",
+ " \n",
+ " Qubit name | \n",
+ " qubit_gate_ns_e3 | \n",
+ " \n",
+ " Some descriptive name for the qubit model\n",
+ " \n",
+ " 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).\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Instruction set | \n",
+ " GateBased | \n",
+ " \n",
+ " Underlying qubit technology (gate-based or Majorana)\n",
+ " \n",
+ " 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.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Single-qubit measurement time | \n",
+ " 100 ns | \n",
+ " \n",
+ " Operation time for single-qubit measurement (t_meas) in ns\n",
+ " \n",
+ " This is the operation time in nanoseconds to perform a single-qubit measurement in the Pauli basis.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Single-qubit gate time | \n",
+ " 50 ns | \n",
+ " \n",
+ " Operation time for single-qubit gate (t_gate) in ns\n",
+ " \n",
+ " This is the operation time in nanoseconds to perform a single-qubit Clifford operation, e.g., Hadamard or Phase gates.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Two-qubit gate time | \n",
+ " 50 ns | \n",
+ " \n",
+ " Operation time for two-qubit gate in ns\n",
+ " \n",
+ " This is the operation time in nanoseconds to perform a two-qubit Clifford operation, e.g., a CNOT or CZ gate.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " T gate time | \n",
+ " 50 ns | \n",
+ " \n",
+ " Operation time for a T gate\n",
+ " \n",
+ " This is the operation time in nanoseconds to execute a T gate.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Single-qubit measurement error rate | \n",
+ " 0.001 | \n",
+ " \n",
+ " Error rate for single-qubit measurement\n",
+ " \n",
+ " This is the probability in which a single-qubit measurement in the Pauli basis may fail.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Single-qubit error rate | \n",
+ " 0.001 | \n",
+ " \n",
+ " Error rate for single-qubit Clifford gate (p)\n",
+ " \n",
+ " This is the probability in which a single-qubit Clifford operation, e.g., Hadamard or Phase gates, may fail.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Two-qubit error rate | \n",
+ " 0.001 | \n",
+ " \n",
+ " Error rate for two-qubit Clifford gate\n",
+ " \n",
+ " This is the probability in which a two-qubit Clifford operation, e.g., CNOT or CZ gates, may fail.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " T gate error rate | \n",
+ " 0.001 | \n",
+ " \n",
+ " Error rate to prepare single-qubit T state or apply a T gate (p_T)\n",
+ " \n",
+ " This is the probability in which executing a single T gate may fail.\n",
+ " | \n",
+ "
\n",
+ "
\n",
+ " \n",
+ " \n",
+ " Constraints\n",
+ "
\n",
+ " \n",
+ " \n",
+ " Logical depth factor | \n",
+ " constraint not set | \n",
+ " \n",
+ " Factor the initial number of logical cycles is multiplied by\n",
+ " \n",
+ " This is the factor takes into account a potential overhead to the initial number of logical cycles.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Maximum number of T factories | \n",
+ " constraint not set | \n",
+ " \n",
+ " The maximum number of T factories can be utilized during the algorithm's runtime\n",
+ " \n",
+ " 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.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Maximum runtime duration | \n",
+ " constraint not set | \n",
+ " \n",
+ " The maximum runtime duration allowed for the algorithm runtime\n",
+ " \n",
+ " 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.\n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " Maximum number of physical qubits | \n",
+ " constraint not set | \n",
+ " \n",
+ " The maximum number of physical qubits allowed for utilization to the algorith\n",
+ " \n",
+ " 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.\n",
+ " | \n",
+ "
\n",
+ "
Assumptions
"
+ ],
+ "text/plain": [
+ "{'status': 'success',\n",
+ " 'jobParams': {'qecScheme': {'name': 'surface_code',\n",
+ " 'errorCorrectionThreshold': 0.01,\n",
+ " 'crossingPrefactor': 0.03,\n",
+ " 'logicalCycleTime': '(4 * twoQubitGateTime + 2 * oneQubitMeasurementTime) * codeDistance',\n",
+ " 'physicalQubitsPerLogicalQubit': '2 * codeDistance * codeDistance',\n",
+ " 'maxCodeDistance': 50},\n",
+ " 'errorBudget': 0.001,\n",
+ " 'qubitParams': {'instructionSet': 'GateBased',\n",
+ " 'name': 'qubit_gate_ns_e3',\n",
+ " 'oneQubitMeasurementTime': '100 ns',\n",
+ " 'oneQubitGateTime': '50 ns',\n",
+ " 'twoQubitGateTime': '50 ns',\n",
+ " 'tGateTime': '50 ns',\n",
+ " 'oneQubitMeasurementErrorRate': 0.001,\n",
+ " 'oneQubitGateErrorRate': 0.001,\n",
+ " 'twoQubitGateErrorRate': 0.001,\n",
+ " 'tGateErrorRate': 0.001,\n",
+ " 'idleErrorRate': 0.001},\n",
+ " 'constraints': {'maxDistillationRounds': 3},\n",
+ " 'estimateType': 'singlePoint'},\n",
+ " 'physicalCounts': {'physicalQubits': 829766,\n",
+ " 'runtime': 30540132000,\n",
+ " 'rqops': 26547620,\n",
+ " 'breakdown': {'algorithmicLogicalQubits': 223,\n",
+ " 'algorithmicLogicalDepth': 3635730,\n",
+ " 'logicalDepth': 3635730,\n",
+ " 'numTstates': 4700938,\n",
+ " 'clockFrequency': 119047.61904761905,\n",
+ " 'numTfactories': 19,\n",
+ " 'numTfactoryRuns': 247418,\n",
+ " 'physicalQubitsForTfactories': 633080,\n",
+ " 'physicalQubitsForAlgorithm': 196686,\n",
+ " 'requiredLogicalQubitErrorRate': 4.111329254130006e-13,\n",
+ " 'requiredLogicalTstateErrorRate': 7.090783442226494e-11,\n",
+ " 'numTsPerRotation': 15,\n",
+ " 'cliffordErrorRate': 0.001}},\n",
+ " 'physicalCountsFormatted': {'runtime': '31 secs',\n",
+ " 'rqops': '26.55M',\n",
+ " 'physicalQubits': '829.77k',\n",
+ " 'algorithmicLogicalQubits': '223',\n",
+ " 'algorithmicLogicalDepth': '3.64M',\n",
+ " 'logicalDepth': '3.64M',\n",
+ " 'numTstates': '4.70M',\n",
+ " 'numTfactories': '19',\n",
+ " 'numTfactoryRuns': '247.42k',\n",
+ " 'physicalQubitsForAlgorithm': '196.69k',\n",
+ " 'physicalQubitsForTfactories': '633.08k',\n",
+ " 'physicalQubitsForTfactoriesPercentage': '76.30 %',\n",
+ " 'requiredLogicalQubitErrorRate': '4.11e-13',\n",
+ " 'requiredLogicalTstateErrorRate': '7.09e-11',\n",
+ " 'physicalQubitsPerLogicalQubit': '882',\n",
+ " 'logicalCycleTime': '8 microsecs',\n",
+ " 'clockFrequency': '119.05k',\n",
+ " 'logicalErrorRate': '3.00e-13',\n",
+ " 'tfactoryPhysicalQubits': '33.32k',\n",
+ " 'tfactoryRuntime': '120 microsecs',\n",
+ " 'numInputTstates': '255',\n",
+ " 'numUnitsPerRound': '17, 1',\n",
+ " 'unitNamePerRound': '15-to-1 space efficient, 15-to-1 RM prep',\n",
+ " 'codeDistancePerRound': '7, 19',\n",
+ " 'physicalQubitsPerRound': '33.32k, 22.38k',\n",
+ " 'tfactoryRuntimePerRound': '36 microsecs, 84 microsecs',\n",
+ " 'tstateLogicalErrorRate': '2.16e-11',\n",
+ " 'logicalCountsNumQubits': '97',\n",
+ " 'logicalCountsTCount': '1',\n",
+ " 'logicalCountsRotationCount': '59',\n",
+ " 'logicalCountsRotationDepth': '59',\n",
+ " 'logicalCountsCczCount': '1.18M',\n",
+ " 'logicalCountsCcixCount': '0',\n",
+ " 'logicalCountsMeasurementCount': '109.75k',\n",
+ " 'errorBudget': '1.00e-3',\n",
+ " 'errorBudgetLogical': '3.33e-4',\n",
+ " 'errorBudgetTstates': '3.33e-4',\n",
+ " 'errorBudgetRotations': '3.33e-4',\n",
+ " 'numTsPerRotation': '15',\n",
+ " 'logicalDepthFactor': 'constraint not set',\n",
+ " 'maxTFactories': 'constraint not set',\n",
+ " 'maxDuration': 'constraint not set',\n",
+ " 'maxPhysicalQubits': 'constraint not set'},\n",
+ " 'logicalQubit': {'codeDistance': 21,\n",
+ " 'physicalQubits': 882,\n",
+ " 'logicalCycleTime': 8400,\n",
+ " 'logicalErrorRate': 3.000000000000003e-13},\n",
+ " 'tfactory': {'physicalQubits': 33320,\n",
+ " 'runtime': 120000,\n",
+ " 'numTstates': 1,\n",
+ " 'numInputTstates': 255,\n",
+ " 'numRounds': 2,\n",
+ " 'numUnitsPerRound': [17, 1],\n",
+ " 'unitNamePerRound': ['15-to-1 space efficient', '15-to-1 RM prep'],\n",
+ " 'codeDistancePerRound': [7, 19],\n",
+ " 'physicalQubitsPerRound': [33320, 22382],\n",
+ " 'runtimePerRound': [36400, 83600],\n",
+ " 'logicalErrorRate': 2.1639895946963144e-11},\n",
+ " 'errorBudget': {'logical': 0.0003333333333333333,\n",
+ " 'tstates': 0.0003333333333333333,\n",
+ " 'rotations': 0.0003333333333333333},\n",
+ " 'logicalCounts': {'numQubits': 97,\n",
+ " 'tCount': 1,\n",
+ " 'rotationCount': 59,\n",
+ " 'rotationDepth': 59,\n",
+ " 'cczCount': 1175013,\n",
+ " 'ccixCount': 0,\n",
+ " 'measurementCount': 109746},\n",
+ " 'reportData': {'groups': [{'title': 'Physical resource estimates',\n",
+ " 'alwaysVisible': True,\n",
+ " 'entries': [{'path': 'physicalCountsFormatted/runtime',\n",
+ " 'label': 'Runtime',\n",
+ " 'description': 'Total runtime',\n",
+ " '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 (8,400 nanosecs) multiplied by the 3,635,730 logical cycles to run the algorithm. If however the duration of a single T factory (here: 120,000 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.'},\n",
+ " {'path': 'physicalCountsFormatted/rqops',\n",
+ " 'label': 'rQOPS',\n",
+ " 'description': 'Reliable quantum operations per second',\n",
+ " 'explanation': 'The value is computed as the number of logical qubits after layout (223) (with a logical error rate of 4.11e-13) multiplied by the clock frequency (119,047.62), which is the number of logical cycles per second.'},\n",
+ " {'path': 'physicalCountsFormatted/physicalQubits',\n",
+ " 'label': 'Physical qubits',\n",
+ " 'description': 'Number of physical qubits',\n",
+ " 'explanation': 'This value represents the total number of physical qubits, which is the sum of 196,686 physical qubits to implement the algorithm logic, and 633,080 physical qubits to execute the T factories that are responsible to produce the T states that are consumed by the algorithm.'}]},\n",
+ " {'title': 'Resource estimates breakdown',\n",
+ " 'alwaysVisible': False,\n",
+ " 'entries': [{'path': 'physicalCountsFormatted/algorithmicLogicalQubits',\n",
+ " 'label': 'Logical algorithmic qubits',\n",
+ " 'description': 'Number of logical qubits for the algorithm after layout',\n",
+ " '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} = 97$ logical qubits in the input algorithm, we require in total $2 \\\\cdot Q_{\\\\rm alg} + \\\\lceil \\\\sqrt{8 \\\\cdot Q_{\\\\rm alg}}\\\\rceil + 1 = 223$ logical qubits.'},\n",
+ " {'path': 'physicalCountsFormatted/algorithmicLogicalDepth',\n",
+ " 'label': 'Algorithmic depth',\n",
+ " 'description': 'Number of logical cycles for the algorithm',\n",
+ " '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 109,746 single-qubit measurements, the 59 arbitrary single-qubit rotations, and the 1 T gates, three multi-qubit measurements for each of the 1,175,013 CCZ and 0 CCiX gates in the input program, as well as 15 multi-qubit measurements for each of the 59 non-Clifford layers in which there is at least one single-qubit rotation with an arbitrary angle rotation.'},\n",
+ " {'path': 'physicalCountsFormatted/logicalDepth',\n",
+ " 'label': 'Logical depth',\n",
+ " 'description': 'Number of logical cycles performed',\n",
+ " 'explanation': \"This number is usually equal to the logical depth of the algorithm, which is 3,635,730. 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.\"},\n",
+ " {'path': 'physicalCountsFormatted/clockFrequency',\n",
+ " 'label': 'Clock frequency',\n",
+ " 'description': 'Number of logical cycles per second',\n",
+ " 'explanation': 'This is the number of logical cycles that can be performed within one second. The logical cycle time is 8 microsecs.'},\n",
+ " {'path': 'physicalCountsFormatted/numTstates',\n",
+ " 'label': 'Number of T states',\n",
+ " 'description': 'Number of T states consumed by the algorithm',\n",
+ " 'explanation': 'To execute the algorithm, we require one T state for each of the 1 T gates, four T states for each of the 1,175,013 CCZ and 0 CCiX gates, as well as 15 for each of the 59 single-qubit rotation gates with arbitrary angle rotation.'},\n",
+ " {'path': 'physicalCountsFormatted/numTfactories',\n",
+ " 'label': 'Number of T factories',\n",
+ " 'description': \"Number of T factories capable of producing the demanded 4,700,938 T states during the algorithm's runtime\",\n",
+ " 'explanation': 'The total number of T factories 19 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{4,700,938 \\\\cdot 120,000\\\\;\\\\text{ns}}{1 \\\\cdot 30,540,132,000\\\\;\\\\text{ns}}\\\\right\\\\rceil$'},\n",
+ " {'path': 'physicalCountsFormatted/numTfactoryRuns',\n",
+ " 'label': 'Number of T factory invocations',\n",
+ " 'description': 'Number of times all T factories are invoked',\n",
+ " 'explanation': 'In order to prepare the 4,700,938 T states, the 19 copies of the T factory are repeatedly invoked 247,418 times.'},\n",
+ " {'path': 'physicalCountsFormatted/physicalQubitsForAlgorithm',\n",
+ " 'label': 'Physical algorithmic qubits',\n",
+ " 'description': 'Number of physical qubits for the algorithm after layout',\n",
+ " 'explanation': 'The 196,686 are the product of the 223 logical qubits after layout and the 882 physical qubits that encode a single logical qubit.'},\n",
+ " {'path': 'physicalCountsFormatted/physicalQubitsForTfactories',\n",
+ " 'label': 'Physical T factory qubits',\n",
+ " 'description': 'Number of physical qubits for the T factories',\n",
+ " 'explanation': 'Each T factory requires 33,320 physical qubits and we run 19 in parallel, therefore we need $633,080 = 33,320 \\\\cdot 19$ qubits.'},\n",
+ " {'path': 'physicalCountsFormatted/requiredLogicalQubitErrorRate',\n",
+ " 'label': 'Required logical qubit error rate',\n",
+ " 'description': 'The minimum logical qubit error rate required to run the algorithm within the error budget',\n",
+ " 'explanation': 'The minimum logical qubit error rate is obtained by dividing the logical error probability 3.33e-4 by the product of 223 logical qubits and the total cycle count 3,635,730.'},\n",
+ " {'path': 'physicalCountsFormatted/requiredLogicalTstateErrorRate',\n",
+ " 'label': 'Required logical T state error rate',\n",
+ " 'description': 'The minimum T state error rate required for distilled T states',\n",
+ " 'explanation': 'The minimum T state error rate is obtained by dividing the T distillation error probability 3.33e-4 by the total number of T states 4,700,938.'},\n",
+ " {'path': 'physicalCountsFormatted/numTsPerRotation',\n",
+ " 'label': 'Number of T states per rotation',\n",
+ " 'description': 'Number of T states to implement a rotation with an arbitrary angle',\n",
+ " 'explanation': 'The number of T states to implement a rotation with an arbitrary angle is $\\\\lceil 0.53 \\\\log_2(59 / 0.0003333333333333333) + 4.86\\\\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.'}]},\n",
+ " {'title': 'Logical qubit parameters',\n",
+ " 'alwaysVisible': False,\n",
+ " 'entries': [{'path': 'jobParams/qecScheme/name',\n",
+ " 'label': 'QEC scheme',\n",
+ " 'description': 'Name of QEC scheme',\n",
+ " 'explanation': 'You can load pre-defined QEC schemes by using the name `surface_code` or `floquet_code`. The latter only works with Majorana qubits.'},\n",
+ " {'path': 'logicalQubit/codeDistance',\n",
+ " 'label': 'Code distance',\n",
+ " 'description': 'Required code distance for error correction',\n",
+ " 'explanation': 'The code distance is the smallest odd integer greater or equal to $\\\\dfrac{2\\\\log(0.03 / 0.0000000000004111329254130006)}{\\\\log(0.01/0.001)} - 1$'},\n",
+ " {'path': 'physicalCountsFormatted/physicalQubitsPerLogicalQubit',\n",
+ " 'label': 'Physical qubits',\n",
+ " 'description': 'Number of physical qubits per logical qubit',\n",
+ " 'explanation': 'The number of physical qubits per logical qubit are evaluated using the formula 2 * codeDistance * codeDistance that can be user-specified.'},\n",
+ " {'path': 'physicalCountsFormatted/logicalCycleTime',\n",
+ " 'label': 'Logical cycle time',\n",
+ " 'description': 'Duration of a logical cycle in nanoseconds',\n",
+ " 'explanation': 'The runtime of one logical cycle in nanoseconds is evaluated using the formula (4 * twoQubitGateTime + 2 * oneQubitMeasurementTime) * codeDistance that can be user-specified.'},\n",
+ " {'path': 'physicalCountsFormatted/logicalErrorRate',\n",
+ " 'label': 'Logical qubit error rate',\n",
+ " 'description': 'Logical qubit error rate',\n",
+ " 'explanation': 'The logical qubit error rate is computed as $0.03 \\\\cdot \\\\left(\\\\dfrac{0.001}{0.01}\\\\right)^\\\\frac{21 + 1}{2}$'},\n",
+ " {'path': 'jobParams/qecScheme/crossingPrefactor',\n",
+ " 'label': 'Crossing prefactor',\n",
+ " 'description': 'Crossing prefactor used in QEC scheme',\n",
+ " '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.'},\n",
+ " {'path': 'jobParams/qecScheme/errorCorrectionThreshold',\n",
+ " 'label': 'Error correction threshold',\n",
+ " 'description': 'Error correction threshold used in QEC scheme',\n",
+ " '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.'},\n",
+ " {'path': 'jobParams/qecScheme/logicalCycleTime',\n",
+ " 'label': 'Logical cycle time formula',\n",
+ " 'description': 'QEC scheme formula used to compute logical cycle time',\n",
+ " 'explanation': 'This is the formula that is used to compute the logical cycle time 8,400 ns.'},\n",
+ " {'path': 'jobParams/qecScheme/physicalQubitsPerLogicalQubit',\n",
+ " 'label': 'Physical qubits formula',\n",
+ " 'description': 'QEC scheme formula used to compute number of physical qubits per logical qubit',\n",
+ " 'explanation': 'This is the formula that is used to compute the number of physical qubits per logical qubits 882.'}]},\n",
+ " {'title': 'T factory parameters',\n",
+ " 'alwaysVisible': False,\n",
+ " 'entries': [{'path': 'physicalCountsFormatted/tfactoryPhysicalQubits',\n",
+ " 'label': 'Physical qubits',\n",
+ " 'description': 'Number of physical qubits for a single T factory',\n",
+ " '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.'},\n",
+ " {'path': 'physicalCountsFormatted/tfactoryRuntime',\n",
+ " 'label': 'Runtime',\n",
+ " 'description': 'Runtime of a single T factory',\n",
+ " 'explanation': 'The runtime of a single T factory is the accumulated runtime of executing each round in a T factory.'},\n",
+ " {'path': 'tfactory/numTstates',\n",
+ " 'label': 'Number of output T states per run',\n",
+ " 'description': 'Number of output T states produced in a single run of T factory',\n",
+ " 'explanation': 'The T factory takes as input 255 noisy physical T states with an error rate of 0.001 and produces 1 T states with an error rate of 2.16e-11.'},\n",
+ " {'path': 'physicalCountsFormatted/numInputTstates',\n",
+ " 'label': 'Number of input T states per run',\n",
+ " 'description': 'Number of physical input T states consumed in a single run of a T factory',\n",
+ " 'explanation': 'This value includes the physical input T states of all copies of the distillation unit in the first round.'},\n",
+ " {'path': 'tfactory/numRounds',\n",
+ " 'label': 'Distillation rounds',\n",
+ " 'description': 'The number of distillation rounds',\n",
+ " 'explanation': 'This is the number of distillation rounds. In each round one or multiple copies of some distillation unit is executed.'},\n",
+ " {'path': 'physicalCountsFormatted/numUnitsPerRound',\n",
+ " 'label': 'Distillation units per round',\n",
+ " 'description': 'The number of units in each round of distillation',\n",
+ " 'explanation': 'This is the number of copies for the distillation units per round.'},\n",
+ " {'path': 'physicalCountsFormatted/unitNamePerRound',\n",
+ " 'label': 'Distillation units',\n",
+ " 'description': 'The types of distillation units',\n",
+ " '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.'},\n",
+ " {'path': 'physicalCountsFormatted/codeDistancePerRound',\n",
+ " 'label': 'Distillation code distances',\n",
+ " 'description': 'The code distance in each round of distillation',\n",
+ " '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.'},\n",
+ " {'path': 'physicalCountsFormatted/physicalQubitsPerRound',\n",
+ " 'label': 'Number of physical qubits per round',\n",
+ " 'description': 'The number of physical qubits used in each round of distillation',\n",
+ " '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.'},\n",
+ " {'path': 'physicalCountsFormatted/tfactoryRuntimePerRound',\n",
+ " 'label': 'Runtime per round',\n",
+ " 'description': 'The runtime of each distillation round',\n",
+ " 'explanation': 'The runtime of the T factory is the sum of the runtimes in all rounds.'},\n",
+ " {'path': 'physicalCountsFormatted/tstateLogicalErrorRate',\n",
+ " 'label': 'Logical T state error rate',\n",
+ " 'description': 'Logical T state error rate',\n",
+ " 'explanation': 'This is the logical T state error rate achieved by the T factory which is equal or smaller than the required error rate 7.09e-11.'}]},\n",
+ " {'title': 'Pre-layout logical resources',\n",
+ " 'alwaysVisible': False,\n",
+ " 'entries': [{'path': 'physicalCountsFormatted/logicalCountsNumQubits',\n",
+ " 'label': 'Logical qubits (pre-layout)',\n",
+ " 'description': 'Number of logical qubits in the input quantum program',\n",
+ " 'explanation': 'We determine 223 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.'},\n",
+ " {'path': 'physicalCountsFormatted/logicalCountsTCount',\n",
+ " 'label': 'T gates',\n",
+ " 'description': 'Number of T gates in the input quantum program',\n",
+ " '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.'},\n",
+ " {'path': 'physicalCountsFormatted/logicalCountsRotationCount',\n",
+ " 'label': 'Rotation gates',\n",
+ " 'description': 'Number of rotation gates in the input quantum program',\n",
+ " '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.'},\n",
+ " {'path': 'physicalCountsFormatted/logicalCountsRotationDepth',\n",
+ " 'label': 'Rotation depth',\n",
+ " 'description': 'Depth of rotation gates in the input quantum program',\n",
+ " 'explanation': 'This is the number of all non-Clifford layers that include at least one single-qubit rotation gate with an arbitrary angle.'},\n",
+ " {'path': 'physicalCountsFormatted/logicalCountsCczCount',\n",
+ " 'label': 'CCZ gates',\n",
+ " 'description': 'Number of CCZ-gates in the input quantum program',\n",
+ " 'explanation': 'This is the number of CCZ gates.'},\n",
+ " {'path': 'physicalCountsFormatted/logicalCountsCcixCount',\n",
+ " 'label': 'CCiX gates',\n",
+ " 'description': 'Number of CCiX-gates in the input quantum program',\n",
+ " 'explanation': 'This is the number of CCiX gates, which applies $-iX$ controlled on two control qubits [[1212.5069](https://arxiv.org/abs/1212.5069)].'},\n",
+ " {'path': 'physicalCountsFormatted/logicalCountsMeasurementCount',\n",
+ " 'label': 'Measurement operations',\n",
+ " 'description': 'Number of single qubit measurements in the input quantum program',\n",
+ " '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%.'}]},\n",
+ " {'title': 'Assumed error budget',\n",
+ " 'alwaysVisible': False,\n",
+ " 'entries': [{'path': 'physicalCountsFormatted/errorBudget',\n",
+ " 'label': 'Total error budget',\n",
+ " 'description': 'Total error budget for the algorithm',\n",
+ " '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.\"},\n",
+ " {'path': 'physicalCountsFormatted/errorBudgetLogical',\n",
+ " 'label': 'Logical error probability',\n",
+ " 'description': 'Probability of at least one logical error',\n",
+ " 'explanation': 'This is one third of the total error budget 1.00e-3 if the input algorithm contains rotation with gates with arbitrary angles, or one half of it, otherwise.'},\n",
+ " {'path': 'physicalCountsFormatted/errorBudgetTstates',\n",
+ " 'label': 'T distillation error probability',\n",
+ " 'description': 'Probability of at least one faulty T distillation',\n",
+ " 'explanation': 'This is one third of the total error budget 1.00e-3 if the input algorithm contains rotation with gates with arbitrary angles, or one half of it, otherwise.'},\n",
+ " {'path': 'physicalCountsFormatted/errorBudgetRotations',\n",
+ " 'label': 'Rotation synthesis error probability',\n",
+ " 'description': 'Probability of at least one failed rotation synthesis',\n",
+ " 'explanation': 'This is one third of the total error budget 1.00e-3.'}]},\n",
+ " {'title': 'Physical qubit parameters',\n",
+ " 'alwaysVisible': False,\n",
+ " 'entries': [{'path': 'jobParams/qubitParams/name',\n",
+ " 'label': 'Qubit name',\n",
+ " 'description': 'Some descriptive name for the qubit model',\n",
+ " '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).'},\n",
+ " {'path': 'jobParams/qubitParams/instructionSet',\n",
+ " 'label': 'Instruction set',\n",
+ " 'description': 'Underlying qubit technology (gate-based or Majorana)',\n",
+ " '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.'},\n",
+ " {'path': 'jobParams/qubitParams/oneQubitMeasurementTime',\n",
+ " 'label': 'Single-qubit measurement time',\n",
+ " 'description': 'Operation time for single-qubit measurement (t_meas) in ns',\n",
+ " 'explanation': 'This is the operation time in nanoseconds to perform a single-qubit measurement in the Pauli basis.'},\n",
+ " {'path': 'jobParams/qubitParams/oneQubitGateTime',\n",
+ " 'label': 'Single-qubit gate time',\n",
+ " 'description': 'Operation time for single-qubit gate (t_gate) in ns',\n",
+ " 'explanation': 'This is the operation time in nanoseconds to perform a single-qubit Clifford operation, e.g., Hadamard or Phase gates.'},\n",
+ " {'path': 'jobParams/qubitParams/twoQubitGateTime',\n",
+ " 'label': 'Two-qubit gate time',\n",
+ " 'description': 'Operation time for two-qubit gate in ns',\n",
+ " 'explanation': 'This is the operation time in nanoseconds to perform a two-qubit Clifford operation, e.g., a CNOT or CZ gate.'},\n",
+ " {'path': 'jobParams/qubitParams/tGateTime',\n",
+ " 'label': 'T gate time',\n",
+ " 'description': 'Operation time for a T gate',\n",
+ " 'explanation': 'This is the operation time in nanoseconds to execute a T gate.'},\n",
+ " {'path': 'jobParams/qubitParams/oneQubitMeasurementErrorRate',\n",
+ " 'label': 'Single-qubit measurement error rate',\n",
+ " 'description': 'Error rate for single-qubit measurement',\n",
+ " 'explanation': 'This is the probability in which a single-qubit measurement in the Pauli basis may fail.'},\n",
+ " {'path': 'jobParams/qubitParams/oneQubitGateErrorRate',\n",
+ " 'label': 'Single-qubit error rate',\n",
+ " 'description': 'Error rate for single-qubit Clifford gate (p)',\n",
+ " 'explanation': 'This is the probability in which a single-qubit Clifford operation, e.g., Hadamard or Phase gates, may fail.'},\n",
+ " {'path': 'jobParams/qubitParams/twoQubitGateErrorRate',\n",
+ " 'label': 'Two-qubit error rate',\n",
+ " 'description': 'Error rate for two-qubit Clifford gate',\n",
+ " 'explanation': 'This is the probability in which a two-qubit Clifford operation, e.g., CNOT or CZ gates, may fail.'},\n",
+ " {'path': 'jobParams/qubitParams/tGateErrorRate',\n",
+ " 'label': 'T gate error rate',\n",
+ " 'description': 'Error rate to prepare single-qubit T state or apply a T gate (p_T)',\n",
+ " 'explanation': 'This is the probability in which executing a single T gate may fail.'}]},\n",
+ " {'title': 'Constraints',\n",
+ " 'alwaysVisible': False,\n",
+ " 'entries': [{'path': 'physicalCountsFormatted/logicalDepthFactor',\n",
+ " 'label': 'Logical depth factor',\n",
+ " 'description': 'Factor the initial number of logical cycles is multiplied by',\n",
+ " 'explanation': 'This is the factor takes into account a potential overhead to the initial number of logical cycles.'},\n",
+ " {'path': 'physicalCountsFormatted/maxTFactories',\n",
+ " 'label': 'Maximum number of T factories',\n",
+ " 'description': \"The maximum number of T factories can be utilized during the algorithm's runtime\",\n",
+ " '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.'},\n",
+ " {'path': 'physicalCountsFormatted/maxDuration',\n",
+ " 'label': 'Maximum runtime duration',\n",
+ " 'description': 'The maximum runtime duration allowed for the algorithm runtime',\n",
+ " '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.'},\n",
+ " {'path': 'physicalCountsFormatted/maxPhysicalQubits',\n",
+ " 'label': 'Maximum number of physical qubits',\n",
+ " 'description': 'The maximum number of physical qubits allowed for utilization to the algorith',\n",
+ " '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.'}]}],\n",
+ " 'assumptions': ['_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)._',\n",
+ " '**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.',\n",
+ " '**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.',\n",
+ " '**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).',\n",
+ " '**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.',\n",
+ " '**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.',\n",
+ " '**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.']}}"
+ ]
+ },
+ "execution_count": 3,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "result = qsharp.estimate(\"RunProgram()\")\n",
+ "result"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "application/vnd.jupyter.widget-view+json": {
+ "model_id": "003abe6b38c541a2a73570ee794b26d8",
+ "version_major": 2,
+ "version_minor": 1
+ },
+ "text/plain": [
+ "SpaceChart(estimates={'status': 'success', 'jobParams': {'qecScheme': {'name': 'surface_code', 'errorCorrectio…"
+ ]
+ },
+ "execution_count": 4,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "from qsharp_widgets import SpaceChart\n",
+ "SpaceChart(result)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Collecting pandas\n",
+ " Downloading pandas-2.2.2-cp310-cp310-macosx_11_0_arm64.whl.metadata (19 kB)\n",
+ "Collecting numpy>=1.22.4 (from pandas)\n",
+ " Downloading numpy-2.1.0-cp310-cp310-macosx_14_0_arm64.whl.metadata (60 kB)\n",
+ "Requirement already satisfied: python-dateutil>=2.8.2 in /Users/yurij/miniforge3/envs/q-sharp-exercises/lib/python3.10/site-packages (from pandas) (2.9.0)\n",
+ "Collecting pytz>=2020.1 (from pandas)\n",
+ " Downloading pytz-2024.1-py2.py3-none-any.whl.metadata (22 kB)\n",
+ "Collecting tzdata>=2022.7 (from pandas)\n",
+ " Downloading tzdata-2024.1-py2.py3-none-any.whl.metadata (1.4 kB)\n",
+ "Requirement already satisfied: six>=1.5 in /Users/yurij/miniforge3/envs/q-sharp-exercises/lib/python3.10/site-packages (from python-dateutil>=2.8.2->pandas) (1.16.0)\n",
+ "Downloading pandas-2.2.2-cp310-cp310-macosx_11_0_arm64.whl (11.3 MB)\n",
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m11.3/11.3 MB\u001b[0m \u001b[31m16.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m:01\u001b[0m\n",
+ "\u001b[?25hDownloading numpy-2.1.0-cp310-cp310-macosx_14_0_arm64.whl (5.4 MB)\n",
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.4/5.4 MB\u001b[0m \u001b[31m19.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
+ "\u001b[?25hDownloading pytz-2024.1-py2.py3-none-any.whl (505 kB)\n",
+ "Downloading tzdata-2024.1-py2.py3-none-any.whl (345 kB)\n",
+ "Installing collected packages: pytz, tzdata, numpy, pandas\n",
+ "Successfully installed numpy-2.1.0 pandas-2.2.2 pytz-2024.1 tzdata-2024.1\n"
+ ]
+ }
+ ],
+ "source": [
+ "! pip install pandas"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {},
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "data": {
+ "text/html": [
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " Logical qubits | \n",
+ " Logical depth | \n",
+ " T states | \n",
+ " Code distance | \n",
+ " T factories | \n",
+ " T factory fraction | \n",
+ " Physical qubits | \n",
+ " rQOPS | \n",
+ " Physical runtime | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " Gate-based µs, 10⁻³ | \n",
+ " 223 | \n",
+ " 3.64M | \n",
+ " 4.70M | \n",
+ " 17 | \n",
+ " 13 | \n",
+ " 40.54 % | \n",
+ " 216.77k | \n",
+ " 21.86k | \n",
+ " 10 hours | \n",
+ "
\n",
+ " \n",
+ " Gate-based µs, 10⁻⁴ | \n",
+ " 223 | \n",
+ " 3.64M | \n",
+ " 4.70M | \n",
+ " 9 | \n",
+ " 14 | \n",
+ " 43.17 % | \n",
+ " 63.57k | \n",
+ " 41.30k | \n",
+ " 5 hours | \n",
+ "
\n",
+ " \n",
+ " Gate-based ns, 10⁻³ | \n",
+ " 223 | \n",
+ " 3.64M | \n",
+ " 4.70M | \n",
+ " 17 | \n",
+ " 16 | \n",
+ " 69.08 % | \n",
+ " 416.89k | \n",
+ " 32.79M | \n",
+ " 25 secs | \n",
+ "
\n",
+ " \n",
+ " Gate-based ns, 10⁻⁴ | \n",
+ " 223 | \n",
+ " 3.64M | \n",
+ " 4.70M | \n",
+ " 9 | \n",
+ " 14 | \n",
+ " 43.17 % | \n",
+ " 63.57k | \n",
+ " 61.94M | \n",
+ " 13 secs | \n",
+ "
\n",
+ " \n",
+ " Majorana ns, 10⁻⁴ | \n",
+ " 223 | \n",
+ " 3.64M | \n",
+ " 4.70M | \n",
+ " 9 | \n",
+ " 19 | \n",
+ " 82.75 % | \n",
+ " 501.48k | \n",
+ " 82.59M | \n",
+ " 10 secs | \n",
+ "
\n",
+ " \n",
+ " Majorana ns, 10⁻⁶ | \n",
+ " 223 | \n",
+ " 3.64M | \n",
+ " 4.70M | \n",
+ " 5 | \n",
+ " 13 | \n",
+ " 31.47 % | \n",
+ " 42.96k | \n",
+ " 148.67M | \n",
+ " 5 secs | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " Logical qubits Logical depth T states Code distance \\\n",
+ "Gate-based µs, 10⁻³ 223 3.64M 4.70M 17 \n",
+ "Gate-based µs, 10⁻⁴ 223 3.64M 4.70M 9 \n",
+ "Gate-based ns, 10⁻³ 223 3.64M 4.70M 17 \n",
+ "Gate-based ns, 10⁻⁴ 223 3.64M 4.70M 9 \n",
+ "Majorana ns, 10⁻⁴ 223 3.64M 4.70M 9 \n",
+ "Majorana ns, 10⁻⁶ 223 3.64M 4.70M 5 \n",
+ "\n",
+ " T factories T factory fraction Physical qubits rQOPS \\\n",
+ "Gate-based µs, 10⁻³ 13 40.54 % 216.77k 21.86k \n",
+ "Gate-based µs, 10⁻⁴ 14 43.17 % 63.57k 41.30k \n",
+ "Gate-based ns, 10⁻³ 16 69.08 % 416.89k 32.79M \n",
+ "Gate-based ns, 10⁻⁴ 14 43.17 % 63.57k 61.94M \n",
+ "Majorana ns, 10⁻⁴ 19 82.75 % 501.48k 82.59M \n",
+ "Majorana ns, 10⁻⁶ 13 31.47 % 42.96k 148.67M \n",
+ "\n",
+ " Physical runtime \n",
+ "Gate-based µs, 10⁻³ 10 hours \n",
+ "Gate-based µs, 10⁻⁴ 5 hours \n",
+ "Gate-based ns, 10⁻³ 25 secs \n",
+ "Gate-based ns, 10⁻⁴ 13 secs \n",
+ "Majorana ns, 10⁻⁴ 10 secs \n",
+ "Majorana ns, 10⁻⁶ 5 secs "
+ ]
+ },
+ "execution_count": 6,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "from qsharp.estimator import EstimatorParams, QubitParams, QECScheme, LogicalCounts\n",
+ "\n",
+ "labels = [\"Gate-based µs, 10⁻³\", \"Gate-based µs, 10⁻⁴\", \"Gate-based ns, 10⁻³\", \"Gate-based ns, 10⁻⁴\", \"Majorana ns, 10⁻⁴\", \"Majorana ns, 10⁻⁶\"]\n",
+ "\n",
+ "params = EstimatorParams(6)\n",
+ "params.error_budget = 0.333\n",
+ "params.items[0].qubit_params.name = QubitParams.GATE_US_E3\n",
+ "params.items[1].qubit_params.name = QubitParams.GATE_US_E4\n",
+ "params.items[2].qubit_params.name = QubitParams.GATE_NS_E3\n",
+ "params.items[3].qubit_params.name = QubitParams.GATE_NS_E4\n",
+ "params.items[4].qubit_params.name = QubitParams.MAJ_NS_E4\n",
+ "params.items[4].qec_scheme.name = QECScheme.FLOQUET_CODE\n",
+ "params.items[5].qubit_params.name = QubitParams.MAJ_NS_E6\n",
+ "params.items[5].qec_scheme.name = QECScheme.FLOQUET_CODE\n",
+ "\n",
+ "qsharp.estimate(\"RunProgram()\", params=params).summary_data_frame(labels=labels)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " Logical qubits | \n",
+ " Logical depth | \n",
+ " T states | \n",
+ " Code distance | \n",
+ " T factories | \n",
+ " T factory fraction | \n",
+ " Physical qubits | \n",
+ " rQOPS | \n",
+ " Physical runtime | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " Gate-based µs, 10⁻³ | \n",
+ " 25.48k | \n",
+ " 12.27G | \n",
+ " 14.93G | \n",
+ " 27 | \n",
+ " 13 | \n",
+ " 0.61 % | \n",
+ " 37.38M | \n",
+ " 1.57M | \n",
+ " 6 years | \n",
+ "
\n",
+ " \n",
+ " Gate-based µs, 10⁻⁴ | \n",
+ " 25.48k | \n",
+ " 12.27G | \n",
+ " 14.93G | \n",
+ " 13 | \n",
+ " 14 | \n",
+ " 0.78 % | \n",
+ " 8.68M | \n",
+ " 3.27M | \n",
+ " 3 years | \n",
+ "
\n",
+ " \n",
+ " Gate-based ns, 10⁻³ | \n",
+ " 25.48k | \n",
+ " 12.27G | \n",
+ " 14.93G | \n",
+ " 27 | \n",
+ " 15 | \n",
+ " 1.33 % | \n",
+ " 37.65M | \n",
+ " 2.36G | \n",
+ " 2 days | \n",
+ "
\n",
+ " \n",
+ " Gate-based ns, 10⁻⁴ | \n",
+ " 25.48k | \n",
+ " 12.27G | \n",
+ " 14.93G | \n",
+ " 13 | \n",
+ " 18 | \n",
+ " 1.19 % | \n",
+ " 8.72M | \n",
+ " 4.90G | \n",
+ " 18 hours | \n",
+ "
\n",
+ " \n",
+ " Majorana ns, 10⁻⁴ | \n",
+ " 25.48k | \n",
+ " 12.27G | \n",
+ " 14.93G | \n",
+ " 15 | \n",
+ " 15 | \n",
+ " 1.25 % | \n",
+ " 26.11M | \n",
+ " 5.66G | \n",
+ " 15 hours | \n",
+ "
\n",
+ " \n",
+ " Majorana ns, 10⁻⁶ | \n",
+ " 25.48k | \n",
+ " 12.27G | \n",
+ " 14.93G | \n",
+ " 7 | \n",
+ " 13 | \n",
+ " 0.55 % | \n",
+ " 6.25M | \n",
+ " 12.13G | \n",
+ " 7 hours | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " Logical qubits Logical depth T states Code distance \\\n",
+ "Gate-based µs, 10⁻³ 25.48k 12.27G 14.93G 27 \n",
+ "Gate-based µs, 10⁻⁴ 25.48k 12.27G 14.93G 13 \n",
+ "Gate-based ns, 10⁻³ 25.48k 12.27G 14.93G 27 \n",
+ "Gate-based ns, 10⁻⁴ 25.48k 12.27G 14.93G 13 \n",
+ "Majorana ns, 10⁻⁴ 25.48k 12.27G 14.93G 15 \n",
+ "Majorana ns, 10⁻⁶ 25.48k 12.27G 14.93G 7 \n",
+ "\n",
+ " T factories T factory fraction Physical qubits rQOPS \\\n",
+ "Gate-based µs, 10⁻³ 13 0.61 % 37.38M 1.57M \n",
+ "Gate-based µs, 10⁻⁴ 14 0.78 % 8.68M 3.27M \n",
+ "Gate-based ns, 10⁻³ 15 1.33 % 37.65M 2.36G \n",
+ "Gate-based ns, 10⁻⁴ 18 1.19 % 8.72M 4.90G \n",
+ "Majorana ns, 10⁻⁴ 15 1.25 % 26.11M 5.66G \n",
+ "Majorana ns, 10⁻⁶ 13 0.55 % 6.25M 12.13G \n",
+ "\n",
+ " Physical runtime \n",
+ "Gate-based µs, 10⁻³ 6 years \n",
+ "Gate-based µs, 10⁻⁴ 3 years \n",
+ "Gate-based ns, 10⁻³ 2 days \n",
+ "Gate-based ns, 10⁻⁴ 18 hours \n",
+ "Majorana ns, 10⁻⁴ 15 hours \n",
+ "Majorana ns, 10⁻⁶ 7 hours "
+ ]
+ },
+ "execution_count": 7,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "logical_counts = LogicalCounts({\n",
+ " 'numQubits': 12581,\n",
+ " 'tCount': 12,\n",
+ " 'rotationCount': 12,\n",
+ " 'rotationDepth': 12,\n",
+ " 'cczCount': 3731607428,\n",
+ " 'measurementCount': 1078154040\n",
+ "})\n",
+ "\n",
+ "logical_counts.estimate(params).summary_data_frame(labels=labels)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "q-sharp-exercises",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.10.14"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}