Skip to main content

View on GitHub

Open this notebook in GitHub to run it yourself
Intermolecular dispersion forces can be determined by calculating the interaction between two molecules; however, the total force does not simply triple when a third molecule is introduced. This phenomenon is referred to as Many-Body Dispersion (MBD). While it is desirable to evaluate dispersion forces using first-principles calculation methods, attempting to do so with multiple specific molecules results in an exorbitant increase in computational complexity. The Quantum Drude Oscillator (QDO) model [1] is a coarse-grained model that describes “molecules interacting via dispersion forces” as “electrostatic interactions between QDOs.” In this model, a QDO is defined as a harmonic oscillator consisting of a pair of fictitious positively and negatively charged particles connected by a spring. QDOs behave as bosons, and in this tutorial, we see how we can treat such bosonic system using classiq [2].

One-Dimensional QDO Hamiltonian

In this tutorial, we consider a non-dimensional Hamiltonian for NN one-dimensional QDOs which are interacting via quadratic coupling. H^=∑i=1N(x^i2+p^i2)+∑j>iγi,jx^ix^j,\def\H{\hat{H}} \def\x{\hat{x}} \def\p{\hat{p}} \def\bin{\operatorname{bin}} \def\a{\hat{a}} \def\aD{\hat{a}^\dagger} \H = \sum_{i=1}^N (\x_i^2 + \p_i^2) + \sum_{j>i} \gamma_{i,j} \x_i\x_j, where \xi\x_i and \pi\p_i are the bosonic position and momentum operators for oscillator ii and γi,j∈R\gamma_{i,j}\in \mathbb{R} is the coupling between oscillators ii and jj. For simplicity, we assume that all one-dimensional QDOs are identical and aligned parallel to each other and along the inter-oscillator axis, equally separated by distance RR. In this case, the coupling constant is given by γi,j=−4α(R∣i−j∣)−3\gamma_{i,j}=-4\alpha (R|i-j|)^{-3}, where α\alpha is the dipole polarisability. We need to represent this Hamiltonian in terms of Pauli matrices to be able to implement on quantum circuit. Unlike fermions, bosonic Fock states cannot be represented by only zeros and ones. Therefore, when bosons occupy a certain quantum state, we need to encode this by representing the number nn as a binary string in the qubit state. In this tutorial, we denote a Fock state expressed in decimal as ∣n‾⟩|\underline{n}\rangle (with an underline), and a Fock state in binary representation as ∣\bin(n)⟩|\bin(n)\rangle (without an underline). Here, \bin(n)\bin(n) represents the binary representation of nn, and \bin(n)i\bin(n)_i denotes the ii-th bit from the right of the bitstring. When adopting this binary encoding, there is an upper limit to the number of bosons that can occupy the same quantum state. If we allocate mm qubits to the Fock state of each boson, the possible values range from 0 to 2m−12^m - 1. We define the number of levels we can handle as d=2md = 2^m. dd must be large enough to make the result as reliable as possible. Although not used in this tutorial, Classiq’s QNum could potentially handle such bosonic Fock states more intuitively. The bosonic position and momentum operators can be written using ladder operators as: \x=12(\aD+\a),\p=−i2(\aD−\a),\begin{aligned} \x &= \frac{1}{\sqrt{2}}(\aD + \a), \\ \p &= -\frac{i}{\sqrt{2}}(\aD - \a), \end{aligned} where the ladder operators are expressed using projection operators as follows: a^†=∑n=0d−1n+1∣n+1‾⟩⟨n‾∣,a^=∑n=0d−1n+1∣n‾⟩⟨n+1‾∣,\begin{aligned} \hat{a}^\dagger &= \sum_{n=0}^{d-1} \sqrt{n+1} |\underline{n+1}\rangle\langle\underline{n}|, \\ \hat{a} &= \sum_{n=0}^{d-1} \sqrt{n+1} |\underline{n}\rangle\langle\underline{n+1}|, \end{aligned} What does this projection operator look like in binary representation? Let’s take ∣4‾⟩⟨3‾∣|\underline{4}\rangle\langle\underline{3}| with a bit length of m=4m=4 as an example. In this case, the projection operator is: ∣4‾⟩⟨3‾∣=∣0100⟩⟨0011∣=∣0⟩⟨0∣⊗∣1⟩⟨0∣⊗∣0⟩⟨1∣⊗2\begin{aligned} |\underline{4}\rangle\langle\underline{3}| &= |0100\rangle\langle 0011| \\ &= |0\rangle\langle 0| \otimes |1\rangle\langle 0| \otimes |0\rangle\langle 1|^{\otimes 2} \end{aligned} As we can see, the operator ∣n+1‾⟩⟨n‾∣|\underline{n+1}\rangle\langle\underline{n}| can be divided into three parts:
  1. For the bits where ones continue from the 202^0 position, apply ∣0⟩⟨1∣|0\rangle\langle 1|.
  2. For the rightmost zero, apply ∣1⟩⟨0∣|1\rangle\langle 0|.
  3. For all other bits, there is no change, so apply ∣0⟩⟨0∣|0\rangle\langle 0| or ∣1⟩⟨1∣|1\rangle\langle 1|.
