From 4c3f79e2228201c8b0d1d53c081d6c7eee948a90 Mon Sep 17 00:00:00 2001 From: Soyoung Shin <63990199+0sophy1@users.noreply.github.com> Date: Tue, 12 Aug 2025 17:23:11 -0700 Subject: [PATCH 1/9] Added explanation for videos Added some details to match the video. More to be pushed and work done before the utility paper replication. I will finish add contents by the end of tomorrow. --- .../quantum-computing-in-practice/mapping.ipynb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/learning/courses/quantum-computing-in-practice/mapping.ipynb b/learning/courses/quantum-computing-in-practice/mapping.ipynb index 47f7fa211ea..23ef7b7cd6e 100644 --- a/learning/courses/quantum-computing-in-practice/mapping.ipynb +++ b/learning/courses/quantum-computing-in-practice/mapping.ipynb @@ -236,7 +236,7 @@ "metadata": { "description": "Learn about mapping considerations for nature simulation problems.", "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -250,9 +250,16 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3" + "version": "3.11.11" }, - "title": "Coming soon – Mapping" + "title": "Coming soon – Mapping", + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "state": {}, + "version_major": 2, + "version_minor": 0 + } + } }, "nbformat": 4, "nbformat_minor": 5 From 7eaeea0f1c4876a97a277acac1aee51cde94c842 Mon Sep 17 00:00:00 2001 From: Soyoung Shin <63990199+0sophy1@users.noreply.github.com> Date: Tue, 12 Aug 2025 17:35:05 -0700 Subject: [PATCH 2/9] Update simulating-nature.ipynb --- .../simulating-nature.ipynb | 89 +++++++++++++------ 1 file changed, 63 insertions(+), 26 deletions(-) diff --git a/learning/courses/quantum-computing-in-practice/simulating-nature.ipynb b/learning/courses/quantum-computing-in-practice/simulating-nature.ipynb index b13691c6c47..97599b8f6da 100644 --- a/learning/courses/quantum-computing-in-practice/simulating-nature.ipynb +++ b/learning/courses/quantum-computing-in-practice/simulating-nature.ipynb @@ -8,6 +8,7 @@ "# Simulating nature\n", "\n", "Video link\n", + "\n", "Link to tutorial https://quantum.cloud.ibm.com/docs/en/tutorials/probabilistic-error-amplification" ] }, @@ -27,7 +28,7 @@ "\n", "The significance of the talk grew in the 1980s as technology progressed. During this period, Feynman revisited these ideas in another important lecture at Caltech, presenting a paper called “Simulating Nature with Computers.” There, he posed a bold question: could computers be used to perform exact simulations that replicate nature’s behavior at the quantum level? Feynman suggested that, instead of relying on rough approximations to model atomic processes, we could use computers that harness the laws of quantum mechanics themselves—not merely to model nature, but to emulate it.\n", "\n", - "It is this type of physical simulation that we will examine today.\n", + "It is this type of physical simulation that we will examine through this lesson.\n", "\n", "Recall this timeline graphic introduced in a previous episode. At one end of the spectrum, we see problems that are straightforward to solve and do not require the enhanced speed quantum computing might bring.\n", "\n", @@ -45,12 +46,12 @@ "source": [ "## General workflow\n", "\n", - "Before anyone can apply quantum computing to these exciting areas, it’s important to first understand the basic steps in a typical simulation workflow:\n", + "Before anyone can apply quantum computing to these exciting areas, it's important to first understand the basic steps in a typical simulation workflow:\n", "\n", "1. Identify system Hamiltonian\n", "2. Hamiltonian encoding\n", "3. State preparation\n", - "4. State evolution circuit\n", + "4. Time-evolution of the state\n", "5. Circuit optimization\n", "6. Circuit execution\n", "7. Post-processing\n", @@ -59,31 +60,56 @@ "\n", "After setting up the time-evolution circuit, the subsequent stages involve performing the actual experiment. This typically includes optimizing the quantum circuit that implements the time-evolution algorithm, running the circuit on quantum hardware, and post-processing the results. These are the same as the last three steps in the Qiskit patterns framework.\n", "\n", - "Now lets walk through what these steps mean before we move on to coding.\n", + "Now let's walk through what these steps mean before we move on to coding.\n", "\n", "__1. Identify the system Hamiltonian__\n", "\n", - "The first essential step in performing a simulation experiment is to identify the Hamiltonian that describes the system. In many cases, the Hamiltonian is well established. However, sometimes we need to construct it by understanding the energy contributions of smaller parts within the full system. For example, this might involve representing the Hamiltonian as a sum of terms,\n", + "The first essential step in performing a simulation experiment is to identify the Hamiltonian that describes the system. In many cases, the Hamiltonian is well established. However, we often construct it by summing up the energy contributions from smaller parts of the system. This is typically expressed as a sum of terms:\n", "\n", "$$\n", - "H=\\sum_i^N {h_i}\n", + "H=\\sum_i^N {H_i}\n", "$$\n", "\n", - "where each term $h_i$ acts on one of the $N$ local subsystems of the total Hamiltonian $H$. In the case of indistinguishable elementary particles, it is important to determine whether the system involves fermions or bosons, as this affects the system's statistics and how it must be modeled. In practice, people are often interested in physical systems in which the elements are presumed to be well-separated or labeled, and thus distinguishable, as in spins on a lattice.\n", + "where each term $H_i$ acts on one of the $N$ local subsystems (like a single particle or a small group of particles) of the total Hamiltonian $H$. In the case of indistinguishable elementary particles, it is important to determine whether the system involves fermions or bosons, where fermions obey the Pauli Exclusion Principle, meaning no two identical fermions can occupy the same quantum states like electrons. Unlike fermions, multiple bosons can exist in the same quantum state, and these difference affects the system's statistics and how it must be modeled. \n", + "\n", + "In practice, people are often interested in physical systems in which the elements are presumed to be well-separated or labeled, and thus distinguishable, as in spins on a lattice. \n", "\n", "![A lattice with spins and a molecule which is bonded together using electrons which are fermions.](/learning/images/courses/quantum-computing-in-practice/simulating-nature/spins-fermions.svg)\n", "\n", + "This system consists of magnetic dipole spins arranged on a lattice, which are treated as distinguishable particles by counting their address. This system is described by the Transverse-Field Ising Model, and its Hamiltonian is constructed from the sum of two parts:\n", + "\n", + "$$\n", + "H = \\sum_i^N {H_i} = J \\sum_{}Z_iZ_j + h\\sum_{i=0}^N X_i\n", + "$$\n", + "\n", + "Where the first term represents the interaction energy between neighboring spins. Here the $$ indicates that we sum over all pairs of spins that are directly connected on the lattice, $Z_i$ and $Z_j$ are the Pauli-Z matrices, which represent the state of the spins at the site $i$ and $j$, and $J$ is the coupling constant, which defines the strength of this interaction. The second term represents the influence of an external magnetic field applied across the entire system. Here $X_i$ is the Pauli-X matrix acting on the individual spin at site $i$, and $h$ indicates the strength of this external field.\n", + "\n", "__2. Hamiltonian encoding__\n", "\n", - "The next step is to encode the Hamiltonian and translate it into a form that a quantum computer can process. Typically, these Hamiltonians are composed of elementary particles or distinguishable spin systems (sometimes simply called \"spin systems\" for short, though technically fermions and bosons are also systems of objects with spin). When simulating identical fermions or bosons, it is necessary to apply an encoding transformation, such as the Jordan-Wigner or Bravyi-Kitaev transformation. These methods provide a systematic way to convert the Hamiltonian, originally expressed in terms of fermionic or bosonic operators on indistinguishable particles, into Pauli operators acting on distinguishable qubits. Pauli operators are especially convenient because they can be directly translated into quantum gates on a quantum computer. For instance, the Jordan-Wigner transformation maps fermionic operators to Pauli operators in a clear and well-defined manner. On the other hand, if the system already involves distinguishable spin-1/2 particles, then the Hamiltonian is already in a suitable form for quantum computation and no additional encoding is required.\n", + "The next step is to encode the Hamiltonian and **translate** it into a form that a quantum computer can process, which we call encoding. This encoding process depends critically on the type of particles in systems: distinguishable or indistinguishable, and fermion or boson, if the particles are indistinguishable.\n", "\n", "![A flow chart showing different potential types of mappings for different system types including bosons, fermions, and distinguishable particles like spins on a lattice.](/learning/images/courses/quantum-computing-in-practice/simulating-nature/ham-encoding.svg)\n", "\n", + "If you have a system with distinguishable particles, like $1/2$ spins fixed on a lattice, which we took a simple look at above, the Hamiltonian is often already written in a language compatible with qubits. The Pauli-Z operator, for instance, naturally describes a spin's up or down, and no special encoding is needed.\n", + "\n", + "When simulating indistinguishable particles of fermions or bosons, it is necessary to apply an encoding transformation. These particles are used to describe within a special mathematical framework called `second quantization`, which tracks the occupation number of each quantum state by introducing `creation` and `anihilation` operators, where the creation operator $\\hat{a}_i^\\dagger$ adds one particle to state $i$ while the annihilation operator $\\hat{a}_i$ removes one particle from state $i$. Based on this second quantization framework, the fermion can be transformed by Bravyi-Kitaev and Jordan-Wigner. Jordan-Wigner transformation defines the fermionic creation operator \n", + "$\\hat{f}_j^\\dagger = \\Bigl( \\prod\\limits_{k \\lt j}{(-Z_k)} \\Bigr)\\Bigl( \\frac{X_j + i Y_j}{2} \\Bigr)$ which fill the $j$-th quantum state with a fermion and fermionic annihilation operator $\\hat{f}_j= \\Bigl( \\prod\\limits_{k \\lt j}{(-Z_k)} \\Bigr)\\Bigl( \\frac{X_j - i Y_j}{2} \\Bigr)$ which empties a fermion from the $j$=th states. You can find more details of this Jordan-Wigner transformation at our [Quantum Computing in Practice, episode 5 - Mapping](https://quantum.cloud.ibm.com/learning/en/courses/quantum-computing-in-practice/mapping). Similarly, bosons also require their own encoding methods, such as the Holstein-Primakoff transformation, to be represented by qubits.\n", + "\n", + "Ultimately, whether the path is direct or requires a translation, the goal is the same: to express the system's Hamiltonian in the form of Pauli spin operators that a quantum computer can understand and execute.\n", + "\n", "__3. State preparation__\n", "\n", - "After encoding the desired Hamiltonian into the quantum computer’s gate set, the next important step is to select an appropriate initial quantum state to begin the simulation. Ideally, this state should represent a physically meaningful configuration of the system under study. For instance, if the goal is to investigate the ground state energy of a molecule, one might start with a Hartree-Fock approximation or another easily-prepared ansatz that has significant overlap with the true ground state. The choice of initial state influences not only the convergence of variational algorithms such as the Variational Quantum Eigensolver (VQE) but also affects the accuracy and efficiency of time evolution and sampling. Essentially, the initial state serves as the starting point for the computation, laying the groundwork for extracting useful observables from the quantum system being modeled.\n", + "After encoding the desired Hamiltonian into the quantum computer's gate set, the next important step is to select an appropriate initial quantum state to begin the simulation. The choice of initial state influences not only the convergence of variational algorithms such as the Variational Quantum Eigensolver (VQE) but also affects the accuracy and efficiency of time evolution and sampling. Essentially, the initial state serves as the starting point for the computation, laying the groundwork for extracting useful observables from the quantum system being modeled. Ideally, this state should represent a physically meaningful configuration of the system under study. \n", + "\n", + "For many quantum chemistry simulations, the Hartree-Fock state can be a good starting point. In the language of second quantization, Hartree-Fock state ($|\\phi\\rangle_{HF}$) is created by applying creation operators ($\\hat{a}_i^\\dagger$) for each of the lowest-energy orbitals to the vacuum state($|vac\\rangle = |0_1 ... 0_k ... 0_N\\rangle = |0\\rangle ^{\\otimes N}$), a state with no electrons.\n", + "$$\n", + "|\\phi\\rangle_{HF} = \\prod\\limits_{i=1}^k \\hat{a}_i^\\dagger |0\\rangle ^{\\otimes N} = \\hat{a}_1^\\dagger ... \\hat{a}_k^\\dagger |0_1 ... 0_k ... 0_N\\rangle\n", + "$$\n", + "\n", + "Additionally, an easily prepared ansatz with significant overlap to the true ground state can serve as a good initial state for chemistry problems, such as finding the ground state energy.\n", "\n", - "We can write an arbitrary $n$-qubit state as a superposition of computational basis states $∣c_i\\rangle$ with coefficients $a_i$, satisfying normalization conditions. Preparing such a state can generally be approached by applying a specific operator $\\hat{O}$ to the initial state, which is typically the all-zero standard basis state by convention.\n", + "\n", + "More generally, we can write an arbitrary $n$-qubit state as a superposition of computational basis states $∣c_i\\rangle$ with coefficients $a_i$, satisfying normalization conditions. Preparing such a state can generally be approached by applying a specific operator $\\hat{O}$ to the initial state, which is typically the all-zero standard basis state by convention.\n", "\n", "$$\n", "|\\psi\\rangle = \\sum_{i=0}^{2^n-1}{a_i |c_i\\rangle}=\\hat{O}|0\\rangle^{\\otimes n}\\\\\n", @@ -91,7 +117,7 @@ "$$\n", "\n", "\n", - "However, this process often requires an exponential number of CNOT gates, making it generally resource-intensive. We often focus on preparing initial states for which implementation resource demands are more modest. For example, product states, where qubits are not entangled, can be prepared using only single-qubit operations, significantly reducing complexity." + "However, this process often requires an exponential number of CNOT gates, making it generally resource-intensive. We often focus on preparing initial states for which the implementation resource demands are more modest. For this reason, we often focus on preparing initial states that are less complex. A common and practical choice is a product state, where qubits are not entangled, can be prepared using only single-qubit operations, significantly reducing the resource demands of the state preparation and the complexity." ] }, { @@ -101,15 +127,20 @@ "source": [ "__4. Time-evolution of the state__\n", "\n", - "In simple terms, trotterization is a technique for approximating the exponentiation of a matrix (here the Hamiltonian, $H$), especially when the exponent contains non-commuting operators. The exponentiation is very important because the quantum mechanical time-evolution operator is\n", - "\n", + "Now that the initial state is set, we can finally begin the simulation itself - see how the system's state $|\\phi(t=0)\\rangle$ changed into $|\\phi(t)\\rangle$ after some time, $t$. In quantum mechanics, this evolution is described by a single mathematical operation called the time-evolution operator:\n", "$$\n", - "e^{-iHt}\n", + "U(t) = e^{-iHt}\n", "$$\n", + "where we have set $\\hbar=1$ by convention. Applying this operator to our initial state gives us the final state: $|\\phi(t)\\rangle = e^{-iHt}|\\phi(t=0)\\rangle$\n", "\n", - "where we have set $\\hbar=1$ by convention.\n", + "However, building a quantum circuit that directly implements the full operator $e^{-iHt}$ is typically impossible when our Hamiltonian is a sum of different parts, and this is the time we need the Trotterization.\n", "\n", - "Often the Hamiltonian $H$ consists of multiple operators that do not commute. Let us explicitly consider the simple case $H=H_A+H_B$ where $H_A$ and $H_B$, do not commute. A useful approach is to alternately apply their time-evolution exponentials over small durations $t/n$ a total of $n$ times. In the case of two these two non-commuting contributions, we would write\n", + "In simple terms, trotterization is a technique for approximating the exponentiation of a matrix (here the Hamiltonian, $H$), especially when the exponent contains non-commuting operators ($[H_A, H_B] \\neq 0$). Often the Hamiltonian $H$ consists of multiple operators that do not commute. In this case, you cannot separate their exponentials:\n", + "$$\n", + "e^{-i(H_A + H_B)t} \\neq e^{-iH_A t}e^{-iH_B t}\n", + "$$\n", + "\n", + "A useful approach is to alternately apply their time-evolution exponentials over small durations $t/n$ a total of $n$ times. In the case of two these two non-commuting contributions, we would write\n", "\n", "$$\n", "e^{−i H t}\\approx \\left(e^{−i H_A t/n}e^{−i H_B t/n}\\right)^n\n", @@ -117,7 +148,7 @@ "\n", "![A quantum circuit showing trotterized time-evolution operators: operators split into small pieces.](/learning/images/courses/quantum-computing-in-practice/simulating-nature/trotter.svg)\n", "\n", - "This is a first-order treatment, but second-order and other variants also exist. We won't go into the details here. Simply be aware that there are multiple ways to implement this.\n", + "The error introduced by this approximation is called the Trotter error. We can reduce this error by increasing $n$, but this comes at a cost. More advanced, higher-order formulas- the second-order and other variants also exist. For example, the second-order formula offers better accuracy by applying the steps in a symmetric pattern.\n", "\n", "$$\n", "\\begin{aligned}\n", @@ -126,9 +157,8 @@ "\\end{aligned}\n", "$$\n", "\n", - "Here $N$ is the number of non-commuting terms $H_j$ in the Hamiltonian to be broken up in this way, and $n$ is the number of small time steps into which this evolution is broken. Note the reverse order of operators in the second product in the second-order treatment.\n", - "\n", - "See the section on trotterization in the course [Quantum Diagonalization Algorithms](https://quantum.cloud.ibm.com/learning/en/courses/quantum-diagonalization-algorithms/krylov#31-time-evolution) for more details." + "Here $N$ is the number of non-commuting terms $H_j$ in the Hamiltonian to be broken up in this way, and $n$ is the number of small time steps into which this evolution is broken. Note the reverse order of operators in the second product in the second-order treatment. We won't go deeper into the details of trotterization, but please visit the section on trotterization in the course [Quantum Diagonalization Algorithms](https://quantum.cloud.ibm.com/learning/en/courses/quantum-diagonalization-algorithms/krylov#31-time-evolution) for more details.\n", + "\n" ] }, { @@ -151,7 +181,7 @@ "\n", "After completing the optimization step, we are ready to execute the circuit using a primitive. We are considering a simulation experiment in which the goal is to understand how certain properties of the system change over time. For this purpose, the Estimator primitive is the most appropriate choice, as it allows you to measure the expectation values of observables that correspond to these properties.\n", "\n", - "Next, we configure the Estimator with the best available options, including error suppression and mitigation techniques, to improve accuracy. Finally, we run the experiment to collect the results.\n", + "Next, we configure the Estimator with the best available options, including [error suppression and mitigation techniques](https://quantum.cloud.ibm.com/docs/en/guides/error-mitigation-and-suppression-techniques), to improve accuracy. Finally, we run the experiment to collect the results.\n", "\n", "__7. Post-process__\n", "\n", @@ -175,13 +205,13 @@ "\n", "Another remarkable aspect of this work is that it has been widely reproduced: researchers and users now have the ability to replicate and verify the experiment using IBM’s cloud-accessible quantum systems and the Qiskit software framework. In the following, we will guide you through the steps to perform this replication yourself.\n", "\n", - "For this example, we will dive deeper into the specific steps required to translate the problem into inputs that a quantum device can process. Here, we focus on simulating the dynamics of the total magnetization in a system of magnetic dipole spins arranged on a lattice, subjected to an external magnetic field. This system can be described by an Ising model with a transverse magnetic field. We represent it using a parametrized quantum circuit, where the parameters correspond to the tunable values of the spin-spin (ZZ) interactions and the strength of the external, transverse magnetic field ($B_x$, parametrized using X).\n", + "For this example, we will dive deeper into the specific steps required to translate the problem into inputs that a quantum device can process. Here, we focus on simulating the dynamics of the total magnetization in a system of magnetic dipole spins arranged on a lattice, subjected to an external magnetic field. This system can be described by an Ising model with a transverse magnetic field. We represent it using a parametrized quantum circuit, where the parameters correspond to the tunable values of the spin-spin ($ZZ$) interactions and the strength of the external, transverse magnetic field ($B_x$, parametrized using X).\n", "\n", "![Spins on a lattice that point either up or down.](/learning/images/courses/quantum-computing-in-practice/simulating-nature/spins-lattice.svg)\n", "\n", "Since this series is titled Quantum Computing in Practice, we will also cover the experimental techniques used to improve the quality of the results. One important procedure involves identifying and removing \"bad\" qubits—those with low gate fidelities or short decoherence times—that could significantly impact the experiment’s outcome. Such problematic qubits may arise from poor calibration or interactions with two-level systems (TLS). Removing these qubits alters the hardware’s native topology, effectively changing the lattice on which the system is simulated.\n", "\n", - "Additionally, we will discuss how to construct the parametrized quantum circuit that implements the system’s time-evolution using trotterization. A key part of this process is identifying entangling layers within the circuit, which play a crucial role in the main error mitigation technique we will introduce later.\n", + "Additionally, we will discuss how to construct the parametrized quantum circuit that implements the system’s time-evolution using Trotterization. A key part of this process is identifying entangling layers within the circuit, which play a crucial role in the main error mitigation technique we will introduce later.\n", "\n", "### Qiskit patterns step 1: Mapping\n", "\n", @@ -337,7 +367,7 @@ "metadata": { "description": "A review of methods in simulating natural systems as was done in the 2023 utility paper.", "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -351,9 +381,16 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3" + "version": "3.11.11" }, - "title": "Simulating nature" + "title": "Simulating nature", + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "state": {}, + "version_major": 2, + "version_minor": 0 + } + } }, "nbformat": 4, "nbformat_minor": 5 From 64403dfd25ae808b243cb8198ab73dd83a912218 Mon Sep 17 00:00:00 2001 From: Soyoung Shin <63990199+0sophy1@users.noreply.github.com> Date: Tue, 12 Aug 2025 17:36:25 -0700 Subject: [PATCH 3/9] Update mapping.ipynb --- learning/courses/quantum-computing-in-practice/mapping.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/learning/courses/quantum-computing-in-practice/mapping.ipynb b/learning/courses/quantum-computing-in-practice/mapping.ipynb index 23ef7b7cd6e..1a434ccd427 100644 --- a/learning/courses/quantum-computing-in-practice/mapping.ipynb +++ b/learning/courses/quantum-computing-in-practice/mapping.ipynb @@ -236,7 +236,7 @@ "metadata": { "description": "Learn about mapping considerations for nature simulation problems.", "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, From 2c43a6dc40f46ac265cc831f77ced772c0f33675 Mon Sep 17 00:00:00 2001 From: Soyoung Shin <63990199+0sophy1@users.noreply.github.com> Date: Tue, 12 Aug 2025 17:37:24 -0700 Subject: [PATCH 4/9] Update mapping.ipynb --- .../courses/quantum-computing-in-practice/mapping.ipynb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/learning/courses/quantum-computing-in-practice/mapping.ipynb b/learning/courses/quantum-computing-in-practice/mapping.ipynb index 1a434ccd427..fe98c8ac50a 100644 --- a/learning/courses/quantum-computing-in-practice/mapping.ipynb +++ b/learning/courses/quantum-computing-in-practice/mapping.ipynb @@ -250,16 +250,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.11" + "version": "3" }, "title": "Coming soon – Mapping", - "widgets": { - "application/vnd.jupyter.widget-state+json": { - "state": {}, - "version_major": 2, - "version_minor": 0 - } - } }, "nbformat": 4, "nbformat_minor": 5 From d481f1a8fbc976bf788f41552c269d2696b71457 Mon Sep 17 00:00:00 2001 From: Soyoung Shin <63990199+0sophy1@users.noreply.github.com> Date: Tue, 12 Aug 2025 17:37:46 -0700 Subject: [PATCH 5/9] Update mapping.ipynb --- learning/courses/quantum-computing-in-practice/mapping.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/learning/courses/quantum-computing-in-practice/mapping.ipynb b/learning/courses/quantum-computing-in-practice/mapping.ipynb index fe98c8ac50a..47f7fa211ea 100644 --- a/learning/courses/quantum-computing-in-practice/mapping.ipynb +++ b/learning/courses/quantum-computing-in-practice/mapping.ipynb @@ -252,7 +252,7 @@ "pygments_lexer": "ipython3", "version": "3" }, - "title": "Coming soon – Mapping", + "title": "Coming soon – Mapping" }, "nbformat": 4, "nbformat_minor": 5 From c41ab7501c809bf94c02edd9aba5305ef083fe79 Mon Sep 17 00:00:00 2001 From: Soyoung Shin <63990199+0sophy1@users.noreply.github.com> Date: Tue, 12 Aug 2025 17:41:34 -0700 Subject: [PATCH 6/9] Update simulating-nature.ipynb --- .../quantum-computing-in-practice/simulating-nature.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/learning/courses/quantum-computing-in-practice/simulating-nature.ipynb b/learning/courses/quantum-computing-in-practice/simulating-nature.ipynb index 97599b8f6da..a0384c4534a 100644 --- a/learning/courses/quantum-computing-in-practice/simulating-nature.ipynb +++ b/learning/courses/quantum-computing-in-practice/simulating-nature.ipynb @@ -92,7 +92,7 @@ "\n", "If you have a system with distinguishable particles, like $1/2$ spins fixed on a lattice, which we took a simple look at above, the Hamiltonian is often already written in a language compatible with qubits. The Pauli-Z operator, for instance, naturally describes a spin's up or down, and no special encoding is needed.\n", "\n", - "When simulating indistinguishable particles of fermions or bosons, it is necessary to apply an encoding transformation. These particles are used to describe within a special mathematical framework called `second quantization`, which tracks the occupation number of each quantum state by introducing `creation` and `anihilation` operators, where the creation operator $\\hat{a}_i^\\dagger$ adds one particle to state $i$ while the annihilation operator $\\hat{a}_i$ removes one particle from state $i$. Based on this second quantization framework, the fermion can be transformed by Bravyi-Kitaev and Jordan-Wigner. Jordan-Wigner transformation defines the fermionic creation operator \n", + "When simulating indistinguishable particles of fermions or bosons, it is necessary to apply an encoding transformation. These particles are used to describe within a special mathematical framework called `second quantization`, which tracks the occupation number of each quantum state by introducing `creation` and `annihilation` operators, where the creation operator $\\hat{a}_i^\\dagger$ adds one particle to state $i$ while the annihilation operator $\\hat{a}_i$ removes one particle from state $i$. Based on this second quantization framework, the fermion can be transformed by Bravyi-Kitaev and Jordan-Wigner. Jordan-Wigner transformation defines the fermionic creation operator \n", "$\\hat{f}_j^\\dagger = \\Bigl( \\prod\\limits_{k \\lt j}{(-Z_k)} \\Bigr)\\Bigl( \\frac{X_j + i Y_j}{2} \\Bigr)$ which fill the $j$-th quantum state with a fermion and fermionic annihilation operator $\\hat{f}_j= \\Bigl( \\prod\\limits_{k \\lt j}{(-Z_k)} \\Bigr)\\Bigl( \\frac{X_j - i Y_j}{2} \\Bigr)$ which empties a fermion from the $j$=th states. You can find more details of this Jordan-Wigner transformation at our [Quantum Computing in Practice, episode 5 - Mapping](https://quantum.cloud.ibm.com/learning/en/courses/quantum-computing-in-practice/mapping). Similarly, bosons also require their own encoding methods, such as the Holstein-Primakoff transformation, to be represented by qubits.\n", "\n", "Ultimately, whether the path is direct or requires a translation, the goal is the same: to express the system's Hamiltonian in the form of Pauli spin operators that a quantum computer can understand and execute.\n", From a18d2bb0f937ab5e6ccef277995648ca4a603283 Mon Sep 17 00:00:00 2001 From: Soyoung Shin <63990199+0sophy1@users.noreply.github.com> Date: Tue, 12 Aug 2025 17:42:28 -0700 Subject: [PATCH 7/9] Update simulating-nature.ipynb --- .../quantum-computing-in-practice/simulating-nature.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/learning/courses/quantum-computing-in-practice/simulating-nature.ipynb b/learning/courses/quantum-computing-in-practice/simulating-nature.ipynb index 97599b8f6da..a0384c4534a 100644 --- a/learning/courses/quantum-computing-in-practice/simulating-nature.ipynb +++ b/learning/courses/quantum-computing-in-practice/simulating-nature.ipynb @@ -92,7 +92,7 @@ "\n", "If you have a system with distinguishable particles, like $1/2$ spins fixed on a lattice, which we took a simple look at above, the Hamiltonian is often already written in a language compatible with qubits. The Pauli-Z operator, for instance, naturally describes a spin's up or down, and no special encoding is needed.\n", "\n", - "When simulating indistinguishable particles of fermions or bosons, it is necessary to apply an encoding transformation. These particles are used to describe within a special mathematical framework called `second quantization`, which tracks the occupation number of each quantum state by introducing `creation` and `anihilation` operators, where the creation operator $\\hat{a}_i^\\dagger$ adds one particle to state $i$ while the annihilation operator $\\hat{a}_i$ removes one particle from state $i$. Based on this second quantization framework, the fermion can be transformed by Bravyi-Kitaev and Jordan-Wigner. Jordan-Wigner transformation defines the fermionic creation operator \n", + "When simulating indistinguishable particles of fermions or bosons, it is necessary to apply an encoding transformation. These particles are used to describe within a special mathematical framework called `second quantization`, which tracks the occupation number of each quantum state by introducing `creation` and `annihilation` operators, where the creation operator $\\hat{a}_i^\\dagger$ adds one particle to state $i$ while the annihilation operator $\\hat{a}_i$ removes one particle from state $i$. Based on this second quantization framework, the fermion can be transformed by Bravyi-Kitaev and Jordan-Wigner. Jordan-Wigner transformation defines the fermionic creation operator \n", "$\\hat{f}_j^\\dagger = \\Bigl( \\prod\\limits_{k \\lt j}{(-Z_k)} \\Bigr)\\Bigl( \\frac{X_j + i Y_j}{2} \\Bigr)$ which fill the $j$-th quantum state with a fermion and fermionic annihilation operator $\\hat{f}_j= \\Bigl( \\prod\\limits_{k \\lt j}{(-Z_k)} \\Bigr)\\Bigl( \\frac{X_j - i Y_j}{2} \\Bigr)$ which empties a fermion from the $j$=th states. You can find more details of this Jordan-Wigner transformation at our [Quantum Computing in Practice, episode 5 - Mapping](https://quantum.cloud.ibm.com/learning/en/courses/quantum-computing-in-practice/mapping). Similarly, bosons also require their own encoding methods, such as the Holstein-Primakoff transformation, to be represented by qubits.\n", "\n", "Ultimately, whether the path is direct or requires a translation, the goal is the same: to express the system's Hamiltonian in the form of Pauli spin operators that a quantum computer can understand and execute.\n", From df34a105a71aac4bff3869deb4da4285fb686ac6 Mon Sep 17 00:00:00 2001 From: Soyoung Shin <63990199+0sophy1@users.noreply.github.com> Date: Tue, 12 Aug 2025 17:51:47 -0700 Subject: [PATCH 8/9] Update simulating-nature.ipynb --- .../simulating-nature.ipynb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/learning/courses/quantum-computing-in-practice/simulating-nature.ipynb b/learning/courses/quantum-computing-in-practice/simulating-nature.ipynb index a0384c4534a..47965e0f88b 100644 --- a/learning/courses/quantum-computing-in-practice/simulating-nature.ipynb +++ b/learning/courses/quantum-computing-in-practice/simulating-nature.ipynb @@ -70,9 +70,9 @@ "H=\\sum_i^N {H_i}\n", "$$\n", "\n", - "where each term $H_i$ acts on one of the $N$ local subsystems (like a single particle or a small group of particles) of the total Hamiltonian $H$. In the case of indistinguishable elementary particles, it is important to determine whether the system involves fermions or bosons, where fermions obey the Pauli Exclusion Principle, meaning no two identical fermions can occupy the same quantum states like electrons. Unlike fermions, multiple bosons can exist in the same quantum state, and these difference affects the system's statistics and how it must be modeled. \n", + "where each term $H_i$ acts on one of the $N$ local subsystems (like a single particle or a small group of particles) of the total Hamiltonian $H$. In the case of indistinguishable elementary particles, it is important to determine whether the system involves fermions or bosons, where fermions obey the Pauli Exclusion Principle, meaning no two identical fermions can occupy the same quantum states like electrons. Unlike fermions, multiple bosons can exist in the same quantum state, and these difference affects the system's statistics and how it must be modeled.\n", "\n", - "In practice, people are often interested in physical systems in which the elements are presumed to be well-separated or labeled, and thus distinguishable, as in spins on a lattice. \n", + "In practice, people are often interested in physical systems in which the elements are presumed to be well-separated or labeled, and thus distinguishable, as in spins on a lattice.\n", "\n", "![A lattice with spins and a molecule which is bonded together using electrons which are fermions.](/learning/images/courses/quantum-computing-in-practice/simulating-nature/spins-fermions.svg)\n", "\n", @@ -92,14 +92,14 @@ "\n", "If you have a system with distinguishable particles, like $1/2$ spins fixed on a lattice, which we took a simple look at above, the Hamiltonian is often already written in a language compatible with qubits. The Pauli-Z operator, for instance, naturally describes a spin's up or down, and no special encoding is needed.\n", "\n", - "When simulating indistinguishable particles of fermions or bosons, it is necessary to apply an encoding transformation. These particles are used to describe within a special mathematical framework called `second quantization`, which tracks the occupation number of each quantum state by introducing `creation` and `annihilation` operators, where the creation operator $\\hat{a}_i^\\dagger$ adds one particle to state $i$ while the annihilation operator $\\hat{a}_i$ removes one particle from state $i$. Based on this second quantization framework, the fermion can be transformed by Bravyi-Kitaev and Jordan-Wigner. Jordan-Wigner transformation defines the fermionic creation operator \n", + "When simulating indistinguishable particles of fermions or bosons, it is necessary to apply an encoding transformation. These particles are used to describe within a special mathematical framework called `second quantization`, which tracks the occupation number of each quantum state by introducing `creation` and `annihilation` operators, where the creation operator $\\hat{a}_i^\\dagger$ adds one particle to state $i$ while the annihilation operator $\\hat{a}_i$ removes one particle from state $i$. Based on this second quantization framework, the fermion can be transformed by Bravyi-Kitaev and Jordan-Wigner. Jordan-Wigner transformation defines the fermionic creation operator\n", "$\\hat{f}_j^\\dagger = \\Bigl( \\prod\\limits_{k \\lt j}{(-Z_k)} \\Bigr)\\Bigl( \\frac{X_j + i Y_j}{2} \\Bigr)$ which fill the $j$-th quantum state with a fermion and fermionic annihilation operator $\\hat{f}_j= \\Bigl( \\prod\\limits_{k \\lt j}{(-Z_k)} \\Bigr)\\Bigl( \\frac{X_j - i Y_j}{2} \\Bigr)$ which empties a fermion from the $j$=th states. You can find more details of this Jordan-Wigner transformation at our [Quantum Computing in Practice, episode 5 - Mapping](https://quantum.cloud.ibm.com/learning/en/courses/quantum-computing-in-practice/mapping). Similarly, bosons also require their own encoding methods, such as the Holstein-Primakoff transformation, to be represented by qubits.\n", "\n", "Ultimately, whether the path is direct or requires a translation, the goal is the same: to express the system's Hamiltonian in the form of Pauli spin operators that a quantum computer can understand and execute.\n", "\n", "__3. State preparation__\n", "\n", - "After encoding the desired Hamiltonian into the quantum computer's gate set, the next important step is to select an appropriate initial quantum state to begin the simulation. The choice of initial state influences not only the convergence of variational algorithms such as the Variational Quantum Eigensolver (VQE) but also affects the accuracy and efficiency of time evolution and sampling. Essentially, the initial state serves as the starting point for the computation, laying the groundwork for extracting useful observables from the quantum system being modeled. Ideally, this state should represent a physically meaningful configuration of the system under study. \n", + "After encoding the desired Hamiltonian into the quantum computer's gate set, the next important step is to select an appropriate initial quantum state to begin the simulation. The choice of initial state influences not only the convergence of variational algorithms such as the Variational Quantum Eigensolver (VQE) but also affects the accuracy and efficiency of time evolution and sampling. Essentially, the initial state serves as the starting point for the computation, laying the groundwork for extracting useful observables from the quantum system being modeled. Ideally, this state should represent a physically meaningful configuration of the system under study.\n", "\n", "For many quantum chemistry simulations, the Hartree-Fock state can be a good starting point. In the language of second quantization, Hartree-Fock state ($|\\phi\\rangle_{HF}$) is created by applying creation operators ($\\hat{a}_i^\\dagger$) for each of the lowest-energy orbitals to the vacuum state($|vac\\rangle = |0_1 ... 0_k ... 0_N\\rangle = |0\\rangle ^{\\otimes N}$), a state with no electrons.\n", "$$\n", @@ -157,8 +157,7 @@ "\\end{aligned}\n", "$$\n", "\n", - "Here $N$ is the number of non-commuting terms $H_j$ in the Hamiltonian to be broken up in this way, and $n$ is the number of small time steps into which this evolution is broken. Note the reverse order of operators in the second product in the second-order treatment. We won't go deeper into the details of trotterization, but please visit the section on trotterization in the course [Quantum Diagonalization Algorithms](https://quantum.cloud.ibm.com/learning/en/courses/quantum-diagonalization-algorithms/krylov#31-time-evolution) for more details.\n", - "\n" + "Here $N$ is the number of non-commuting terms $H_j$ in the Hamiltonian to be broken up in this way, and $n$ is the number of small time steps into which this evolution is broken. Note the reverse order of operators in the second product in the second-order treatment. We won't go deeper into the details of trotterization, but please visit the section on trotterization in the course [Quantum Diagonalization Algorithms](https://quantum.cloud.ibm.com/learning/en/courses/quantum-diagonalization-algorithms/krylov#31-time-evolution) for more details." ] }, { @@ -367,7 +366,7 @@ "metadata": { "description": "A review of methods in simulating natural systems as was done in the 2023 utility paper.", "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -381,7 +380,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.11" + "version": "3" }, "title": "Simulating nature", "widgets": { From fa471a223572f899ec1bb5980013daa08e7057f3 Mon Sep 17 00:00:00 2001 From: Soyoung Shin <63990199+0sophy1@users.noreply.github.com> Date: Tue, 12 Aug 2025 18:26:29 -0700 Subject: [PATCH 9/9] Update simulating-nature.ipynb --- .../quantum-computing-in-practice/simulating-nature.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/learning/courses/quantum-computing-in-practice/simulating-nature.ipynb b/learning/courses/quantum-computing-in-practice/simulating-nature.ipynb index a505c9bb322..47965e0f88b 100644 --- a/learning/courses/quantum-computing-in-practice/simulating-nature.ipynb +++ b/learning/courses/quantum-computing-in-practice/simulating-nature.ipynb @@ -92,7 +92,7 @@ "\n", "If you have a system with distinguishable particles, like $1/2$ spins fixed on a lattice, which we took a simple look at above, the Hamiltonian is often already written in a language compatible with qubits. The Pauli-Z operator, for instance, naturally describes a spin's up or down, and no special encoding is needed.\n", "\n", - "When simulating indistinguishable particles of fermions or bosons, it is necessary to apply an encoding transformation. These particles are used to describe within a special mathematical framework called `second quantization`, which tracks the occupation number of each quantum state by introducing `creation` and `annihilation` operators, where the creation operator $\\hat{a}_i^\\dagger$ adds one particle to state $i$ while the annihilation operator $\\hat{a}_i$ removes one particle from state $i$. Based on this second quantization framework, the fermion can be transformed by Bravyi-Kitaev and Jordan-Wigner. Jordan-Wigner transformation defines the fermionic creation operator \n", + "When simulating indistinguishable particles of fermions or bosons, it is necessary to apply an encoding transformation. These particles are used to describe within a special mathematical framework called `second quantization`, which tracks the occupation number of each quantum state by introducing `creation` and `annihilation` operators, where the creation operator $\\hat{a}_i^\\dagger$ adds one particle to state $i$ while the annihilation operator $\\hat{a}_i$ removes one particle from state $i$. Based on this second quantization framework, the fermion can be transformed by Bravyi-Kitaev and Jordan-Wigner. Jordan-Wigner transformation defines the fermionic creation operator\n", "$\\hat{f}_j^\\dagger = \\Bigl( \\prod\\limits_{k \\lt j}{(-Z_k)} \\Bigr)\\Bigl( \\frac{X_j + i Y_j}{2} \\Bigr)$ which fill the $j$-th quantum state with a fermion and fermionic annihilation operator $\\hat{f}_j= \\Bigl( \\prod\\limits_{k \\lt j}{(-Z_k)} \\Bigr)\\Bigl( \\frac{X_j - i Y_j}{2} \\Bigr)$ which empties a fermion from the $j$=th states. You can find more details of this Jordan-Wigner transformation at our [Quantum Computing in Practice, episode 5 - Mapping](https://quantum.cloud.ibm.com/learning/en/courses/quantum-computing-in-practice/mapping). Similarly, bosons also require their own encoding methods, such as the Holstein-Primakoff transformation, to be represented by qubits.\n", "\n", "Ultimately, whether the path is direct or requires a translation, the goal is the same: to express the system's Hamiltonian in the form of Pauli spin operators that a quantum computer can understand and execute.\n",