# An update on site search activities for SWGO

M. Santandera,∗, U. Barres de Almeidab, J. A. Bellidoc, T. Bulikd, C. Dibe, B.
Dingusf, S. Garciag, F. Guarinoh, P. Huentemeyeri, D. Mandatj, E. Mezak, L.
Mendesl, L. Nellenm, C. Ocampon, L. Otinianok, E. Quispeo, A. Reiseneggerp, A.
C. Roveroq, F. Sanchezr, A. Sandovals, R. Yanyachit, H. Zhouu on behalf of the
SWGO Collaborationw
_a University of Alabama, Tuscaloosa, USA_, _b CBPF, Brazil_, _c University of
Adelaide, Australia_, _d Astronomical Observatory, University of Warsaw,
Poland_, _e CCTVal, Universidad Tecnica Federico Santa Maria, Chile_, _f
University of Maryland, USA_, _g Universidad Nacional San Antonio Abad del
Cusco, Peru_ _h Dipartimento di Fisica "E. Pancini" dell’Univerità degli Studi
di Napoli and INFN Napoli, Italy_, _i Michigan Technological University, USA_,
_j FZU, Czech Republic_, _k Comisión Nacional de Investigación y Desarrollo
Aeroespacial, Peru_, _l LIP, Portugal_, _m Instituto de Fisica, UNAM, Mexico_,
_n Atacama Astronomical Park, Chile_, _o Universidad de Moquegua, Peru_, _p
Universidad Metropolitana de Ciencias de la Educación (UMCE), Chile_, _q
Instituto de Astronomía y Física del Espacio (IAFE (CONICET-UBA)), Argentina_,
_r Instituto de Tecnologías en Detección y Astropartículas (CNEA, CONICET,
UNSAM), Argentina_, _s Instituto de Ciencias Nucleares, UNAM, Mexico_, _t
Universidad Nacional San Agustín de Arequipa, Peru_, _u Tsung-Dao Lee
Institute, Shanghai Jiao Tong University, China_.
_b The Southern Wide-field Gamma-ray Observatory_

###### Abstract

The Southern Wide-field Gamma-ray Observatory (SWGO) is a project by
scientists and engineers from 14 countries and 78 institutions to design and
build the first wide-field, ground-based gamma-ray observatory in the Southern
Hemisphere, with high duty cycle and covering an energy range rom hundreds of
GeV to the PeV scale. The observatory will cover the Southern sky and aims to
map the Galaxy’s large-scale emission, as well as detecting transient and
variable phenomena. The host sites under consideration are at a minimum
altitude of 4400 m.a.s.l. and comprise two types: flat plateaus of at least 1
km2 for the installation of an array of tank-based water Cherenkov detectors
(WCD), or large natural lakes for the direct deployment of WCD units. Four
South American countries proposed excellent sites to host the observatory
meeting these requirements. Argentina proposed two locations in the Salta
province, Bolivia presented one site in Chacaltaya, Chile two locations within
the Atacama Astronomical Park, and Peru two ground-based locations in the
Arequipa district as well as lakes in the Cuzco region. The SWGO collaboration
is currently conducting a site characterization study, gathering all the
necessary information for site shortlisting and final site selection by the
end of 2023. The process has reached the shortlisting phase, in which primary
and backup sites for each country have been identified. The primary sites were
visited by a team of experts from the collaboration, to investigate and
validate the proposed site characteristics. Here we present an update on these
site selection activities.

∗ Speaker

##  1 Introduction

The Southern Wide-field Gamma-ray Observatory (SWGO) [1] is a proposed
observatory to be built in the Andes mountains of South America. SWGO will
complement existing wide-field instruments currently operational in the
northern hemisphere, such as HAWC and LHAASO, with the goal of observing gamma
rays and cosmic rays from the southern sky with energies above $\sim 10$ GeV.
The observatory will enable the study of the inner Galaxy, a direct
observation of the Galactic Center, the observation of variable and transient
sources such as active galactic nuclei, gamma-ray bursts and multimessenger
triggers, as well as studies of fundamental physics.

Figure 1: Map of sites currently under consideration for SWGO and their
location in the continent.

The scientific and performance requirements of SWGO set constraints on the
location and physical characteristics of the site that will host the detector.
A set of minimum requirements were therefore defined by the SWGO collaboration
to search for candidate sites:

  * •

_Latitude_ : The latitude of the site should be between 10∘ and 30∘ South in
order to ensure a proper view of the Galactic Center region.

  * •

_Altitude_ : A minimum altitude of 4,400 m above sea level is required to
provide a lower energy threshold, as air showers produced by gamma rays and
cosmic rays in the desired energy range attenuate quickly in the atmosphere.

  * •

