BlockAdaptive Quantum Mechanics: an adaptive divideandconquerapproach to interactive quantum chemistry
Mäel Bosson, Sergei Grudinin, Stephane RedonNANOD  INRIA Grenoble  RhoneAlpes655, avenue de l’Europe, 38335 SaintIsmier Cedex, FranceFebruary 28, 2014
Abstract
We present a novel
BlockAdaptive Quantum Mechanics
(BAQM) approach to interactive quantum chemistry. Although quantum chemistry models are known to be computationally demanding, we achieve interactive rates by focusingcomputational resources on the most active parts of the system. BAQM is based on a divideandconquer technique, andconstrains some nucleus positions and some electronic degrees of freedom on the ﬂy to simplify the simulation. As a result,each time step may be performed signiﬁcantly faster, which in turn may accelerate attraction to the neighboring localminima. By applying our approach to the nonselfconsistent ASEDMO (Atom Superposition and Electron DelocalizationMolecular Orbital) theory, we demonstrate interactive rates and eﬃcient virtual prototyping for systems containing morethan a thousand of atoms on a standard desktop computer.
Keywords:
Interactive Quantum Chemistry, Reduced Basis, Adaptive, DivideAndConquer, ASEDMO.1
BlockAdaptive Quantum Mechanics (BAQM) is a new approach to interactive quantum chemistry. BAQM is based on adivideandconquer technique, and constrains some nucleus positions and some electronic degrees of freedom on the ﬂy tosimplify the simulation. By applying our approach to the nonselfconsistent ASEDMO theory, we demonstrate interactiverates and eﬃcient virtual prototyping for systems containing more than a thousand of atoms on a standard desktop computer.2
1
Introduction
The fundamental Schrödinger equation for nuclei and electrons is a fascinating problem that has been attracting a lot of attention in the computational chemistry community. In theory, solving this equation makes it possible to accurately describethe behavior of particles at the atomic scale. Thus, it seems natural that software applications for computeraided design(CAD) of nanosystems should simulate quantum physics. In particular, CAD applications should interactively provide theuser with physicallybased feedback when editing the structure of a nanosystem.Because of the high computational cost of underlying numerical methods, though, interactively solving the Schrödingerequation is a challenging problem. Fortunately, many eﬃcient computational methods have been deduced from approximatetheories
15
. In general, these methods solve the oneelectron Schrödinger equation after it has been projected to a ﬁnite basisset. For instance, employing a basis set composed of atomic orbitals (denoted by
φ
µ
)
30
leads to the following generalizedeigenvalue problem:
HC
=
SCD,
(1)where
H
µν
=
φ
µ

H

φ
ν
and
S
µν
=
φ
µ

