Wenbing Wu

Yann Battie

Vincent Lemaire

Gero Decher

Matthias Pauly

Structure-Dependent Chiroptical Properties of Twisted Multilayered Silver Nanowire Assemblies

Keywords: nanowire assemblies, chiral nanostructures, plasmonics, metasurfaces, circular dichroism

The optical properties of chiral plasmonic metasurfaces depend strongly on their architecture, in particular the orientation and spacing between the individual building blocks assembled into large arrays. However, methods to obtain chiral metamaterials with fully tunable chiroptical properties in the UV, visible and near infrared range are scarce. Here, we show that the chiroptical properties of silver nanowires assembled in helical nanostructures by Grazing Incidence Spraying and Layer-by-Layer assembly can be finely tuned over a broad wavelength range using simple design principles. The angle between the oriented nanowire layers controls the intensity of the circular dichroism, reaching ellipticity values higher than 13° and g-factor values up to 1.6, while the shape of the circular dichroism spectra depends strongly on the spacing between the layers which can be tuned at the nm-scale. The structure-dependent optical properties of the assembly are successfully modeled using a transfer matrix approach.

Chirality, as a fundamental property of molecules and materials, has been a major focus of interest in chemistry [START_REF] Sharpless | Searching for New Reactivity (Nobel Lecture)[END_REF][START_REF] Knowles | Asymmetric Hydrogenations (Nobel Lecture)[END_REF][START_REF] Noyori | Asymmetric Catalysis: Science and Opportunities (Nobel Lecture)[END_REF] since the seminal work of Louis Pasteur in 1848. [START_REF] Pasteur | Mémoire sur la relation qui peut exister entre la forme cristalline et la composition chimique, et sur la cause de la polarisation rotatoire[END_REF] In recent years, artificial chiral nanostructures have attracted much interest in the nanoscience and nanotechnology community for their wide potential of applications in a vast variety of fields, [START_REF] Kong | Plasmonic Chirality and Circular Dichroism in Bioassembled and Nonbiological Systems: Theoretical Background and Recent Progress[END_REF][START_REF] Hentschel | Chiral Plasmonics[END_REF][START_REF] Kumar | Recent Advances in Chiral Plasmonics -Towards Biomedical Applications[END_REF] in particular for sensing of (bio)molecules, [START_REF] Yoo | Metamaterials and chiral sensing: a review of fundamentals and applications[END_REF][START_REF] Hendry | Ultrasensitive Detection and Characterization of Biomolecules using Superchiral Fields[END_REF] optical recording [START_REF] Zijlstra | Five-dimensional Optical Recording Mediated by Surface Plasmons in Gold Nanorods[END_REF] , as broadband circular polarizers [START_REF] Gansel | Gold Helix Photonic Metamaterial as Broadband Circular Polarizer[END_REF] or in quantum materials based on optical cavities. [START_REF] Hübener | Engineering quantum materials with chiral optical cavities[END_REF] Many strategies from bottom-up to top-down approaches have been proposed for the fabrication of such nanomaterials. While top-down techniques are suited to produce well-defined micrometer-scale structures, they require expensive equipment, multistep processes and are not able to make nm-scale structures over large areas at low cost. [START_REF] Hendry | Ultrasensitive Detection and Characterization of Biomolecules using Superchiral Fields[END_REF][START_REF] Yin | Interpreting Chiral Nanophotonic Spectra: The Plasmonic Born-Kuhn Model[END_REF][START_REF] Chen | Metasurfaces with Planar Chiral Meta-Atoms for Spin Light Manipulation[END_REF] Bottom-up approaches have thus been proposed to tackle these challenges. [START_REF] Urban | Chiral Plasmonic Nanostructures Enabled by Bottom-Up Approaches[END_REF][START_REF] Ariga | Supramolecular Chiral Nanoarchitectonics[END_REF] One approach consists in using chiral molecules to template the shape of inorganic nanocrystals during their synthesis, which was successfully applied to synthesize chiral gold nanoparticles [START_REF] Lee | Cysteine-encoded chirality evolution in plasmonic rhombic dodecahedral gold nanoparticles[END_REF][START_REF] Lee | Amino-acid-and peptide-directed synthesis of chiral plasmonic gold nanoparticles[END_REF] and nanorods. [START_REF] González-Rubio | Micelle-Directed Chiral Seeded Growth on Anisotropic Gold Nanocrystals[END_REF] This strategy however relies on molecular templates with limited tunability, while a more flexible strategy consists in assembling achiral nanoparticles, ranging from isotropic metallic nanospheres to anisotropic 1D-nanobjects, into chiral configurations such as twisted nanorod mesostructures, [START_REF] Lan | Au Nanorod Helical Superstructures with Designed Chirality[END_REF][START_REF] Kuzyk | Reconfigurable 3D Plasmonic Metamolecules[END_REF] nanohelices [START_REF] Gao | Tuning the Chiroptical Properties of Elongated Nano-objects via Hierarchical Organization[END_REF][START_REF] Kuzyk | DNA-based Self-Assembly of Chiral Plasmonic Nanostructures with Tailored Optical Response[END_REF] and Bouligand nanostructures. [START_REF] Zhao | Twisted Optical Metamaterials for Planarized Ultrathin Broadband Circular Polarizers[END_REF][START_REF] Hu | Nanoscale Bouligand Multilayers: Giant Circular Dichroism of Helical Assemblies of Plasmonic 1D Nano-Objects[END_REF][START_REF] Lv | Biomimetic Chiral Photonic Crystals[END_REF] Those assemblies are often composed of noble metal nanoparticles as surface plasmon resonances in chiral structures have been shown to give rise to exceptionally high circular dichroism (CD) compared to chiral molecules. [START_REF] Guerrero-Martínez | Intense Optical Activity from Three-Dimensional Chiral Ordering of Plasmonic Nanoantennas[END_REF][START_REF] Probst | Mechano-tunable chiral metasurfaces via colloidal assembly[END_REF] Obtaining nanostructures that display intense CD bands that can be tuned to various frequency ranges is especially important for chiral sensing of molecules that have absorption bands in the UV and visible range and display inherently low chiroptical signals. Inter-particle interactions, plasmonic coupling in particular, play an important role in the emergence of chirality and the associated chiroptical properties of plasmonic metasurfaces, although solid interpretations of these observations are yet to be clearly provided. [START_REF] Mun | Electromagnetic chirality: from fundamentals to nontraditional chiroptical phenomena[END_REF] The controlled positioning of the repeating unit cells in those metamaterials allows engineering their far-field optical properties and their polarization-dependent transmittance, absorbance and reflectance. The collective response does not only derive from the bulk properties of the base materials and from the shape-dependent properties of the individual building blocks, but also from the orientation and arrangement of the individual building blocks. The approaches proposed up to now are often expensive or time-consuming or unable to produce large arrays with a well-controlled architecture. Furthermore, the highly structure-dependent properties cannot be tuned at will because the structural parameters (in particular the interparticle spacing and angle) are constrained by the template itself or by the fabrication method.

