Paper The following article is Open access

About the computation of finite temperature ensemble averages of hybrid quantum-classical systems with molecular dynamics

, , , and

Published 7 June 2021 © 2021 The Author(s). Published by IOP Publishing Ltd on behalf of the Institute of Physics and Deutsche Physikalische Gesellschaft
, , Citation J L Alonso et al 2021 New J. Phys. 23 063011 DOI 10.1088/1367-2630/abf9b3

Download Article PDF
DownloadArticle ePub

You need an eReader or compatible software to experience the benefits of the ePub3 file format.

1367-2630/23/6/063011

Abstract

Molecular or condensed matter systems are often well approximated by hybrid quantum-classical models: the electrons retain their quantum character, whereas the ions are considered to be classical particles. We discuss various alternative approaches for the computation of equilibrium (canonical) ensemble averages for observables of these hybrid quantum-classical systems through the use of molecular dynamics (MD)-i.e. by performing dynamics in the presence of a thermostat and computing time-averages over the trajectories. Often, in classical or ab initio MD, the temperature of the electrons is ignored and they are assumed to remain at the instantaneous ground state given by each ionic configuration during the evolution. Here, however, we discuss the general case that considers both classical and quantum subsystems at finite temperature canonical equilibrium. Inspired by a recent formal derivation for the canonical ensemble for quantum classical hybrids, we discuss previous approaches found in the literature, and provide some new formulas.

Export citation and abstract BibTeX RIS

Original content from this work may be used under the terms of the Creative Commons Attribution 4.0 licence. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.

1. Introduction

Molecular dynamics (MD) [40] is conventionally considered to be the theoretical description of molecular or condensed matter systems that assumes the nuclei to be classical particles. Therefore, these move according to Newton's equations, in the presence of their mutual interaction and of a force that somehow approximates the electron influence. In its traditional formulation (classical MD), the forces are parameterised in some analytical expressions that have been carefully developed over the years, and the numerical problem amounts to the propagation of a purely classical Hamiltonian system with a predefined potential function. The so-called ab initio or first-principles MD [31] substitutes those analytical force definitions by the on the fly calculation of the quantum electronic structure problem, that provides the forces on the ions due to the electrons in a more precise—yet more costly—manner. Still, a first principles MD simulation also consists in the integration of a purely classical problem, even though one needs to use quantum mechanics to obtain the forces at each time step. In both classical and first principles MD, the electrons are usually assumed to remain in their ground state, adiabatically adapting to the ions as they move. Therefore, both the classical MD and the (Born–Oppenheimer ground-state) first-principles MD are not, strictly speaking, hybrid quantum-classical dynamics. These methods have been widely employed for both equilibrium and out-of-equilibrium problems.

In the equilibrium case, when studying a system in, e.g., the canonical ensemble, one is normally not interested in the particular trajectory followed by a microstate, but on the ensemble average values of a given property. The MD simulations are then used to compute the multi-dimensional integrals that define those averages, by substituting them with time-averages over dynamical trajectories of the system—typically, coupled to a thermostat [45]. But in any case, despite the finite temperature, normally the electrons are assumed to be frozen in the ground state. This may be a very good approximation if the electronic excited state energies are far higher than the thermal energies at that temperature. Yet in many circumstances those excited states cannot be ignored.

Out of equilibrium, this may in fact happen very frequently. For example, when dealing with photo-chemistry, that naturally involves electronic excitations. This situation calls for a non-adiabatic extension of the previous MD concept, that allows for 'live' electrons: the dynamics must be that of a true hybrid quantum-classical model, in which both classical and quantum particles evolve simultaneously through a set of coupled equations. Two prototypical examples of truly hybrid dynamics are Ehrenfest equations [11] and surface hopping [46] (in this latter case, the electronic motion is stochastic and consists of 'jumps' between the adiabatic eigenstates).

In equilibrium, one may also need to lift the approximation of ground state electrons, if the temperature is high enough that the thermal population of the excited states is not negligible. This is the situation discussed in this article. In molecular physics this may happen rarely, but in condensed matter, the metallic or near metallic systems naturally call for a computation of ensemble averages that acknowledges the non-zero population of electronic excited states at non-zero temperature, even if low. In any case, this situation begs the questions: what are the canonical ensemble averages for observables of hybrid systems, and can one compute them using MD? The standard procedure used within classical or adiabatic first principles MD is no longer directly applicable if one is simultaneously propagating nuclei and electrons. The idea of assuming ergodicity and attaching a thermostat to the dynamics, a concept designed for purely classical systems, is dubious at best.

This issue has been addressed by performing MD propagating only the classical nuclei, but somehow incorporating the electronic temperature in the definition of the forces, instead of deriving them by merely assuming the electrons to be in the ground state. One possible route, based on the use of density-functional theory, was theorised by Alavi et al [3]. Their method was based on the use of density-functional theory (DFT) [13] to solve for the electronic structure problem. In particular, on the finite temperature extension of DFT (FTDFT) [33, 39], that substitutes the ground-state energy functional by a free energy functional. Then, to perform first principles MD at finite temperature, the forces used to propagate the classical ions are given by the gradient of this free energy functional. In essence, this is the same idea that underlies the approach given in references [9, 10], except that in this latter case the formulation is general, and not tied to DFT. The fact that the electronic free energy—considered at fixed nuclear configurations—can be viewed as an effective classical Hamiltonian from which the hybrid quantum-classical partition function can be computed was already found by Zwanzig [47]. DFT is in fact the most common electronic structure method for the purpose of performing ab initio MD. The inclusion of electronic temperature effects is therefore usually managed with some form of FTDFT. In practice, this procedure consists of using a Fermi–Dirac distribution for the population of the Kohn–Sham orbitals that constitute the fictitious auxiliary non-interacting system employed to substitute the true interacting many-electron problem. The resulting density is used to compute the ionic forces, in lieu of the ground-state density. The procedure should be completed with the use of temperature-dependent exchange-and-correlation functionals, but this is often ignored, as the development of these functionals has proved to be very difficult.

