  We present a novel methodology to compute relaxed dislocations core
configurations, and their energies in crystalline metallic materials using
large-scale \emph{ab-intio} simulations. The approach is based on MacroDFT, a
coarse-grained density functional theory method that accurately computes the
electronic structure but with sub-linear scaling resulting in a tremendous
reduction in cost. Due to its implementation in \emph{real-space}, MacroDFT has
the ability to harness petascale resources to study materials and alloys
through accurate \emph{ab-initio} calculations. Thus, the proposed methodology
can be used to investigate dislocation cores and other defects where long range
elastic defects play an important role, such as in dislocation cores, grain
boundaries and near precipitates in crystalline materials. We demonstrate the
method by computing the relaxed dislocation cores in prismatic dislocation
loops and dislocation segments in magnesium (Mg). We also study the interaction
energy with a line of Aluminum (Al) solutes. Our simulations elucidate the
essential coupling between the quantum mechanical aspects of the dislocation
core and the long range elastic fields that they generate. In particular, our
quantum mechanical simulations are able to describe the logarithmic divergence
of the energy in the far field as is known from classical elastic theory. In
order to reach such scaling, the number of atoms in the simulation cell has to
be exceedingly large, and cannot be achieved with the state-of-the-art density
functional theory implementations.