We have recently reported [START_REF] Hu | Nanoscale Bouligand Multilayers: Giant Circular Dichroism of Helical Assemblies of Plasmonic 1D Nano-Objects[END_REF] that scalable chiral Bouligand nanostructures whose mesoscale anisotropy is controlled with simple macroscopic tools can be prepared from non-chiral plasmonic nanowires and nanorods by combining Grazing Incidence Spraying [START_REF] Blell | Generating in-Plane Orientational Order in Multilayer Films Prepared by Spray-Assisted Layer-by-Layer Assembly[END_REF][START_REF] Sekar | Anisotropic Optical and Conductive Properties of Oriented 1D-Nanoparticle Thin Films made by Spray-Assisted Self-Assembly[END_REF][START_REF] Probst | Highly Oriented Nanowire Thin Films with Anisotropic Optical Properties Driven by the Simultaneous Influence of Surface Templating and Shear Forces[END_REF][START_REF] Hu | Spray-Assisted Alignment of Layer-by-Layer Assembled Silver Nanowires: a General Approach for the Preparation of Highly Anisotropic Nano-Composite Films[END_REF] and Layer-by-Layer assembly. [START_REF] Decher | Fuzzy Nanoassemblies: Toward Layered Polymeric Multicomposites[END_REF][START_REF] Zhao | The Future of Layer-by-Layer Assembly: A Tribute to ACS Nano Associate Editor Helmuth Möhwald[END_REF][START_REF] Richardson | Innovation in Layer-by-Layer Assembly[END_REF] The obtained chiral superstructures composed of two or three layers of oriented silver nanowires (AgNWs) or gold nanorods exhibit very strong chiroptical properties over the entire UV-Vis-NIR spectral range, while the fabrication process has proven to be exceptionally simple and efficient. Here, we show that our approach allows to finely tune the mesostructure, in particular the spacing between the plasmonic layers at a nm-scale and the angle between the oriented AgNW layers, which allows controlling the resulting chiroptical properties, giving rise to an extremely high CD over a broad spectral range. We also show that the structure-dependent optical properties can be successfully modeled using a transfer matrix approach.

Results and Discussion

The hybrid chiral plasmonic assemblies rely on the Layer-by-Layer assembly of twisted films of oriented AgNW layers separated by a dielectric polymeric spacer of controlled thickness. The bottom layer of AgNWs is deposited using Grazing Incidence Spraying of the nanowire suspension on a substrate previously coated with polyelectrolytes. The shear flow of the flowing liquid induces the oriented deposition of the AgNWs, leading to a monolayer of nanowires pointing in the same direction (Figure 1a) that displays highly linearly anisotropic optical properties, as shown previously. [START_REF] Hu | Spray-Assisted Alignment of Layer-by-Layer Assembled Silver Nanowires: a General Approach for the Preparation of Highly Anisotropic Nano-Composite Films[END_REF] The density in NWs can be easily controlled using the suspension concentration and the spraying time. Next, polyelectrolytes of opposite charges can be alternatively deposited to form a polyelectrolyte multilayer dielectric spacer of controlled thickness d (Figure 1b). We have used poly-(ethylene imine) (PEI) as the first polycation deposited on the nanowire layer, followed by negatively charged poly-(styrene sulfonate) (PSS) and positively charged poly-(allylamine hydrochloride) (PAH). The adsorption of each polymer layer is followed by a rinsing step, and the adsorption of the layer pair (PSS/PAH) can be repeated as many times as needed to reach the desired thickness. Finally, a layer of PEI is deposited on the last PSS layer. The substrate can then be rotated by an angle α before spraying the second layer of oriented AgNWs (Figure 1c). We have limited our study in this paper to films composed of 2 layers of AgNWs with a varying spacing d and a varying angle α but we have previously shown that this process can be continued to build films with more AgNW layers, or in which the nature of the plasmonic 1D-nanoobject can be varied. [START_REF] Hu | Nanoscale Bouligand Multilayers: Giant Circular Dichroism of Helical Assemblies of Plasmonic 1D Nano-Objects[END_REF] The hybrid chiral plasmonic assemblies rely on the Layer-by-Layer assembly of twisted films of oriented AgNW layers separated by a dielectric polymeric spacer of controlled thickness. The bottom layer of AgNWs is deposited using Grazing Incidence Spraying of a AgNW suspension on a substrate previously coated with polyelectrolytes. The shear flow of the flowing liquid induces the oriented deposition of the AgNWs, leading to a monolayer of nanowires pointing in the same direction (Figure 1a) that displays highly linearly anisotropic optical properties, as shown previously. [START_REF] Hu | Spray-Assisted Alignment of Layer-by-Layer Assembled Silver Nanowires: a General Approach for the Preparation of Highly Anisotropic Nano-Composite Films[END_REF] The density in NWs can be easily controlled using the suspension concentration and the spraying time. Next, polyelectrolytes of opposite charge can be alternatively deposited to form a polyelectrolyte multilayer dielectric spacer of controlled thickness d (Figure 1b). We have used poly-(ethylene imine) (PEI) as the first polycation deposited on the nanowire layer, followed by negatively charged poly-(styrene sulfonate) (PSS) and positively charged poly-(allylamine hydrochloride) (PAH). The adsorption of each polymer layer is followed by a rinsing step, and the adsorption of the layer pair (PSS/PAH) can be repeated as many times as needed to reach the desired thickness. Finally, a layer of PEI is deposited on the last PSS layer. The substrate can then be rotated by an angle α before spraying the second layer of oriented AgNWs (Figure 1c). We have limited our study in this paper to films composed of 2 layers of AgNWs with a varying spacing d and a varying angle α but we have previously shown that this process can be continued to build films with more AgNW layers, or in which the nature of the plasmonic 1D-nanoobject can be varied. [START_REF] Hu | Nanoscale Bouligand Multilayers: Giant Circular Dichroism of Helical Assemblies of Plasmonic 1D Nano-Objects[END_REF]

Effect of the angle α between AgNW layers

In order to probe the effect of the angle α between the AgNW layers, a series of two-layer structures have been prepared with a fixed interlayer spacing of 13 nm. The deposition sequence can be described as:

PEI/PSS/PAH/PSS/PEI/AgNWs 0°/PEI/(PSS/PAH)5/PSS/PEI/AgNWs α.

Depending on the sign of the angle α, left-handed or right-handed structures can be prepared, which lead to symmetric CD spectra (Figure S4). [START_REF] Hu | Nanoscale Bouligand Multilayers: Giant Circular Dichroism of Helical Assemblies of Plasmonic 1D Nano-Objects[END_REF] Here we focus on left-handed structures (Figure 1c), for which the angle α between the two layers of AgNWs was varied from 0° to 90° (Figure 2a). Samples with α = 0° or 90° have a CD close to 0, which is expected for non-chiral structures, while CD is maximum at α = 45° (Figure 2b). The dimensionless g-factor was calculated from the ellipticity θ using Equation 1 (the g-factor spectra are given in Figure S5):

