Skip to content

Commit 1b0bb3f

Browse files
committed
fixed formulas for purity RB
1 parent c7f669f commit 1b0bb3f

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

ignis/RB_advanced.ipynb

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -431,39 +431,39 @@
431431
"\n",
432432
"### Definition of the purity\n",
433433
"The purity is defined as \n",
434-
"\\begin{equation}\n",
434+
"$$\n",
435435
"\\mathcal{P} = {Tr}(\\rho^2)\n",
436-
"\\end{equation}\n",
436+
"$$\n",
437437
"where $\\rho$ can be expressed as a sum of Pauli matrices\n",
438-
"\\begin{equation}\n",
438+
"$$\n",
439439
"\\rho = \\sum_{i} \\alpha_i P_i\n",
440-
"\\end{equation}\n",
440+
"$$\n",
441441
"where $i$ is a sum over $4^n$ Paulis. Therefore,\n",
442-
"\\begin{equation}\n",
442+
"$$\n",
443443
"\\rho^2 = \\sum_{ij} \\alpha_i \\alpha_j P_i \\cdot P_j\n",
444-
"\\end{equation}\n",
444+
"$$\n",
445445
"and\n",
446-
"\\begin{equation}\n",
446+
"$$\n",
447447
"Tr(\\rho^2) = \\sum_{ij} \\alpha_i \\alpha_j Tr(P_i P_j)\n",
448-
"\\end{equation}\n",
448+
"$$\n",
449449
"If $i\\ne j$ then $P_i P_j = P_k$ (where $P_k \\ne \\mathbf{I}$ and if $i==j$ then $P_i P_j = \\mathcal{I}$). Since $Tr(P_k)=0$, then\n",
450-
"\\begin{equation}\n",
450+
"$$\n",
451451
"Tr(\\rho^2) = \\sum_i \\alpha_i^2 d\n",
452-
"\\end{equation}\n",
452+
"$$\n",
453453
"Now we can calculate any expectation value as,\n",
454-
"\\begin{eqnarray}\n",
454+
"$$\n",
455455
"\\langle \\hat{A} \\rangle = Tr(\\hat{A} \\rho)\n",
456-
"\\end{eqnarray}\n",
456+
"$$\n",
457457
"so the Pauli expectation value is\n",
458-
"\\begin{eqnarray}\n",
459-
"\\langle P_k \\rangle & = & Tr(P_k \\rho) \\\\\n",
460-
"& = & \\sum_i \\alpha_i Tr(P_k P_i)\\\\\n",
461-
"& = & \\alpha_k d\n",
462-
"\\end{eqnarray}\n",
458+
"$$\n",
459+
"\\langle P_k \\rangle = Tr(P_k \\rho) \n",
460+
" = \\sum_i \\alpha_i Tr(P_k P_i)\n",
461+
" = \\alpha_k d\n",
462+
"$$\n",
463463
"so\n",
464-
"\\begin{eqnarray}\n",
464+
"$$\n",
465465
"Tr(\\rho^2) = \\sum_k \\langle P_k \\rangle^2 /d\n",
466-
"\\end{eqnarray}"
466+
"$$"
467467
]
468468
},
469469
{
@@ -473,11 +473,11 @@
473473
"### Step 1: Generating the purity RB sequences \n",
474474
"\n",
475475
"To calculate all $Z$ correlators we only need the on diagonal elements of $\\rho$ (i.e. what is measured in experiment). If we apply a $\\pi/2$ rotation to the density matrix and then measure the $Z$ correlator,\n",
476-
"\\begin{eqnarray}\n",
477-
"\\rho^{'} & = & e^{i P_j \\pi/4} \\rho e^{-i P_j \\pi/4} \\\\\n",
478-
"Tr(Z \\rho^{'}) & = & Tr(Z e^{i P_j \\pi/4} \\rho e^{-i P_j \\pi/4}) \\\\\n",
479-
"& = & Tr(e^{-i P_j \\pi/4}Z e^{i P_j \\pi/4} \\rho)\n",
480-
"\\end{eqnarray}\n",
476+
"$$\n",
477+
"\\rho^{'} = e^{i P_j \\pi/4} \\rho e^{-i P_j \\pi/4} \\\\\n",
478+
"Tr(Z \\rho^{'}) = Tr(Z e^{i P_j \\pi/4} \\rho e^{-i P_j \\pi/4}) \n",
479+
" = Tr(e^{-i P_j \\pi/4}Z e^{i P_j \\pi/4} \\rho)\n",
480+
"$$\n",
481481
"which looks like calculating the expectation value of the rotated Pauli. \n",
482482
"\n",
483483
"Therefore, in order to generate each of the $3^n$ circuits, we need to do (per each of the $n$ qubits) either:\n",

0 commit comments

Comments
 (0)