Therefore, ∣n+1‾⟩⟨n‾∣|\underline{n+1}\rangle\langle\underline{n}| can be expressed using Pauli matrices as: ∣n+1‾⟩⟨n‾∣=(⨂i=k+1m−1∣bin(n)i⟩⟨bin(n)i∣)⊗∣1⟩⟨0∣⊗(∣0⟩⟨1∣)⊗k=(⨂i=k+1m−1I+(−1)bin(n)iZ2)⊗X−iY2⊗(X+iY2)⊗k,\begin{aligned} |\underline{n+1}\rangle\langle\underline{n}| &= \left(\bigotimes_{i=k+1}^{m-1} |\text{bin}(n)_i\rangle\langle\text{bin}(n)_i| \right) \otimes |1\rangle\langle0| \otimes \left(|0\rangle\langle1|\right)^{\otimes k} \\ &= \left(\bigotimes_{i=k+1}^{m-1} \frac{I + (-1)^{\text{bin}(n)_i}Z}{2}\right) \otimes \frac{X-iY}{2} \otimes \left(\frac{X+iY}{2}\right)^{\otimes k}, \end{aligned} where kk is the position of the rightmost 0 in \bin(n)\bin(n). By noting the relationship ∣n+1‾⟩⟨n‾∣=(∣n‾⟩⟨n+1‾∣)†|\underline{n+1}\rangle\langle\underline{n}| = (|\underline{n}\rangle\langle\underline{n+1}|)^\dagger, we can write the QDO Hamiltonian in terms of Pauli matrices. The following code generates the coupling terms for this Hamiltonian.
Output:
Now, let’s verify that the coupling terms between oscillator 1 and oscillator 2 are expressed as follows when the number of qubits mm assigned to each QDO’s Fock state is m=1m=1 and m=2m=2. x^1x^2∣m=1=12X1X2,\def\termplus{\frac{\sqrt{3}+1}{4\sqrt{2}}} \def\termminus{\frac{\sqrt{3}-1}{4\sqrt{2}}} \def\x{\hat{x}} \begin{split} \x_1\x_2\rvert_{m=1} = \frac{1}{2}X_1X_2, \end{split} x^1x^2∣m=2=3+24X1X3+\termplusX1X2X3+\termplusX1X3X4+14X1X2X3X4+\termplusY1Y2X3+14Y1Y2X3X4+\termplusX1Y3Y4+14X1X2Y3Y4−\termminusY1Y2X3Z4−\termminusX1Z2Y3Y4−14X1Z2X3−\termminusX1Z2X3X4−14X1X3Z4−\termminusX1X2X3Z4+2−34X1Z2X3Z4+14Y1Y2Y3Y4.\def\x{\hat{x}} \begin{split} \x_1\x_2 \lvert_{m=2} = & \frac{\sqrt{3}+2}{4}X_1X_3 + \termplus X_1X_2X_3 + \termplus X_1X_3X_4 +\frac{1}{4}X_1X_2X_3X_4 + \termplus Y_1Y_2X_3 +\frac{1}{4}Y_1Y_2X_3X_4 \\ & + \termplus X_1Y_3Y_4 +\frac{1}{4}X_1X_2Y_3Y_4 - \termminus Y_1Y_2X_3Z_4 -\termminus X_1Z_2Y_3Y_4 - \frac{1}{4}X_1Z_2X_3 \\ &- \termminus X_1Z_2X_3X_4 - \frac{1}{4} X_1X_3Z_4 - \termminus X_1X_2X_3Z_4 + \frac{2-\sqrt{3}}{4}X_1Z_2X_3Z_4 +\frac{1}{4}Y_1Y_2Y_3Y_4. \end{split}
Output:
Output:
The non-interacting terms of the QDO Hamiltonian can be reduced to a simplified form as follows: x^2+p^2=(a^†+a^)22−(a^†−a^)22=a^†a^+a^a^†=2a^†a^+1=2(∑n=0d−1(n+1)∣n+1‾⟩⟨n+1‾∣)+1=2(∑j=0m−12j∣1⟩⟨1∣j)+1=∑j=0m−12j(Ij−Zj)+1=2mI⊗m−∑j=0m−12jZj\begin{aligned} \hat{x}^2 + \hat{p}^2 &= \frac{(\hat{a}^\dagger + \hat{a})^2}{2} - \frac{(\hat{a}^\dagger - \hat{a})^2}{2} \\ &= \hat{a}^\dagger \hat{a} + \hat{a} \hat{a}^\dagger \\ &= 2 \hat{a}^\dagger \hat{a} + 1 \\ &= 2 \left(\sum_{n=0}^{d-1} (n+1) |\underline{n+1}\rangle\langle\underline{n+1}| \right) + 1 \\ &= 2 \left(\sum_{j=0}^{m-1} 2^j |1\rangle\langle 1|_j \right) + 1\\ &= \sum_{j=0}^{m-1} 2^j (I_j - Z_j) + 1\\ &= 2^m I^{\otimes m} - \sum_{j=0}^{m-1} 2^j Z_j \end{aligned} Note that the number operator a^†a^\hat{a}^\dagger \hat{a}, defined by its action a^†a^∣n⟩=n∣n⟩\hat{a}^\dagger \hat{a}|n\rangle = n|n\rangle, is diagonal in the Fock basis.
With the code above, we are now ready to generate the QDO Hamiltonian.