In this work, we discuss this and other possible routes to obtain the rigorous canonical ensemble averages through the use of thermostatted MD. The goal is to establish a clear theoretical link between the definition of hybrid ensemble averages and the manners that one can use to compute them using some form of MD with a thermostat. The basic idea consists of generating an ensemble with some form of MD, even if the generated ensemble is wrong, and then using a reweighting formula to compute the right averages. From the analysis, it emerges that, in fact, various possibilities exist. The dynamics for the classical particles moving on the free energy surface will be shown to be a very particular case of this general class. The relative efficiency of the various options may depend on the particular system and choice of electronic structure method. The idea of performing wrong or fictitious dynamics, and then correcting with some reweighting procedure, has been used in the past in the field of MD mostly with the objective of accelerating rare events—see for example references [17, 23]. In this work we extend the same idea to the simulation of hybrid quantum-classical systems.

In section 2 we present the expressions for the ensemble averages that constitute the target of the current work. Section 3 discusses the possibility of computing these using a hybrid quantum-classical non-adiabatic MD such as Ehrenfest dynamics. Although the naïve computation of time-averages over thermostatted Ehrenfest dynamics trajectories lead to wrong results (as already noted in earlier works [32, 34, 35]), we discuss ways to correct this issue. Section 4 discusses approaches based on classical-only MD propagations.

2. The canonical ensemble of hybrid quantum-classical systems

We start by recalling which are the ensemble averages that we are addressing in this work.

The first step should be to clarify the mathematical description of a hybrid model, an issue that is not at all obvious, as demonstrated by the various proposals that have been put forward, and by the discussions about their internal consistency [1, 2, 4, 12, 15, 1820, 22, 25, 27, 28, 3638, 4244]. We will however assume the following very broad assumptions. The classical part is described by a set of position $Q\in {\mathbb{R}}^{n}$ and momentum $P\in {\mathbb{R}}^{n}$ variables, that we will hereafter collectively group as ξ = (Q, P). Normally, they correspond to N particles, such that n = 3N in three dimensions. The quantum part is described by a complex Hilbert space $\mathcal{H}$. The observables of the full hybrid system are Hermitian operators on $\mathcal{H}$ that may depend parametrically on the classical variables, $\hat{A}\left(\xi \right):\mathcal{H}\to \mathcal{H}$. Some observables may refer only to the classical subsystem; in that case they are just ξ-functions times the identity, i.e. $\hat{A}\left(\xi \right)=A\left(\xi \right)\hat{I}$. If, on the contrary, they refer to the quantum subsystem only, they are operators that lack the ξ-dependence. In any other case, a hybrid observable couples the quantum and classical parts to each other. The most important one is the Hamiltonian $\hat{H}\left(\xi \right)$. Although its precise form is not important for the following discussion, as an example we write here the typical definition of this Hamiltonian for a set of Ne quantum electrons and N nuclei:

Equation (1)

The first term is the kinetic energy of the classical particles, whereas the second part is

Equation (2)

where the first term is the kinetic electronic operator, the second term is the electron–nucleus interaction potential, and the last (purely classical) term is the nucleus–nucleus interaction potential.

Ensembles of hybrid quantum-classical systems can be described [4, 5, 25] by ξ-dependent density matrices, $\hat{\rho }\left(\xi \right)$, normalized as:

Equation (3)

These fully characterize the ensemble, i.e. they permit to obtain the probabilities associated to any measurement. For example, the probability associated to finding the classical subsystem at ξ, and measuring a for observable $\hat{A}\left(\xi \right)$, is given by $\mathrm{Tr}\left[\hat{\rho }\left(\xi \right){\hat{\pi }}_{a}\left(\xi \right)\right]$, where ${\hat{\pi }}_{a}\left(\xi \right)$ is the projector associated to the eigenvalue a of $\hat{A}\left(\xi \right)$. Or, the probability density associated to the classical subsystem, regardless of the quantum part, is given by ${F}_{\text{C}}\left(\xi \right)=\mathrm{Tr}\enspace \hat{\rho }\left(\xi \right)$. Likewise, given any observable $\hat{A}$, the ensemble average is given by:

Equation (4)

One route to the definition of equilibrium ensembles is the principle of maximization of entropy. Recently, we argued [5] that the proper definition of entropy for a hybrid quantum-classical system must be:

Equation (5)

Likewise, we also showed that the maximization of this entropy, subject to the constraint of a given value for the average energy, leads to the hybrid canonical ensemble:

Equation (6)

Equation (7)

Therefore, the canonical ensemble average of any observable is:

Equation (8)

The computation of these averages is challenging. First, depending on the model and quantum level of theory used, the calculation of the traces, that in principle require all excited states, can be problematic. But, more importantly, the integral over the classical phase space is difficult because of its very large dimensionality (6N for N classical particles in 3D).

This latter problem is of course akin to the one encountered when studying purely classical systems. It is therefore natural to ask whether it is possible to circumvent it by doing some form of MD.

3. The failure of Ehrenfest dynamics, and some ways to correct it