𝑔 = = ( ) (1)
The g-factor, which quantifies the chiroptical anisotropy, reaches a maximum value of 0.3 at α = 45° and 385 nm. The g-factor is plotted as function of the angle α for λ = 385 nm and 800 nm as an example in Figure 2c, the normalized variation being the same for all wavelengths.

The CD of the superstructures have been modeled as function of the angle α at a fixed interlayer spacing (d = 13 nm) according to the Berreman transfer matrix formalism (BTM) [START_REF] Schubert | Polarization-Dependent Optical Parameters of Arbitrarily Anisotropic Homogeneous Layered Systems[END_REF] based on the measured optical properties of an AgNW oriented layer. The ordinary and extraordinary complex dielectric functions of a typical AgNW monolayer are fitted from measured reflection ellipsometry spectra (Figure S2) and are used to model the Mueller Matrix of the 2-layer chiral thin films at varying angle α, from which the CD is calculated (Figure 2d and Figure S6 andS7). [START_REF] Pérez | Polarized Light and the Mueller Matrix Approach[END_REF] The measured CD is well-reproduced by the simulations, with CD = 0 mdeg for α = 0° or 90° and CD being maximum for α = 45°, the position of the peaks being reasonably well reproduced. The polar spectrum of the CD intensity (Figure 2d) is centrosymmetric as α and α + 180° represent identical structures. Furthermore, enantiomorphic structures are obtained for α and -α, for which the CD has the same spectral shape with an opposite sign. Simulations of the Circular birefringence (CB) and of the Linear Dichroism (LD) and Birefringence (LB) for varying α can be found in the supporting information (Figure S6 andS7).

The measurements and simulations clearly show that the intensity of the CD can be very conveniently and easily tuned by controlling the angle between the AgNW layers. However, the spectral shape, in particular the position of the CD peaks does not depend on the angle α.

Varying distance d and fixed angle α.

The LbL-assembly approach allows to tune the polyelectrolyte multilayer thickness between two layers of AgNWs with a nanometer-scale precision. Indeed, the number of polyelectrolyte layers that constitute the dielectric spacer between the two plasmonic oriented layers can be chosen at will. We thus varied the number of polyelectrolyte layer pairs between two layers of AgNWs in order to tune the interlayer spacing d, while keeping the angle between the orientation of the two AgNW layers constant at 45°. The deposition sequence can be written as:

PEI/PSS/PAH/PSS/PEI/AgNWs 0°/PEI/(PSS/PAH)n/PSS/PEI/AgNWs 45°.

Figure 3a shows the cross-section SEM images of two-layer structures with different interlayer spacing d. The spacing is proportional to the number n of layer pairs of PSS/PAH (Figure 3b), and each polyelectrolyte layer pair has a thickness of 2.1 nm. The thickness of the polymer multilayer film refers to the interlayer spacing averaged from 10-20 different positions on the cross-section SEM images. The rather small error bar evidences the excellent smoothness of the thin films and thus the very good nm-scale control that is offered on the interlayer spacing.

g-factor spectra of the two-AgNW-layer structures with an angle fixed at α = 45° and the interlayer spacing d varying from 13 nm to 200 nm are shown in Figure 3c (the CD spectra are given in Figure S8, and the corresponding number of layer pairs n in Table S1). The influence of the interlayer spacing on the CD of the films is remarkable: while the negative CD peak at 385 nm is unchanged, the CD peaks in the visible range are red-shifted as the interlayer spacing increases, and for large spacing (d ≥ 100 nm), oscillations appear on the g-factor and CD spectra, reaching very high values. In particular, CD > 13 000 mdeg is obtained for d = 200 nm at λ = 1500 nm (Figure S8), while the extinction of the film is only 0.25, which reflects in a g-factor over 1.6 (Figure 3c). This exceptionally high value equals the highest g-factor value reported so far, [START_REF] Lv | Biomimetic Chiral Photonic Crystals[END_REF] but with a much simpler structure composed of only 2 plasmonic layers. The same trend is observed for samples with a spacer layers of a few micrometers (Figure S9), while the period of the oscillations is getting smaller when the spacing increases. The nm-scale control of the interlayer spacing thus allows tuning the shape of the CD and g-factor spectra (and in particular the wavelength of maximum CD) very easily over a large spectral range.

The LD/LB of thin films with strong linear anisotropies can induce artifacts on the CD measured with a commercial CD spectrometer, whereas all the contribution to the polarimetry (LD, LB, CD and CB) can be measured accurately with Mueller Matrix Polarimetry (MMP). We thus have carefully checked that the CD measured on a commercial CD spectrometer is in good agreement with the CD measured by MMP (Figure S11). Furthermore, the CD modeled using the transfer matrix approach (Figure S10 andS11) is in good agreement with the measured CD (Figure 3d and Figure S12), including the red-shifting of the peaks in the visible range of the spectra and the oscillations for larger spacing. However, even though the main features of the measurements are well-reproduced by the simulations, some differences can still be noted, especially regarding the amplitude and the exact wavelength at which the peaks appear. As the position of the CD peaks are shown to be highly sensitive to the interlayer spacing, a slight variation of a few % between the spacing in the modeled spectra and in the measured samples can significantly shift the wavelength of the main features of the CD spectra.

The CD spectra have features that do not depend on the spacing (like the negative peak at 385 nm and the broad positive band in the visible range) on which spacing-dependent "oscillations" are superimposed when the distance between the AgNW is larger enough. This latter feature resembles very much the interferences observed in transmission spectra of Fabry-Perot cavities. Indeed, these oscillations disappear and the CD spectra become spacing-independent if the reflections at interfaces are suppressed or if the polymer layer is modeled with vanishing coherence (Figure S3). This confirms that the interference-like oscillations in the CD spectra at large spacing are due to the reflective and anisotropic response of the nanowire layers.

Conclusion and discussion

We have shown that the chiroptical properties of chiral plasmonic films composed of two layers of oriented AgNWs can be finely tuned with simple design rules during their construction. The intensity of the CD depends directly on the angle between the 2 AgNW layers, the highest chiroptical signal being obtained when the angle α between the orientation of the two layers of AgNWs is 45°, while α = 0° or 90° are achiral structures with no CD. The position of the peaks in the CD spectra depend strongly on the spacing between the AgNW layers that can be controlled at a nm-scale using polyelectrolyte multilayers deposited by the LbL approach as a dielectric spacer. The peaks of the CD spectra in the visible and NIR range redshift with the increase of the interlayer spacing and oscillations of the spectra appear for large interlayer spacing (> 100 nm) due to interference-like effects arising from the polarizationdependent reflection at AgNW/polymer interfaces. An exceptionally high CD of more than 13° has been reached, which corresponds to a g-factor of 1.6.