Calculate the Ground State Energy of One-Dimensional QDO Hamiltonian

Here, we compute the ground state energy using the Variational Quantum Eigensolver (VQE).
Output:
Output:
Output:
Output:
output Let’s attempt to reproduce Fig. 1 from [2]. We will model I2\mathrm{I_2} molecules as one-dimensional QDOs and calculate how the London dispersion energy ΔE\Delta E changes according to the distance between the two parallel oscillators. We define the parameters such that the axial polarizability is α=14.5 A˚3\alpha = 14.5 \ \mathrm{\AA^3} and the frequency is ℏω/2=9.61 eV\hbar \omega / 2 = 9.61 \ \mathrm{eV}.
Output:
Output:
Output:
Output:
Output:
Output:
Output:
Output:
Output:
Output:
Output:
The theoretical value of the London dispersion force in this case can be calculated as follows. The Hamiltonian is: =˝p^122μ+p^222μ+12μω2(x^12+x^22+γx^1x^2),\def\Cvv{C_{\parallel,\parallel}} \def\Cvh{C_{\parallel, \perp}} \def\Chh{C_{\perp, \perp}} \H = \frac{\hat{p}_1^2}{2\mu} + \frac{\hat{p}_2^2}{2\mu} + \frac{1}{2}\mu\omega^2(\hat{x}_1^2+\hat{x}_2^2 + \gamma \hat{x}_1 \hat{x}_2), where μ\mu is the effective mass and γ=−4αR−3\gamma = -4\alpha R^{-3}. By defining the transformed variables p^±=12(p^1±p^2),x^±=12(x^1±x^2),\hat{p}_\pm = \frac{1}{\sqrt{2}}(\hat{p}_1 \pm \hat{p}_2), \qquad \hat{x}_\pm = \frac{1}{\sqrt{2}}(\hat{x}_1 \pm \hat{x}_2), the Hamiltonian can be rewritten in this new uncoupled basis as =˝(p^+22μ+12μω2(1+γ2)x^+2)+(p^−22μ+12μω2(1−γ2)x^−2).\H = \left(\frac{\hat{p}_+^2}{2\mu} + \frac{1}{2}\mu\omega^2\left(1+\frac{\gamma}{2}\right)\hat{x}_+^2\right) +\left(\frac{\hat{p}_-^2}{2\mu} + \frac{1}{2}\mu\omega^2\left(1-\frac{\gamma}{2}\right)\hat{x}_-^2\right). Therefore, the ground state energy is given by E=12ℏω(1+γ2+1−γ2).E = \frac{1}{2}\hbar \omega \left(\sqrt{1+\frac{\gamma}{2}} + \sqrt{1-\frac{\gamma}{2}}\right). In the absence of the London dispersion force - specifically, when the distance between the oscillators is R=∞R = \infty - we have γ=0\gamma = 0, which yields E=ℏωE = \hbar \omega. From this, the London dispersion energy can be calculated as: ΔE=12ℏω(1+γ2+1−γ2−2).\Delta E = \frac{1}{2}\hbar \omega \left(\sqrt{1+\frac{\gamma}{2}} + \sqrt{1-\frac{\gamma}{2}} - 2\right). Below, we will confirm that VQE can obtain energy values close to this exact solution regardless of the distance between oscillators.
Now, let’s compare the London dispersion energy with the results obtained from the VQE.
output From this graph, we can see that the VQE results yield energy values close to the analytical solution we calculated earlier. Next, let’s investigate how ΔE\Delta E changes with respect to the number of qubits mm (and the corresponding dimension dd) assigned to each QDO.
output Looking at this graph, we can see that the accuracy of the calculated energy increases as more qubits are used for each QDO. The impact of mm (or dd) on accuracy becomes more apparent as we vary the coupling constant γ\gamma.
output This graph makes it clearer that higher values of dd lead to greater accuracy. We can see that d=4d = 4 is a good approximation to the exact solution until very large couplings γ\gamma. For reference, −γ=2-\gamma = 2 corresponds to a Hamiltonian that is no longer positive-semidefinite, at this point the charged Drude particles dissociate from the nuclei and the system breaks down. For physically relevant systems, we expect to require value of −γ-\gamma much lower than 2, and we can therefore limit ourselves to small dd [2].