_Surface area_ : The minimum area to host the SWGO reference configuration
design requires 80,000 m2 for an inner high fill-factor array, surrounded by
an area of at least 200,000 m2 for a sparser array. In order to accommodate
potential future extensions of increase the high-energy reach of the
instrument, an available area of $\sim$ 1 km2 is required.

These hard constraints (latitude, altitude, and available area) are the
minimum requirements that should be met to identify a potential candidate
site. The criteria for the selection of a site among those that pass the
minimum requirements are the performance, cost and risks of constructing SWGO
at a given site. The performance of the SWGO array at a given site could be
affected by its physical characteristics, such as latitude (observable sky),
altitude (energy threshold), and deviations from an ideal layout (trigger and
acceptance considerations), among others. The costs involve both construction
and operational aspects, while risks include environmental and social impacts
(e.g. social, archaeological, or economical restrictions to the region; risk
of earthquakes, flooding or heavy snow), economical and legal considerations
(e.g. regulations regarding the importation of scientific equipment, site
access, land use, etc.), and risks associated with on-site activities (e.g.
access to required water, power, internet, safety conditions, health risks,
local support, etc.). Given the scope of the project a site availability
timescale of 20 years was selected as highly desirable.

There are currently three detector designs under consideration, all based on
the water Cherenkov detection (WCD) principle proven by past and current
observatories:

  1. 1.

Tank design: This is the baseline design. It consists of a large number of
light-tight WCD tanks ($\sim$5,000) following a HAWC-like design [2]. Each
tank is about 3.8 m in diameter and 3 m in height and is equipped with one or
more photon sensors overlooking a volume of purified water. The detector is
composed of a core array with high fill factor surrounded by a sparser outer
array.

  2. 2.

Pond design: This concept follows the design of previous and current
instruments such as Milagro and LHAASO [3], where photon sensors are located
in a large water pool (or "pond") instead of being isolated in individual WCD
tanks. Photon sensors can still be optically isolated from each other by
placing curtains or other types of barriers under water. This solution
involves the construction of a large artificial pond at the detector site that
will have to be completely covered to prevent light contamination.

  3. 3.

Lake design: In this novel concept, a natural lake is used as part of the
detector by placing the photo sensors into ’bags’ that contain purified water
and are immersed in the lake, keeping them at the right distance away from
each other.

The choice of detector technology and the site selection process are
intimately linked, as some candidate sites may be able to host a particular
detector design but not others.

The site selection process started with the definition of representatives for
the proposed host countries, a first round of data collection for each
proposed site (including the technical and economical benefits of each), and
the creation of a shortlist of candidate sites. The shortlist will include a
primary and backup site for each detector technology that the country plans to
host, where the preliminary primary and backup definitions are determined
based on the relative merits of each site for a specific country. The
information collected for the candidate sites is then collected into reports
available to the entire collaboration.

Four countries presented candidate sites to host SWGO, shown in Fig. 1111A map
of all sites with additional photos and videos is shown here.. We list them
below along with their temporary designations as primary or backup sites:

  1. 1.

Argentina: two sites were presented for a tank array: Cerro Vecar (primary)
and Alto Tocomar (backup), both in the province of Salta, in the north of the
country.

  2. 2.

Bolivia: One site was presented for a tank array: Cerro Estuquería near the
existing ALPACA experimen [4], in the Chacaltaya plateu. The site is currently
under evaluation as a backup as it did not meet the minimum required area of 1
km2.

  3. 3.

Chile: two sites were presented for a tank array: Pampa La Bola (primary) and
Pajonales (backup), near the location of the ALMA observatory in the Atacama
Desert.

  4. 4.

Peru: two sites were presented for a tank or pond array: Yanque (primary) and
Imata (backup) in the Arequipa region, and one site for a lake array: the lake
Sibinacocha area in the Cuzco region (primary). Two additional lake sites are
currently being evaluated: Pasto Grande and Suches, in the Arequipa region.

The selection of a primary and backup site for each country and detector
design during the shortlisting process is determined by the relative merits of
each site within that country. Given the elevation difference between some
sites (Fig. 2) within the same country, a simulation study is underway to help
assess the impact on the scientific performance (in particular the low-energy
sensitivity of the array) this could have to settle the primary or backup
definition during the shortlisting step.

Figure 2: Histograms of distribution of altitudes of all sites visited. A
narrow histogram means a flat site, and a wide histograms indicates a site
with a large slope. All histograms have been adjusted to match the elevation
from Google Earth.