All these optical characteristics are successively modeled using a transfer matrix approach based on the measured anisotropic properties of the individual layers and the structural parameters of the assembly (angle and spacing). Note that no coupling between the plasmon modes of the neighboring AgNWs is necessary to model the far-field response. Indeed, the modeling is based on the successive and independent interaction of the light beam with each layer of AgNWs and polymers. Each AgNW layer acts as a linearly polarizing filter (exhibiting both linear dichroism and birefringence), and the combination of those layers stacked at a certain angle and spacing induces circular birefringence and dichroism. However, when the two layers of AgNWs are close enough (typically below 100 nm), a coupling may occur between their localized surface plasmon resonance modes, which may also contribute to the CD and CB.

In conclusion, we have introduced in this work an easy way to tune the chiroptical properties of chiral nanostructures made from non-chiral commercially available products. We have shown that the large-scale structure can be finely controlled at the nanometer scale using a directed self-assembly approach. Although the proposed chiral structure is the most simple chiral assembly one could think of, it displays a huge broadband CD reaching extremely high g-factor values that can be easily tuned over the entire UV, Visible and NIR range with simple geometric parameters, which is not the case for most self-assembly techniques which rely on a template whose structure cannot be modified at will. Interestingly, the intensity of the CD can be modulated using the angle between the nanowire layers, while the shape of the CD spectrum depends on the spacing, which allows controlling independently the intensity and shape of CD spectra. Only commercially available products are used using simple equipment and room-temperature/ambient-pressure working conditions.

Chiral plasmonic metasurfaces can be used as polarization photodetectors, [START_REF] Li | Circularly polarized light detection with hot electrons in chiral plasmonic metamaterials[END_REF] for chiral second harmonic generation, [START_REF] Wang | Observation of a Giant Nonlinear Chiro-Optical Response in Planar Plasmonic-Photonic Metasurfaces[END_REF] to produce chiral forces for enantioseparation, [START_REF] Hayat | Lateral chiralitysorting optical forces[END_REF] for chiral catalysis [START_REF] Pedrueza-Villalmanzo | Perspective: plasmon antennas for nanoscale chiral chemistry[END_REF] or for sensing. [START_REF] Lee | Plasmonic metamaterials for chiral sensing applications[END_REF] All these applications require metasurfaces which produce a very high CD and whose optical properties can be tuned to match the desired application. The structure tunability demonstrated here give simple design rules to prepare efficient metasurfaces with targeted properties. The proposed approach also allows making more complex nanostructures in which various materials (like nanoparticles or functional (bio)-molecules) can be placed at a well-controlled position within the assembly, opening perspectives for a variety of applications in photonics, optoelectronic, biosensing and chiral catalysis.

ASSOCIATED CONTENT Supporting Information

The Supporting Information is available free of charge on the ACS Publications website. Chemicals used, sample fabrication details, modelling methods, discussion on the origin of the oscillations in the CD spectra and supplementary data: CD spectra for left-handed and right-handed samples, CD and g-factor spectra of 2-layer samples oriented at a varying angle α and varying spacing d, modeled spectra of LD, LB, CD and CB as function of spacing d and angle α, comparison of modeled CD spectra with CD spectra measured by MMP and CD spectrometry (PDF).

Figure 1 .

 1 Figure 1. Scheme of the sample fabrication. a) A first layer of oriented silver nanowires (AgNWs, d ≈ 60 nm, L ≈ 3-5 μm) is formed by Grazing Incidence Spraying on a PEI-coated substrate, b) before depositing a polyelectrolyte multilayer dielectric spacer (PEI/(PSS/PAH)n/PSS/PEI) of a precisely tunable thickness d by Layer-by-Layer assembly of polyelectrolytes. c) Finally, the sample can be rotated by an arbitrary angle α before depositing the oriented AgNW top layer.

Figure 2 .

 2 Figure 2. Variation of the angle α between the AgNW layers. a) SEM images of two-layer structures with a fixed interlayer spacing d = 13 nm and with a varying angle α. b) CD spectra measured in the UV-Vis-NIR range for samples with a varying angle α, from which c) the g-factor measured at 385 nm and 800 nm as function of the angle α is calculated. d) Modeled CD of two-layer structures with a fixed interlayer spacing d = 13 nm as function of the angle α. The radius corresponds to the wavelength, the angular coordinate to the angle α between the AgNW layers and the color scale to CD in mdeg.

Figure 3 .

 3 Figure 3. Variation of the spacing d between the AgNW layers. a) Cross-section SEM images of two-layer structures with varying interlayer spacing d. b) Interlayer spacing d as a function of number of PSS/PAH layer pairs n. c) g-factor spectra of two-layer structures with increasing interlayer spacing d. d) Measured (left) and modeled (right) CD spectra as function of the interlayer spacing d (note the different wavelength scale and the different color scale coding for the CD in mdeg).

ACKNOWLEDGMENT