Calculating Many-Body Dispersion Effect

Now that we know the exact London dispersion energy of two identical parallel QDOs along the inter-oscillator axis is ΔE=12ℏω(1+γ2+1−γ2−2),\Delta E = \frac{1}{2}\hbar \omega \left(\sqrt{1+\frac{\gamma}{2}} + \sqrt{1-\frac{\gamma}{2}} - 2\right), where γ=−4αR−3\gamma = -4\alpha R^{-3}, we might expect that adding a third QDO would result in a simple summation of these pairwise interactions. Under this assumption, the total dispersion energy for a linear chain of three QDOs (with a distance RR between neighbors) would be given by: ΔE=ℏω(1+γ12+1−γ12−2)+12ℏω(1+γ22+1−γ22−2),\Delta E = \hbar \omega \left(\sqrt{1+\frac{\gamma_1}{2}} + \sqrt{1-\frac{\gamma_1}{2}} - 2\right) + \frac{1}{2}\hbar \omega \left(\sqrt{1+\frac{\gamma_2}{2}} + \sqrt{1-\frac{\gamma_2}{2}} - 2\right), where γ1=−4αR−3, γ2=−4α(2R)−3\gamma_1 = -4\alpha R^{-3},\ \gamma_2 = -4\alpha (2R)^{-3}. Let’s compare this to the results obtained by diagonalizing the Hamiltonian for d=4d=4.
Let’s also try computing the energy by VQE using the following ansatz.
Output:
Output:
Output:
Output:
Output:
Output:
Output:
Output:
Output:
Output:
Output:
Output:
Output:
output From this plot, we can see that diagonalizing the Hamiltonian for d=4d=4 yields a larger energy shift at short distances between QDOs than when considering only two-body pairwise interactions. This suggests that many-body effects are playing a role.

References

[1]: A. P. Jones, J. Crain, V. P. Sokhan, T. W. Whitfield, and G. J. Martyna, Quantum Drude Oscillator Model of Atoms and Molecules: Many-Body Polarization and Dispersion Interactions for Atomistic Simulation, Phys. Rev. B 87, 144103 (2013). [2]: L. W. Anderson, M. Kiffner, P. K. Barkoutsos, I. Tavernelli, J. Crain, and D. Jaksch, Coarse-Grained Intermolecular Interactions on Quantum Processors, Phys. Rev. A 105, 062409 (2022).