A visit to the countries hosting at least one primary site (i.e. Argentina,
Chile and Peru) was organized for October-November of 2022. In the next
sections we describe the characteristics of the sites under consideration,
including information collected during the 2022 visit.

##  2 Candidate sites in Argentina

The sites in Argentina (Fig. 3) are 5 km away from each other, measured
linearly, along National Road 51 (RN51) in the province of Salta. The nearest
town is San Antonio de Los Cobres (SAC, pop. 5,480, 30 km away) accessible via
an unpaved road. Both sites are proposed to host tank arrays. No electrical
power and no internet connectivity exist at either site at the moment. The
nearest illuminated internet fibre point is in San Antonio de Los Cobres. The
average temperature on site is -5 °C (range: -15 °C to +10 °C) in the winter
and +3 °C in the summer (-5 °C to +15 °C).

The Cerro Vecar site ($\sim$4,800 m.a.s.l., 24.2° S) is near two
observatories: QUBIC and LLAMA. The soil is sandy with some large rocks in the
higher part of the area, and would have to be flattened prior to construction.
The Alto Tocomar site (4,420 ma.s.l., 24.2° S) has sandy soil with no rocks
and it has a flat area ($<1$% slope) that extends over 1 km2.

Figure 3: _Top:_ Map showing the location of both Argentinian sites with
respect to SAC. _Bottom left:_ Photo of the Cerro Vecar site with a map
showing elevation contours with 2 m spacing with respect to the average.
_Bottom right:_ Same as left for the Alto Tocomar site.

##  3 Candidate site in Bolivia

A site in Cerro Estuqueria, Chacaltaya Plateau (4,750 m.a.s.l., 16° S, Fig.
4), near the existing ALPACA observatory [4], has been proposed to host a tank
array. Due to the available area being 0.72 km2, less than the minimum
requirement, it is being considered only as a backup at the moment. The
nearest cities are El Alto and La Paz (Bolivia’s capital), 15 km and 20 km
away respectively measured linearly, connected to the site via an unpaved
road. The average temperature in the Chacaltaya plateau is in the range
between -4.2 °C and 5.5 °C. The site has no internet access at present, with
the nearest internet access point about 10 km away. A 6.9 kV line runs near
the site that could be used for electrical power. Water is not available on
site, although underground water could be used as a source.

Figure 4: _Left_ : Location of the Cerro Estuqueria site with respect to La
Paz, with the inset map showing a 600 m diameter circle representing a
potential site location near ALPACA. _Right:_ View of the Chacaltaya plateau
from ALPACA.

##  4 Candidate sites in Chile

Figure 5: Map of sites currently under consideration for SWGO and their
location in the continent.

The Pampa La Bola (current primary, elevation 4,750 m.a.s.l., 22.9° S) and
Pajonales (current backup, elevation 4,625 m.a.s.l., 23.0° S) sites are
located within the Atacama Astronomical Park (AAP), about 18 km from each
other along Road 27, a paved road that connects both sites with San Pedro de
Atacama (pop. 4,000), about 45 km away. Both sites are proposed to host tank
arrays. The average low temperature in the winter is about -18 °C, and the
average high in the summer is +10 °C.

No electrical power is available on site. Water is not available on site but
it can also be purchased and transported from the nearby town of Calama, 150
km away. The nearest internet connection is the AAP fibre connection point at
ALMA, 6 km away from Pampa La Bola. The soil in Pampa La Bola is made of very
small stones and sand, with a flat area (slope $<$ 2%) of several km2, while
in Pajonales there is a mixture of sand and a few rocks and the area has an
overall slope of $\sim 7$%. The sites are near astronomical observatories at
Cerro Toco and ALMA in the Chajnantor plateau (see Fig. 5) .

##  5 Candidate sites in Peru

Two sites are proposed in Peru to host tank or pond arrays: Yanque (4,850
m.a.s.l., 15.7° S) and Imata (4,450 m.a.s.l., 15.9° S), both in the Arequipa
region. Lows in the winter reach -16 °C, and highs in the summer are around 17
°C. Both regions are flat (slopes of $<3$% for Yanque and $<2$% for Imata),
with an available area of 1 km2 for Yanque, and multiple km2 for Imata. No
high-speed internet connection is available at either site.

Figure 6: _Left_ : Map of the locations of different sites in Peru. _Center:_
regional maps for the sites in the Cuzco (top) and Arequipa (bottom) regions.
_Right:_ Elevation contours (2 m spacing) for Imata and Yanque including
photos of the sites taken during the 2022 visit (bottom) and a drone picture
of lake Sibinacocha with bathymetry measurements of the southern part of the
lake.