The authors wish to thank the Electron microscopy platform of the Institute Charles Sadron for their help in the characterization of the multilayer samples, the ellipsometry core facility of LCP-A2MC (Université de Lorraine, http://lcp-a2mc.univ-lorraine.fr). W.W. acknowledges financial support of the China Scholarship Council and V.L. thanks the LabEx CSC "Chemistry of Complex Systems" 10-LABX-0026 for financial support.

AUTHOR INFORMATION

Corresponding Author matthias.pauly@ics-cnrs.unistra.fr

Author Contributions

M.P. and G.D conceived and supervised the study. W.W. and V.L. fabricated and characterized the samples. Y.B. measured the MMP spectra and performed the modeling. W.W and M.P. analyzed the data and wrote the manuscript, with help of all authors.

Notes

The authors declare no competing financial interests.

SYNOPSIS TOC


Annabelle Gillet

Éric Leclercq
email: eric.leclercq@u-bourgogne.fr

Nadine Cullot
email: nadine.cullot@u-bourgogne.fr

MuLOT: Multi-level Optimization of the Canonical Polyadic Tensor Decomposition at Large-Scale

Keywords: Tensor decomposition, Data mining, Multi-dimensional analytics

come   L'archive ouverte pluridisciplinaire

Introduction

Tensors are powerful mathematical objects, which bring capabilities to model multi-dimensional data [START_REF] Cichocki | Nonnegative matrix and tensor factorizations: applications to exploratory multi-way data analysis and blind source separation[END_REF]. They are used in multiple analytics frameworks, such as Tensorflow [START_REF] Abadi | Tensorflow: A system for large-scale machine learning[END_REF], PyTorch [START_REF] Paszke | PyTorch: An imperative style, high-performance deep learning library[END_REF], Theano [START_REF] Al-Rfou | Theano: A Python framework for fast computation of mathematical expressions[END_REF], TensorLy [START_REF] Kossaifi | Tensorly: Tensor learning in python[END_REF], where their ability to represent various models is a great advantage. Furthermore, associated with powerful decompositions, they can be used to discover the hidden value of Big Data. Tensor decompositions are used for various purposes such as dimensionality reduction, noise elimination, identification of latent factors, pattern discovery, ranking, recommendation and data completion. They are applied in a wide range of applications, including genomics [START_REF] Hore | Tensor decomposition for multiple-tissue gene expression experiments[END_REF], analysis of health records [START_REF] Yang | Tagited: Predictive task guided tensor decomposition for representation learning from electronic health records[END_REF], graph mining [START_REF] Sun | Beyond streams and graphs: dynamic tensor analysis[END_REF] and complex networks analysis [START_REF] Papalexakis | Do more views of a graph help? community detection and clustering in multi-graphs[END_REF][START_REF] Araujo | Com2: fast automatic discovery of temporal ('comet') communities[END_REF]. Papalexakis et al. in [START_REF] Papalexakis | Tensors for data mining and data fusion: Models, applications, and scalable algorithms[END_REF] review major usages of tensor decompositions in data mining applications.

Most of tensor libraries that include decompositions work with tensors of limited size, and do not consider the large-scale challenge. However, as tensors model multi-dimensional data, their global size varies exponentially depending on the number and size of their dimensions, making them sensitive to largescale issues. Some intermediate structures needed in the algorithms result in data explosion, such as the Khatri-Rao product in the canonical polyadic decomposition [START_REF] Jeon | Haten2: Billion-scale tensor decompositions[END_REF]. Thus, analyzing Big Data with tensors requires optimization techniques and suitable implementations, able to scale up. These optimizations are directed toward different computational aspects, such as the memory consumption, the execution time or the scaling capabilities, and can follow different principles, such as coarse grained optimizations, fine grained optimizations or incremental computations.

In this article we focus on the canonical polyadic decomposition (also known as CANDECOMP/PARAFAC or CP decomposition) that allows to factorize a tensor into smaller and more usable sets of vectors [START_REF] Kolda | Tensor decompositions and applications[END_REF], and which is largely adopted in exploratory analyzes. Our contribution is twofold: 1) we propose an optimized algorithm to achieve large scale CP decomposition, that uses dense or sparse data structures depending on what suits best each step, and that leverages incremental computation, coarse and fine grained optimizations to improve every computation in the algorithm ; and 2) we provide an implementation in Scala using Spark that outperforms the state of the art of large-scale tensor CP decomposition libraries. The implementation is open source and available on Github 1 , along with experimental evaluations to validate its efficiency especially at large scale.

The rest of the article is organized as follows: section 2 presents an overview of tensors including the CP decomposition, section 3 introduces a state of the art of tensor manipulation libraries, section 4 describes our scalable and optimized algorithm, section 5 details the experiments we ran to compare our algorithm to other large-scale CP decomposition libraries, section 6 presents a study on real data performed with our algorithm and finally section 7 concludes.

Overview of tensors and CP decomposition

Tensors are general abstract mathematical objects which can be considered according to various points of view such as a multi-linear application, or as the generalization of matrices to multiple dimensions. We will use the definition of a tensor as an element of the set of the functions from the product of N sets

I j , j = 1, . . . , N to R : X ∈ R I 1 ×I 2 ו••×I N ,
where N is the number of dimensions of the tensor or its order or its mode. Table 1 summarizes the notations used in this article.

Tensor operations, by analogy with operations on matrices and vectors, are multiplications, transpositions, unfolding or matricizations and factorizations (also named decompositions) [START_REF] Kolda | Tensor decompositions and applications[END_REF][START_REF] Cichocki | Nonnegative matrix and tensor factorizations: applications to exploratory multi-way data analysis and blind source separation[END_REF]. The reader can consult these references for an overview of the major operators. We only highlight the most significant operators on tensors which are used in our algorithm. The mode-n matricization of a tensor

X ∈ R I 1 ×I 2 ו••×I N noted X (n) produces a matrix M ∈ R I n ×Π j n I j . The
Hadamard product of two matrices having the same size (i.e., I × J) noted A * B is the elementwise matrix product. The Kronecker product between a matrix A ∈ R I×J and a matrix B ∈ R K×L noted A ⊗ B gives a matrix C ∈ R (IK)× (JL) , where each element of A is multiplied by B. The Khatri-Rao product of two matrices having the same number of columns noted A B is a columnwise Kronecker product. The canonical polyadic decomposition allows to factorize a tensor into smaller and more exploitable sets of vectors [START_REF] Harshman | Foundations of the PARAFAC procedure: Models and conditions for an" explanatory[END_REF][START_REF] Rabanser | Introduction to tensor decompositions and their applications in machine learning[END_REF]. Given a N-order tensor X ∈ R I 1 ×I 2 ו••×I N and a rank R ∈ N, the CP decomposition factorizes the tensor X into N column-normalized factor matrices A (i) ∈ R I i ×R for i = 1, . . . , N with their scaling factors λ ∈ R R as follows: X λ, A (1) , A (2) , . . . ,

A (N) = R r=1 λ r a (1)
r • a (2) r • • • • • a (N) r
where a

(i)
r are columns of A (i) .

Algorithm 1 CP-ALS

Require: Tensor X ∈ R I 1 ×I 2 ו••×I N and target rank R 1: Initialize A (1) , . . . , A (N) , with A (n) ∈ R In×R 2: repeat 3: for n = 1, . . . , N do 4:

V ← A (1)T A (1) * . . . * A (n-1)T A (n-1) * A (n+1)T A (n+1) * . . . * A (N)T A (N) 5:

A (n) ← X (n) (A (N) • • • A (n+1) A (n-1) • • • A (1) )V † 6: normalize columns of A (n) 7: λ ← norms of A (n) 8:
end for 9: until < convergence > Several algorithms have been proposed to compute the CP decomposition [START_REF] Sidiropoulos | Tensor decomposition for signal processing and machine learning[END_REF], we focus on the alternating least squares (ALS) one, described above in algorithm 1. The Matricized Tensor Times Khatri-Rao Product (MTTKRP, line 5 of the algorithm 1) is often the target of optimizations, because it involves the tensor matricized of size R I n ×J , with J = Π j n I j , as well as the result of the Khatri-Rao product of size R J×R . It is thus computationally demanding and uses a lot of memory to store the dense temporary matrix resulting of the Khatri-Rao product [START_REF] Phan | Fast alternating ls algorithms for high order candecomp/parafac tensor factorizations[END_REF].

State of the art

Several tensor libraries have been proposed. They can be classified according to their capability of handling large tensors or not.

