From 5a1ae8de4ca7d00eeffc6ffc407426b90ffab34b Mon Sep 17 00:00:00 2001 From: Dor Harpaz Date: Thu, 25 Jun 2026 15:23:52 +0300 Subject: [PATCH 1/2] Normalize math notation: display delimiters to $$, unicode to LaTeX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Across 27 main notebooks (markdown cells only): bare \begin{equation}/eqnarray and $- or $$-wrapped equation envs converted to clean $$...$$; bare \begin{align} wrapped as $$\begin{aligned}...\end{aligned}$$; matrix/cases/aligned content envs left inside $$. Unicode math symbols converted to LaTeX — prose symbols wrapped in $...$ (e.g. ψ -> $\psi$), in-math swapped († -> \dagger, ⊆ -> \subseteq), code-cell/backtick unicode left untouched. Verified per notebook with a structural linter and nbconvert markdown render (no execute). --- .../quantum_autoencoder.ipynb | 2 +- .../qmc_user_defined/qmc_user_defined.ipynb | 14 +++--- .../hamiltonian_simulation_guide.ipynb | 12 ++--- .../qsvt_matrix_inversion.ipynb | 4 +- .../vqls/vqls_with_lcu.ipynb | 2 - .../glued_trees/glued_trees.ipynb | 12 ++--- .../qfold.ipynb | 32 +++++++------- .../link_monitoring/link_monitoring.ipynb | 2 +- .../credit_card_fraud/credit_card_fraud.ipynb | 2 +- .../portfolio_optimization_with_hhl.ipynb | 20 +++++---- .../rainbow_options_bruteforce_method.ipynb | 4 +- .../rainbow_options_direct_method.ipynb | 8 ++-- .../rainbow_options_integration_method.ipynb | 12 ++--- .../integer_linear_programming.ipynb | 12 +++-- .../min_graph_coloring.ipynb | 2 +- .../robust_posture_optimization.ipynb | 2 +- .../high_level_modeling_flexible_qpe.ipynb | 4 +- .../qml_with_classiq_guide.ipynb | 8 ++-- .../linear_combination_of_unitaries.ipynb | 44 +++++++++---------- .../quantumwalk_complex_network.ipynb | 2 +- .../algo_design_QCE_tutorial_part_I.ipynb | 4 +- ...mbinatorial_qmod_workshop_for_maxcut.ipynb | 2 +- ...mbi_workshop_equality_constriants_PO.ipynb | 24 +++++----- .../rainbow_options_workshop_bruteforce.ipynb | 4 +- .../grover_workshop/grover_workshop.ipynb | 26 +++++------ .../workshops/hhl_workshop/hhl_workshop.ipynb | 2 +- .../oracle_workshop/oracles_workshop.ipynb | 2 +- 27 files changed, 135 insertions(+), 129 deletions(-) diff --git a/algorithms/QML/quantum_autoencoder/quantum_autoencoder.ipynb b/algorithms/QML/quantum_autoencoder/quantum_autoencoder.ipynb index d1c167f81..eeeaa36a7 100644 --- a/algorithms/QML/quantum_autoencoder/quantum_autoencoder.ipynb +++ b/algorithms/QML/quantum_autoencoder/quantum_autoencoder.ipynb @@ -85,7 +85,7 @@ "2. An encoder block, which is a variational quantum ansatz with input port of size $n$ and output ports of size $m$ and $n-m$.\n", "3. A swap test block between the $n-m$ trash output of the encoder and new $n-m$ zero registers.\n", "\n", - "We train the network such that the test qubit of the swap test is at state |0⟩ with probability 1.\n", + "We train the network such that the test qubit of the swap test is at state $|0\\rangle$ with probability 1.\n", "![Screenshot 2025-07-02 at 23.22.05.png](attachment:639bca1b-0f13-4994-983d-b4f995942861.png)\n", "
\n", "
Quantum autoencoder layout: uncoded data of size 4 transforms into two outputs, a coded register of size 2 and trash outputs of size 2 at state $|00\\rangle$\n", diff --git a/algorithms/amplitude_amplification_and_estimation/qmc_user_defined/qmc_user_defined.ipynb b/algorithms/amplitude_amplification_and_estimation/qmc_user_defined/qmc_user_defined.ipynb index 737643a8f..fafb47ab2 100644 --- a/algorithms/amplitude_amplification_and_estimation/qmc_user_defined/qmc_user_defined.ipynb +++ b/algorithms/amplitude_amplification_and_estimation/qmc_user_defined/qmc_user_defined.ipynb @@ -15,17 +15,19 @@ "source": [ "Monte Carlo integration refers to estimating expectation values of a function $f(x)$, where $x$ is a random variable drawn from some known distribution $p$:\n", "\n", - "\\begin{equation}\n", + "$$\n", "\\tag{1}\n", "E_{p}(x) = \\int f(x)p(x) dx.\n", - "\\end{equation}\n", + "$$\n", "Such evaluations appear in the context of option pricing or credit risk analysis.\n", "\n", "The basic idea of QMCI assumes that we have a quantum function $A$, which, for a given $f$ and $p$, loads the following state of $n+1$ qubits:\n", - "\\begin{align}\n", + "$$\n", + "\\begin{aligned}\n", "\\tag{2}\n", "A|0\\rangle_n|0\\rangle = \\sum^{2^n-1}_{i=0} \\sqrt{f_i} \\sqrt{p_i}|i\\rangle_n|1\\rangle + \\sum^{2^n-1}_{i=0} \\sqrt{1-f_i} \\sqrt{p_i}|i\\rangle_n|0\\rangle = \\sqrt{a}|\\psi_1\\rangle+\\sqrt{1-a}|\\psi_0\\rangle,\n", - "\\end{align}\n", + "\\end{aligned}\n", + "$$\n", "where it is understood that the first $2^n$ states represent a discretized space of $x$, and that $0\\leq f(x)\\leq 1$.\n", "Then, by applying the amplitude estimation (AE) algorithm for the \"good-state\" $|\\psi_1 \\rangle$, we can estimate its amplitude:\n", "$$\n", @@ -360,10 +362,10 @@ "Here we apply a basic AE algorithm that is based on QPE. The idea behind this algorithm is the following:\n", "\n", "The state $A|0\\rangle_n|0\\rangle$ is spanned by two eigenvectors of our Grover operator $Q$, with the two corresponding eigenvalues\n", - "\\begin{equation}\n", + "$$\n", "\\tag{5}\n", "\\lambda_{\\pm}=\\exp\\left(\\pm i2\\pi \\theta \\right), \\qquad \\sin^2 \\left(\\pi \\theta\\right)\\equiv a.\n", - "\\end{equation}\n", + "$$\n", "Therefore, if we apply a QPE on $A|0\\rangle_n|0\\rangle$, we have these two eigenvalues encoded in the QPE register. However, both give the value of $a$, so there is no ambiguity." ] }, diff --git a/algorithms/hamiltonian_simulation/hamiltonian_simulation_guide/hamiltonian_simulation_guide.ipynb b/algorithms/hamiltonian_simulation/hamiltonian_simulation_guide/hamiltonian_simulation_guide.ipynb index a98985985..6760f990c 100644 --- a/algorithms/hamiltonian_simulation/hamiltonian_simulation_guide/hamiltonian_simulation_guide.ipynb +++ b/algorithms/hamiltonian_simulation/hamiltonian_simulation_guide/hamiltonian_simulation_guide.ipynb @@ -79,9 +79,9 @@ "id": "6", "metadata": {}, "source": [ - "\\begin{equation}\n", + "$$\n", "H_{full} = \\sum_{j} h_j H_j,\n", - "\\end{equation}" + "$$" ] }, { @@ -107,17 +107,17 @@ "source": [ "Now that the problem is stated, a possible solution is the Suzuki-Trotter decomposition, also known as Trotterization. Simply put, this method involves 'breaking' the evolution operator into the evolution operators of its components. In the **first order**, it looks like this:\n", "\n", - "\\begin{equation*}\n", + "$$\n", "e^{-itH}=\\exp\\left\\{-it\\sum_{j=1}^N h_j H_j\\right\\} \\approx \\left(\\prod_{j}^N e^{-it h_j H_j/r}\\right)^r + \\mathcal{O}(t^2/r).\n", - "\\end{equation*}\n", + "$$\n", "\n", "Details about this decomposition are in [[1]](#ts_paper).\n", "\n", "This formula is important and has applications in several scenarios. Additionally, if you need an error that scales better than $t^2$, it is possible to achieve higher-order Suzuki-Trotter formulas. For example, the **second-order** Suzuki-Trotter would look like this:\n", "\n", - "\\begin{equation*}\n", + "$$\n", "e^{-itH}=\\exp\\left\\{-i\\left(\\sum_{j=1}^N \\frac{t_j}{2}\\,H_j + \\sum_{j=N}^1 \\frac{t_j}{2}\\,H_j\\right)\\right\\} \\approx \\left(\\prod_{j=1}^N e^{-it_j\\, H_j/(2r)}\\prod_{j=N}^1 e^{-it_j\\, H_j/(2r)}\\right)^r + \\mathcal{O}(t^3/r).\n", - "\\end{equation*}\n" + "$$\n" ] }, { diff --git a/algorithms/quantum_linear_solvers/qsvt_matrix_inversion/qsvt_matrix_inversion.ipynb b/algorithms/quantum_linear_solvers/qsvt_matrix_inversion/qsvt_matrix_inversion.ipynb index c510e3103..8215d4e13 100644 --- a/algorithms/quantum_linear_solvers/qsvt_matrix_inversion/qsvt_matrix_inversion.ipynb +++ b/algorithms/quantum_linear_solvers/qsvt_matrix_inversion/qsvt_matrix_inversion.ipynb @@ -70,10 +70,10 @@ "$$\n", "where $\\mathrm{Poly(\\sigma)}$ is a polynomial with a well-defined parity. The QSVT routine allows to block-encode such singular value polynomial transforms, based on the Quantum Signal Processing (QSP) approach. For the case of matrix inversion, we have the identities,\n", "$$\n", - "\\begin{align}\n", + "\\begin{aligned}\n", "A^\\dagger &=V^\\dagger \\Sigma W,\\\\\n", "A^{-1} &= V^\\dagger \\Sigma^{-1}W,\n", - "\\end{align}\n", + "\\end{aligned}\n", "$$\n", "from which we can deduce that: \n", "\n", diff --git a/algorithms/quantum_linear_solvers/vqls/vqls_with_lcu.ipynb b/algorithms/quantum_linear_solvers/vqls/vqls_with_lcu.ipynb index 32bf3d69e..3527ea148 100644 --- a/algorithms/quantum_linear_solvers/vqls/vqls_with_lcu.ipynb +++ b/algorithms/quantum_linear_solvers/vqls/vqls_with_lcu.ipynb @@ -283,12 +283,10 @@ "We treat a specific example based on a system of three qubits:\n", "\n", "$$\\begin{aligned}\n", - "\\begin{align}\n", "A &= c_0 A_0 + c_1 A_1 + c_2 A_2 = \\ 0.55 \\mathbb{I} \\ + \\ 0.225 Z_1 \\ + \\ 0.225 Z_2\n", "\\\\\n", "\\\\\n", "|b\\rangle &= U_b |0 \\rangle = H_0 H_1 H_2 |0\\rangle,\n", - "\\end{align}\n", "\\end{aligned}$$\n", "\n", "where $Z_j, X_j, H_j$ represent the Pauli $Z$, Pauli $X$, and Hadamard\n", diff --git a/algorithms/quantum_walks/glued_trees/glued_trees.ipynb b/algorithms/quantum_walks/glued_trees/glued_trees.ipynb index 2b14d80e0..9ecd6029b 100644 --- a/algorithms/quantum_walks/glued_trees/glued_trees.ipynb +++ b/algorithms/quantum_walks/glued_trees/glued_trees.ipynb @@ -51,11 +51,11 @@ "$$\n", "\\mathbf{H} := -\\begin{pmatrix}\n", "\\mathbf{0} & \\mathbf{B} \\\\\n", - "\\mathbf{B}^† & \\mathbf{0}\n", + "\\mathbf{B}^\\dagger & \\mathbf{0}\n", "\\end{pmatrix}\n", "$$\n", "\n", - "where $\\mathbf{B}$ is any $N \\times M$ matrix such that $\\mathbf{B}\\mathbf{B}^†=\\mathbf{A}$. However, to use this matrix $\\mathbf{H}$ for Hamiltonian simulation, it must have a size corresponding to a power of two, while $\\mathbf{A}$ is size $N \\times N$. We can deal with this by ensuring that $\\mathbf{B}$ is size $N \\times (N+4)$, so the resulting Hamiltonian $\\mathbf{H}$ is a square matrix with side length $2N+4 = 2(2^{n+1}-2)+4 = 2^{n+2}$. This means that a glued trees system with $n$ columns for one tree can be simulated using $n+2$ qubits.\n", + "where $\\mathbf{B}$ is any $N \\times M$ matrix such that $\\mathbf{B}\\mathbf{B}^\\dagger=\\mathbf{A}$. However, to use this matrix $\\mathbf{H}$ for Hamiltonian simulation, it must have a size corresponding to a power of two, while $\\mathbf{A}$ is size $N \\times N$. We can deal with this by ensuring that $\\mathbf{B}$ is size $N \\times (N+4)$, so the resulting Hamiltonian $\\mathbf{H}$ is a square matrix with side length $2N+4 = 2(2^{n+1}-2)+4 = 2^{n+2}$. This means that a glued trees system with $n$ columns for one tree can be simulated using $n+2$ qubits.\n", "\n", "In this notebook, we generate the matrix $\\mathbf{A}$ by building the glued trees structure using the NetworkX library such that the nodes are labeled in order from the entrance to exit node and using the `nx.adjacency_matrix` function to generate an adjacency matrix using that ordering. We decompose $\\mathbf{A}$ using [Cholesky decomposition](https://en.wikipedia.org/wiki/Cholesky_decomposition) to get a square matrix where its product with its conjugate transpose is equal to $\\mathbf{A}$. This matrix is the same size as $\\mathbf{A}$, however, so we must pad it with four columns of zeroes to get our matrix $\\mathbf{B}$ of size $N \t\\times (N+4)$ so $\\mathbf{H}$ has a size corresponding to a power of two. We can then create the block Hamiltonian with the proper size using $\\mathbf{B}$ and $\\mathbf{B}^\\dagger$, and decompose it into a sum of Pauli strings using the Classiq built-in `matrix_to_pauli_operator` function. The number of terms in the decomposition grows quickly with system size, and including all of them may produce circuits too deep for current quantum hardware. We therefore use two strategies depending on the system size.\n", "\n", @@ -205,21 +205,21 @@ "\\begin{aligned}\n", "|\\psi(t)\\rangle &\\propto \\begin{pmatrix}\n", "\\dot{\\vec{x}}(t) \\\\\n", - "i\\mathbf{B}^{†} \\vec{x}(t) \n", + "i\\mathbf{B}^{\\dagger} \\vec{x}(t) \n", "\\end{pmatrix} \\\\\n", "\\begin{pmatrix}\n", "\\dot{\\vec{x}}(t) \\\\\n", - "i\\mathbf{B}^{†} \\vec{x}(t) \n", + "i\\mathbf{B}^{\\dagger} \\vec{x}(t) \n", "\\end{pmatrix} &= e^{-it\\mathbf{H}} \\begin{pmatrix}\n", "\\dot{\\vec{x}}(0) \\\\\n", - "i\\mathbf{B}^{†} \\vec{x}(0) \n", + "i\\mathbf{B}^{\\dagger} \\vec{x}(0) \n", "\\end{pmatrix}\n", "\\end{aligned}\n", "$$\n", "\n", "where $\\vec{x}(0)=(0,0,\\dots,0)^T$ and $\\dot{\\vec{x}}(0)=(1,0,\\dots,0)^T$ using a linear ordering of nodes. \n", "\n", - "Since the speed of the entrance node oscillator $|\\dot{x}_1(t)|$ is represented by the quantum state $|0\\rangle$ and should have probability 1 at $t=0$, there is no specific state preparation necessary for this system. It should also be noted that since our matrix $\\mathbf{B}^†$ is padded with four rows of zeroes, the highest four quantum states do not correspond to the displacement or speed of any oscillator. This means that the quantum state representing the speed of the exit node oscillator $|\\dot{x}_N(t)|$, which is what we are most interested in, corresponds to $|N-1\\rangle=|2^{n+1}-3\\rangle$. We track this particular quantum state around $t \\approx 2n$, expecting a spike that represents the system of oscillators \"reaching\" the exit node from the initial push to the entrance node." + "Since the speed of the entrance node oscillator $|\\dot{x}_1(t)|$ is represented by the quantum state $|0\\rangle$ and should have probability 1 at $t=0$, there is no specific state preparation necessary for this system. It should also be noted that since our matrix $\\mathbf{B}^\\dagger$ is padded with four rows of zeroes, the highest four quantum states do not correspond to the displacement or speed of any oscillator. This means that the quantum state representing the speed of the exit node oscillator $|\\dot{x}_N(t)|$, which is what we are most interested in, corresponds to $|N-1\\rangle=|2^{n+1}-3\\rangle$. We track this particular quantum state around $t \\approx 2n$, expecting a spike that represents the system of oscillators \"reaching\" the exit node from the initial push to the entrance node." ] }, { diff --git a/applications/chemistry/protein_folding/protein_folding_with_quantum_walk/qfold.ipynb b/applications/chemistry/protein_folding/protein_folding_with_quantum_walk/qfold.ipynb index 1d171246a..dd82ada5c 100644 --- a/applications/chemistry/protein_folding/protein_folding_with_quantum_walk/qfold.ipynb +++ b/applications/chemistry/protein_folding/protein_folding_with_quantum_walk/qfold.ipynb @@ -19,13 +19,13 @@ "\n", "1. Structure space grows explosively\n", "\n", - " * Each amino-acid residue has dihedral angles ψ and φ, and their combinations generate countless possible spatial structures.\n", - " * For example, if φ and ψ are each discretized into several dozen levels, the number of possible structures grows exponentially with respect to the number of residues N.\n", + " * Each amino-acid residue has dihedral angles $\\psi$ and $\\phi$, and their combinations generate countless possible spatial structures.\n", + " * For example, if $\\phi$ and $\\psi$ are each discretized into several dozen levels, the number of possible structures grows exponentially with respect to the number of residues N.\n", "\n", "2. Limitations of classical computation\n", "\n", " * Classically, the search is performed using molecular dynamics (MD) simulations or Monte Carlo (MC) methods.\n", - " * In the MC method in particular, the procedure “compute energy difference ΔE → determine whether to accept the new structure using the classical Metropolis rule” is repeated.\n", + " * In the MC method in particular, the procedure “compute energy difference $\\Delta E \\to$ determine whether to accept the new structure using the classical Metropolis rule” is repeated.\n", " * However, because many energy minima exist, classical searches tend to fall into local optima, and large-scale exploration is computationally difficult.\n", "\n", "3. Potential of quantum computation\n", @@ -51,14 +51,14 @@ "\n", "### - Classical processing [2]\n", "\n", - "In QFold’s classical preprocessing, prior to executing the quantum computation, a finite set of φ–ψ angle configurations is sampled. For each configuration, using quantum chemistry software (e.g., **Psi4**), the **energy difference ΔE** in the transition from the current structure to the proposed structure is calculated and saved as a dataset. Through this process, the “stability” of each local structural change is provided as numerical values. However, in this notebook, classical processing is not performed; instead, the dataset already computed in [2] is used, and the focus is placed only on the quantum computation.\n", + "In QFold’s classical preprocessing, prior to executing the quantum computation, a finite set of $\\phi$–$\\psi$ angle configurations is sampled. For each configuration, using quantum chemistry software (e.g., **Psi4**), the **energy difference $\\Delta E$** in the transition from the current structure to the proposed structure is calculated and saved as a dataset. Through this process, the “stability” of each local structural change is provided as numerical values. However, in this notebook, classical processing is not performed; instead, the dataset already computed in [2] is used, and the focus is placed only on the quantum computation.\n", "\n", "### - Quantum encoding\n", "\n", "\n", "In the quantum encoding of the protein, the degrees of freedom of the structure are mapped onto qubits as follows:\n", "\n", - "* Rotation-angle qubits: encode the discretized angles φ and ψ\n", + "* Rotation-angle qubits: encode the discretized angles $\\phi$ and $\\psi$\n", "* Move-id register: selects the dihedral angle to be updated\n", "* Coin qubit: encodes the Metropolis acceptance probability\n", "\n", @@ -70,15 +70,15 @@ "$$\n", "A = \\min \\left( 1, e^{-\\beta \\Delta E} \\right)\n", "$$\n", - "(β is the inverse-temperature parameter). This probability is converted into the rotation angle\n", + "($\\beta$ is the inverse-temperature parameter). This probability is converted into the rotation angle\n", "$$\n", "\\theta = 2 \\arcsin \\left( \\sqrt{A} \\right)\n", "$$\n", - "and Ry(θ) is applied to the coin qubit. As a result, low-energy structures are assigned higher amplitudes, and the transitions of the quantum walk are biased toward energetically favorable directions. Next, when the coin qubit is 1, the dihedral angle (φ or ψ) indicated by the move-id is updated. Afterwards, the auxiliary computation is uncomputed, and the reversibility of the entire operation is preserved. Furthermore, a **Grover-type reflection operator** is applied, and according to Szegedy’s quantization of the Markov chain, the amplitudes of the low-energy states are amplified through interference effects.\n", + "and Ry($\\theta$) is applied to the coin qubit. As a result, low-energy structures are assigned higher amplitudes, and the transitions of the quantum walk are biased toward energetically favorable directions. Next, when the coin qubit is 1, the dihedral angle ($\\phi$ or $\\psi$) indicated by the move-id is updated. Afterwards, the auxiliary computation is uncomputed, and the reversibility of the entire operation is preserved. Furthermore, a **Grover-type reflection operator** is applied, and according to Szegedy’s quantization of the Markov chain, the amplitudes of the low-energy states are amplified through interference effects.\n", "\n", "### - Measurement and interpretation of the results\n", "\n", - "After repeating the walk operator for multiple steps, the φ and ψ registers are measured. Combinations that appear with high frequency in the measurement results correspond to low free-energy, stable folding structures.\n" + "After repeating the walk operator for multiple steps, the $\\phi$ and $\\psi$ registers are measured. Combinations that appear with high frequency in the measurement results correspond to low free-energy, stable folding structures.\n" ] }, { @@ -88,22 +88,22 @@ "source": [ "## Dataset\n", "\n", - "The dataset used in this study is a table of **energy differences ΔE** that were precomputed by classical computation (e.g., Psi4) after restricting the protein folding problem to a **finite number of discrete states**. In this notebook, the energy set by Minifold is not computed; instead, the dataset described in reference [2] is used. Each state is uniquely represented by a **binary string of five types of bits**, and each bit is assigned the following meaning. The dataset stores “**the ΔE obtained when a state (φ, ψ) is changed according to the move-id**.”\n", + "The dataset used in this study is a table of **energy differences $\\Delta E$** that were precomputed by classical computation (e.g., Psi4) after restricting the protein folding problem to a **finite number of discrete states**. In this notebook, the energy set by Minifold is not computed; instead, the dataset described in reference [2] is used. Each state is uniquely represented by a **binary string of five types of bits**, and each bit is assigned the following meaning. The dataset stores “**the $\\Delta E$ obtained when a state ($\\phi$, $\\psi$) is changed according to the move-id**.”\n", "\n", "| Quantum register | Physical meaning | Notes |\n", "| ---------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------- |\n", - "| $\\phi$ register | Current value of the dihedral angle $\\phi$ (0 = 0°, 1 = $\\pi$) | Rotational degree of freedom of the protein backbone |\n", - "| $\\psi$ register | Current value of the dihedral angle $\\psi$ (0 = 0°, 1 = $\\pi$) | The other main dihedral angle |\n", - "| $M$ register | move-id (0 → change $\\phi$ / 1 → change $\\psi$) | Specifies which angle to move |\n", - "| move-val | (0 = $−\\pi$, 1 = $+\\pi$) | In the 1-bit discretization this is always **1** (fixed at +π) |\n", + "| $\\phi$ register | Current value of the dihedral angle $\\phi$ (0 = $0^\\circ$, 1 = $\\pi$) | Rotational degree of freedom of the protein backbone |\n", + "| $\\psi$ register | Current value of the dihedral angle $\\psi$ (0 = $0^\\circ$, 1 = $\\pi$) | The other main dihedral angle |\n", + "| $M$ register | move-id (0 $\\to$ change $\\phi$ / 1 $\\to$ change $\\psi$) | Specifies which angle to move |\n", + "| move-val | (0 = $-\\pi$, 1 = $+\\pi$) | In the 1-bit discretization this is always **1** (fixed at +$\\pi$) |\n", "| coin (auxiliary) | coin placeholder | The actual coin qubit is generated inside the circuit; the input is always 0 |\n", "\n", "Example: **key = \"00100\"**\n", "\n", - "* $b_0 = 0 \\rightarrow \\phi = 0°$\n", - "* $b_1 = 0 \\rightarrow \\psi = 0°$\n", + "* $b_0 = 0 \\rightarrow \\phi = 0^\\circ$\n", + "* $b_1 = 0 \\rightarrow \\psi = 0^\\circ$\n", "* $b_2 = 1 \\rightarrow {\\rm move}\\,\\, \\psi$\n", - "* $b_3 = 0 \\rightarrow −\\pi$ (the dataset always uses 1, so fixed to 1)\n", + "* $b_3 = 0 \\rightarrow -\\pi$ (the dataset always uses 1, so fixed to 1)\n", "* $b_4 = 0 \\rightarrow$ coin placeholder\n", "\n", "The $\\Delta E$ value corresponding to this key means “the energy difference when the current structure ($\\phi = 0, \\psi = 0$) has $\\psi = 0$ changed by +$\\pi$.”\n" diff --git a/applications/cybersecurity/link_monitoring/link_monitoring.ipynb b/applications/cybersecurity/link_monitoring/link_monitoring.ipynb index 7e8a42644..c265ae36a 100644 --- a/applications/cybersecurity/link_monitoring/link_monitoring.ipynb +++ b/applications/cybersecurity/link_monitoring/link_monitoring.ipynb @@ -38,7 +38,7 @@ "\n", "To effectively address the link monitoring challenge, this tutorial leverages graph theory to model the WSN. Each sensor is represented as a node, and communication links between sensors are depicted as edges. This graphical representation captures the essence of connectivity in the network, providing a foundation for optimizing link monitoring.\n", "\n", - "A WSN can be modeled as a graph $G(V,E)$, where $V$ and $E$ represent the set of vertices (nodes) and edges (communication links), respectively. A vertex cover of a given undirected graph $G(V,E)$ is a set $S ⊆ V$ where each $e \\in E$ is incident to at least one vertex of $S$.\n", + "A WSN can be modeled as a graph $G(V,E)$, where $V$ and $E$ represent the set of vertices (nodes) and edges (communication links), respectively. A vertex cover of a given undirected graph $G(V,E)$ is a set $S \\subseteq V$ where each $e \\in E$ is incident to at least one vertex of $S$.\n", "\n", "### MVC Concept\n", "\n", diff --git a/applications/finance/credit_card_fraud/credit_card_fraud.ipynb b/applications/finance/credit_card_fraud/credit_card_fraud.ipynb index c8a5eb237..630619e16 100644 --- a/applications/finance/credit_card_fraud/credit_card_fraud.ipynb +++ b/applications/finance/credit_card_fraud/credit_card_fraud.ipynb @@ -175,7 +175,7 @@ "Data properties:\n", "- The database contains only numeric input variables that are the result of a PCA transformation.\n", "- Due to confidentiality issues, original features are not provided.\n", - "- Features V1, V2, … V28 are the principal components obtained with PCA.\n", + "- Features V1, V2, $\\dots$ V28 are the principal components obtained with PCA.\n", "- The only features that have not been transformed with PCA are 'Time' and 'Amount'.\n", "- The 'Time' feature is the number of seconds that elapsed between each transaction and the first transaction in the dataset.\n", "- The 'Amount' feature is the transaction amount.\n", diff --git a/applications/finance/hybrid_hhl_for_portfolio_optimization/portfolio_optimization_with_hhl.ipynb b/applications/finance/hybrid_hhl_for_portfolio_optimization/portfolio_optimization_with_hhl.ipynb index f2fa0bee2..e22f9977b 100644 --- a/applications/finance/hybrid_hhl_for_portfolio_optimization/portfolio_optimization_with_hhl.ipynb +++ b/applications/finance/hybrid_hhl_for_portfolio_optimization/portfolio_optimization_with_hhl.ipynb @@ -37,14 +37,16 @@ "- Finally, the portfolio problem has two constants: a desired total return $R$, and a total budget $B$.\n", "\n", "The task is to find a solution for the allocation vector $\\vec{w}$ which minimizes the risk\n", - "\\begin{equation}\n", + "$$\n", "\\min_{\\vec{w}} \\vec{w}^T\\cdot \\Sigma \\cdot \\vec{w},\n", - "\\end{equation}\n", + "$$\n", "under the constraints of\n", - "\\begin{eqnarray}\n", + "$$\n", + "\\begin{aligned}\n", " \\text{getting the desired total return: } R&=\\vec{\\mu}^T\\cdot\\vec{w},\\\\\n", " \\text{satisfying the total known budget: } B&=\\vec{p}^T\\cdot\\vec{w}\n", - "\\end{eqnarray}" + "\\end{aligned}\n", + "$$" ] }, { @@ -53,7 +55,7 @@ "metadata": {}, "source": [ "Writing this problem as a constrained minimization problem in a continuous space, we get a set of linear equations:\n", - "\\begin{equation}\n", + "$$\n", " \\begin{pmatrix}\n", " 0 & 0 & \\vec{\\mu}^T \\\\\n", " 0 & 0 & \\vec{p}^T \\\\\n", @@ -70,15 +72,15 @@ " B \\\\\n", " \\vec{0} \\\\\n", " \\end{pmatrix}, \\quad (1)\n", - "\\end{equation}\n", + "$$\n", "where $\\nu_{1,2}$ are Lagrange multipliers.\n", "\n", "**comment**: one can rescale the problem and set the total budget to $B=1$.\n", "\n", "Equation (1) is of the form of a linear equation:\n", - "\\begin{equation}\n", + "$$\n", "A\\cdot \\vec{x} = \\vec{b} \\quad (2)\n", - "\\end{equation}" + "$$" ] }, { @@ -103,7 +105,7 @@ "\n", "1. **State Preparation for the vector $\\vec{b}$**: Let us assume that $\\vec{b}$ is of size $2^n$, then:\n", "$$\n", - "ֿ|0\\rangle_n \\xrightarrow[{\\rm SP}]{} \\sum^{2^n-1}_{i=0}b_i|i\\rangle_n. \\quad (3)\n", + "|0\\rangle_n \\xrightarrow[{\\rm SP}]{} \\sum^{2^n-1}_{i=0}b_i|i\\rangle_n. \\quad (3)\n", "$$\n", "2. **Quantum Phase Estimation (QPE) for the unitary $e^{2\\pi iA}$**: This quantum block approximates the eigenvalues of the matrix $A$, $\\{\\lambda_i\\}^{2^n}_{i=1}$, into a register of size $m$. If we write the vector $\\vec{b}$ in the basis of eigenvectors of $A$, $\\sum^{2^n-1}_{i=0}b_i|i\\rangle_n = \\sum^{2^n-1}_{j=0}\\beta_j|\\psi_j\\rangle_n$, then the QPE stage gives\n", "$$\n", diff --git a/applications/finance/rainbow_options/rainbow_options_bruteforce_method.ipynb b/applications/finance/rainbow_options/rainbow_options_bruteforce_method.ipynb index 8c9a08187..7886c91ac 100644 --- a/applications/finance/rainbow_options/rainbow_options_bruteforce_method.ipynb +++ b/applications/finance/rainbow_options/rainbow_options_bruteforce_method.ipynb @@ -474,12 +474,12 @@ "source": [ "## Post-process\n", "Add a term to the post-processing function:\n", - "\\begin{equation}\n", + "$$\n", "\\begin{split}\n", "&\\mathbb{E} \\left[\\max\\left(e^{b \\cdot z}, Ke^{-b'}\\right) \\right] e^{b'} - K \\\\\n", "= &\\mathbb{E} \\left[\\max\\left(e^{-a\\hat{x}}, Ke^{-b'-ax_{max}}\\right) \\right]e^{b'+ ax_{max}} - K \n", "\\end{split}\n", - "\\end{equation}" + "$$" ] }, { diff --git a/applications/finance/rainbow_options/rainbow_options_direct_method.ipynb b/applications/finance/rainbow_options/rainbow_options_direct_method.ipynb index 311a7d537..55fc694f3 100644 --- a/applications/finance/rainbow_options/rainbow_options_direct_method.ipynb +++ b/applications/finance/rainbow_options/rainbow_options_direct_method.ipynb @@ -296,13 +296,13 @@ "source": [ "## Direct Method\n", "The direct exponential amplitude loading encodes in $\\tilde{f}$ the following function:\n", - "\\begin{equation}\n", + "$$\n", "\\tilde{f}(x)=\n", " \\begin{cases}\n", " e^{-a\\hat{x}}, & \\text{if } \\frac{x}{2^P} \\geq \\frac{\\log(K) -b'}{b}\\\\\n", " Ke^{-(b'+ ax_{max})}, & \\text{if } \\frac{x}{2^P} < \\frac{\\log(K) -b'}{b}\n", " \\end{cases}\n", - "\\end{equation}\n", + "$$\n", "\n", "where $\\hat{x}$ is the binary complement of $x$ ($\\hat{x}=x-x_{max}$) and $x_{max}=2^R-1$, the maximum value that can be stored in the $|x\\rangle$ register. For loading $e^{-a\\hat{x}}$, the $|r\\rangle$ is initialized to all zeros. One controlled rotation for each qubit is performed. The rotation angles are $\\theta_i = 2\\arccos \\left({\\sqrt{e^{-a2^i}}}\\right)$. All the probabilities of getting a $|0\\rangle^{\\otimes{R}}$ in the $|r\\rangle$ are then collected by a multi-controlled X (MCX) gate and stored in the $|1\\rangle$ state of a target qubit." ] @@ -487,12 +487,12 @@ "source": [ "## Post-process\n", "Add a term to the post-processing function:\n", - "\\begin{equation}\n", + "$$\n", "\\begin{split}\n", "&\\mathbb{E} \\left[\\max\\left(e^{b \\cdot z}, Ke^{-b'}\\right) \\right] e^{b'} - K \\\\\n", "= &\\mathbb{E} \\left[\\max\\left(e^{-a\\hat{x}}, Ke^{-b'-ax_{max}}\\right) \\right]e^{b'+ ax_{max}} - K \n", "\\end{split}\n", - "\\end{equation}" + "$$" ] }, { diff --git a/applications/finance/rainbow_options/rainbow_options_integration_method.ipynb b/applications/finance/rainbow_options/rainbow_options_integration_method.ipynb index 7d79672a5..b69b97d4a 100644 --- a/applications/finance/rainbow_options/rainbow_options_integration_method.ipynb +++ b/applications/finance/rainbow_options/rainbow_options_integration_method.ipynb @@ -275,16 +275,16 @@ "## Integration Method\n", "\n", "The comparator collects the probabilities $g(r)$ of $|r\\rangle$ state until $|r\\rangle$ register is lower than $|x\\rangle$:\n", - "\\begin{equation}\n", + "$$\n", "\\begin{split}\n", "&\\sum_{r=0}^{2^R-1}{\\sqrt{g(r)}}|x\\rangle|r\\rangle|r\\leq x\\rangle \\\\\n", "= &|x\\rangle \\otimes \\left[ \\sum_{r=0}^{x}{\\sqrt{g(r)}} |r\\rangle |1\\rangle + \\sum_{r=x}^{2^R-1}{\\sqrt{g(r)}} |r\\rangle |0\\rangle \\right]\n", "\\end{split}\n", - "\\end{equation}\n", + "$$\n", "Collecting the probability to have $r\\leq x$, define the function:\n", - "\\begin{equation}\n", + "$$\n", "\\tilde{h}(x)=\\sum_{r=0}^{x}g(r)\n", - "\\end{equation}\n", + "$$\n", "Evaluating the probability to get a $|1\\rangle$ results in $\\sum_{x = 0}^{2^R-1}{\\tilde{h}(x)}$.\n", "To obtain a given function $\\tilde{h}$, choose a proper function $g(r)$.\n", "The $g(r)$ for $r=0$ value must therefore be:\n", @@ -457,12 +457,12 @@ "\n", "Add a term to the post-processing function:\n", "\n", - "\\begin{equation}\n", + "$$\n", "\\begin{split}\n", "\\mathbb{E} \\left[\\max\\left(\\frac{e^{a(x+1)} - 1}{e^{a(x_{max} +1)}-1}c + \\frac{1}{e^a} , Ke^{-b'}\\right)\\right] e^{b'} - K \\\\\n", "=\\mathbb{E} \\left[\\max\\left(\\frac{e^{a(x+1)} - 1}{e^{a(x_{max} +1)}-1}, \\frac{Ke^{-b'}}{c} - \\frac{e^{-a}}{c}\\right)\\right]ce^{b'} + e^{b'}e^{-a} - K\n", "\\end{split}\n", - "\\end{equation}" + "$$" ] }, { diff --git a/applications/optimization/integer_linear_programming/integer_linear_programming.ipynb b/applications/optimization/integer_linear_programming/integer_linear_programming.ipynb index 5b3bde72d..66b81d2c8 100644 --- a/applications/optimization/integer_linear_programming/integer_linear_programming.ipynb +++ b/applications/optimization/integer_linear_programming/integer_linear_programming.ipynb @@ -19,17 +19,21 @@ "## Mathematical Formulation\n", "The ILP problem can be formulated as follows: given an $n$-dimensional vector $\\vec{c} = (c_1, c_2, \\ldots, c_n)$, an $m \\times n$ matrix $A = (a_{ij})$ with $i=1,\\ldots,m$ and $j=1,\\ldots,n$, and an $m$-dimensional vector $\\vec{b} = (b_1, b_2, \\ldots, b_m)$, find an $n$-dimensional vector $\\vec{x} = (x_1, x_2, \\ldots, x_n)$ with integer entries that maximizes (or minimizes) the cost function:\n", "\n", - "\\begin{align*}\n", + "$$\n", + "\\begin{aligned}\n", "\\vec{c} \\cdot \\vec{x} = c_1x_1 + c_2x_2 + \\ldots + c_nx_n\n", - "\\end{align*}\n", + "\\end{aligned}\n", + "$$\n", "\n", "subject to these constraints:\n", "\n", - "\\begin{align*}\n", + "$$\n", + "\\begin{aligned}\n", "A \\vec{x} & \\leq \\vec{b} \\\\\n", "x_j & \\geq 0, \\quad j = 1, 2, \\ldots, n \\\\\n", "x_j & \\in \\mathbb{Z}, \\quad j = 1, 2, \\ldots, n\n", - "\\end{align*}\n", + "\\end{aligned}\n", + "$$\n", "\n", "This tutorial guides you through the steps of solving the problem with the Classiq platform, using QAOA [[2](#QAOA)]. The solution is based on defining a Pyomo model for the optimization problem to solve." ] diff --git a/applications/optimization/min_graph_coloring/min_graph_coloring.ipynb b/applications/optimization/min_graph_coloring/min_graph_coloring.ipynb index 447c44076..fc5955dab 100644 --- a/applications/optimization/min_graph_coloring/min_graph_coloring.ipynb +++ b/applications/optimization/min_graph_coloring/min_graph_coloring.ipynb @@ -22,7 +22,7 @@ "\n", "- each vetrex ${v_i}$ is assigned with a color $k_i \\in \\{0, 1, ..., k-1\\}$\n", "- adajecnt vertex have different colors: for each $v_i, v_j$ such that $(v_i, v_j) \\in E$, $k_i \\neq k_j$.\n", - "A graph which is k-colorable but not (k−1)-colorable is said to have chromatic number k. The maximum bound on the chromatic number is $D_G + 1$, where $D_G$ is the maximum vertex degree. The graph coloring problem is known to be in the NP-hard complexity class." + "A graph which is k-colorable but not (k-1)-colorable is said to have chromatic number k. The maximum bound on the chromatic number is $D_G + 1$, where $D_G$ is the maximum vertex degree. The graph coloring problem is known to be in the NP-hard complexity class." ] }, { diff --git a/applications/optimization/robust_posture_optimization/robust_posture_optimization.ipynb b/applications/optimization/robust_posture_optimization/robust_posture_optimization.ipynb index b9d7fe082..c8544d2f5 100644 --- a/applications/optimization/robust_posture_optimization/robust_posture_optimization.ipynb +++ b/applications/optimization/robust_posture_optimization/robust_posture_optimization.ipynb @@ -17,7 +17,7 @@ "\n", "* The algorithm is based on variational optimization methods similar to the Variational Quantum Eigensolver (VQE) and the Quantum Approximate Optimization Algorithm (QAOA). The quantum circuit performs the forward kinematics, while the classical optimizer—COBYLA (Constrained Optimization BY Linear Approximation)—evaluates the error and updates the parameters iteratively. This classical optimization loop provides flexibility to incorporate additional objective terms such as energy minimization or obstacle avoidance.\n", "\n", - "* The proposed quantum circuit ansatz represents each robotic link using one qubit. The orientation of each link is encoded on the Bloch sphere using single-qubit rotation gates (RX, RY, RZ). The expectation values $(⟨X⟩, ⟨Y⟩, ⟨Z⟩)$ are multiplied by the corresponding link lengths to compute the end-effector position. Furthermore, an entangled circuit structure using RXX, RYY, and RZZ gates is introduced, capturing the parent–child link dependencies in orientation. This entanglement enhances both convergence speed and solution accuracy.\n", + "* The proposed quantum circuit ansatz represents each robotic link using one qubit. The orientation of each link is encoded on the Bloch sphere using single-qubit rotation gates (RX, RY, RZ). The expectation values $(\\langle X\\rangle, \\langle Y\\rangle, \\langle Z\\rangle)$ are multiplied by the corresponding link lengths to compute the end-effector position. Furthermore, an entangled circuit structure using RXX, RYY, and RZZ gates is introduced, capturing the parent–child link dependencies in orientation. This entanglement enhances both convergence speed and solution accuracy.\n", "\n", "This method is implemented on Qmod and validated through both simulation and real quantum hardware. The results demonstrate that introducing entanglement enables faster and more accurate inverse kinematics solutions compared to unentangled cases, thereby confirming the effectiveness of quantum computation in robotic applications.\n" ] diff --git a/tutorials/advanced_tutorials/high_level_modeling_flexible_qpe/high_level_modeling_flexible_qpe.ipynb b/tutorials/advanced_tutorials/high_level_modeling_flexible_qpe/high_level_modeling_flexible_qpe.ipynb index 1dd4a5018..2b3f18d62 100644 --- a/tutorials/advanced_tutorials/high_level_modeling_flexible_qpe/high_level_modeling_flexible_qpe.ipynb +++ b/tutorials/advanced_tutorials/high_level_modeling_flexible_qpe/high_level_modeling_flexible_qpe.ipynb @@ -145,14 +145,14 @@ "\n", "\n", "Define ansatz for the repetition scaling $f(p)$:\n", - "\\begin{equation}\n", + "$$\n", "f(p)\\equiv \\left\\{\n", "\\begin{array}{l l}\n", "r_0 & \\text{if } pThe resulting state phases should show x² rotation of the respective computational-state value, modulo 8 (determined by the domain of variable `x`). The steps are a 1/8 of a full $2\\pi$ rotation*" + "*
The resulting state phases should show $x^2$ rotation of the respective computational-state value, modulo 8 (determined by the domain of variable `x`). The steps are a 1/8 of a full $2\\pi$ rotation
*" ] }, { diff --git a/tutorials/workshops/combinatorial_workshop/combinatorial_qmod_workshop_for_maxcut.ipynb b/tutorials/workshops/combinatorial_workshop/combinatorial_qmod_workshop_for_maxcut.ipynb index 51c383df2..4f3f41462 100644 --- a/tutorials/workshops/combinatorial_workshop/combinatorial_qmod_workshop_for_maxcut.ipynb +++ b/tutorials/workshops/combinatorial_workshop/combinatorial_qmod_workshop_for_maxcut.ipynb @@ -424,7 +424,7 @@ "metadata": {}, "source": [ "In the QAOA algorithm, the classical cost function is converted to a Hamiltonian and the `estimate_cost` method give the $\n", - "⟨H_C{\\displaystyle \\rangle }$. But you can define anything with the `estimate_cost`, not necessarily the expectation value of the Hamiltonian." + "\\langle H_C{\\displaystyle \\rangle }$. But you can define anything with the `estimate_cost`, not necessarily the expectation value of the Hamiltonian." ] }, { diff --git a/tutorials/workshops/finance_workshops/combi_workshop_equality_constriants_PO.ipynb b/tutorials/workshops/finance_workshops/combi_workshop_equality_constriants_PO.ipynb index adaa92b98..541ae829a 100644 --- a/tutorials/workshops/finance_workshops/combi_workshop_equality_constriants_PO.ipynb +++ b/tutorials/workshops/finance_workshops/combi_workshop_equality_constriants_PO.ipynb @@ -45,9 +45,9 @@ "\n", "With the above definitions, the total expected return of the portfolio is $\\mu^T w$ and the total risk is $w^T \\Sigma w$. We'll use a simple difference of the two as our cost function, with the additional constraint that the total sum of assets does not exceed a predefined budget $B$. We note that there are many other possibilities for defining a cost function (e.g. add a scaling factor to the risk/return or even some non-linear relation). For reasons of simplicity we select the model below, and we assume all constants and variables are dimensionless.\n", "Thus, the problem is, given the constant inputs $\\mu, \\Sigma, D, B$, to find optimal variable $w$ as follows:\n", - "$\\begin{equation*}\n", + "$$\n", "\\min_{w \\in D} w^T \\Sigma w - \\mu^T w,\n", - "\\end{equation*}$\n", + "$$\n", "subject to $\\Sigma_{i} w_i \\leq B$.\n", "The case presented above is called integer portfolio optimization, since the domains $D_i$ are over the (positive) integers.\n", "Another variation of this problem defines weights over binary domains, and will not be discussed here." @@ -82,23 +82,23 @@ "source": [ "#### First we will solve the problem without adding constraint.\n", "Just:\n", - "$$\\begin{equation*}\n", + "$$\n", "\\min_{w \\in D} w^T \\Sigma w - \\mu^T w\n", - "\\end{equation*}$$\n", + "$$\n", "\n", "#### Then, we will add equality constraint:\n", "\n", - "$$\\begin{equation*}\n", + "$$\n", "\\min_{w \\in D} w^T \\Sigma w - \\mu^T w\n", - "\\end{equation*}$$\n", + "$$\n", "subject to:\n", "$$\\Sigma_{i} w_i == B$$\n", "\n", "#### Finaly, we will add inequality constraints:\n", "\n", - "$$\\begin{equation*}\n", + "$$\n", "\\min_{w \\in D} w^T \\Sigma w - \\mu^T w,\n", - "\\end{equation*}$$\n", + "$$\n", "subject to:\n", "$$\\Sigma_{i} w_i \\leq B$$" ] @@ -780,17 +780,17 @@ "source": [ "The method to deal with equality constraint, namely:\n", "\n", - "$$\\begin{equation*}\n", + "$$\n", "\\min_{w \\in D} w^T \\Sigma w - \\mu^T w\n", - "\\end{equation*}$$\n", + "$$\n", "subject to:\n", "$$\\Sigma_{i} w_i == B$$\n", "\n", "is to add a penalty term to lead us to the set of valid solutions. To do so, we will change the objective function as follows:\n", "\n", - "$$\\begin{equation*}\n", + "$$\n", "\\min_{w \\in D} w^T \\Sigma w - \\mu^T w + P * (\\Sigma_{i} w_i - B)^2\n", - "\\end{equation*}$$\n", + "$$\n", "\n", "Where $P$ is the penalty value you need to define." ] diff --git a/tutorials/workshops/finance_workshops/rainbow_options_workshop_bruteforce.ipynb b/tutorials/workshops/finance_workshops/rainbow_options_workshop_bruteforce.ipynb index ec3f89456..c635567d8 100644 --- a/tutorials/workshops/finance_workshops/rainbow_options_workshop_bruteforce.ipynb +++ b/tutorials/workshops/finance_workshops/rainbow_options_workshop_bruteforce.ipynb @@ -697,12 +697,12 @@ "source": [ "## Post Process\n", "We need to add to the post-processing function a term:\n", - "\\begin{equation}\n", + "$$\n", "\\begin{split}\n", "&\\mathbb{E} \\left[\\max\\left(e^{b \\cdot z}, Ke^{-b'}\\right) \\right] e^{b'} - K \\\\\n", "= &\\mathbb{E} \\left[\\max\\left(e^{-a\\hat{x}}, Ke^{-b'-ax_{max}}\\right) \\right]e^{b'+ ax_{max}} - K\n", "\\end{split}\n", - "\\end{equation}" + "$$" ] }, { diff --git a/tutorials/workshops/grover_workshop/grover_workshop.ipynb b/tutorials/workshops/grover_workshop/grover_workshop.ipynb index 8074bae10..e01cbaf54 100644 --- a/tutorials/workshops/grover_workshop/grover_workshop.ipynb +++ b/tutorials/workshops/grover_workshop/grover_workshop.ipynb @@ -247,14 +247,14 @@ "metadata": {}, "source": [ "The above figure describe geometrically the reflection of some state $|{\\psi}\\rangle=\\alpha|{\\psi_\\text{good}}\\rangle+\\beta|{\\psi_\\text{bad}}\\rangle$ about the state $|{\\psi_\\text{bad}}\\rangle$ such that\n", - "$\\begin{equation}\n", + "$$\n", "R(\\alpha|{\\psi_\\text{good}}\\rangle+\\beta|{\\psi_\\text{bad}}\\rangle) = -\\alpha|{\\psi_\\text{good}}\\rangle+\\beta|{\\psi_\\text{bad}}\\rangle\n", - "\\end{equation}$\n", + "$$\n", "\n", "This operator can also be written as\n", - "$\\begin{equation}\n", + "$$\n", "R|{x}\\rangle=(-1)^{(x==\\text{good solution})}|{x}\\rangle\n", - "\\end{equation}$\n", + "$$\n", "\n", "so if the state of $x$ is a solution it gets a $(-)$ phase." ] @@ -281,7 +281,7 @@ "id": "25", "metadata": {}, "source": [ - "$\\begin{equation} |{a,b,c}\\rangle\\rightarrow(-1)^{(2a+b==c)}|{a,b,c}\\rangle\\end{equation}$\n", + "$$ |{a,b,c}\\rangle\\rightarrow(-1)^{(2a+b==c)}|{a,b,c}\\rangle$$\n", "\n", "In a visual representation, this is what we want:" ] @@ -353,15 +353,15 @@ "source": [ "As with the oracle reflection operator, we can describe any state $|{\\psi}\\rangle$ as a superposition of the initial state $|{\\psi_0}\\rangle$ such that and the orthogoanl state to it $|{\\psi_0^{\\bot}}\\rangle$ \n", "\n", - "$\\begin{equation}\n", + "$$\n", "|{\\psi}\\rangle = \\alpha |{\\psi_0}\\rangle +\\beta |{\\psi_0^{\\bot}}\\rangle\n", - "\\end{equation}$\n", + "$$\n", "\n", "Here we want to apply a $\\pi$ phase to all states that are not equal our initial guess. The reflection operator (our diffuser) is defined as:\n", "\n", - "$\\begin{equation}\n", + "$$\n", "R(\\alpha |{\\psi_0}\\rangle +\\beta |{\\psi_0^{\\bot}}\\rangle) = \\alpha |{\\psi_0}\\rangle -\\beta |{\\psi_0^{\\bot}}\\rangle\n", - "\\end{equation}$\n" + "$$\n" ] }, { @@ -370,14 +370,14 @@ "metadata": {}, "source": [ "To implement a reflection about the initial state $\\vert \\psi_0 \\rangle$, we instead perform a reflection about the computational zero state $\\vert 0 \\rangle$, conjugated by our state-preparation unitary for the initial state $\\vert \\psi_0 \\rangle$. That is, if $U_{\\psi_0}|{0}\\rangle=|{\\psi_0}\\rangle$ then we will implement the desired $R$ operator with:\n", - "$\\begin{equation}\n", + "$$\n", "R = U_{\\psi_0}R_0 U_{\\psi_0}^{\\dagger}\n", - "\\end{equation}$\n", + "$$\n", "\n", "where $R_0$ is the reflection operator about the zero state:\n", - "$\\begin{equation}\n", + "$$\n", "R_0|{x}\\rangle = (-1)^{(x\\ne0)}|{x}\\rangle= (2|{0}\\rangle\\langle{0}|-I)|{x}\\rangle\n", - "\\end{equation}$" + "$$" ] }, { diff --git a/tutorials/workshops/hhl_workshop/hhl_workshop.ipynb b/tutorials/workshops/hhl_workshop/hhl_workshop.ipynb index f29e37e11..79f3fec5e 100644 --- a/tutorials/workshops/hhl_workshop/hhl_workshop.ipynb +++ b/tutorials/workshops/hhl_workshop/hhl_workshop.ipynb @@ -396,7 +396,7 @@ "\n", "And put all together in `my_hhl` function\n", "\n", - "You can apply QPE† * EigenValInv * QPE using the [within_apply operator](https://docs.classiq.io/latest/qmod-reference/language-reference/statements/within-apply/)" + "You can apply QPE$^\\dagger$ * EigenValInv * QPE using the [within_apply operator](https://docs.classiq.io/latest/qmod-reference/language-reference/statements/within-apply/)" ] }, { diff --git a/tutorials/workshops/oracle_workshop/oracles_workshop.ipynb b/tutorials/workshops/oracle_workshop/oracles_workshop.ipynb index 60bb58ec7..870ef22f5 100644 --- a/tutorials/workshops/oracle_workshop/oracles_workshop.ipynb +++ b/tutorials/workshops/oracle_workshop/oracles_workshop.ipynb @@ -92,7 +92,7 @@ "id": "7", "metadata": {}, "source": [ - "with $x∈\\{0,1\\}$ and $y\\in\\{0,1,2,3\\}$. We first define a quantum function that implements the arithmetic operation described above:" + "with $x\\in\\{0,1\\}$ and $y\\in\\{0,1,2,3\\}$. We first define a quantum function that implements the arithmetic operation described above:" ] }, { From b3311962b3278fd087cc2ed844ce2382eb1fc643 Mon Sep 17 00:00:00 2001 From: Dor Harpaz Date: Thu, 25 Jun 2026 16:57:08 +0300 Subject: [PATCH 2/2] Fix malformed display-math delimiter in solving_qlsp_with_aqc Cell 1 closed a single-line display equation with a stray $.$ instead of $$ (Null(H_1) = span(...)$.$ -> ...)$$.), leaving an odd $$ count. Pre-existing typo, surfaced by the math linter during the unicode pass. --- .../adiabatic_linear_solvers/solving_qlsp_with_aqc.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/algorithms/quantum_linear_solvers/adiabatic_linear_solvers/solving_qlsp_with_aqc.ipynb b/algorithms/quantum_linear_solvers/adiabatic_linear_solvers/solving_qlsp_with_aqc.ipynb index a5b9b6551..7a26e0723 100644 --- a/algorithms/quantum_linear_solvers/adiabatic_linear_solvers/solving_qlsp_with_aqc.ipynb +++ b/algorithms/quantum_linear_solvers/adiabatic_linear_solvers/solving_qlsp_with_aqc.ipynb @@ -115,7 +115,7 @@ "### 5. Adiabatic Evolution and Null Space\n", "\n", "Note that there is a degeneracy in the number of null states (unlike the regular adiabatic algorithm usage where we typically look at a single ground state):\n", - "$$\\text{Null}(H_1) = \\text{span}(|\\tilde{x}\\rangle, |\\bar{b}\\rangle)$.$\n", + "$$\\text{Null}(H_1) = \\text{span}(|\\tilde{x}\\rangle, |\\bar{b}\\rangle)$$.\n", "\n", "We also note that for any $s$, $|\\bar{b}\\rangle$ is always in the null space of $H(f(s))$; i.e.,\n", "\n",