For Yanque, the nearest town is Chivay (pop. 6,600), located about 30 km away
(25 km on a paved road, and the last 5 km on a dirt road). Small lakes, used
by the local community, are located nearby that could be used as a water
source. Electrical power is available about 10 km away from the site. The soil
is sandy with some big rocks are present. The Imata site is located 4 km away
from the town of Imata (pop. 460), where electrical power is available. A
river passing next to the site could be used as the water source, and the soil
is sandy with very few rocks.

Lake Sibinacocha (4,860 m.a.s.l., 13.9° S) is a very large lake with an area
of 14 km2 located in the Cuzco region. Two smaller lakes, Cochauma and
Cochachaca, are located nearby. The area is accessible via unpaved roads and
the nearest town is the village of Phinaya (pop. 340) about 2 km away from the
nearest lakeshore. Bathymetry studies in the southern-most part of Sibinacocha
yield an average depth of $\sim 20$ m, and temperatures in the area are stable
through the year, with highs of 10-14 °C and lows of -3 to -9 °C. For more
lake options, two additional sites in the Arequipa region (Pasto Grande and
Suches) are currently under evaluation for a lake design detector.

##  6 Engagement with local communities

One of the main goals of the site search process has been engaging local
communities, and the native _pueblos originarios_ of the area, organizing
meetings and outreach activities during our visits to the candidate sites.
These meetings (Fig.7) were very informative and have helped us understand
their needs, requests, interests, and engagement better. More information on
how to best engage and collaborate with local communities and pueblos
originarios at each of the proposed sites is being collected, so that we can
follow best practices of community participatory research and form sustainable
and lasting partnerships that will help us better interact and integrate our
activities with the community.

Figure 7: _Left_ : Presentation of the SWGO project to members of local
pueblos originarios communities in San Antonio de los Cobres, Argentina,
during the 2022 site visit. _Center_ : Meeting of the site visit team in 2022
with the mayor of San Pedro de Atacama, Chile, who is also the local
representative of a pueblos originarios community. _Right_ : SWGO collaborator
Dr. Sandro Arias has started a Science Center at the Phinaya school, Peru.

##  7 Next steps

The end of the shortlisting step is expected for the end of 2023, taking as
input results from a study underway to evaluate the elevation-dependence of
the scientific performance of the array. This will also help settle sites as
either primary or backup options. The primary sites will then undergo full
cost and environmental impact studies as well as risk assessments. Using this
information, a preferred and backup site for the construction of SWGO will be
selected in 2024.

## References

  * [1] SWGO Collaboration, J. Hinton PoS ICRC2021 (2021) 023.
  * [2] “HAWC Collaboration. The High-Altitude Water Cherenkov Gamma-Ray Observatory.”  https://www.hawc-observatory.org.
  * [3] “LHAASO Collaboration. The Large High-Altitude Air Shower Observatory.”  http://english.ihep.cas.cn/lhaaso/.
  * [4] T. Kawashima and The ALPACA Collaboration arXiv e-prints (Aug., 2022) arXiv:2208.14659.


# Optimized Crystallographic Graph Generation for Material Science

Astrid Klipfel1,2,3 Yaël Frégier3 Adlane Sayede2&Zied Bouraoui1 1Univ. Artois,
UMR 8188, Centre de Recherche en Informatique de Lens (CRIL), F-62300 Lens,
France.
2Univ. Artois, UMR 8181, Unité de Catalyse et de Chimie du Solide (UCCS),
F-62300 Lens, France.
3Univ. Artois, UR 2462, Laboratoire de Mathématiques de Lens (LML), F-62300
Lens, France.
<EMAIL_ADDRESS>
###### Abstract

Graph neural networks are widely used in machine learning applied to
chemistry, and in particular for material science discovery. For crystalline
materials, however, generating graph-based representation from geometrical
information for neural networks is not a trivial task. The periodicity of
crystalline needs efficient implementations to be processed in real-time under
a massively parallel environment. With the aim of training graph-based
generative models of new material discovery, we propose an efficient tool to
generate cutoff graphs and k-nearest-neighbours graphs of periodic structures
within GPU optimization. We provide pyMatGraph a Pytorch-compatible framework
to generate graphs in real-time during the training of neural network
architecture. Our tool can update a graph of a structure, making generative
models able to update the geometry and process the updated graph during the
forward propagation on the GPU side. Our code is publicly available at
https://github.com/aklipf/mat-graph.

##  1 Introdution