rTensor (http://jamesyili.github.io/rTensor/) provides users with standard operators to manipulate tensors in R language including tensor decompositions, but does not support sparse tensors. Tensor Algebra Compiler (TACO) provides optimized tensor operators in C++ [START_REF] Kjolstad | The tensor algebra compiler[END_REF]. High-Performance Tensor Transpose [START_REF] Springer | Hptt: a high-performance tensor transposition c++ library[END_REF] is a C++ library only for tensor transpositions, thus it lacks lots of useful operators. Tensor libraries for MATLAB, such as TensorToolbox (https://www.tensortoolbox.org/) or MATLAB Tensor Tools (MTT, https: //github.com/andrewssobral/mtt), usually focus on operators including tensor decompositions with optimization on CPU or GPU. TensorLy [START_REF] Kossaifi | Tensorly: Tensor learning in python[END_REF], written in Python, allows to switch between tensor libraries back-ends such as TensorFlow or PyTorch. All of these libraries do not take into account large tensors, which cannot fit in memory.

On the other hand, some implementations focus on performing decompositions on large-scale tensors in a distributed setting. HaTen2 [START_REF] Jeon | Haten2: Billion-scale tensor decompositions[END_REF] is a Hadoop implementation of the CP and Tucker decompositions using the map-reduce paradigm. It was later improved with BigTensor [START_REF] Park | Bigtensor: Mining billion-scale tensor made easy[END_REF]. SamBaTen [START_REF] Gujral | Sambaten: Sampling-based batch incremental tensor decomposition[END_REF] proposes an incremental CP decomposition for evolving tensors. The authors developed a Matlab and a Spark implementations. Gudibanda et al. in [START_REF] Gudibanda | All-at-once decomposition of coupled billion-scale tensors in apache spark[END_REF] developed a CP decomposition for coupled tensors using Spark (i.e., different tensors having a dimension in common). ParCube [START_REF] Papalexakis | ParCube: Sparse parallelizable CANDECOMP-PARAFAC tensor decomposition[END_REF] is a parallel Matlab implementation of the CP decomposition. CSTF [START_REF] Blanco | Cstf: Large-scale sparse tensor factorizations on distributed platforms[END_REF] is based on Spark and proposes a distributed CP decomposition.

As a conclusion, the study of the state of the art shows some limitations of the proposed solutions. A majority of frameworks are limited to 3 or 4 dimensions which is a drawback for analyzing large-scale, real and complex data. They focus on a specific type of optimization, and use only sparse structures to satisfy the sparsity of large tensors. This is a bottleneck to performance, as they do not consider all the characteristics of the algorithm (i.e., the factor matrices are dense). Furthermore, they are not really data centric, as they need an input only with integer indexes, for dimensions and for values of dimensions. Thus it reduces greatly the user-friendliness as the mapping between real values (e.g., user name or timestamp) and indexes has to be supported by the user. The Hadoop implementations need a particular input format, thus necessitate data transformations to execute the decomposition and to interpret the results, leading to laborious prerequisites and increasing the risk of mistakes when working with the results. Moreover, not all of the implementations are opensource, some only give the binary code.

Distrtibuted, scalable and optimized ALS for Apache Spark

Optimizing the CP ALS tensor decomposition induces several technical challenges, that gain importance proportionally to the size of the data. Thus, to compute the decomposition at large scale, several issues have to be resolved.

First, the data explosion of the MTTKRP is a serious computational bottleneck (line 5 of algorithm 1), that can overflow memory, and prevent to work with large tensors, even if they are extremely sparse. Indeed, the matrix produced by the Khatri-Rao has J × R non-zero elements, with J = Π j n I j , for an input tensor of size R I 1 ×I 2 ו••×I N . We propose to reorder carefully this operation, in order to avoid the data explosion and to improve significantly the execution time (see algorithm 3).

The main operations in the ALS algorithm, i.e., the update of the factor matrices, are not themselves parallelizable (lines 4 and 5 of algorithm 1). In such a situation, it is profitable to think of other methods to take advantage of parallelism, that could be applied on fine grained operations. For example, leveraging parallelism for matrices multiplication is an optimization that can be applied in many situations. This also eases the reuse of such optimizations, without expecting specific characteristics from the algorithm (see section 4.2).

The nature of data structures used in the CP decomposition are mixed: tensors are often sparse, while factor matrices are dense. Their needs to be efficiently implemented diverge, so rather than sticking globally to sparse data structures to match the sparsity of tensors, each structure should take advantage of their particularities to improve the whole execution (see section 4.1). To the best of our knowledge, this strategy has not been explored by others.

The stopping criterion can also be a bottleneck. In distributed implementations of the CP ALS, the main solutions used to stop the algorithm are to wait for a fixed number of iterations, or to compute the Frobenius norm on the difference between the input tensor and the tensor reconstructed from the factor matrices. The first solution severely lacks in precision, and the second is computationally demanding as it involves outer products between all the factor matrices. However, an other option is available to check the convergence, and consists in measuring the similarity of the factor matrices between two iterations, evoked in [START_REF] Cichocki | Nonnegative matrix and tensor factorizations: applications to exploratory multi-way data analysis and blind source separation[END_REF][START_REF] Kolda | Tensor decompositions and applications[END_REF]. It is a very efficient solution at large-scale, as it merges precision and light computations (see section 4.3).

Finally, the implementation should facilitate the data loading, and avoid data transformations only needed to fit the expected input of the algorithm. It should also produce easily interpretable results, and minimize the risk of errors induced by laborious data manipulations (see section 4.4). The study of the state of the art of tensor libraries shows that tensors are often used as multi dimensional arrays, that are manipulated through their indexes, even if they represent real world data. The mapping between indexes and values is delegated to the user, although being an error-prone step. As it is a common task, it should be handled by the library.

To tackle these challenges, we leverage three optimization principles to develop an efficient decomposition: coarse grained optimization, fine grained optimization, and incremental computation. The coarse grained one relies on specific data structures and capabilities of Spark to efficiently distribute operations. The incremental computation is used to avoid to compute the whole Hadamard product at each iteration. The fine grained optimization is applied on the MTTKRP to reduce the storage of large amount of data and costly computations. For this, we have extended Spark's matrices with the operations needed for the CP decomposition. In addition, we choose to use an adapted converging criteria, efficient at large-scale. For the implementation of the algorithm, we take a data centric point of view to facilitate the loading of data and the interpretation of the results. Our CP decomposition implementation is thus able to process tensors with billions of elements (i.e., non zero entries) on a mid-range workstation, and small and medium size tensors can be processed in a short time on a low-end personal computer.

Distributed and scalable matrix data structures

A simple but efficient sparse matrix storage structure is COO (COOrdinate storage) [START_REF] Ahmed | A framework for sparse matrix code synthesis from high-level specifications[END_REF][START_REF] Goharian | Comparative analysis of sparse matrix algorithms for information retrieval[END_REF]. The CoordinateMatrix, available in the mllib package of Spark [START_REF] Bosagh Zadeh | Matrix computations and optimization in apache spark[END_REF], is one of those structures, that stores only the coordinates and the value of each existing element in a RDD (Resilient Distributed Datasets). It is well suited to process sparse matrices. X Fig. 1: Blocks mapping for a multiplication between two BlockMatrix Another useful structure is the BlockMatrix. It is composed of multiple blocks containing each a fragment of the global matrix. Operations can be parallelized by executing it on each sub-matrix. For binary operations such as multiplication, only blocks from each BlockMatrix that will be associated are sent to each other, and the result is then aggregated if needed (see figure 1). It is thus an efficient structure for dense matrices, and allows distributed computations to process all blocks.

Unfortunately, only some basic operations are available for BlockMatrix, such as multiplication or addition. The more complex ones, such as the Hadamard and Khatri-Rao products, are missing. We have extended Spark BlockMatrix with more advanced operations, that keep the coarse grained optimization logic of the multiplication. We also added new operations, that involve BlockMatrix and CoordinateMatrix to take advantage of the both structures for our optimized MTTKRP (see below).

Mixing three principles of optimization

Tensors have generally a high level of sparsity. In the CP decomposition, they only appear under their matricized form, thus they are naturally manipulated as CoordinateMatrix in our implementation. On the other hand, the factor matrices A of the CP decomposition are dense, because they hold information for each value of each dimension. They greatly benefit from the capabilities of the extended BlockMatrix we developed. By using the most suitable structure for each part of the algorithm, we leverage specific optimizations that can speed up the whole algorithm.

Algorithm 2 CP-ALS adapted to Spark

Require: Tensor X ∈ R I 1 ×I 2 ו••×I N and target rank R 1: Initialize A (1) , . . . , A (N) , with n+1) , A (n-1) , . . . , A (1) ))V † 7:

A (n) ∈ R In×R 2: V ← A (1)T A (1) * . . . * A (N)T A (N) 3: repeat 4: for n = 1, . . . , N do 5: V ← V A (n)T A (n) 6: A (n) ← MTTKRP(X (n) , (A (N) , . . . , A (
V ← V * A (n)T A (n) 8:
normalize columns of A (n) 9:

λ ← norms of A (n) 10:

end for 11: until < convergence > Besides to using and improving Spark's matrices according to the specificities of data, we also have introduced fine grained optimization and incremental computing into the algorithm to avoid costly operations in terms of memory and execution time. Those improvements are synthesized in algorithm 2 and explained below.

First, to avoid computing V completely at each iteration for each dimension, we propose to do it incrementally. Before iterating, we calculate the Hadamard product for all A (line 2 of the algorithm 2). At the beginning of the iteration, A (n)T A (n) is element-wise divided from V, giving the expected result at this step (line 5 of the algorithm 2). At the end of the iteration, the Hadamard product between the new A (n)T A (n) and V prepares V for the next iteration (line 7 of the algorithm 2).

The MTTKRP part (line 6 of the algorithm 2) is sensitive to improvement, as stated in section 2. Indeed, by focusing on the result rather than on the operation, it can be easily reordered. For example, if we multiply a 3-order tensor matricized on dimension 1 with the result of A (3) A (2) , we can notice that in the result, the indexes of the dimensions in the tensor X correspond directly to those in the matrices A (3) and A (2) . This behaviour is represented below -with notation shortcut B i = A (2) (i, 1) and C i = A (3) (i, 1) -in an example simplified with only one rank:

a 1 b 1 c 1 a 1 b 2 c 1 a 1 b 1 c 2 a 1 b 2 c 2 a 2 b 1 c 1 a 2 b 2 c 1 a 2 b 1 c 2 a 2 b 2 c 2 ×             B 1 C 1 B 2 C 1 B 1 C 2 B 2 C 2             = a 1 b 1 c 1 .B 1 C 1 + a 1 b 2 c 1 .B 2 C 1 + a 1 b 1 c 2 .B 1 C 2 + a 1 b 2 c 2 .B 2 C 2 a 2 b 1 c 1 .B 1 C 1 + a 2 b 2 c 1 .B 2 C 1 + a 2 b 1 c 2 .B 1 C 2 + a 2 b 2 c 2 .B 2 C 2
Thus, rather than computing the full Khatri-Rao product and performing the multiplication with the matricized tensor, we apply a fine grained optimization that takes advantage of the mapping of indexes, and that anticipates the construction of the final matrix. For each entry of the CoordinateMatrix of the matricized tensor (i.e., all non-zero values), we find in each factor matrix A which element will be used, and compute elements of the final matrix (algorithm 3).

Algorithm 3 Detail of the MTTKRP

Require: The index of the factor matrix n, the matricized tensor X (n) ∈ R In×J with J = Π j n I j and A (1) , . . . , A (n-1) , A (n+1) , . . . , A (N) , with

A (i) ∈ R I i ×R 1: Initialize A (n) at 0, with A (n) ∈ R In×R 2: for each (x, y, v) in X (n) with
x, y the coordinates and v the value do 3:

for r = 1, . . . , R do 4:

value ← v 5:

for each A (i) with i n do 6: c ← extract A (i) coordinate from y 7:

value ← value × A (i) (c, r) 8:

end for 9:

A (n) (x, r) ← A (n) (x, r) + value 10:
end for 11: end for

Stopping criterion

To evaluate the convergence of the algorithm and when it can be stopped, a majority of CP decomposition implementations uses the Frobenius norm on the difference between the original tensor and the reconstructed tensor from the factor matrices. However, at large-scale the reconstruction of the tensor from the factor matrices is an expensive computation, even more than the naive MTTKRP. Waiting for a predetermined number of iterations is not very effective to avoid unnecessary iterations. Thus, other stopping criteria such as the evaluation of the difference between the factor matrices with those of the previous iteration [START_REF] Cichocki | Nonnegative matrix and tensor factorizations: applications to exploratory multi-way data analysis and blind source separation[END_REF][START_REF] Kolda | Tensor decompositions and applications[END_REF] are much more interesting, as they work on smaller chunks of data. To this end, we use the Factor Match Score (FMS) [START_REF] Chi | On tensors, sparsity, and nonnegative factorizations[END_REF] to measure the difference between factor matrices of the current iteration ( λ, A (1) , A (2) , . . . , A (N) ) and those of the previous iteration ( λ, Â(1) , Â(2) , . . . , Â(N) ). The FMS is defined as follows:

FMS = 1 R R r=1 1 - ξ - ξ max(ξ, ξ) N n=1 a (n)T r â(n) r a (n) r . â(n) r where ξ = λ r N n=1 a (n) r and ξ = λr N n=1 â(n) r

Data centric implementation

Our implementation of the CP decomposition, in addition to being able to run with any number of dimensions, is data centric: it takes a Spark DataFrame as input to execute the CP directly on real data. Thus, it benefits from Spark capabilities to retrieve data directly from various datasources. A specific column of the DataFrame contains the values of the tensor and all the other columns contain the values for each dimension. The CP operators returns a map associating the original names of the dimensions to a new DataFrame with three columns for each dimension: the dimension's values, the rank, and the value computed by the CP decomposition. By using DataFrame as input, we allow the use of any type as dimensions' values. For example, users could create a DataFrame with four columns: username, hashtag, time and value, with username and hashtag being of type String in order to easily interpret the decomposition result. This avoids having to handle an intermediate data structure containing the mapping between indexes and real values, and thus reduces the risk of mistakes when transforming data.

Experiments

To validate our algorithm, we have run experiments on tensors produced by varying the size of dimensions and the sparsity, on a Dell PowerEdge R740 server (Intel(R) Xeon(R) Silver 4210 CPU @ 2.20GHz, 20 cores, 256GB RAM). We compare our execution time to those of the baseline of distributed CP tensor decomposition libraries available: HaTen2 [START_REF] Jeon | Haten2: Billion-scale tensor decompositions[END_REF], BigTensor [START_REF] Park | Bigtensor: Mining billion-scale tensor made easy[END_REF], SamBaTen [START_REF] Gujral | Sambaten: Sampling-based batch incremental tensor decomposition[END_REF] and CSTF [START_REF] Blanco | Cstf: Large-scale sparse tensor factorizations on distributed platforms[END_REF]. Hadoop 2.6.0 was used to execute HaTen and BigTensor. We also study the scalabiliy of MuLOT by varying the number of cores used by Spark. Tensors were created randomly with 3 dimensions of the same size, from 100 to 100k. The sparsity ranges from 10 -1 to 10 -9 , and tensors were created only if the number of non-zero elements is superior to 3 × size and inferior or equal to 1B (with dimensions of size 100 and 1 000, tensors can only have respectively 10 6 and 10 9 non-zero elements at most, with a sparsity up to 10 -1 they cannot reach 1B elements, but respectively 10 5 and 10 8 non-zero elements). We have run the CP decomposition for 5 iterations, and have measured the execution time. Results are shown in figure 2. The source code of the experiments and the tool used to create tensors are available at https://github.com/AnnabelleGillet/ MuLOT/tree/main/experiments.

Our implementation clearly outperforms the state of the art, with speed-up reaching several order of magnitude. CSTF keeps up concerning the execution time of small tensors, but is no match for large tensors, and cannot compute the decomposition for tensors with 1B elements. Execution times of MuLOT are nearly linear following the number of non-zero elements. The optimization techniques applied show efficient results even for very large tensors of billion elements, with a maximum execution time for a 3-order tensor with dimensions of size 100k of 62 minutes, while the closest, BigTensor, takes 547 minutes. It also does not induce a high overhead for small tensors, as the decomposition on those with dimensions of size 100 takes less than 10 seconds. We also studied the scalability of our algorithm (figure 3). We measured the speed-up depending on the number of cores used by Spark. Our algorithm shows a sub-linear scalability, but without a big gap. The scalability is an important property for large-scale computations.

Real data study

We have experimented our decomposition in the context of Cocktail2 , an interdisciplinary research project aiming to study trends and weak signals in discourses about food and health on Twitter. In order to test our decomposition on real data, we focus on french tweets revolving around COVID-19 vaccines, harvested with Hydre, a high performance plateforme to collect, store and analyze tweets [START_REF] Gillet | Lambda+, the renewal of the Lambda Architecture: Category Theory to the rescue (to be published)[END_REF]. The corpus contains 9 millions of tweets from the period of November 18th 2020 to January 26th 2021.

We would like to study the communication patterns in our corpus. To this end, we have built a 3-order tensor, with a dimension representing the users, another the hashtags and the last one the time (with a week granularity). For each user, we kept only the hashtags that he had used at least five times on the whole period. The size of the tensor is 10340 × 5469 × 80, with 135k non-zero elements. We have run the CP decomposition with 20 ranks.

This decomposition allowed us to discover meaningful insights on our data, some of the most interesting ranks have been represented in figure 4 (the accounts have been anonymised). We have a background discourse talking about lockdown and curfew, with some hashtags related to media and the French Prime Minister. It corresponds to the major actuality subjects being discussed around the vaccines.

It also reveals more subject-oriented patterns, with one being anti-Blanquer (the French Minister of Education), where accounts that seem to belong to highschool teachers use strong hashtags against the Minister (the translation of some of the hashtags are: Blanquer lies, Blanquer quits, ghost protocol, the protocol refers to the health protocol in french schools). We can identify in this pattern a strong movement of disagreement, with teachers and parents worrying about the efficiency and the applicability of the measures took to allow schools to stay open during the pandemic.

Another pattern appears to be anti-government, with some signs of conspiracy. They use hashtags such as health dictatorship, great reset, deep state corruption, wake up, we are the people, disobey, etc. Indeed, the pandemic inspired a rise in doubt and opposition to some decisions of the government to handle the situation, that sometimes lead to conspiracy theories.

It is interesting to see that the CP decomposition is able to highlight some isolated patterns. With this capability, we identify a bot in our corpus, that quotes tweets that it judges as conspiracy-oriented, and gives them a score to measure the degree of conspiracy.

The CP decomposition is well-suited to real case studies. It is a great tool for our project, as it shows promising capabilities to detect patterns in data along tensor dimensions, with a good execution time. The results given by the decomposition can be easily interpreted and visualized: they can be shared with researchers in social science to specify the meaning of each rank, and thus giving valuable insights on the corpus.

Conclusion

We have proposed an optimized algorithm for the CP decomposition at largescale. We have validated this algorithm with a Spark implementation, and shows that it outperforms the state of the art by several orders of magnitude. We also put data at the core of tensors, by taking care of the mapping between indexes and values without involving the user, thus allowing to focus on data and analyses. Through experiments, we proved that our library is well-suited for small to large-scale tensors, and that it can be used to run the CP decomposition on low-end computers for small and medium tensors, hence making possible a wide range of use cases.

We plan to continue our work on tensor decompositions by 1) exploring their use in social networks analyzes ; 2) developing other tensor decompositions such as Tucker, HOSVD or DEDICOM ; and 3) studying the impact of the choice of the norm for the scaling of the factor matrices.

Fig. 2 :

 2 Fig. 2: Execution time for tensors with 3 dimensions of size 100 (top-left), 1 000 (top-right), 10 000 (bottom-left) and 100 000 (bottom-right). CSTF produces an Out Of Memory exception for tensors with 1B elements

Fig. 3 :

 3 Fig. 3: Near-linear scalability of our algorithm

Fig. 4 :

 4 Fig. 4: Communication patterns in the vaccine corpus (from top to bottom): the anti-Blanquer, the conspirators/anti-government, the background speech, and a bot to measure conspiracy score of tweets

Table 1 :

 1 Symbols and operators used

	Symbol Definition	Symbol Definition
	X	A tensor	•	Outer product
	X (n)	Matricization of a tensor X	⊗	Kronecker product
		on mode-n	*	Hadamard product
	a	A scalar		Hadamard division
	v	A column vector		Khatri-Rao product
	M	A matrix	†	Pseudo inverse

https://projet-cocktail.fr/

Acknowledgments This work is supported by ISITE-BFC (ANR-15-IDEX-0003) coordinated by G. Brachotte, CIMEOS Laboratory (EA 4177), University of Burgundy.