One possibility that immediately comes to mind is the use of a hybrid quantum-classical MD, such as Ehrenfest's, and attaching a thermostat in order to simulate the presence of a bath that would permit to generate the canonical ensemble along the trajectory. In other words, replicating the procedure invented for 'standard' MD, but using a hybrid dynamics that requires the explicit propagation of the electrons.

It was soon realized, however, that this procedure leads to wrong ensemble averages [32, 34, 35]. In the following, we will reexamine this fact in the light of the Hamiltonian character of Ehrenfest dynamics. This analysis will help to understand the correction procedures that in fact permit to use this dynamics to obtain the true ensemble averages.

3.1. Fast recap of Hamiltonian dynamics

Let us first recap the basics of Hamiltonian theory. A system can be characterized by providing a phase space $\mathcal{M}$ of even dimension 2n. The Poisson bracket is an operation defined over functions in this phase space (the observables), which in the canonical coordinates $\left(q,p\right)\in \mathcal{M}$ reads:

Equation (9)

The dynamics is determined by the definition of a Hamiltonian function H: the equations of motion for the coordinates qi or pi of any state in $\mathcal{M}$ are ${\dot {q}}_{i}=\left\{{q}_{i},H\right\}$ and ${\dot {p}}_{i}=\left\{{p}_{i},H\right\}$, or equivalently, as they are more often encountered, in the form of Hamilton's equations:

Equation (10)

Equation (11)

If there is no certainty about the system state, instead of a single point, one must use a probability distribution ρ(q, p, t) defined over the phase space, also known as an ensemble. This distribution may change in time, according to Liouville's equation:

Equation (12)

The entropy of any ensemble can be computed as (hereafter, we will group all variables q, p as y):

Equation (13)

The maximization of this entropy over all possible ensembles subject to the constraint of a given Hamiltonian ensemble average or energy, ⟨Hρ = ∫dμ(y)H(y)ρ(y), leads to the canonical ensemble [41]:

Equation (14)

Equation (15)

Here, $\beta =\frac{1}{{k}_{\text{B}}T}$ is inversely proportional to the temperature T, 'CC' stands for 'classical canonical', ZCC(β) is the partition function, and the integrals extend over all phase space. This is an equilibrium ensemble, lacking the time-dependence because it is stationary: {H, ρCC} = 0.

The averages, for any observable A, over this canonical ensemble are then given by:

Equation (16)

The obvious numerical difficulty of computing these very high-dimensional integrals can then be circumvented by integrating a single dynamical trajectory, and using the ergodic hypothesis to identify a time average with the phase space integral:

Equation (17)

where yβ (t) is a trajectory obtained by solving the equations of the motion, modified with a thermostat, i.e.:

Equation (18)