New materials discovery is a fundamental challenge in material sciences where
high-throughput screening based on machine learning models is largely employed
to obtain materials with desired properties. Crystalline (crystal) material
generation has recently received considerable attention, e.g. Xie et al.
(2022); Gibson et al. (2022); Klipfel et al. (2023). In our setting, we are
interested in generating new crystal materials for developing new solar panels
with a band gap enabling hydrolyse. This helps to solve problems related to
clean energy production and storage, which is one of the major challenges
facing our society. It can also be used to produce hydrocarbons from CO2,
helping to reduce the carbon footprint of human activities.

From organic chemistry to material science, Graph Neural Networks (GNN) have
received increasing attention in a variety of tasks such as classification
Schütt et al. (2017); Jørgensen et al. (2018); Gasteiger et al. (2020b, a);
Chen et al. (2019); Choudhary and DeCost (2021); Klicpera et al. (2021) and
generation Satorras et al. (2021); Xie et al. (2022); Long et al. (2021);
Ekström Kelvinius et al. (2022); Gibson et al. (2022). Notice that organic
molecules are composed of wide carbon chains with a limited variety of atoms,
while crystal materials are three-dimensional periodic structures composed of
a wide variety of chemical bonds and atoms. The periodic structure of crystals
is often represented as a parallelepiped tiling, a.k.a crystal lattice or unit
cell. While generating graph-based representations of organic molecules is
straightforward, the periodic structure of crystals makes difficult graph
processing when training a generative model, and in particular when a
massively parallel environment is required. More precisely, generative models
may update the geometry of a chemical structure during forward propagation.
However, since the graph associated with a given structure is built from the
local environment of atoms, a modification of the geometry leads to the
modifications of the graph associated with the structure. Consequently,
building a generative model with a dynamic graph is hard to achieve on a
periodic structure compared to organic molecules.

When training graph-based generative models for material discovery, cutoff
distance is a commonly used technique Schütt et al. (2017); Gasteiger et al.
(2020b); Jørgensen et al. (2018). It designates a relative distance threshold
value above which no interaction between nodes is considered. In the same
vein, Jørgensen et al. (2018); Chen et al. (2019) suggests that k-nearest-
neighbours (KNN) graphs can also be a good choice for GNN models. KNN-graph is
a type of graph where all the nodes are connected to the k-nearest nodes. When
processing small molecules, any naive strategy of computing the interatomic
distances is feasible, allowing to compute KNN or cutoff graph in a short
amount of time and reasonable memory. However, for periodic structures which
are infinite, the search area should be carefully selected to avoid
unnecessary calculation and memory saturation. In fact, the volume of the
search space expands with the cube of the search radius. As such, possible
graphs should be generated in milliseconds to be usable in practice during the
training process. Moreover, a periodic structure is represented with a multi-
graph where a given node can share multiple edges with another and with itself
which brings more complexity to the graph generation process. Finally, for big
structures, a processing strategy suitable for massively parallel environments
should be used in order to deal with a batch of multiple structures at the
same time.

To address the aforementioned issues, we propose an efficient tool that solves
KNN and cutoff graph generation for crystalline materials. We provide a
compatible implementation with PyTorch that performs on GPUs111Code available
at https://github.com/aklipf/mat-graph. We used an approach inspired by the
KD-tree search algorithm adapted for periodic structures and propose a data
structure adapted to massively parallel environments (GPUs) that effectively
keeps track of the KNN of each atom. We empirically show the benefits of using
our tool.

##  2 Crystallographic Graph Generation

A crystalline structure can be defined with a cloud of atoms and a repetition
pattern that represent periodicity. The repetition pattern is often described
as a parallelepiped called a lattice or a cell. The periodic structure is
obtained with the tiling of the space by the crystal cell. Consequently, a
given atom inside of the cell has multiple positions because of the tiling in
space and the local environment of an atom which can overlap with adjacent
repetition.

Figure 1: Example of a crystal composed of two atoms, atom 0 is in the centre
of the cell and atom 1 is in the bottom left corner. The edges of the graph
$\Gamma_{1}$ associated with a material are composed of the index of a source
node, the index of the target node and the coordinate of the cell of the
targeted node.

###  2.1 Crystallographic Graph

We follow Klipfel et al. (2023) to define the graph associated with a crystal
material as an oriented graph where each edge is represented by triplets
containing the index of the source node, the index of the destination node and
the relative cell coordinate of the destination node. Figure 1 illustrates
this representation. Notice that the definition of graph provided in Klipfel
et al. (2023) generalizes to most of the graph definitions proposed in
previous works Jørgensen et al. (2018); Chen et al. (2019); Satorras et al.
(2021). We now recall the formal definition of crystalline structure Klipfel
et al. (2023).

######  Definition 1.