φ
ν
.
(2)The diagonal matrix
D
contains the sorted eigenvalues and the matrix
C
contains the corresponding eigenvectors (
e
i
denotesthe
i
th
lowest eigenvalue and
C
i
the corresponding eigenvector). The potential energy of the system is the sum:
E
=
N/
2
i
=1
2
e
i
,
(3)where
N
is the number of electrons in the system. The gradient of the potential energy is:
∇
x
E
=
µ
ν
P
µν
∇
x
H
µν
−
µ
ν
W
µν
∇
x
S
µν
,
(4)where
P
is the density matrix and
W
is the energyweighted density matrix:
P
=
N/
2
i
=1
2
C
i
C
T i
, W
=
N/
2
i
=1
2
e
i
C
i
C
T i
.
(5)One approach to eﬃciently evaluate the Hamiltonian matrix
H
is to use a semiempirical model such as the ASEDMO(Atom Superposition and Electron Delocalization Molecular Orbital) theory
3
. In this theory, we have recently presented aninteractive quantum chemistry approach red
7
based on the DivideAndConquer (D&C) method
16
. In particular, we havedemonstrated that interactively solving the oneelectron Schrödinger equation is possible on current desktop computers forsystems composed of a few hundreds of atoms. By subdividing the system into many overlapping subsystems, this approachhas a linear time complexity in the number of atoms, as well as a good parallel scaling
32
, which should thus allow forcontinued improvements with current hardware trends in personal computers.Despite this, it will still be diﬃcult to achieve interactive rates in two situations:
•
Large number of subsystems
: since the number of subsystems increases linearly with the number of atoms, somesystems will simply be too large to allow for interactive rates.
•
Large subsystems
: to reach high accuracy, the D&C approach needs to employ suﬃciently large overlapping subsystems
7
. In this case, solving even a single subsystem’s eigendecomposition problem may be too costly to achieveinteractive rates. Furthermore, it may be diﬃcult to expect important speedups in the near future because diagonalization algorithms typically have poor parallel scaling
5,8
and the serial speed of processing cores is reaching a physicallimit
41
. One approach to speedup electronic structure calculations consists in incrementally updating eigenvectors,as in the Residual Minimization – Direct Inversion of the Iterative Subspace” (RMDIIS) approach
33
. Unfortunately,this may be as slow as the direct approach when too many eigenvectors have to be updated. Another approach could3
be to directly freeze the density matrix while letting atomic nuclei move
17
. However, when a nonorthogonal basisset is used, this may produce nonorthogonal molecular orbitals which might attract the system in conﬁgurations withactually higher potential energy.To address both issues, we propose a novel
BlockAdaptive Quantum Mechanics
(BAQM) approach, based on the DivideAndConquer method and two new components.First, in order to decouple the computational complexity from the system’s size, we propose to
adaptively simulate
thenucleus degrees of freedom. In general, the nearsightedness principle
23
makes it possible to perform a fast incremental updateof the electronic structure when only some atoms have moved
17,26,39,40
. In the DivideAndConquer approach
16
, the systemis divided into nearly independent overlapping subsystems. In the context of a non selfconsistent theory, when all atomsof a subsystem are frozen in space, both the Hamiltonian and its eigendecomposition are constant. To take advantage of this fact, we extend the approach we previously introduced for adaptive Cartesian mechanics coordinates
6
. Precisely, wefreeze and unfreeze
groups
of atoms, according to the applied atomic forces and the system’s decomposition into overlappingsubsystems. We call this ﬁrst component
BlockAdaptive Cartesian Mechanics
.Second, to be able to deal with large subsystems for which diagonalization is the bottleneck, we propose to use an
adaptively updated
reduced basis which takes advantage of temporal coherence between successive eigendecomposition problems.For some methods, evaluating the Hamiltonian and overlap matrices may be computationally demanding. However, thesecomputations are intrinsically parallel and can beneﬁt from modern hardware architectures such as Graphics ProcessingUnits (GPUs)
43
. Similarly, the computation of the density matrix has a cubic complexity in the number of basis functions,but dense matrix multiplications are memoryfriendly
42,46
and can be eﬃciently handled on modern hierarchicalmemorymulticore architectures
13,45
. As a result, we have focused our eﬀorts on the computation of molecular orbitals. A natural wayto accelerate the resolution of many similar diﬀerential equations is to use a reduced basis approach
31
. This methodologyhas been applied in speciﬁc contexts for electronic structure calculation
12,29
. In this paper, we propose to use an adaptivereduced basis which is automatically updated during the simulation. We call this second component
Adaptive ReducedBasis Quantum Mechanics
.We demonstrate that the BAQM approach may signiﬁcantly speedup energy minimization, as well as enable
interactive
quantum chemistry for large molecular systems. Figure 1 illustrates interactive virtual prototyping of a polyﬂuorene chainmolecule.Figure 1:
BlockAdaptive Quantum Mechanics (BAQM) in SAMSON (Software for Adaptive Modeling andSimulation Of Nanosystems)
1
. In this example the system is divided into four subsystems. The energy is minimizedcontinuously as the user edits the molecular system. At each time step, both the geometry and the electronic structureare incrementally and adaptively updated. Because the user pulls one atom (red arrow) in the left part of the system,the electronic structure is updated with the full basis for the leftmost subsystem (all atoms are red). In the neighboringsubsystem, the electronic structure is updated according to a reducedbasis approximation (some carbons are black and somehydrogens are white). In the right part of the molecule, the user force does not have a suﬃciently large impact, and atomspositions are frozen (all atoms are blue).4
2
Overview
In general, adaptive approaches automatically focus computational resources on the most relevant parts of a problem. We usesuch an approach to maintain interactive rates while modeling chemical structures based on quantum chemistry principles.In this section, we provide an overview of our approach, and introduce its two main components: blockadaptive Cartesianmechanics, and adaptive reducedbasis quantum mechanics. For completeness, we ﬁrst brieﬂy recall the ASEDMO theoryand the DivideAndConquer (D&C) technique. red We refer the reader to our previous publication
7
for more details aboutour ASEDMO D&C method.
2.1
The ASEDMO theory
In this paper, we used the ASEDMO theory
3
to test and validate our BAQM approach. In this theory, the electronicdensity function is split into two terms: a
perfectlyfollowing term
(the electron density when atoms do not interact), anda
nonperfectlyfollowing term
(corresponding to the bonds formation). This last term is computed based on the ExtendedHückel Molecular Orbital theory (EHMO)
20
, a simple semiempirical quantum chemistry method which approximates theHamiltonian matrix terms as:
H
µν
=
K I
µ
+
I
ν
2
S
µν
,
(6)where
I
µ
is the ionization energy of the atomic orbital
φ
µ
, and
K
is the WolfsbergHelmholtz constant.
2.2
The DivideAndConquer (D&C) technique
redThe D&C approach is attractive because of its eﬃciency (nearly perfect parallel scaling
32,35
), simplicity for nonorthogonalbasis sets, and accuracy
16,22,25,44,47,48
. There are three main steps in it:
•
Dividing the system
The srcinal system
S
is ﬁrst divided into
M
nonoverlapping subsystems
S
1
,
...
,
S
M
. Then, for each subsystem
S
i
,an
extended
subsystem
S
∗
i
is deﬁned as the one containing all atoms from
S
i
and those closer to these atoms than acertain distance cutoﬀ.
•
Computing each subsystem electronic structure independently
red A basis set is associated to each extended subsystem
S
∗
i
(
1
i
M
). The projection of the oneelectron Schrödingerequation in redthis basis leads to the generalized eigenvalue problems:
H
i
C
i
=
S
i
C
i
D
i
,
1
i
M.
(7)red Each local generalized eigenvalue problem (7) provides a set of molecular orbitals, which are then globally rankedaccording to their corresponding energies. We then populate these molecular orbitals until there are exactly
N
electronsin the system, as detailed in
7
.
•
Summing up the various contributions
red The occupied molecular orbitals determine the local density matrices
P
i
and energyweighted density matrices
W
i
,from which the density matrix
P
and the energyweighted density matrix
W
are obtained
via
a superposition scheme
7
.Once
P
and
W
have been obtained, the potential energy is expressed as
E
= Tr(
HP
)
(8)and the gradient of the potential energy is approximated as:
∇
x
E
=
µ
ν
P
µν
∇
x
H
µν
−
µ
ν
W
µν
∇
x
S
µν
.
(9)5