Here, we have symbolically added to the Poisson bracket {⋅, ⋅} a thermostat Xβ (t) (it may represent Langevin's stochastic term [29, 45], a Nose–Hoover chain [30], etc.)

3.2. Schrödinger dynamics as a Hamiltonian system

The theory summarized in subsection 3.1 can be applied to any Hamiltonian dynamics—for example, to Schrödinger's equation, which despite its quantum character, is a 'classical' Hamiltonian system from a mathematical perspective. We summarize this fact here—for the mathematical conditions and functional spaces (both finite and infinite dimensional) on which this formalism can be applied, see [16, 26]; in [24], one can follow the standard approach that is summarized here.

Indeed, Schrödinger's equation ( = 1 is assumed throughout this paper),

Equation (19)

is easy to rewrite as a set of Hamiltonian equations. First, one expands the wavefunction in an orthonormal basis ${\left\{{\varphi }_{i}\right\}}_{i}$, and rewrites Schrödinger's equation for the coefficients ci = ⟨φi |ψ⟩:

Equation (20)

where Hij are the elements of the Hamiltonian matrix ${H}_{ij}=\langle {\varphi }_{i}\vert \hat{H}\vert {\varphi }_{j}\rangle $. We define a set of 'position' and 'momenta' variables by taking the real and imaginary parts of this coefficients, respectively: $c=\frac{1}{\sqrt{2}}\left(q+\text{i}p\right)$. One may then show [24, 26] that equation (19) is equivalent to

Equation (21)

Equation (22)

i.e. Hamiltonian's equations, defining H(q, p) as the expectation value of $\hat{H}$ for the wavefunction determined by the (q, p) coefficients: $H\left(q,p\right)=\langle \psi \left(q,p\right)\vert \hat{H}\vert \psi \left(q,p\right)\rangle $. Note that these 'position' and 'momentum' variables should not be given any particular physical meaning, forcing any analogy with classical mechanics.

The Poisson bracket can then be defined in the usual way (equation (9)). We will use the notation {⋅,⋅}Q for this Poisson bracket defined in this new 'quantum' phase space, ${\mathcal{M}}_{Q}$, defined by the variables (q, p). The system dynamics then reduces to:

Equation (23)

for any function f defined in ${\mathcal{M}}_{Q}$. For the particular case of the coordinate functions q and p, one obtains the Hamilton equations above. Taking into account the dependence of ψ(q, p), they are entirely equivalent to Schrödinger's equation (see [24, 26] for details).

Gibbs canonical ensemble associated with the expectation value of the energy H(q, p), equation (14), is stationary under the dynamics, and in principle one could attach one of the typical classical-type thermostats to Schrödinger equation, and produce this ensemble through a trajectory. If one did that, however, the resulting ensemble averages would be wrong, because Gibbs ensemble is not the true quantum canonical ensemble, which is defined through a density matrix as:

Equation (24)

Equation (25)

This is the density matrix that maximizes the von Neumann entropy,

Equation (26)

which is the real entropy of a quantum system, and not equation (13), from which the classical canonical ensemble is derived. It is obvious that the fact that the 'thermostatted' Schrödinger dynamics does not produce the correct thermal averages is not a defect of Schrödinger equation, but results of the erroneous application of a technique invented for classical systems to quantum ones.

3.3. Ehrenfest dynamics as a Hamiltonian system

Ehrenfest dynamics, usually introduced as a partial classical limit of the full-quantum dynamics [11], constitutes also a Hamiltonian system, as shown for example in [6, 7, 11]. We summarize here this fact.

We consider a hybrid quantum-classical system, as defined in section 2. The classical variables ξ = (Q, P) define a classical phase space ${\mathcal{M}}_{\text{C}}$, whereas the quantum variables η = (q, p), associated to a wavefunction ψ(η) as explained above, define a quantum phase space ${\mathcal{M}}_{Q}$. We may put these together and define a full, hybrid phase space:

Equation (27)

Furthermore, we may define a Poisson bracket for functions defined on this full hybrid space by adding the two classical and quantum brackets, defined over the ξ and η variables, respectively:

Equation (28)

Thus, the classical bracket derivates only with respect to the classical coordinates (Q, P), and the quantum bracket with respect to the quantum ones (q, p). It is a well known result of Poisson geometry that the addition of two brackets in a Cartesian product results in a bracket that fulfills all the necessary properties.

Finally, given any hybrid observable $\hat{A}\left(\xi \right)$, we may define a real function over $\mathcal{M}$ as:

Equation (29)

If, in particular, we consider the Hamiltonian operator $\hat{H}\left(\xi \right)$, which is dependent on the classical degrees of freedom ξ, the hybrid dynamics is generated by the function $H\left(\eta ,\xi \right)=\langle \psi \left(\eta \right)\vert \hat{H}\left(\xi \right)\vert \psi \left(\eta \right)\rangle $ and the Poisson bracket:

Equation (30)

Equation (31)

where in the last equality of both lines the classical and quantum nature of ξ and η respectively has been invoked to make use of ${\left\{\xi ,f\right\}}_{Q}={\left\{\eta ,f\right\}}_{\text{C}}=0\forall \enspace f\in {C}^{\infty }\left(\mathcal{M}\right)$.

One may further expand those equations: for the hybrid Poisson bracket acting on the classical variables ξi , one has:

Equation (32)

If one then considers the cases ξi = Qk or ξi = Pk separately, one arrives to Newton's-like equations for Qi , Pi :

Equation (33)

Equation (34)

On the other hand, the dynamical equation of the quantum variables,

Equation (35)

is exactly the same as equation (23), but with a dependence of the Hamiltonian operator on the classical variables. Therefore, this equation, as it was shown in the previous section for the quantum-only case, is equivalent to Schrödinger's equation for ψ(η)—although one must maintain that parametric dependence of the Hamiltonian operator on the classical variables ξ = Q, P:

Equation (36)

Equations (33), (34) and (36) are Ehrenfest's equations for a hybrid model. From our previous analysis of the classical and the quantum case, it becomes clear that they compose a Hamiltonian system with the Poisson bracket defined as in equation (28). Perhaps the form given in equations (33), (34) and (36) is still not the most recognizable; if one uses the Hamiltonian defined in equations (1) and (2) for a set of electrons and nuclei, one gets:

Equation (37)

Equation (38)

Equation (39)

Allured by the Hamiltonian character of this set of equations, one may be tempted to consider the Gibbs equilibrium ensemble, equation (14), to be the hybrid canonical one. In terms of the quantum-classical variables, it reads:

Equation (40)

Equation (41)

It is also a stationary ensemble in the hybrid case. The averages over this ensemble would be the ones obtained if one attaches a thermostat tuned to temperature $T=\frac{1}{{k}_{\text{B}}\beta }$ to Ehrenfest dynamics, propagates a trajectory (ηβ (t), ξβ (t)), and computes the time averages:

Equation (42)

For example, one practical way to proceed is to use Langevin's dynamics (although there are various other thermostat definitions that have been invented over the years), that essentially consists in substituting the equation for the force (38) by:

Equation (43)

where ${ \overrightarrow {\eta }}_{I}\left(t\right)$ are stochastic Gaussian processes that must verify:

Equation (44)

Equation (45)

The α, β indices run over the three spatial dimensions; see for example reference [45] for details. In any case, the values thus obtained are not the ensemble average values that one would wish to obtain, given above in equation (8), hence the previously documented numerical failure of this approach—see for example references [32, 34, 35]. It should be noted, however, that this fact by itself should not be considered a failure of Ehrenfest dynamics—inasmuch as the same fact noted above for the quantum case cannot be considered a failure of Schrödinger equation. It results, once again, of the erroneous application of a technique invented for purely classical systems to hybrid ones, that contain some quantum variables.

A correct statistical-mechanical definition of a system requires the definition of a sample space, i.e., a basis of mutually exclusive events, which can be unequivocally characterized by the results of an experiment (see [5, 8, 14, 21]). The underlying reason behind the difference between classical and hybrid (or quantum) ensembles is that, in classical systems, all points in the phase space are mutually exclusive, whereas they are not in the quantum and hybrid case. Indeed, in classical mechanics, two different points of the phase space represent statistical events which are mutually exclusive: if the system is at state ξ, one cannot measure it to be at state ξ'. One may then define an entropy function using the classical phase space as sample space (i.e. a space that contains mutually exclusive events), and its maximization, subject to a fixed ensemble energy, leads to the classical Gibbs canonical ensemble.

In contrast, in quantum mechanics, two different states of the Hilbert space are not always mutually exclusive: if the system is at state ϕ, the probability of measuring it to be at ϕ' is not zero, unless the two states are orthogonal, ⟨ϕ|ϕ'⟩ = 0. Therefore, using the standard theory of probability, we should consider only orthogonal states to represent events (see sections 4.5 and 4.6 of [21]). This consideration led von Neumann and others to the introduction of the concept of density matrix in order to define a statistical ensemble—and to the definition of an entropy based on these objects, whose maximization results in the quantum canonical ensemble.

This precaution about the exclusivity of events must also be taken in the hybrid case—a fact that is discussed at more length in reference [5]. The points of the hybrid phase space are not mutually exclusive unless their quantum parts are orthogonal, or their classical parts are different. It should be noticed, however, that the MD procedure (and in particular the thermostats) produces a visitation of the phase space that disregards this fact. Thus, a MD trajectory visits (assuming ergodicity) all points in a hybrid phase space, assigning to each one a Boltzmann weight, and therefore producing a purely classical canonical ensemble that does not take into account the non-exclusivity of hybrid events.

3.4. Corrected averages for Ehrenfest dynamics

Nevertheless, equation (42) can be useful, as we will show now. The thermostatted Ehrenfest dynamics does sample the phase space, and it generates an ensemble, even if wrong. One may then apply a reweighting procedure—essentially, modifying the averaging in the time integral—and obtain the correct hybrid ensemble averages. This can be done in fact in several ways.

The first thing to notice is that equation (42) holds for any function g(η, ξ) on $\mathcal{M}$, not only on the ones that result of a hybrid observable as $A\left(\eta ,\xi \right)=\langle \eta \vert \hat{A}\left(\xi \right)\vert \eta \rangle $. Then one may ask the question: for any hybrid observable $\hat{A}$, can one find a function ${g}_{\hat{A}}\left(\eta ,\xi \right)$, such that:

Equation (46)

If so, one could then perform the dynamics and use equation (42) with ${g}_{\hat{A}}$ in order to obtain $\langle {g}_{\hat{A}}{\rangle }_{\text{CC}}\left(\beta \right)$, and therefore the true hybrid ensemble average $\langle \hat{A}{\rangle }_{\text{HC}}\left(\beta \right)$.

The answer is positive, and there is not only one, but many possible functions that can be used. In the following, we consider two examples:

  • (a)  
    Equation (46) holds if ${g}_{\hat{A}}$ is defined as:
    Equation (47)
    Equation (48)
    The computation of the normalization factor μ(β) may seem problematic, but it can be obtained from the dynamical trajectory, in the following way: for each ${g}_{\hat{A}}$, we define an 'unnormalized' function
    Equation (49)
    such that $\langle {g}_{\hat{A}}{\rangle }_{\text{CC}}\left(\beta \right)=\mu \left(\beta \right)\langle {\tilde {g}}_{\hat{A}}{\rangle }_{\text{CC}}\left(\beta \right)$.On the other hand, we know that for the identity operator, $\langle \hat{I}{\rangle }_{\text{HC}}\left(\beta \right)=1$, and therefore:
    Equation (50)
    Thus, we may compute μ(β) as $1/{\langle {\tilde {g}}_{\hat{I}}\rangle }_{\text{CC}}\left(\beta \right)$, and ${\langle {\tilde {g}}_{\hat{I}}\rangle }_{\text{CC}}\left(\beta \right)$ can be obtained from a dynamics propagation, i.e.:
    Equation (51)
    Summarizing, a final formula that permits to compute the hybrid ensemble averages is:
    Equation (52)
    Therefore, the procedure consists of performing a thermostatted Ehrenfest dynamics, and computing the previous time integrals over the obtained trajectory (ηβ (t), ξβ (t)). One obvious difficulty lies in the computation of the traces over the quantum Hilbert space, whose difficulty depends on the level of theory used to deal with the quantum electronic problem.
  • (b)  
    Equation (46) also holds if ${g}_{\hat{A}}$ is defined as:
    Equation (53)
    Equation (54)
    where ηα (ξ) are the adiabatic states:
    Equation (55)
    and
    Equation (56)
    The difficulty due to the computation of the λ(β) factor can be solved in a similar way to the method used in the previous case, leading to the following final formula:
    Equation (57)
    This formula avoids the need to compute all the electronic excited states, necessary for the traces present in equation (52). In exchange, it contains a probably worse numerical difficulty: the presence of the delta functions. The interpretation of these is the following: during the trajectories, one should not count in the average the state that is being visited, unless the trajectory passes by an eigenstate of the Hamiltonian (a state of the adiabatic basis). In other words, apart from the normalization factor given by the denominator, this formula is a modification of the straightforward average given in equation (42), that discards all states except for the adiabatic eigenstates.That correction is easy to understand intuitively. Let us first rewrite the hybrid canonical ensemble density matrix,
    Equation (58)
    in terms of its spectral decomposition for each ξ:
    Equation (59)
    where Eα (ξ) are the eigenvalues, and ${\hat{\eta }}_{\alpha }\left(\xi \right)$ the projectors on the eigenspaces of the Hamiltonian $\hat{H}\left(\xi \right)$ (we assume, for simplicity, that there is no degeneration; otherwise one would just need to use an orthogonal basis for each degenerate subspace). Now, this expression can be written in terms of a (generalized) probability distribution function in $\mathcal{M}$, as:
    Equation (60)
    This distribution determines ${\hat{\rho }}_{\text{HC}}\left(\xi \right)$, since:
    Equation (61)
    By comparing equation (60) with equation (40), it becomes clear that the error that this latter equation does is counting all possible states, whereas the true hybrid ensemble only counts the states in the adiabatic basis. Of course, one could choose a different basis, but the point is that the 'classical' Gibbs distribution (40) overcounts the quantum states. For a deeper discussion on this issue, we refer the reader to reference [5].In order to implement this procedure numerically, one should of course use some finite representation of the delta functions, giving them a non-zero width. It is unclear, however, that this would lead to an efficient scheme, since the propagation would probably have to be very long in order to obtain an accurate sampling of the quantum states.

4. Approaches that do not require the propagation of the electrons

The use of Ehrenfest dynamics to compute the ensemble averages, as described in the previous section, has a notable caveat: it requires the explicit propagation of the electrons. The time scale associated to the electronic movement is very small (of the order of attoseconds), which makes hybrid MD schemes computationally intensive due to the need of a very fine time step.

In this section, we show how this problem can be circumvented by making use of dynamics that do not explicitly propagate the electrons, such as ground-state Born–Oppenheimer MD—including the necessary correction to account for the hot electrons, or the dynamics based on the electronic free energy surface that has already been used in the past. In this way, we frame these approaches into the theoretical setup described above.

Let us suppose that we perform a MD for the classical particles, based on a Hamiltonian function $\mathcal{H}\left(\xi \right)$ (to be specified below). In this case, the dynamics is not hybrid: the propagation equations involve only the classical particles, moving under the influence of $\mathcal{H}\left(\xi \right)$. The ergodic assumption, if it holds, permits to compute:

Equation (62)

for any function g(ξ). Notice that the classical canonical ensemble that we are using now refers to the classical degrees of freedom ξ only, as opposed to the one used in the previous section, that included the quantum ones.

In the same manner as we did in the previous section, one may wonder the following: for a given hybrid observable $\hat{A}\left(\xi \right)$, does there exist some function ${g}_{\hat{A}}\left(\xi \right)$ such that

Equation (63)

Once again, the answer is affirmative, and in more ways than one. One obvious possibility, analogous to the first one used for Ehrenfest dynamics, is:

Equation (64)

Equation (65)

As it happened in the previous section, the calculation of the normalization factor μ(β) does not require of the explicit computation of the partition functions (that may be impractical), but may result from the MD propagation itself, using the identity ${\langle \hat{I}\rangle }_{\text{HC}}\left(\beta \right)=1$. Using this fact and the same procedure shown in the previous section, one arrives to the final formula:

Equation (66)

This formula is very similar to equation (52). However, the trajectory ξβ (t) to be used here must be obtained through a thermostatted classical-only MD determined by a Hamiltonian function $\mathcal{H}\left(\xi \right)$, in contrast to the hybrid quantum-classical Ehrenfest dynamics used in the previous section. The Hamiltonian function $\mathcal{H}\left(\xi \right)$ is in fact arbitrary, although a bad choice for this object could lead to a very bad convergence with respect to the total propagation time tf —since using the ergodic hypothesis requires an accurate sampling of phase space. Two options that immediately come to mind are:

  • (a)  
    Using the electronic free energy:
    Equation (67)
    This actually permits to simplify equation (66) into a very appealing form:
    Equation (68)
    where at each classical phase space point in the trajectory one must compute the quantum ensemble average:
    Equation (69)
    Equation (68) reminds of the usual MD ergodic averaging formula, just substituting the observable value by the thermal quantum average. In fact, if the observable that one is interested in is purely classical, $\hat{A}\left(\xi \right)=A\left(\xi \right)\hat{I}$, the formula is identical:
    Equation (70)
    Therefore, for purely classical observables, if one uses the electronic free energy instead of the ground-state adiabatic energy as the Hamiltonian driving the ionic movement, the resulting MD provides the hybrid canonical averages using the 'standard' ergodic average. If the observable is itself hybrid, one must compute at each point during the trajectory the quantum thermal average.This propagation of the classical variables following the electronic free energy surface underlies the scheme put forward by Alavi et al [3], although in that work the procedure is tightly tied to the use of FTDFT as the scheme that handles the electronic structure problem (computation of the free energy, and of its gradients). The same concept was also suggested by some of the current authors in references [9, 10].
  • (b)  
    Using the ground-state Born–Oppenheimer energy:
    Equation (71)
    In this case we would just need to do the usual ground-state Born–Oppenheimer MD, which has the advantage of being a very well known and tested technique, for which plenty of codes and tools exist. In order to obtain the hybrid ensemble averages that do not ignore the electronic temperature, however, one must use the averaging formula (66), which for this case can be transformed into:
    Equation (72)
    where α runs over all the adiabatic eigenstates, and
    Equation (73)
    are the electronic excitations.On top of the usual ground-state Born–Oppenheimer MD, the added difficulty here would be the computation of these excitations, which may be more or less demanding depending on the level of theory used to model the many-electron problem.Note that if the observable $\hat{A}\left(\xi \right)$ is actually a classical observable $A\left(\xi \right)\hat{I}$, this scheme can also be rewritten as:
    Equation (74)
    Here, we also write the formula in terms of the free energy. Computationally, the difference with respect to the previous approach given in formula (70) is that one does not need the gradients of the free energy, necessary in the previous approach for the computation of the forces in the dynamics.

All previous formulas have assumed that the thermostat is fixed to the target temperature. However, the dynamics can be performed at a different temperature (a technique that has been used in MD to probe larger regions of configuration space in less simulation time), as long as the reweighting corrects for this. Take, for example, formula (66), that we repeat here for convenience, although we now use two different temperatures β and β':

Equation (75)

In this formula the temperature dependence is twofold:

  • (a)  
    The temperature used to define the thermostat, which appears in the β' labeling the trajectories ${\xi }^{{\beta }^{\prime }}\left(t\right)$. This should be equal to the temperature used for defining the re-weighting factors, i.e. the inverse Boltzmann weight ${\text{e}}^{{\beta }^{\prime }\mathcal{H}\left({\xi }^{{\beta }^{\prime }}\left(t\right)\right)}$.
  • (b)  
    The 'target' temperature, that is the one that should be used in the exponent of the un-normalized hybrid canonical ensemble density matrix, appearing inside the trace, ${\text{e}}^{-\beta \hat{H}}$.

These two temperatures can be different, and formula (75) still holds. In practical applications, this would permit to obtain hybrid canonical ensemble averages at different temperatures β by computing a single thermostatted trajectory at a fixed 'ergodic temperature' β'. The main motivation to use this procedure is saving computation time, as only one trajectory needs to be computed, and the results at different temperatures are obtained by post-processing this one trajectory. Furthermore, once one has the thermostatted dynamics, the computation of the ensemble averages at different temperatures using formula (75) can be easily parallelized, either using a core for each different temperature, or even dividing the post-processing of the original trajectory in different sections.

This can also be done when using Ehrenfest dynamics, and formulas (52) and (57) above. It does not hold, however, if one uses formulas (68) or (70) for the dynamics on the free energy surface, since they rely on a cancellation that is only achieved if the two temperatures are equal (two temperatures can also be used when doing the dynamics on the free energy, but one would then need to compute the free energy at those two temperatures). Note also that, in practice, this procedure cannot be indefinitely extended to any temperature range, since the ergodic visitation will not be effective unless the two temperatures are similar.

A higher temperature trajectory will provide a wider visitation of the whole phase space in less time, which in principle would imply faster approximation to the ergodic limit. This could be used to obtain low temperature ensemble averages in less simulation time. Indeed, using artificially high temperatures has been used to be able to observe rare events in MD simulations in the past. Notice, however, that a high temperature trajectory will necessarily be less dense in the relevant phase space areas. This might have the opposite effect, and lead to a bad convergence, specially if the two temperatures are too different. In general, for a particular problem, it cannot be determined beforehand which of the two effects would prevail

Summarizing, the previous formulas permit to use well known MD techniques and obtain canonical averages that correctly account for the electronic temperature. Looking, for example, at equation (74), the procedure entails two steps:

  • (a)  
    One first performs a standard first principles MD simulation using, for example, the common technique based on ground-state DFT.
  • (b)  
    Then, either on the fly as the trajectory is being generated, or later in a post-processing procedure, one computes the electronic free-energy at the trajectory points, using the finite-temperature DFT extension. With such information, one can use equation (74) to correct the time averages that, without this averaging method, would fail to converge to the real canonical ensemble.

This scheme can be applied on top of trajectories obtained previously, had they been saved. Note that, for the reasons explained above, one may recycle trajectories obtained with ground-state BOMD at some (nuclear only) temperature, to compute ensemble averages at various different global temperatures. This may be an advantage over the procedure implied by equation (70) (MD with forces computed on the electronic free-energy surface), as in that case one trajectory must be generated at each temperature. Finally, of course DFT need not be the method to be used for the computation of the forces—and the finite temperature DFT need not be the procedure to obtain the free energy, as one may use for example TDDFT to compute the electronic excitations and apply formula (72).

4.1. Numerical example

We finish with a numerical demonstration of the validity of the formulas given above, using a simple model and the very last of the presented schemes: 'standard' ground-state Born–Oppenheimer MD with a correction formula. Thus, we consider a simple dimer model, using the internuclear distance Q as the only classical position variable (being P the corresponding momentum), and the subspace generated by the two lowest electronic adiabatic states as the quantum space. Furthermore, we consider that these two adiabatic states correspond to Morse potentials. Hence, the Hamiltonian operator ruling the hybrid dynamics can be written, in the basis of its eigenstates, as:

Equation (76)

where m is the dimer reduced mass, and the Morse potentials are given by:

Equation (77)

The parameters defining the Morse potential for the ith energy level Vi (Q) have an easy interpretation: Δi is a global shift that sets the value of the curve at its minimum; qi the position at that minimum (Vi (Q = qi ) = Δi ); Di defines how quickly the potential ascends for Q > qi , and also determines the value of the gap between the minimum (Δi ) and the big Q limit of the potential: limQ Vi (Q) = Δi + Di . Lastly, bi defines how narrow the well is, how sharply it grows when Q → 0, and also how rapidly it reaches the plateau for Q > qi . The vibrational frequency associated to each potential well is given by ${\omega }_{i}=\sqrt{\frac{2{b}^{2}D}{m}}$. Figure 1 depicts these potential energy curves 6 .

Figure 1.

Figure 1. Electronic potential energy curves of the modeled dimer (in units of the ground state vibrational frequency ω0): ground state (blue) and first excited state (dashed red), as a function of the dimer length (in units of the ground state equilibrium distance).

Standard image High-resolution image

Using ground-state Born–Oppenheimer MD means that the classical degrees of freedom follow the Hamiltonian system defined by the function:

Equation (78)

The system is coupled to a Langevin thermostat, at the temperature given by $T=\frac{1}{{k}_{\text{B}}\beta }$. This dynamics provides an ergodic curve over the classical phase space with a visitation weight given by the Boltzmann factor ${\text{e}}^{-\beta {E}_{0}\left(Q,P\right)}$. Using the corrected averaging procedure defined by equation (72), we can obtain the hybrid canonical ensemble averages. Although this formula is valid for any observable, we chose to compute the average value of the length of the dimer, a purely classical observable: $\hat{A}\left(Q,P\right)=Q\hat{I}$.

Figure 2 shows the results. As the model is particularly simple, we can display both the exact values (i.e. the hybrid canonical ensemble averages computed by performing the direct integration in phase space, using equation (8)), and the values produced by using the time-averages over the dynamics. In this latter case, we display both the corrected averages, that result from formula (72), and the ergodic averages using ground-state MD, which corresponds to the purely-classical canonical ensemble average. It is clear how the proposed reweighting formula yields the correct numbers.

Figure 2.

Figure 2. Ensemble average dimer length, ⟨QHC(β), in units of the ground state equilibrium length q0, as a function of temperature, calculated via: (1) direct integration in the phase space, labeled PSI; (2) ground-state MD without the correction, i.e. ignoring the electronic temperature, labeled gsMD; (3) ground-state MD with the application of the correcting average formula (72), labeled MD; (4) ground-state MD at a single temperature (T' ∼ 1.35ω0/kB) for the thermostat with the application of the correcting average formula (75) for the whole range of temperatures of the target HCE.

Standard image High-resolution image

We stress that, in the procedure presented above, the computation of the ergodic trajectory is an indirect way to perform phase space integrals over the classical phase space. In principle, any infinite (tf ) ergodic trajectory could be used as a basis to apply the corrected averaging procedure, as long as the implicit distribution over the phase space that results of the dynamics is compensated in the time averages: the use of the ground-state potential energy surface to generate the dynamics is one of the possible many choices. This only holds if the trajectory provides a dense enough visitation of the phase space.

However, in practice, the simulations provide only finite-time trajectories and, therefore, the visitation of phase space is not dense. The effectiveness of a given dynamics will depend on what regions of phase space it probes more frequently. Some thermostatted MD trajectories will be more cost-effective than others, if they visit more frequently the regions of the phase space that are relevant to the target distribution.

In our example, the target distribution is the hybrid canonical ensemble, and one should choose a dynamics that is likely to force the system to spend time on its high probability regions. This is not the only factor to consider, however. For example, it is likely that Ehrenfest dynamics fulfills this condition, but the cost of propagating Ehrenfest equations is high, due to the need to propagate the electrons. Likewise, it may happen that using the free energy as the driving Hamiltonian is costly due to the requirement of computing its gradients with respect to the classical degrees of freedom in order to obtain the forces. A dynamics that requires longer times tf to achieve the convergence of the time average can be however computationally cheaper if the cost of performing the propagation itself is lower. We consider that ground-state MD can be a good compromise, specially at low temperatures, but the analysis strongly depends on the particular model, the electronic structure method, etc.

Finally, the blue crosses in figure 2 (marked as MD T') are the results obtained by performing a single trajectory at a fixed temperature T', and then correcting appropriately for each different temperature. We have chosen T' ∼ 1.35ω0/kB, corresponding to the sixth data point in the figure, as it is in the middle of the temperature range that we want to probe. The accuracy seems to be slightly better than the results obtained by performing different trajectories at different temperatures. This should not be taken as a general rule: we have performed convergence analysis with both methods and we cannot conclude that the use of the different-temperature method always leads to more precise averages for equal total propagation time. Note, however, than the single-trajectory method may be more advantageous as the computation time saved by not computing the multiple trajectories at different temperatures can be used to converge better the single trajectory with respect to its total propagation time.

5. Conclusions

We have examined the problem of computing the canonical ensemble averages through MD calculations, for hybrid quantum classical systems (typically, quantum electrons and classical nuclei in molecular or condensed matter physics and chemistry). If the temperature is high enough so that the electronic excited states cannot be ignored, performing ground state Born Oppenheimer MD and computing the ergodic averages on the generated trajectories does not yield the correct ensemble averages.

The fact that one cannot assume that the electrons are inert, adiabatically adapting to the ground state, naturally seems to demand for a truly hybrid dynamics, such as Ehrenfest's. However, the addition of a thermostat to these equations, followed by the computation of the resulting observable time-averages, does not produce the right averages either. The quantum character of part of the electrons cannot be handled by the standard MD + thermostat procedure, designed to produce essentially classical equilibrium ensembles.

Nevertheless, performing a thermostatted dynamics, be it Ehrenfest, or a purely classical one such as ground state MD, does generate a trajectory (i.e. an ensemble) in phase space that can be reweighted in order to obtain the true hybrid averages. This amounts to correcting the time averaging formulas. It has been the purpose of this work to examine here the various options that exist, setting them in a common language. The procedure can be followed using Ehrenfest dynamics, which is a hybrid dynamics, but can also be followed using classical-only dynamics driven by, for example, the ground-state Born–Oppenheimer Hamiltonian. Likewise, this framework does include, as a particular case, the possibility of performing the nuclear dynamics on the Hamiltonian that results of considering the electronic free energy. In this case, if one is interested in computing averages of purely classical observables, the time averages do not require correction, as the factors cancel out. The suitability of any of these procedures over the others depends on the particular model and level of theory used to handle the electronic structure problem.

Acknowledgments

The authors acknowledge financial support by MINECO Grant FIS2017-82426 P. CB acknowledges financial support by Gobierno de Aragón through the Grant defined in ORDEN IIU/1408/2018.

Data availability statement

All data that support the findings of this study are included within the article (and any supplementary files).

Footnotes

  • We supply, as supporting information (https://stacks.iop.org/NJP/23/063011/mmedia), a computational notebook containing all the code that generates the results displayed in the article. It also contains all the chosen parameter values.

Please wait… references are loading.