The representation space of featured materials ${\cal M}^{F}$ is the disjoint
union $\coprod_{n\in\mathbb{N}}\mathcal{M}^{F}_{n}$ where:

${\cal M}^{F}_{n}=\big{\\{}(\rho,x,z)\>|\>\rho\in
GL_{d}(\mathbb{R}),\>x\in[0,1[^{n\times d},\>z\in F^{n}\big{\\}}$

Chemical materials are represented in $\mathcal{M}=\mathcal{M}^{\mathbb{N}}$,
with atomic numbers as feature sequence $z$.

$\mathcal{M}^{F}_{n}$ is an infinite set of triplet $\rho$, $x$, $z$ that
represents all possible materials with $n$ atoms. The atomic number has a
chemistry reference, e.g. 1 for hydrogen or 6 for carbon.

######  Definition 2.

We call directed 2-graph $\Gamma=(\Gamma_{0},\Gamma_{1},\Gamma_{2})$ a triplet
of sets together with applications:

  * •

$\pi_{1}:\Gamma_{1}\to\Gamma_{0}\times\Gamma_{0}$, written
$\pi_{1}(\gamma)=({\mathrm{src}(\gamma)},{\mathrm{tgt}(\gamma)})$

  * •

$\pi_{2}:\Gamma_{2}\to\Gamma_{0}\times\Gamma_{0}\times\Gamma_{0}$

We call $\Gamma$ a directed 1-graph when $\Gamma_{2}=\varnothing$.

The aforementioned graphs are often called multi-graphs or hyper-graphs
because they generalise 1-graphs to dimensions $\geq 1$. They are directed
because we do not assume any symmetry on $\Gamma$ w.r.t vertice permutations.
Recall that $\pi_{1}$ and $\pi_{2}$ may not be injective.

######  Definition 3.

Let $M=(\rho,x,z)$ in $\mathcal{M}_{n}^{F}$ be a material and $c_{i}>0$ for
$1\leq i\leq n$ denotes cutoff distances. We define a directed 2-graph
$\Gamma=\Gamma_{M,c}$ by the graded components:

  * •

$\Gamma_{0}=\\{1,\dots,n\\}$

  * •

$\Gamma_{1}=\big{\\{}(i,j,\tau)\in\Gamma_{0}\times\Gamma_{0}\times\mathbb{Z}^{d}\>\big{|}\>||\rho(x_{j}-x_{i}+\tau)||<c_{i}\big{\\}}$

  * •

$\Gamma_{2}=\big{\\{}(\gamma,\gamma^{\prime})\in\Gamma_{1}\times\Gamma_{1}\>\big{|}\>{\mathrm{src}(\gamma)}={\mathrm{src}(\gamma^{\prime})}\big{\\}}$

This graph construction includes many definitions of material graphs, making
it versatile and usable in most contexts. This definition includes a graph
built from a constant cutoff distance (i.e. $c_{i}$ is constant), a graph
built from $k$ nearest neighbour or built from chemical properties such as the
covalent radii. For more detail, we refer to Klipfel et al. (2023).

###  2.2 Generation Process

To handle the periodic nature of crystalline, we adapt our graph generation
process to work in a torus space. To this end, graph generation is performed
by exploring the direct repetition of a cell where we start by evaluating the
adjacent cell and extend the search area until we find all the edges. Our
graph generation method is built upon two main parts: a searching algorithm
and an ordered stack. Combined, the generation process follows an iterative
process limiting the RAM usage by splitting the search area. Our generation
process remains fast since only a few iterations are required, avoiding
useless search areas.

Figure 2: The searching procedure continues while the evaluated area (in the
parallelogram with continuous lines) doesn’t fully overlap with the search
area (represented as a red circle). The next evaluated area (in dotted lines)
expends in the direction where the search area is not yet evaluated.

#### Searching procedure

Our search procedure is based on a classic KD-tree search strategy. As shown
in Figure 2, a search radius is used to represent the area where connected
nodes can exist. On the other side, we expand the explored area up to a search
radius. As the search radius is defined with the KNN in the case of a KNN-
graph, the search radius decreases over time when a new area is explored. The
search procedure pseudo-code is given by Algorithm 1.

Algorithm 1 KNN graph generation algorithm

Input:
$k$: the k nearest connected atoms
$\rho$: the shape of the lattice of the crystal
$x$: the position of the nodes inside the lattice
Output: a set of edges

1: $d^{\max}_{i}\leftarrow\infty$

2: $border\leftarrow(0,0,0)$

3: $\Gamma_{1}\leftarrow\\{\emptyset\\}$

4: while $\text{any}(d^{\max}_{i}>\text{closest\\_distance}(border,\rho))$ do

5: $extension\leftarrow\text{next\\_evaluated\\_area}(border,d^{\max}_{i})$

6: $\gamma\leftarrow\text{evaluate\\_area}(\rho,x,extension)$

7: $\Gamma_{1}\leftarrow\text{push\\_nearest}(\Gamma_{1},\gamma,k)$

8: $border\leftarrow border+extension$

9:
$d^{\max}_{i}\leftarrow\max_{(i^{\prime},j,\tau)\in\Gamma_{1}|i^{\prime}=i}d_{i^{\prime}j\tau}$

10: end while

11: return $\Gamma_{1}$

#### Ordered stack

To keep track of the k closest points already discovered by our search
procedure, we proposed an efficient data structure to store points. Our
ordered stack first concatenates new data and then sorts them by distance.
After that, the edges are filtered to keep only the KNN in the case of a KNN-
graph or the edges under a given cutoff distance in the case of a cutoff-
graph.

Algorithm 2 Push edges in and ordered stack

Input:
$k$: the k shortest edges
$\Gamma_{1}$: a list of edges
$\gamma$: the list of edges to merge
Output: the list of the k shortest edges

1: $\Gamma^{\prime}_{1}\leftarrow\Gamma_{1}\mathbin{\|}\gamma$

2:
$\Gamma^{\prime}_{1}\leftarrow\text{sort\\_by\\_distance}(\Gamma^{\prime}_{1})$

3:
$\Gamma^{\prime}_{1}\leftarrow\text{stable\\_sort\\_by\\_source\\_index}(\Gamma^{\prime}_{1})$

4: $d^{k}_{i}\leftarrow\text{k\\_nearest\\_distance}_{i}(\Gamma^{\prime}_{1})$

5:
$\Gamma^{\prime}_{1}\leftarrow\\{(i,j,\tau)\in\Gamma^{\prime}_{1}|d_{(i,j,\tau)}\leq
d^{k}_{i}\\}$

6: return $\Gamma^{\prime}_{1}$

In addition to graph generation, our tool provides additional functionalities
such as:

  * •

Symmetric graph: as some GNN require symmetric directed graphs to perform
specific message-passing schema, our tool includes a procedure that makes a
given graph symmetric by adding missing edges while guaranteeing the
uniqueness of the edges.

  * •

Triplets generation: We provide an implementation to generate triplets
composed of two edges sharing the same source nodes during the run-time. This
task is important because recent works use triplets information during
inference Klipfel et al. (2023); Xie et al. (2022); Klicpera et al. (2021).

##  3 Performance Evaluation

To evaluate the performance of our tool, we conducted experiments on Materials
project Jain et al. (2013) which is a dataset composed of 133420 crystalline
materials studied with ab inito calculation. We considered the same setting as
Xie et al. (2022) where structures composed of more than 64 atoms are removed
since they are in general considered outliers. The experiments are performed
on an Nvidia quadro RTX 8000 GPU.

#### CPU vs GPU

We compared the time required to process all the structures for our tool with
and without GPU optimization. We used a fixed batch size of 256 structures and
generated the structures for the 16, the 32 and the 64 nearest neighbours of
atoms. As shown in table 1, the KNN-graph generated on GPU is up to 40 times
faster than an equivalent CPU library.

| knn | cutoff distance
---|---|---
| 16 | 32 | 64 | 3.0 | 5.0 | 8.0
CPU | 1029.6 | 1120.1 | 1669.3 | 968.3 | 1214.4 | 2829.9
GPU | 25.2 | 25.8 | 37.7 | 20.5 | 34.0 | 57.8
batch | 0.053 | 0.055 | 0.080 | 0.043 | 0.072 | 0.123

Table 1: Processing time of 119701 filtered structures in seconds for CPU, GPU
and Batch configurations. KNN denotes the number of neighbours in the graph
while the cutoff distance defines a radius (in Angstrom) inside which all
atoms are connected. Batch corresponds to the generation time for a single
batch of 256 structures.

#### Complexity, inference time and RAM usage

To check the time complexity of our method, we compare the generation time of
one batch with various KNN settings in Table 1 and batch size in Table 2).
Experiments on batch size have been performed for a KNN-graph with 32
neighbours.

batch size | 32 | 64 | 128 | 256 | 512
---|---|---|---|---|---
batch (ms) | 22.0 | 24.7 | 35.0 | 59.3 | 97.5
total (s) | 82.2 | 46.2 | 32.7 | 27.7 | 22.8
RAM (Mo) | 565.6 | 1079.6 | 2300.1 | 2991.0 | 4811.2

Table 2: Batch time corresponds to the building time of the graph for a single
batch. Total time refers to the time required to process the entire dataset.
RAM to the average GPU RAM used by our graph generation tool.

##  4 Conclusion

We propose an efficient tool to convert crystalline materials into graphs. Our
library allows for reducing the time spent during prepossessing. More
importantly, the graph conversion is quick enough to be used during the
training process without the prepossessing step and updates the graph while
updating the geometry of a given structure. Our tool opens new possibilities
in generative networks for material science.

## Acknowledgments

This work has been supported by ANR-22-CE23-0002 ERIANA, ANR-20-THIA-0004 and
by HPC resources from GENCI-IDRIS (Grant 2022-[AD011013338]).

## References

  * Chen et al. [2019] Chi Chen, Weike Ye, Yunxing Zuo, Chen Zheng, and Shyue Ping Ong.  Graph networks as a universal machine learning framework for molecules and crystals.  Chemistry of Materials, 31(9):3564–3572, 2019.
  * Choudhary and DeCost [2021] Kamal Choudhary and Brian DeCost.  Atomistic line graph neural network for improved materials property predictions.  npj Computational Materials, 7(1):185, Nov 2021.
  * Ekström Kelvinius et al. [2022] Filip Ekström Kelvinius, Rickard Armiento, and Fredrik Lindsten.  Graph-based machine learning beyond stable materials and relaxed crystal structures.  Phys. Rev. Materials, 6:033801, Mar 2022.
  * Gasteiger et al. [2020a] Johannes Gasteiger, Shankari Giri, Johannes T. Margraf, and Stephan Günnemann.  Fast and uncertainty-aware directional message passing for non-equilibrium molecules.  In Machine Learning for Molecules Workshop, NeurIPS, 2020.
  * Gasteiger et al. [2020b] Johannes Gasteiger, Janek Groß, and Stephan Günnemann.  Directional message passing for molecular graphs.  In International Conference on Learning Representations (ICLR), 2020\.
  * Gibson et al. [2022] Jason B. Gibson, Ajinkya C. Hire, and Richard G. Hennig.  Data-augmentation for graph neural network learning of the relaxed energies of unrelaxed structures.  arXiv, 2022.
  * Jain et al. [2013] Anubhav Jain, Shyue Ping Ong, Geoffroy Hautier, Wei Chen, William Davidson Richards, Stephen Dacek, Shreyas Cholia, Dan Gunter, David Skinner, Gerbrand Ceder, et al.  Commentary: The materials project: A materials genome approach to accelerating materials innovation.  APL materials, 1(1):011002, 2013.
  * Jørgensen et al. [2018] Peter Bjørn Jørgensen, Karsten Wedel Jacobsen, and Mikkel N. Schmidt.  Neural message passing with edge updates for predicting properties of molecules and materials.  arXiv, 2018.
  * Klicpera et al. [2021] Johannes Klicpera, Florian Becker, and Stephan Günnemann.  Gemnet: Universal directional graph neural networks for molecules.  In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, 2021.
  * Klipfel et al. [2023] Astrid Klipfel, Olivier Peltre, Najwa Harrati, Yaël Fregier, Adlane Sayede, and Zied Bouraoui.  Equivariant message passing neural network for crystal material discovery.  In Thirty-Seventh AAAI Conference on Artificial Intelligence, AAAI 2023. AAAI Press, 2023.
  * Long et al. [2021] Teng Long, Nuno M. Fortunato, Ingo Opahle, Yixuan Zhang, Ilias Samathrakis, Chen Shen, Oliver Gutfleisch, and Hongbin Zhang.  Constrained crystals deep convolutional generative adversarial network for the inverse design of crystal structures.  npj Computational Materials, 7(1):66, May 2021.
  * Satorras et al. [2021] Víctor Garcia Satorras, Emiel Hoogeboom, and Max Welling.  E(n) equivariant graph neural networks.  In Marina Meila and Tong Zhang, editors, Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 9323–9332. PMLR, 18–24 Jul 2021.
  * Schütt et al. [2017] Kristof Schütt, Pieter-Jan Kindermans, Huziel Enoc Sauceda Felix, Stefan Chmiela, Alexandre Tkatchenko, and Klaus-Robert Müller.  Schnet: A continuous-filter convolutional neural network for modeling quantum interactions.  In NIPS, pages 992–1002, 2017.
  * Xie et al. [2022] Tian Xie, Xiang Fu, Octavian-Eugen Ganea, Regina Barzilay, and Tommi S. Jaakkola.  Crystal diffusion variational autoencoder for periodic material generation.  In International Conference on Learning Representations, 2022.