J Andreas Baerentzen

Jeppe Revall Frisvad

Jonàs Martínez

Curl Noise Jittering

Keywords: Computing methodologies → Computer graphics jittered grid, curl noise, blue noise

à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

INTRODUCTION

Sampling points in a 2D or a 3D domain is a common task in computer graphics. Several applications favor so-called blue noise sampling [START_REF] Robert | Dithering with blue noise[END_REF]]. Since colors of noise are defined in analogy with colors of light, blue means that the spectrum of the noise predominantly contains high frequencies. Spatially, this translates to point samples spread isotropically and evenly over the domain so that no two points are too close together. When using point collections for applications such as procedural generation of cellular materials or foams, distributing scattered objects, or sampling, broadly, blueness is an important property.

Poisson disk sampling [START_REF] Robert | Stochastic sampling in computer graphics[END_REF]], also known as random sequential adsorption [START_REF] Feder | Random sequential adsorption[END_REF]], is a classical algorithm for computing a blue noise sampling. The principle is to generate random points but reject anyone too close to a previously added point. Figure 4 (rightmost column) shows an example of a Poisson disk sampling. Compared to jittering points on a regular grid, the corresponding frequency spectrum is "bluer", i.e., there is a wider gap between the central peak and the halo of noise surrounding it.

The rejection scheme used in the original Poisson disk sampling is slow -especially as the domain starts filling up, and more sampled points are likely to be rejected. Subsequent works have significantly improved computational efficiency and blue noise sampling quality. However, almost all approaches require the entire point set to be computed and stored. This is unsuitable for applications where we only seek to determine a small subset of sample points or where storing the entire point set is infeasible. Applications that require this property usually resort to approaches based on jittering, where points within a grid are randomly perturbed within each grid cell [START_REF] Robert | Stochastic sampling in computer graphics[END_REF]]. This makes it possible to find the closest sample by inspecting only the jittered positions of lattice points within a certain distance of the query point, and the positions of the rest of the points do not need to be computed.

In this paper, we refer to a method for generating a point collection as implicit when it provides the point closest to a query point without generating the entire collection and independently of the size of the collection. Our key insight is that displacing the points of a regular lattice along a curl noise [START_REF] Bridson | Curl-noise for procedural fluid flow[END_REF] vector field enhances the blue noise sampling quality (Figure 1). Since the displacements are small, our method can be considered a jittering approach, and it is possible to define an implicit method for generating point collections jittered by curl noise.

Curl noise is a divergence-free vector noise designed to emulate the velocity field of incompressible, turbulent fluids. Because curl noise is divergence-free, it contains neither sources nor sinks, which is important for our purposes. We carefully choose the curl noise parameters to achieve a balanced tradeoff between point set quality and computational efficiency. Notably, our method significantly improves the blue noise quality compared to prior works based on jittered grid sampling (see Figure 4).

An implementation of our method can be found at https://github. com/jonasmb/curlnoisejittering.

In summary, we provide the following contributions:

• Curl Noise Jittering (CNJ): an implicit method for computing 2D and 3D blue noise point distributions. • A study of the suitable parameters of CNJ to improve sampling quality while preserving computational efficiency. • An evaluation of the benefits of CNJ for implicit material modeling and rendering.

Related Work

In this section, we review and compare prior methods and applications for point sampling in the context of computer graphics.

Poisson disk sampling. A widely used method considers a Poisson disk sampling in which any two points are separated by a minimum distance [START_REF] Robert | Stochastic sampling in computer graphics[END_REF]] that results in a blue noise sampling. The standard dart-throwing algorithm consists of iteratively placing points that are separated from each other by a minimum distance. Several works have studied efficient algorithms for Poisson disk sampling [START_REF] Dunbar | A spatial data structure for fast Poissondisk sample generation[END_REF][START_REF] Bridson | Fast Poisson disk sampling in arbitrary dimensions[END_REF][START_REF] Wei | Parallel Poisson disk sampling[END_REF][START_REF] Ebeida | Efficient maximal Poisson-disk sampling[END_REF][START_REF] Corsini | Efficient and flexible sampling with blue noise properties of triangular meshes[END_REF][START_REF] Yuksel | Sample elimination for generating Poisson disk sample sets[END_REF], and most of them are summarized in surveys [START_REF] Lagae | A comparison of methods for generating Poisson disk distributions[END_REF][START_REF] Yan | A survey of blue-noise sampling and its applications[END_REF]]. Poisson disk sampling algorithms are typically iterative processes that do not lend themselves to efficiently determining a subset of points lying in a given subspace.

Optimization-based methods. A broad class of sampling methods seek to optimize the position of a set of points to obtain blue noise. A popular method is Lloyd's algorithm [START_REF] Lloyd | Least squares quantization in PCM[END_REF]], in which the points are iteratively moved to the centroid of their corresponding Voronoi cells. Lloyd's algorithm was enhanced with the capacityconstrained point distribution method [START_REF] Balzer | Capacity-constrained point distributions: A variant of Lloyd's method[END_REF]] and subsequently improved through the lens of optimal transport [START_REF] De Goes | Blue noise through optimal transport[END_REF][START_REF] Qin | Wasserstein blue noise sampling[END_REF]. [START_REF] Fattal | Blue-noise point sampling using kernel density model[END_REF] introduced an interacting particles model based on statistical mechanics. Similarly, [START_REF] Jiang | Blue noise sampling using an SPH-based method[END_REF] proposed a sampling algorithm based on smoothed particle hydrodynamics. [START_REF] Heck | Blue noise sampling with controlled aliasing[END_REF] proposed constructing sampling patterns with prescribed spectral properties by iteratively updating the point positions. Recently, Ahmed et al. [2022] presented an optimization method based on placing a set of Gaussian kernels on the sample points and defining an objective function that can be minimized with gradient-descent and that leads to a blue noise distribution. While delivering high-quality results, optimization-based methods eventually become inefficient as the number of samples increases and do not allow efficient retrieval of the points in a given subspace.

Tile-based methods. Another set of methods partitions the 2D space with tiles to sample points. For instance, by subdividing a Penrose tiling [START_REF] Ostromoukhov | Fast hierarchical importance sampling with blue noise properties[END_REF], by precomputing and optimizing a set of tiles containing points [START_REF] Hiller | Tiled blue noise samples[END_REF][START_REF] Lagae | A procedural object distribution function[END_REF][START_REF] Kopf | Recursive Wang tiles for real-time blue noise[END_REF][START_REF] Abdalla | An adaptive point sampler on a regular lattice[END_REF], by tiling with polyominos [START_REF] Ostromoukhov | Sampling with polyominoes[END_REF], hexagons [START_REF] Wachtel | Fast tile-based adaptive sampling with user-specified Fourier spectra[END_REF], or AA optimized patterns [START_REF] Abdalla | AA patterns for point sets with controlled spectral properties[END_REF]]. To the best of our knowledge, tiling approaches only considered the 2D case since its most typical application is digital half-toning and rendering.

Low-discrepancy sequences. Another class of efficient methods is based on generating so-called low discrepancy sequences, which are of interest for Monte Carlo integration [START_REF] Pilleboue | Variance analysis for Monte Carlo integration[END_REF]. Classical examples are the [START_REF] Halton | Algorithm 247: Radical-inverse quasi-random point sequence[END_REF], [START_REF] Hammersley | Sphere tracing: A geometric method for the antialiased ray tracing of implicit surfaces[END_REF] or [START_REF] Il | On the distribution of points in a cube and the approximate evaluation of integrals[END_REF] sequences. Recent work considered scrambled Morton ordering [Ahmed and Wonka 2020], improving Sobol in lower dimensions [START_REF] Paulin | Cascaded Sobol' sampling[END_REF], or optimizing and exploring a space of sequences named dyadic nets [START_REF] Abdalla | Optimizing dyadic nets[END_REF][START_REF] Abdalla | Analysis and synthesis of digital dyadic sequences[END_REF]. It is possible to find the coordinates of a point in a given stratum of a (0, 𝑚, 2) dyadic net containing 2 𝑚 points in 𝑂 (𝑚) time. This entails that a logarithmic time algorithm for locating the closest point in a dyadic net is feasible, provided that the binary flags that determine the net can be computed in constant time. Unfortunately, this means that an optimized dyadic net, e.g. a Blue Net [Ahmed and Wonka 2021], does not seem to admit an efficient query for the closest lattice point.

Error-diffusion methods. Blue noise is intimately related to the application of digital halftoning [Ulichney 1988], which seeks to depict a grayscale image by varying the size or the distribution of tiny black dots arranged in a regular pattern. Different techniques based on error diffusion [START_REF] Floyd | An adaptive algorithm for spatial gray-scale[END_REF], in which a quantization error is distributed among pixels, have considered blue noise samplings [START_REF] Daniel | Blue and green noise halftoning models[END_REF][START_REF] Ostromoukhov | A simple and efficient error-diffusion algorithm[END_REF]. Again, such algorithms are inherently iterative and do not allow for the implicit identification of points in a subset of the space.

Jittered-grid methods. Some approaches have explored how to enhance the original jittering method. For instance, to modify the jittering in order to improve the projected sampling onto the vertical or horizontal line with multi-jittering methods [START_REF] Chiu | Multi-jittered sampling[END_REF][START_REF] Christensen | Progressive multijittered sample sequences[END_REF]. Similarly, [START_REF] Kensler | Correlated Multi-Jittered Sampling[END_REF] used correlated jittering of rows and columns. [START_REF] Victor Klassen | Filtered jitter[END_REF] proposed to smooth the result by considering the average perturbation between the neighbors of a grid cell. [START_REF] Dammertz | Rank-1 Lattices in Computer Graphics[END_REF] considered jittering rank-1 lattices with Lloyd's algorithm. Our method is also an improved jittering method, but it significantly improves the blue noise quality compared to [START_REF] Victor Klassen | Filtered jitter[END_REF] and [START_REF] Kensler | Correlated Multi-Jittered Sampling[END_REF], see Figure 4.

Jittered grid and procedural noises. Jittered grids have endured the test of time thanks to their efficient, implicit, and simple formulation, and numerous procedural texturing methods use jittering to implicitly retrieve a local neighborhood of samples around a query point. For instance, Worley noise [START_REF] Worley | A cellular texture basis function[END_REF]] and its descendants [START_REF] Martínez | Procedural Voronoi foams for additive manufacturing[END_REF]] are examples of procedural cellular structures relying on a jittered grid. Our technique improves the quality of Worley noise, leading to better visual results while incurring a slight loss of efficiency (see Figure 5). Worley noise is one example among many other procedural methods based on jittering that may directly benefit from our method.

CURL NOISE JITTERING IN 2D

We define jittering as the process of displacing the points, 𝑃, of a regular lattice by a small amount to obtain a less regular set of points, 𝑃 * . Regular lattices are typically formed as the vertices of tilings of the plane. While quadrangular tilings are often used, we observe that the densest packing of circles [START_REF] Fejes | Über die dichteste Kugellagerung[END_REF]] is obtained by associating a circle with each vertex of a triangular tiling, which also has six-fold symmetry rather than four-fold. Moreover, initial experiments gave better results for this type of lattice. Hence, we use lattices formed as the vertices of triangular tiling, as shown in Figure 1 (left).

We can obtain the jittered points in two ways. We can generate 𝑃 * directly by computing the displacement for each point p ∈ 𝑃 and storing the jittered point p * ∈ 𝑃 * . This is the most efficient option if 𝑃 is known in advance and of acceptable size. However, the benefit of methods based on jittering is that we can generate 𝑃 * implicitly. Namely, we can find the point p * ∈ 𝑃 * closest to a given query point x without generating 𝑃 * .

For implicit evaluation, the portion of the lattice that we need to inspect depends on the largest possible jitter displacement, which we will denote the jitter radius, 𝑟 𝑗 . Say, p ∈ 𝑃 is the lattice point closest to the query point x. The distance to the corresponding jittered point, p * , is at most 𝑟 𝑗 + ∥x -p∥. Thus, the closest jittered point must lie within a disk of radius 𝑟 𝑗 + ∥x -p∥ centered at x (see Figure 2). We need to inspect all lattice points whose disks of radius 𝑟 𝑗 intersect the disk at x. In practice, this set includes neighbors (i.e., adjacent lattice points), second-order neighbors, and, in rare cases, third-order neighbors of p.

Jittering can be construed as moving the points of the initial lattice along a vector field. Expressed in this fashion, p * is obtained by tracing a streamline starting at p from time 𝑡 = 0 till 𝑡 = 1,

p * = C p (1) , (1)
Closest lattice point in blue. The first-order neighbors are light grey, and the second-order neighbors are dark grey. The closest jittered point must lie within the disk centered on the closest lattice point. where the curve C p is the streamline defined in terms of the differential equation

C p (0) = p (2) d d𝑡 C p (𝑡) = V(C p (𝑡)) , (3)
and V is the vector field determining how points are displaced. In the case of traditional random jittering, we can consider V constant within each subdomain. The subdomain would typically be the pixel or, more generally, the Voronoi region around the point. As the streamline tracing method, we choose a 4th order Runge-Kutta method (RK4) [START_REF] Runge | Über die numerische Auflösung von Differentialgleichungen[END_REF]] which improved on taking an Euler step (see Figure 7); a deeper investigation into streamline tracing methods could yield further improvements.

The advantage of interpreting jittering as streamline tracing is that we can now consider ways to obtain vector fields that lead to better blue noise quality. We posit that divergence free vector fields would be advantageous since such vector fields do not contain sources or sinks which, respectively, repel and attract the points, leading to uneven distributions of points. In addition to being divergence-free, the vector field we seek must be noisy in the sense that it has no manifest anisotropy, since this would likely show in the jittered points. In other words, we claim that a noisy but divergence-free vector field can lead to jittered point sets where the points are regularly distributed while the anisotropy of the original grid is greatly reduced. See Section 2.4 for further discussion.

Unfortunately, the requirement that the vector field be divergencefree rules out some apparent candidates. For instance, neither the gradient field of a noise function, nor smoothly interpolating random vectors would produce a divergence-free vector field.

Curl Noise

There is, however, a method for generating noisy yet divergencefree vector fields. This method, due to [START_REF] Bridson | Curl-noise for procedural fluid flow[END_REF], is known as curl noise. The curl, ∇×, of a 3D vector field,

Φ = [𝜙 𝑥 , 𝜙 𝑦 , 𝜙 𝑧 ], is ∇ × Φ = 𝜕𝜙 𝑧 𝜕𝑦 - 𝜕𝜙 𝑦 𝜕𝑧 , 𝜕𝜙 𝑥 𝜕𝑧 - 𝜕𝜙 𝑧 𝜕𝑥 , 𝜕𝜙 𝑦 𝜕𝑥 - 𝜕𝜙 𝑥 𝜕𝑦 .
For 2D curl noise, we will assume that Φ = [0, 0, 𝑓 ] for some noise function 𝑓 : R 3 → R. This means that

∇ × Φ = 𝜕𝜙 𝑧 𝜕𝑦 , - 𝜕𝜙 𝑧 𝜕𝑥 , 0 = 𝜕𝑓 𝜕𝑦 , - 𝜕𝑓 𝜕𝑥 , 0 .
In other words, since Φ is orthogonal to the 𝑥𝑦-plane, the curl, ∇×Φ, lies in the 𝑥𝑦-plane. Moreover, ∇ × Φ, is known to be divergencefree because of the equality of mixed partial derivatives (Clairaut's Theorem). Due to this property, flows that follow ∇ × Φ are volumepreserving, and for our purposes, this ensures that the vector field is free of sinks and sources.

As an aside, we note that in 2D, the streamlines of ∇×Φ are simply the iso-contours of 𝑓 , which means that any particle following such a trajectory, with sufficient numerical precision, will eventually return to its starting point.

Curl Noise Jittering

We can now formulate curl noise jittering operationally,

cnj[𝑁 , 𝑠, 𝑡] (x) = C x (𝑡) , (4)
where

C x (0) = x , (5) d d𝑡 C x = 𝜕𝑁 (𝑥/𝑠, 𝑦/𝑠) 𝜕𝑦 , - 𝜕𝑁 (𝑥/𝑠, 𝑦/𝑠) 𝜕𝑥 . (6)
Thus, cnj is governed by three parameters: the noise function 𝑁 , the noise scale 𝑠, and finally the time 𝑡 for which we trace along the streamline.

Noise Functions

The choice of underlying noise function is essential when implementing curl noise and, by extension, curl noise jittering. It is important that the noise function is band limited, stationary, and isotropic [START_REF] Perlin | An image synthesizer[END_REF][START_REF] Ares Lagae | A survey of procedural noise functions[END_REF]; it is also a requirement that we can efficiently compute derivatives of the noise function.

We have tested three different noise functions that adhere to these requirements:

• Sparse convolution noise (SC) [START_REF] Lewis | Texture synthesis for digital painting[END_REF][START_REF] Lewis | Algorithms for solid noise synthesis[END_REF]].

• Sum of sines noise (SoS) [START_REF] Schachter | Long crested wave models[END_REF][START_REF] Nelson | Vectorized procedural models for natural terrain: Waves and islands in the sunset[END_REF]].

• Perlin noise [START_REF] Perlin | An image synthesizer[END_REF][START_REF] Perlin | Improving noise[END_REF]. For Perlin noise, we adapt an implementation by Iñigo Quilez1 that includes computation of derivatives. Our implementation of sparse convolution noise is based on a version that can be evaluated locally [START_REF] Revall | Fast high-quality noise[END_REF], and that has been described in a closed formula [START_REF] Luongo | Microstructure control in 3D printing with digital light processing[END_REF] for which it is easy to find derivatives. Sine functions are easily differentiable. The principle of SoS is to construct an 𝑛D function by superposing 𝑛D waves. [START_REF] Nelson | Vectorized procedural models for natural terrain: Waves and islands in the sunset[END_REF] discusses how this can be used to construct models of water waves, and [START_REF] Schachter | Long crested wave models[END_REF] describes a similar model for narrow-band noise. In our formulation, SoS noise is based on waves of the form

𝑤 [𝑎, d, 𝜙] (x) = 𝑎 sin d 𝑇 x + 𝜙 , ( 7
)
where 𝑎 is the amplitude and 𝜙 is the phase of the wave, while d = 2𝜋 𝜆 n is a frequency vector in which 𝜆 is the wavelength and n is the unit length direction of the wave. SoS noise is defined by

𝑁 (x) = ∑ (𝑎,d,𝜙 ) ∈𝑊 𝑤 [𝑎, d, 𝜙] (x) , ( 8
)
where 𝑊 is the set of parameter tuples. For each tuple, we generate the parameters by first sampling the random variables, 𝑠 ∼ N (0, 𝜎) from a normal distribution and 𝛼, 𝜙 ∼ U (0, 2𝜋) from a uniform distribution. Next, we compute d = (𝜎 + 𝑠) [cos(𝛼), sin(𝛼)] and 𝑎 = exp(-𝑠 2 /𝜎 2 ). Thus, the amplitude is largest for waves with a

Quality Measures and Parameter Selection

Curl noise jittering is motivated by the premise that displacing the points of a lattice along a curl noise vector field will imbue the points with blue noise properties. This hypothesis is based on the observation that flow along a curl noise vector field is volume-preserving because the field is divergence-free. While volume preservation does not imply preservation of point distances, it does guarantee that there are no sinks or sources which, respectively, attract or repel the points when transported along the field for a short time. This leads us to assume that the point spacing of the lattice would be preserved to some extent for (short) flows along the vector field.

Yet, the regularity of the lattice, and hence anisotropy, is diminished because the vector field is a noise function.

However, it appears hard to provide a formal argument. Instead, we offer a quantitative metric for blue noise properties. This metric is used to assess the quality of CNJ as well as competing methods and to tune the parameters of our method. Specifically, it is important to select an appropriate time step (as discussed above) and noise scale. If the noise scale is extremely coarse, the lattice is locally translated, and the lattice structure remains visible. In contrast, if the scale is too fine (i.e., the frequency is too high), the method devolves to random jittering.

Our quantitative analysis is based on the point set analysis framework (PSA) [START_REF] Schlömer | Accurate spectral analysis of twodimensional point sets[END_REF][START_REF] Heck | Blue noise sampling with controlled aliasing[END_REF], which is commonly used in related work, e.g. [START_REF] Abdalla | Gaussian blue noise[END_REF]]. We briefly recall the different metrics in the following. We refer the reader to [START_REF] Heck | Blue noise sampling with controlled aliasing[END_REF] for further details.

The power spectrum of a signal, such as a point process, is the Fourier transform of the autocorrelation function of the signal, and it can also be computed directly as the absolute square of the Fourier transform of the signal. Useful statistics can be derived by partitioning the power spectrum into concentric annuli of width Δ, and then averaging the spectrum samples within each annulus 𝜉 𝑟 of central radius 𝑟 [START_REF] Schlömer | Accurate spectral analysis of twodimensional point sets[END_REF]. The radially averaged power spectrum 𝑃 (𝜉 𝑟 ) measures the average of the power spectrum in some annulus 𝜉 𝑟 . The anisotropy is defined by 𝑎(𝜉 𝑟 ) = 𝑉 2 (𝜉 𝑟 ) 𝑃 (𝜉 𝑟 ) , where 𝑉 2 (𝜉 𝑟 ) is the sample variance of the power spectrum in some annulus 𝜉 𝑟 . Lower anisotropy values indicate that the power spectrum is close to being radially symmetric; thus, the resulting point process is close to isotropic. We define the power-weighted mean anisotropy,

ā = ∑ 𝑟 >0 𝑎(𝜉 𝑟 )𝑃 2 (𝜉 𝑟 ) = ∑ 𝑟 >0 𝑉 2 (𝜉 𝑟 )𝑃 (𝜉 𝑟 ) , (9)
where the first annulus 𝑟 = 0 containing the zero frequency is excluded. The largest frequency 𝑣 so that the average energy in the power spectrum up to 𝑣 stays below 0.1 is called the effective Nyquist frequency and denoted 𝑣 eff . Intuitively, frequencies below 𝑣 eff can be sampled and reconstructed with little error, while frequencies above lead to aliasing. Now, we define the quality of a point set as the ratio of the effective Nyquist frequency to mean anisotropy,

𝑞 = 𝑣 eff ā 𝑟 𝑗 < 𝛿 0 𝑟 𝑗 ≥ 𝛿 , ( 10
)
where 𝛿 is the edge length of the regular lattice, i.e., the distance between two neighboring points. Thus, 𝑞 is proportional to the effective Nyquist frequency and inversely proportional to the average anisotropy -unless the maximum displacement due to jittering exceeds the edge length of the lattice. Assigning 𝑞 = 0 for 𝑟 𝑗 ≥ 𝛿 is important for the implicit generation of 𝑃 * : the greater 𝑟 𝑗 , the more grid points could beget the closest jittered point. If 𝑟 𝑗 < 𝛿, 𝑞 balances the two requirements that the jittered points are well separated (𝑣 eff large) and isotropy ( ā small).

In Figure 3, 𝑣 eff , ā, and 𝑞 are plotted as a function of time step 𝑡 and noise scale 𝑠 for the three noise functions considered. Based on the underlying (30 × 30) grids of quality values, the maximum was found for each function, and the results are presented in Table 1. Perlin noise has the highest quality and is less computationally demanding than the other noise functions. Hence, it was selected for our 2D experiments. Note that the scale 𝑠 is the ratio of the side length of the Perlin noise grid to the distance between lattice points.

Implementation

The direct 2D method for curl noise jittering was implemented in Python for all three noise functions. Our code interfaces to the PSA library2 , which is used for the quality metric. Our code also interfaces to the CCVT library3 and the dyadic nets4 library, both of which were used for comparison. The performance of the direct methods was evaluated on a single Apple M1 core.

The implicit 2D curl noise jittering method is implemented in GLSL on the ShaderToy platform. This implementation employs only Perlin noise and runs at 2.04 ms per frame in 1080p resolution when using an NVIDIA RTX 3090 GPU. We found that in practice, we do not need to check the distances between lattice points and query points if we jitter all neighbors up to the second order.

Comparisons

Like all methods based on jittering, CNJ places each point without considering the positions of nearby points and can hence be evaluated implicitly. We compare CNJ to two other methods based on jittering and three methods that consider the local neighborhood. The jittering-based methods are clearly the most similar to ours, while methods that consider neighboring points can provide very high quality. We also included iterative curl noise jittering ICNJ in this comparison. The iterative method applies jittering with a time step that is halved in each iteration (and we used 64 iterations). The noise scale is the same for all iterations, but the noise is different each iteration (since we add an offset).

From the category of jittering based methods, we compare against Kensler's correlated multi-jittered (CMJ) sampling approach [START_REF] Kensler | Correlated Multi-Jittered Sampling[END_REF]]. The principle is that each row and each column is jittered with a sequence of perpendicular displacements. Since the displacements are identical for all rows (columns), neighbors along each row (column) are never closer than the edge length of the grid. We also compare against the smoothed jittering (SJ) of a triangular lattice proposed by [START_REF] Victor Klassen | Filtered jitter[END_REF].

From the category of non jittering-based methods, we compare against the Blue Nets (BN) method [Ahmed and Wonka 2021], capacity-constrained Voronoi tessellations (CCVT) [START_REF] Balzer | Capacity-constrained point distributions: A variant of Lloyd's method[END_REF]] and the fast Poisson disk sampling (PDS) method proposed by [START_REF] Bridson | Fast Poisson disk sampling in arbitrary dimensions[END_REF].

For each of these seven methods, we show the point clouds and their associated power and radial spectra in Figure 4. We also computed our quality measure, 𝐷 * , the L2 norm of star-discrepancy [START_REF] Wang | Low discrepancy sequences in high dimensions: How well are their projections distributed?[END_REF], and timings, all averaged over 100 runs. These results are shown in Table 2, which also includes the programming language used. CCVT attains the highest quality. This is unsurprising since this method uses information about the neighborhood to optimize positions. ICNJ and regular CNJ are second and third, respectively. In most cases, the slightly increased quality of ICNJ would not justify the increased computational cost. Blue Nets is only in fourth place due to a comparatively high anisotropy. However, the discrepancy of the Blue Nets method is less than half that of its closest competitor. Low discrepancy is a trait that appears to be shared by (0, 𝑚, 2) nets in general; such nets can be generated very quickly using the Netshuffle algorithm of Ahmed and Wonka [2021], albeit dyadic nets do not have blue noise properties unless they are optimized.

CNJ and ICNJ are the only methods that can be evaluated implicitly (all based on jittering) with a low anisotropy. In general, isotropy is challenging to achieve with jittering since a regular lattice exhibits high anisotropy. It is perhaps more surprising that while Poisson disk sampling has the lowest anisotropy of all methods, its 𝑣 eff is also very low, and the overall quality is inferior to CNJ.

Applications and Extensions

Steven [START_REF] Worley | A cellular texture basis function[END_REF] proposed a method for texturing based on distances to randomly scattered points, which can be used to model the appearance of objects with cracked or segmented surfaces. In Worley's original formulation, points were computed on the fly by hashing the value of a grid cell to a random point within each cell. With curl noise jittering, we can produce a more even distribution of points leading, in turn, to a more regular cellular structure than in the original method, as shown in Figure 5. All images in Figure 5 were generated in ShaderToy using the implicit method. In the top row, the color is based purely on the distance to the closest point. In the bottom row, the difference between the distance to the closest and second closest point is used to generate the line color. The position of the closest jittered point is hashed to cell color.

We implemented the direct method in a Blender script to generate a distribution of boxes, see Figure 6 (right). A similar distribution generated by using Blender's built-in Poisson disk sampling is shown on the left. While the differences are subtle, our method seems to produce a slightly more even distribution.

CURL NOISE JITTERING IN 3D

An important difference in 3D is that we need a vector-valued noise (a 3D vector field is needed to take the curl in 3D). In the case of Perlin noise, this means evaluating the function three times with different offsets. For the sum of sines, the three evaluations with different offsets are easily performed in the same sum. Finally, since sparse convolution noise is based on the convolution of randomly placed random impulses, we just need to use random vector-valued impulses, which entails little extra cost.

The initial grid to use for curl noise jittering depends on the desired packing density of the point distribution. If we start from a regular octahedral grid (body centered cubic lattice [START_REF] Theußl | Optimal regular volume sampling[END_REF], obtained by inserting a point at the center of each voxel of a cubic grid and using the faces of the cells in the cubic grid as the bases of regular octahedra), we get a denser point distribution than if we start from a cubic grid. The properties of the noise functions also come into play when we work in 3D. We ran a parameter study by rendering out 3D point distributions as collections of spheres. We visually inspected the results to qualitatively assess whether the findings in 2D generalize to 3D. The behavior with different parameters is a bit different in 3D. Perlin noise and SoS seem to more strictly require using the RK4 method to avoid regularities. SoS can occasionally exhibit ripples in the point distribution, but this seems avoidable with well-chosen parameters. Sparse convolution noise is, in that sense, easier to find suitable parameters for in 3D, and it seems to perform reasonably well with an Euler step. If combined with RK4, sparse convolution noise becomes more expensive to evaluate than the other methods.

Implementation

We implemented 3D curl noise jittering in CUDA for NVIDIA OptiX (v7.6) [START_REF] Parker | OptiX: a general purpose ray tracing engine[END_REF]] and render metals by path tracing of specular materials with a complex index of refraction [START_REF] Pharr | Physically Based Rendering: From Theory to Implementation[END_REF]. Sphere tracing [START_REF] Hammersley | Sphere tracing: A geometric method for the antialiased ray tracing of implicit surfaces[END_REF]] is used for ray-surface intersection in a signed distance field (SDF). We rendered images using the previously mentioned RTX 3090 GPU. The rendering time for a one sample per pixel (1spp) frame of resolution 720 × 720 is provided for different examples in Figures 8 and9.

Applications

The ability of our method to produce a point set with blue noise properties makes it suitable for approximate modeling of the jammed hard-particle packings observed in granular materials [START_REF] Torquato | Jammed hard-particle packings: From Kepler to Bernal and beyond[END_REF][START_REF] Meng | Multi-scale modeling and rendering of granular materials[END_REF]. As an example, we made a bunny out of tiny spheres and rendered it with the camera at different distances from the object, see Figure 8. We used a regular octahedral lattice as our initial grid, with a total of around 1.3 billion spheres in the entire volume of the bunny. Our implicit method was used with the sum of sines (and RK4) to get an SDF for a stochastic sphere packing with little overlapping of the spheres.

The production of stochastic foam by a random bubble-forming chemical process results in material structures represented well by Voronoi cells [START_REF] Bogunia | Microstructure characterization and stochastic modeling of open-cell foam based on 𝜇CT-image analysis[END_REF]]. Based on our discussion of the Worley method (see Section 2.7), we believe our method can be used advantageously for the 3D modeling of foams. As an example, we modeled the structure of open-cell aluminum and copper foams (see Figure 9). For the rendering of the metals, we use available measured complex indices of refraction of oxidized aluminum [START_REF] Querry | Optical Constants[END_REF]] and copper [START_REF] Glassner | Principles of Digital Image Synthesis[END_REF]]. We use the Worley method and find the distances to the nearest points in our point distribution by inspecting the positions of the grid nodes in the first-order neighborhood after being curl noise jittered. Let 𝑑 𝑖 , 𝑖 = 1, . . . , 4, denote distances from the point of interest x in the volume with 𝑑 1 being the distance to the closest point and 𝑑 1 < 𝑑 2 < 𝑑 3 < 𝑑 4 . For the more porous aluminum foam, we use a regular grid and the following formula for conversion to a non-Euclidean signed distance field:

sdf (x) = (𝑑 2 (x) -𝑑 1 (x)) 𝛼 + (𝑑 3 (x) -𝑑 2 (x)) 𝛼 + (𝑑 3 (x) -𝑑 1 (x)) 𝛼 -𝜀 . (11)
The parameters in this model are 𝛼, which is related to the enclosedness of the cavities, and 𝜀, which is the thickness of the geometric features. We used 𝛼 = 1.55 and 𝜀 = 0.1 for the aluminum foam. In the curl noise jittering, we used sparse convolution noise with an Euler step for this material.

For the copper foam, we use a trabeculum formula by Fabrice Neyret 5 . The non-Euclidean signed distance field is then sdf

(x) = 1 𝑑 3 (x) -𝑑 1 (x) + 1 𝑑 4 (x) -𝑑 1 (x) -1 -𝜀 . (12)
In this case, we used 𝜀 = 0.06 and CNJ with the octahedral grid as the initial grid (as for the bunny). Figure 10 compares the CNJ of the cubic grid versus the octahedral grid. Visual inspection of the foams as compared with foams obtained using random jitter sampling of one point per voxel in the grid (Figure 9) confirms that our curl noise jittering effectively reduces clustering of points and thus achieves a better model of the real metal foams.

5 https://www.shadertoy.com/view/MlB3Wt

DISCUSSION AND LIMITATIONS

We have demonstrated that creating point sets with blue noise properties is possible using a simple jittering approach. Going forward, this type of point set can more readily be used in real-time applications or where large domains need to be sampled. Of course, applications that need a blue noise sampling large enough that either generating or storing the points would be a limiting factor will benefit the most. However, we note that our method is simple to implement and can be used as a drop-in replacement for applications that already employ jittering. CNJ works in both 2D and 3D, and while we have focused on the 2D case in our analysis, our 3D results indicate that CNJ can be useful for procedural materials with very fine granularity where precomputing blue noise point sets would lead to prohibitive memory consumption. In the future, we are also interested in extending curl noise jittering to other domains. For instance, time-varying noise functions could be useful in certain scenarios.

Our work presupposes that a lattice is given. This does not preclude adaptive curl noise jittering, where the point density depends on, for instance, an underlying image's intensity. However, this would require that the lattice adapts to the intensity, which is not a part of our investigation but might be an avenue for future work. Finally, we would also like to explore the use of other noise functions and streamline tracing methods. We used a cubic grid for the aluminum foam due to its higher porosity and an octahedral grid for the copper foam. The time in the corner is for a 1spp frame. The blue noise properties of our method helps it better avoid point clustering issues. The photos in the rightmost column, courtesy of Beihai Composite Materials (https://www.metalfoamweb.com/), provide some intuition on the appearance of real metal foams.

8Δ CNJ of 8Δ CNJ of 8Δ closeup CNJ of □ closeup CNJ of □ □

Figure 10: To indicate the difference between the cubic grid (□) and the octahedral grid (8Δ), we here show the point distributions for the copper foam scene when using the two different types of initial grid. We tried to obtain a similar result with both grids. Due to the larger distance between the nodes in the cubic grid, we made the grid smaller, applied a larger time step, and decreased the scale in CNJ. The distribution of points is more uneven for the cubic grid.

Figure 2 :

 2 Figure 2: A query point shown (red) in a triangular lattice.

Figure 3 :

 3 Figure 3: From left to right, each row shows the effective Nyquist frequency, the anisotropy, and the derived quality measure, which is simply their ratio, for curl noise jittering based on sparse convolution noise (top), sum-of-sines noise (middle), and Perlin noise (bottom).

Figure 4 :

 4 Figure4: Comparison of our method (far left) to the methods discussed in Section 2.6. We show point sets (top) as well as the power spectrum (zoomed in ×10, middle) and the radial spectrum for each point set (bottom).

Figure 5 :

 5 Figure 5: Two different Worley noise textures generated using random displacements (left) and CNJ (right).

Figure 6 :Figure 7 :

 67 Figure 6: In this example, randomly oriented and scaled boxes were placed on a square using Blender's built-in Poisson disk sampling (left) and our CNJ method (right).

Figure 8 :Figure 9 :

 89 Figure 8: Moving closer and closer to a seemingly dusty version of the Stanford bunny (http://graphics.stanford.edu/data/3Dscanrep/). This illustrates our ability to distribute a very large number of points using CNJ w. SoS and RK4. Rendering time for a 1spp frame (left to right): 2.5 s, 4.5 s, 5.4 s, 6.4 s. Rendered here with 3000 samples per pixel.

Table 1 :

 1 Effective Nyquist limit (𝑣 eff ), anisotropy ( ā), and quality (𝑞) for different noise functions and selected pairs of parameters, time step 𝑡 and noise scale 𝑠. The best values are in boldface.

	Noise type	𝑡	𝑠	𝑣 eff	ā	𝑞
	SC	1.25862 5.65517 0.745 81.8 0.0091
	SoS	3.58621 6.27586	0.7 72.6 0.0096
	Perlin	1.05862 2.86207 0.705 71.9 0.0098

Table 2 :

 2 Average results for 100 runs of the tested methods. The statistics shown are: effective Nyquist, 𝑣 eff , anisotropy, ā, quality, 𝑞, discrepancy, 𝐷 * , and time. Methods above the double line can be evaluated implicitly, and methods below cannot. The best values within each of these two categories are in boldface.

	Method 𝑣 eff ↑ ā ↓	𝑞 ↑	D* ↓	time(s) ↓ language
	CNJ 0.7	71.81 0.0097	0.002	0.0621	Python
	ICNJ 0.74	72.81 0.01	0.0021	2.22	Python
	CMJ 0.82	960.6 0.00086 0.0023	0.00218 Python
	SJ 0.44	442.7 0.001	0.0034	0.00788	Python
	BN 0.83	88.27 0.0095	0.00083 47.9	C++
	CCVT 0.83	78.85 0.011	0.002	20.8	C++
	PDS 0.26	70.63 0.0036	0.0047	0.332	Python

https://iquilezles.org/articles/gradientnoise/ frequency vector close to the mean. For the

2D experiments in this paper, we use |𝑊 | = 256 and 𝜎 = 7.

https://github.com/nodag/psa

https://github.com/michaelbalzer/ccvt

http://abdallagafar.com/publications/dyadic-nets/

ACKNOWLEDGMENTS

This project was partially supported by the Villum Foundation through the Villum Investigator Project InnoTop.


Carlos A Castilla-Martinez

Umit Lucas Roussignol

Umit B Demirci
email: umit.demirci@umontpellier.fr

Magnesium hydrazinidoborane: Synthesis, characterization and features for solid-state hydrogen storage

Keywords: Hydrazine borane, Hydrazinidoborane, Hydrogen storage, Magnesium

published or not. The documents may come

2

Introduction

Nowadays, fossil fuels are the main source of energy for humanity. Every year, the energy demand increases and consequently, fossil fuels are being depleted. Furthermore, the burning of these fuels is the main contributor of the release of greenhouse gases into the atmosphere and thus, of global warming. With this background, the need of a cleaner and an abundant source of energy is imperative. The best substitute for fossil fuels appears to be hydrogen [START_REF] Dawood | Hydrogen production for energy: An overview[END_REF][START_REF] Van De Graaf | The new oil? The geopolitics and international governance of hydrogen[END_REF]. The reasons to consider hydrogen as the fuel of the future are diverse: it has the highest energy content of any known fuel, it is non-toxic, it is abundant as an element, it can be produced from clean sources, it produces zero pollutant emissions and it can be used in both stationary and mobile applications [START_REF] Widera | Renewable hydrogen implementations for combined energy storage, transportation and stationary applications[END_REF][START_REF] Pareek | Insights into renewable hydrogen energy: Recent advances and prospects[END_REF]. However, the infrastructure for a future based on hydrogen still requires of much effort to be done. In this context, one of the main challenges of hydrogen technologies is hydrogen storage.

Hydrogen can be stored in high pressure vessels, at low temperature or in a material [START_REF] Moradi | Hydrogen storage and delivery: Review of the state of the art technologies and risk and reliability analysis[END_REF]. The latest technology is the most promising and different approaches have been investigated to obtain materials with a high hydrogen storage capacity. Hydrogen can be stored through electrochemical methods [START_REF] Kaur | Review on hydrogen storage materials and methods from an electrochemical viewpoint[END_REF]. Hydrogen is also stored via physical or chemical interactions within a material. Different types of materials have been considered depending on the type of interaction. For example, for hydrogen physisorption, carbon materials, zeolites and metal organic frameworks have been envisaged; meanwhile for hydrogen chemisorption, compounds like liquid ammonia, boron and nitrogen-based materials or complex/intermetallic hydrides have been considered [START_REF] Kharbachi | Metal hydrides and related materials. Energy carriers for novel hydrogen and electrochemical storage[END_REF][START_REF] Hirscher | Materials for hydrogen-based energy storage -past, recent progress and future outlook[END_REF][START_REF] Kojima | Hydrogen storage materials for hydrogen and energy carriers[END_REF][START_REF] Luo | Enhanced hydrogen storage/sensing of metal hydrides by nanomodification[END_REF].

Boron and nitrogen-based materials have been intensely studied for chemical hydrogen storage [START_REF] Kumar | Solid-state hydrogen rich boronnitrogen compounds for energy storage[END_REF][START_REF] Wang | Metal B-N-H hydrogen-storage compound: Development and perspectives[END_REF][START_REF] Yao | Noble-metal-free nanocatalysts for hydrogen generation from boron-and nitrogen-based hydrides[END_REF]. These compounds have advantageous characteristics: (i) B and N are light atoms that can bind with multiple hydrogen atoms, giving a high H2 content to these compounds; (ii) characteristic heteropolar dihydrogen interactions [START_REF] Magos-Palasyuk | Experimental and theoretical evidence of dihydrogen bonds in lithium amidoborane[END_REF], which allows the molecules to release H2 at mild conditions ; and (iii) these compounds are solid at ambient conditions and stable under an inert atmosphere.

One of the most representative example of boron-and nitrogen-based compounds is ammonia borane (NH3BH3, AB) [START_REF] Akbayrak | Ammonia borane as hydrogen storage materials[END_REF]. AB is a widely studied material that carries 19.5 wt. % H and it has been considered for solid-state hydrogen storage. Despite the high hydrogen content of the material, the release of H2 starts at high temperature (at about 100 °C) and during thermolysis, undesired byproducts like ammonia NH3 and borazine B3N3H6 are produced. Another representative boron-and nitrogen-based compound is a derivative of AB, hydrazine borane (N2H4BH3, HB, 15.4 wt. % H) [START_REF] Hu | Hydrazine borane : A promising hydrogen storage material[END_REF][START_REF] Wang | Bimetallic Ni-Pt nanoparticles immobilized on mesoporous N-doped carbon as a highly efficient catalyst for complete hydrogen evolution from hydrazine borane[END_REF][START_REF] Yao | Highly efficient hydrogen generation from hydrazine borane via a MoOx-promoted NiPd nanocatalyst[END_REF]. Compared to AB, HB starts to dehydrogenate at a lower temperature, at about 60 °C. However, HB also suffers the formation of undesired byproducts (N2H4 and NH3). In addition, it forms a shock-sensitive product when heated above 300 °C. Like in the case of AB, the use of pristine HB for hydrogen storage in the solid state is not viable.

Different approaches have been proposed in order to overcome the issues encountered by HB.

The chemical modification of HB, substituting one of the H δ+ of the hydrazine moiety of the molecule by an alkali metal cation M + is one of those options. These compounds are called alkali hydrazinidoboranes (denoted MHB). Up to now, all the alkali hydrazinidoboranes have been synthesized: LiHB (LiN2H3BH3, 11.7 wt. % H), NaHB (NaN2H3BH3, 8.9 wt. % H), KHB (KN2H3BH3, 7.2 wt. % H), RbHB (RbN2H3BH3, 4.6 wt. % H) and CsHB (CsN2H3BH3, 3.4 wt. % H) [START_REF] Wu | Metal hydrazinoborane LiN2H3BH3 and LiN2H3BH3•2N2H4BH3: crystal structures and highextent dehydrogenation[END_REF][START_REF] Moury | Lithium hydrazinidoborane: A polymorphic material with potential for chemical hydrogen storage[END_REF][START_REF] Moury | Sodium hydrazinidoborane: A chemical hydrogen-storage material[END_REF][START_REF] Chua | Alkali metal hydride modification on hydrazine borane for improved dehydrogenation[END_REF][START_REF] Castilla-Martinez | Rubidium hydrazinidoborane: Synthesis, characterization and hydrogen release properties[END_REF][START_REF] Castilla-Martinez | Cesium hydrazinidoborane, the last of the alkali hydrazinidoboranes, studied as potential hydrogen storage material[END_REF]. The synthesis reactions of alkali hydrazinidoboranes were carried out between HB and the respective alkali metal hydride or pure metal, following the subsequent reactions:

MH + NH2NH2BH3 → NH2NH(M)BH3 + H2 (1) M + NH2NH2BH3 → NH2NH(M)BH3 + ½ H2 (2)
With M = Li, Na, K for (1) and M = Rb, Cs for (2). All of these compounds are crystalline at ambient conditions, and they have shown better dehydrogenation properties than HB. The introduction of the metal cation in the molecule causes the destabilization of the molecule and all alkali hydrazinidoboranes start to dehydrogenate at a lower temperature than HB. Unfortunately, all of them release undesired byproducts. Besides, the solid residues after dehydrogenation have shown a complex composition and the identification of such chemical species is still a big challenge, and makes the regeneration of the material difficult.

Further research has been done in order to investigate the destabilization effect of alkaline earth atoms on HB, to obtain the alkaline earth hydrazinidoboranes (M(N2H3BH3)2, M(HB)2). Up to now, the only example is the calcium derivative Ca(HB)2 (Ca(N2H3BH3)2, 9.3 wt. % H) [START_REF] Ould-Amara | Calcium hydrazinidoborane: Synthesis, characterization, and promises for hydrogen storage[END_REF].

However, Ca(HB)2 could not be obtained as a pure phase: the material is a mixture of the precursor CaH2, and the new phase Ca(HB)2. Furthermore, the synthesis conditions are very particular: the mixture CaH2:2HB has to be ball milled, heated at 1 °C min -1 up to 62 °C, kept at that temperature for 50 min and then quickly cooled down to room temperature. Despite all the effort to obtain the compound, it dehydrogenates in the range 90-170 °C and releases undesired byproducts (NH3, N2H4 and N2).

In the past, our research group has tried to synthesize the magnesium derivative, Mg(HB)2, in multiple ways, but all of them had failed [START_REF] Pylypko | Metal hydride-hydrazine borane: Towards hydrazinidoboranes or composites as hydrogen carriers[END_REF][START_REF] Castilla-Martinez | Amidoboranes and hydrazinidoboranes: State of the art, potential for hydrogen storage, and other prospects[END_REF]. In this study, we finally obtained Mg(HB)2, through a wet method that we developed accordingly. This method has not been previously used for the synthesis of hydrazinidoboranes, and it consists in the direct reaction between HB and a metal alkyl precursor, di-n-butylmagnesium, in THF. Mg(HB)2 carries 10.6 wt. % H, which represents more H than any of the alkali hydrazinidoboranes (with the exception of LiHB). The thermal properties of the magnesium derivative are in contrast with previous hydrazinidoboranes. The characterization and evaluation of the dehydrogenation properties of Mg(HB)2, were carried out in this study and are presented hereafter.

Materials and methods

Reagents

Commercial hydrazine hemisulphate (N2H4•½H2SO4, Sigma-Aldrich, ≥98 %), sodium borohydride (NaBH4, Sigma-Aldrich, ≥98 %) and 1,4-dioxane (Sigma-Aldrich, anhydrous, ≥99.8%) were used to synthesize HB. Di-n-butylmagnesium solution (Sigma-Aldrich, 1.0 M in heptane) was used as the source of magnesium, and THF (Acros Organics, extra dry, 99.5 %)

was used as the solvent in the synthesis of Mg(HB)2.

Synthesis

Synthesis of HB

The experiments were carried out under an inert atmosphere using either a glove box (MBraun M200B; O2< 0.1 ppm and H2O< 0.1 ppm) or a Schlenk line. HB is synthesized by a method that was developed and optimized in our lab [START_REF] Moury | Hydrazine borane: Synthesis, characterization, and application prospects in chemical hydrogen storage[END_REF]. In this synthesis route, 21.59 g of N2H4·½H2SO4 and 10.12 g of NaBH4 are weighed in the glove box and put in a flask, which is transferred outside the glove box. Once connected to the Schlenk line, both reactants are suspended in 150 mL of 1,4-dioxane in a round-bottom Schlenk under stirring at 30 °C for 48 h. The obtained suspension is filtered and then, the solvent of the obtained solution is removed under vacuum.

With this route, almost pure HB is obtained (>99.5 % pure, with a yield of approximately 80 %).

The synthesis reaction is written as follows:

NaBH 4 + N 2 H 4 • 1 2 H 2 SO 4 → N 2 H 4 BH 3 + 1 2 Na 2 SO 4 + H 2 (3)

Synthesis of Mg(HB)2

Inside the glovebox, 0.300 g of HB were dissolved in 20 mL of anhydrous THF under stirring.

With a syringe, 3 mL of the di-n-butylmagnesium were added dropwise. The molar ratio HB:Mg was of 2:1, with a 10% excess of HB. After the first drops were added, a white precipitate formed, and the release of gaseous butane was observed (Supplementary Material (SM), Figure S1). The suspension was maintained under stirring for 20 h. The overall reaction can be written as follows:

2N 2 H 4 BH 3 + CH 3 CH 2 3 2 Mg → Mg N 2 H 3 BH 3 2 + 2C 4 H 10 (4)
After this time, the white suspension was centrifuged for 15 min at 5500 rpm. The solvent was removed and fresh THF was added to wash the product and remove any remaining HB. This process was repeated twice. The washed product was collected into a vial and it was introduced into a round bottom Schlenk flask. Right after, the flask was taken out of the glovebox and it was connected to the Schlenk line to be dried under vacuum overnight (at room temperature). Finally, the product, in the form of a white powder, was recovered and stored inside the glovebox for further analyses.

Characterization

Structural characterization

Mg(HB)2 and the dehydrogenated solid residues were analyzed by Fourier Transformed Infrared spectroscopy (FTIR, NEXUS instrument, ThermoFisher Scientific, equipped with an attenuated total reflection accessory from 600 to 4000 cm -1 wavenumber, 32 scans). The samples were prepared inside the glove box in vials, and analyzed under air, taking them out of the vial at the last moment before the analysis. The same samples were also analyzed by solid-state 11 B magic angle spinning nuclear magnetic resonance (MAS NMR; Varian VNMR4000, 128.31 MHz).

ZrO2 rotors of 3.2 mm in diameter were used for the analyses.

Powder X-ray diffraction (PXRD) was used to characterize all the samples. A PANalytical X'pert Pro diffractometer in Bragg-Brentano geometry was used. The samples were analyzed over the 2θ range of 10-65°. All the samples were prepared inside the glovebox, and they were protected from air by a Kapton film. X-ray Photoelectron Spectroscopy (XPS) analyses were performed with a spectrometer Escalab 250Xi (ThermoElectron), equipped with an Al-Kα monochromatized source (1486.6 eV). The binding energy was calibrated with the C 1s reference at 285.0 eV. In addition, some liquid-state Nuclear Magnetic Resonance analyses were performed (NMR; Bruker Avance; 9 T; 400 MHz, CD3CN as deuterated solvent).

Thermal characterization

Mg(HB)2 was analyzed using simultaneous thermogravimetric (TG) and differential scanning calorimetry (DSC) analyses, in an SDT Q600 apparatus (TA Instruments). In addition, a TG analysis (Netzsch STA 449 F1 Jupiter) coupled with a mass spectrometer (MS; Netzsch QMS 403 D Aëolos Quadro) was performed to analyze the evolved gases from the sample. The samples were prepared inside the glove box, where the powder was enclosed in an aluminum Tzero hermetic pan to keep it under inert atmosphere. Before the analysis, the pan was pierced with a needle to allow the gases to escape.

The decomposition behavior of Mg(HB)2 was analyzed at isothermal condition at different temperatures (80, 100 and 120 °C) in a stainless-steel reactor. In the glove box, 80 mg of the sample was weighed and placed in a glass vial inside the reactor. The reactor was transferred outside the glove box, connected to a pressure controller and immersed in an oil bath at the required temperature. The change of pressure was monitored as a function of time. The equivalents of gas liberated were calculated considering the gas as ideal. The time period in which the reactor passes from room temperature to the analysis temperature was not considered.

The gases released by the sample were analyzed with a gas chromatograph (GC; PerkinElmer Clarus 400 equipped with a ShinCarbon ST 100/120 Restek column), using helium as the vector gas. The GC is coupled with a mass spectrometer (MS; PerkinElmer Clarus 600 T, equipped with an Elite-GC Molesieve and an Elite Plot Q column). Typically, a sample of 100 μL of gas was taken with a glass syringe and injected into the GC-MS.

Results and discussion

Preliminary comments

Mg(HB)2 is a white powder at room temperature. Tests of solubility in anhydrous organic solvents were unsuccessful for THF, 1-4 dioxane, toluene and dimethyl carbonate. Regarding protic solvents, Mg(HB)2 violently reacts with water (hydrolysis reaction), with a fast H2 release.

The same happens, at a slower rate, for methanol, ethanol and isopropanol (alcoholysis reactions). This behavior is typical of the alkali hydrazinidoboranes and of AB derivatives (amidoboranes) [START_REF] Wu | Metal hydrazinoborane LiN2H3BH3 and LiN2H3BH3•2N2H4BH3: crystal structures and highextent dehydrogenation[END_REF][START_REF] Moury | Sodium hydrazinidoborane: A chemical hydrogen-storage material[END_REF][START_REF] Castilla-Martinez | Rubidium hydrazinidoborane: Synthesis, characterization and hydrogen release properties[END_REF][START_REF] Chua | Development of amidoboranes for hydrogen storage[END_REF]. When Mg(HB)2 was treated at 400 °C, the solid product recovered was stable; in comparison with HB, the generation of a shock-sensitive product was avoided. Ion conductivity experiments were carried out to test the effect of the Mg 2+ in the material. Nevertheless, the sample was not at all conductive.

Molecular structure of Mg(HB)2

Mg(HB)2 was analyzed by FTIR and the spectrum was compared with that of HB (Figure 1). As it can be observed, Mg(HB)2 presents all the characteristic bands of B-and N-based compounds, and the spectrum is similar to those of the other hydrazinidoboranes [START_REF] Moury | Lithium hydrazinidoborane: A polymorphic material with potential for chemical hydrogen storage[END_REF][START_REF] Moury | Sodium hydrazinidoborane: A chemical hydrogen-storage material[END_REF][START_REF] Castilla-Martinez | Rubidium hydrazinidoborane: Synthesis, characterization and hydrogen release properties[END_REF][START_REF] Castilla-Martinez | Cesium hydrazinidoborane, the last of the alkali hydrazinidoboranes, studied as potential hydrogen storage material[END_REF]. The N-H stretching bands can be seen in the range 2800-3400 cm -1 , while the B-H stretching vibration modes are observed between 2000-2600 cm -1 . However, the spectrum is different from that of the parent HB [START_REF] Moury | Hydrazine borane: Synthesis, characterization, and application prospects in chemical hydrogen storage[END_REF]. Both the N-H and B-H vibrational modes are less complex in Mg(HB)2 in comparison with HB. This indicates a difference in the bonding and electronic structure in the N2H4 -of HB and the Mg-N2H3 -of Mg(HB)2, and this is due to weaker interactions between the protic H δ+ and the hydridic H δ-hydrogens in the molecule [START_REF] Kim | Rules and trends of metal cation driven hydride-transfer mechanisms in metal amidoboranes[END_REF]. The same trend can be seen in the N-H bending region (1300-1600 cm -1 ). In addition, in the case of HB, the B-N bond appears at 749 cm -1 and for Mg(HB)2, it has blue-shifted to 790 cm -1 , indicating an increase in energy, and thus a shortening of the B-N bond, characteristic of hydrazinidoboranes [START_REF] Xiong | High-capacity hydrogen storage in lithium and sodium amidoboranes[END_REF]. Mg(HB)2 was analyzed by 11 B MAS NMR spectroscopy and its spectrum was compared with that of HB (Figure 2). HB presents a single signal with a split shape centered at -24 ppm, indicating an NBH3 environment. This shape is characteristic of a quadrupolar effect of the boron, indicating anisotropy around the atom [START_REF] Eaton | NMR of boron compounds[END_REF][START_REF] Hansen | 11 B chemical shift anisotropies in borates from 11 B MAS, MQMAS, and single-crystal NMR spectroscopy[END_REF][START_REF] Hermanek | 11 B NMR Spectra of boranes, main-group heteroboranes, and substituted derivatives Factors influencing chemical shifts of skeletal atoms[END_REF]. In the case of Mg(HB)2, a single peak is observed at -19 ppm, corresponding to an NBH3 environment. This symmetric signal indicates a change in the electronic environment around the boron atom, indicating a change from an anisotropic environment to an isotropic environment around it. The shift of this signal to a lower field and the symmetric shape are indubitable proof of the substitution of one of the protic hydrogens of the hydrazine moiety by the alkaline-earth cation, as this has been systematically observed for all alkali hydrazinidoboranes [START_REF] Moury | Lithium hydrazinidoborane: A polymorphic material with potential for chemical hydrogen storage[END_REF][START_REF] Moury | Sodium hydrazinidoborane: A chemical hydrogen-storage material[END_REF][START_REF] Chua | Alkali metal hydride modification on hydrazine borane for improved dehydrogenation[END_REF][START_REF] Castilla-Martinez | Rubidium hydrazinidoborane: Synthesis, characterization and hydrogen release properties[END_REF][START_REF] Castilla-Martinez | Cesium hydrazinidoborane, the last of the alkali hydrazinidoboranes, studied as potential hydrogen storage material[END_REF]. This shift indicates an increase in the electronic density around the N atom and thus, the shortening of the B-N bond, in agreement with the FTIR analysis. Another signal can be observed in the spectrum of Mg(HB)2, centered at -8 ppm (marked with a star). We associate this signal with a slight decomposition of the material due to the MAS NMR analysis (due to the rotor rotation). This is a phenomenon that we have observed systematically during the MAS NMR analysis of several boron-and nitrogen-based compounds. However, we do not discard the possibility of a slight decomposition of the sample during the synthesis of the compound, due to the exothermicity of the reaction. The * indicates some byproducts due to a slight decomposition of the sample during the analysis.

Mg(HB)2 was analyzed by PXRD (SM, Figure S2). No peaks can be found in the diffraction pattern. This indicates an amorphous compound. It is important to remark that the synthesis was tried out at low temperature (-5 °C), trying to slow down the kinetics of formation of Mg(HB)2, but in all cases the results were the same.

Thermal decomposition of Mg(HB)2

The thermal decomposition of Mg(HB)2 was investigated by thermal gravimetric analysis and differential scanning calorimetry, with a heating ramp of 5 °C min -1 . The gases released by the sample were analyzed by MS. As shown in Figure 3, the compound starts to decompose at 60 °C and it loses 6 wt. % of the initial mass in the range of 60-115 °C. After this first loss, the material presents relative stability between 115 and 180 °C. In the range of 180-400 °C, the mass loss is of 11 wt. %. According to the MS results, the first loss of mass is mainly due to the release of N2 and H2. However, a small signal for m/z = 32 is also present, which indicates the evolution of N2H4. The second mass loss is related to the emission of N2, H2 and NH3. The overall mass loss in the range of 40-400 °C is of 16.6 wt. %, which surpasses the hydrogen content of Mg(HB)2, The DSC curve shows a single exothermic event at 222 °C. According to the MS analysis, there is an important release of H2 and N2 at 217 and 224 °C, respectively. The exothermic peak at 222 °C seems to be related to the emission of these two gases. In contrast with the alkali hydrazinidoboranes, Mg(HB)2 does not show an endothermic process, and thus, it apparently does not melt. A similar behavior was found for Ca(HB)2 [START_REF] Ould-Amara | Calcium hydrazinidoborane: Synthesis, characterization, and promises for hydrogen storage[END_REF].

The lack of theoretical calculations in the decomposition mechanisms of hydrazinidoboranes prevents us from giving an exact reaction pathway. However, we can propose a mechanism based on the available information. The evolution of N2H4, NH3 and H2 could be explained by the formation of an analogous compound of diammoniate of diborane ([(NH3)2BH2] + [BH4] -, DADB), a compound detected in the thermolysis of AB [START_REF] Rizzi | The onset of dehydrogenation in solid ammonia borane: An ab initio metadynamics study[END_REF][START_REF] Stowe | In situ solid state 11 B MAS-NMR studies of the thermal decomposition of ammonia borane: Mechanistic studies of the hydrogen release pathways from a solid state hydrogen storage material[END_REF][START_REF] Kobayashi | Mechanism of solidstate thermolysis of ammonia borane: A 15 N NMR study using fast magic-angle spinning and dynamic nuclear polarization[END_REF][START_REF] Chatterjee | Development of a reaction mechanism for liquid-phase decomposition of ammonia borane[END_REF][START_REF] Chen | Experimental and computational study of the formation mechanism of the diammoniate of diborane: The role of dihydrogen bonds[END_REF]. It is likely that the dehydrogenation of Mg(HB)2 happens via the "metal cation driven hydride-transfer" mechanism (Figure 4) [START_REF] Banu | Dehydrogenation of lithium hydrazinidoborane: Insight from computational analysis[END_REF][START_REF] Li | Theoretical study of the structure and dehydrogenation mechanism of sodium hydrazinidoborane[END_REF][START_REF] Shevlin | Dehydrogenation mechanisms and thermodynamics of MNH2BH3 (M = Li, Na) metal amidoboranes as predicted from first principles[END_REF]. This mechanism implies the migration of a hydridic H δ-hydrogen atom from the BH3 moiety of the molecule to form a metal hydride intermediate with the metal cation (Mg-H). Just after, the H δ-is transferred to the other [N2H3BH3] -anion. This leads to the formation of an intermediate such as [Mg(N2H3)2BH2] + [BH4] -. The dehydrocoupling reaction might continue due to this hypothetical species. Also, it is probable that parallel reactions might happen: due to the higher concentration of N2H3 with respect to the BH2 groups, the formation of volatile products such as N2 and NH3 takes place, following equations ( 5) and ( 6). were weighed and put in a stainless-steel reactor inside the glovebox. The reactor was transferred out of the glovebox and heated in a controlled furnace. The heating ramp was of 5 °C min -1 up to 140 °C, in order to maintain the conditions used in the TG analysis. The reactor was left for 5 min after the furnace reached 140 °C, and after this, it was taken out of the furnace and left to cool down to room temperature. To treat the sample at 400 °C, a tubular furnace was used. A flow of nitrogen (100 mL min -1 ) was set and the sample was heated from room temperature to 400 °C with a ramp of 5 °C min -1 . After this, the sample was left to cool down in the furnace to room temperature. Both solid products were characterized.

2N 2 H 3 → 2NH 3 + N 2 (5) 2N 2 H 3 → N 2 H 4 + H 2 + N 2 (6)
The FTIR spectra of the samples heated at 140 and 400 °C, hereafter referred as MgHB140 and MgHB400 respectively, were compared with the one of Mg(HB)2 (SM, Figure S3). Regarding MgHB140, a slight change can be seen in the N-H stretching band at about 2800 cm -1 that is less intense. However, no other visible changes are observed: the two spectra are practically identical. In the case of MgHB400, the N-H and B-H stretching bands have disappeared. Broad bands can be seen at about 760 cm -1 and at 1400 cm -1 , which belong to B-N vibrational modes.

The results of the 11 B MAS NMR analysis are shown in Figure 5. There are no changes between the fresh sample and the one heated with a ramp at 140 °C; the only signal is still present at -19 ppm, belonging to the NBH3 environment. In the case of MgHB400, a broad signal can be seen in the positive chemical shifts. The signals that appear between 0-5 ppm belong to BN4 environments [START_REF] Kobayashi | Mechanism of solidstate thermolysis of ammonia borane: A 15 N NMR study using fast magic-angle spinning and dynamic nuclear polarization[END_REF][START_REF] Li | Two novel derivatives of ammonia borane for hydrogen storage: Synthesis, structure, and hydrogen desorption investigation[END_REF]. The signals between 10-30 ppm are typical to trivalent boron species, and they are usually assigned to boron and nitrogen-based polymeric species, such as polyborazylene and/or boron nitride with BN2H or BN3 environments [START_REF] Kim | Synthesis and characterization of poly-(aminoborane) as a new boron nitride precursor[END_REF][START_REF] Gervais | 11 B and 15 N solid state NMR investigation of a boron nitride preceramic polymer prepared by ammonolysis of borazine[END_REF][START_REF] Gervais | Chemically derived BN ceramics: Extensive 11 B and 15 N solid-state NMR study of a preceramic polyborazilene[END_REF]. Also, it is possible that homopolar dehydrocoupling between the B atoms may occur, giving rise to B2NH environments [START_REF] Roy | Exploring the homopolar dehydrocoupling of ammonia borane by solid-state multinuclear NMR spectroscopy[END_REF]. These signals are typically detected in the solid products after thermolysis of boron-and nitrogen-based compounds. The PXRD patterns of the samples are shown in Figure 6. Broad peaks can be observed between 12-25°, indicated by the symbol #, which corresponds to the Kapton film used to protect the sample from air. For MgHB140, a single peak appeared at 18.2° when the sample was heated up to 140 °C. This peak does not correspond with any of the diffraction peaks of a possible compound formed during thermolysis, such as MgH2, Mg or Mg(BH)4. It is possible that a crystalline intermediate has formed in such conditions. However, we repeated the experiments heating fresh Mg(HB)2 up to 125 and 155 °C and no diffraction peaks were detected in the patterns. In the case of MgHB400, the sample is amorphous, with a small signal presented at 42.7°. In this case, this peak could belong to MgO [START_REF] Sahoo | Magnesium oxide nanoparticles decorated iron oxide nanorods: Synthesis, characterization and remediation of Congo red dye from aqueous media[END_REF][START_REF] Karuppusamy | Ultrasound-assisted synthesis of mixed calcium magnesium oxide (CaMgO2) nanoflakes for photocatalytic degradation of methylene blue[END_REF][START_REF] Vijai Anand | Bio-28 engineered magnesium oxide nanoparticles as nano-priming agent for enhancing seed germination and seedling vigour of green gram (Vigna radiata L)[END_REF], which corresponds to the (2 0 0) plane. It is possible that some air entered in contact with the sample when introducing it into the tubular furnace, which would result in the formation of small quantities of Mg(OH)2, that would dehydrate to MgO with thermal treatment [START_REF] Kondo | Investigation on the mechanisms of Mg(OH)2 dehydration and MgO hydration by near-infrared spectroscopy[END_REF]. In addition, a broad signal appeared centered at 26°, that is associated with the formation of amorphous boron nitride [START_REF] Lei | Highly crumpled boron nitride nanosheets as adsorbents: Scalable solvent-less production[END_REF]. In order to have a better overview of the chemical state of Mg(HB)2 and the solid products obtained after heat treatment at 140 and 400 °C, the samples were analyzed by XPS. The B 1s

and N 1s spectra of the three samples are shown in Figure 7. For Mg(HB)2, the B 1s spectrum

shows two signals, one centered at 188.8 eV that is assigned to B-H bonds [START_REF] Oñate | Deposition of hydrogenated B-C thin films and their mechanical and chemical characterization[END_REF], and the other at 191.8 eV that can be assigned to a BNxOy species(B-O) [START_REF] Schild | XPS investigations of thick, oxygen-containing cubic boron nitride coatings[END_REF][START_REF] Marincel | Scalable purification of boron nitride nanotubes via wetthermal etching[END_REF][START_REF] Badi | High temperature dielectric properties of (BxNyOz) thin films deposited using ion source assisted physical vapor deposition[END_REF]. This last signal is associated with a partial oxidation of the sample due to the exposure of the sample to the atmosphere. As the samples were packed and transported to perform the XPS analysis, it is probable that a small quantity of air could have entered the vial during transportation.

The N 1s spectrum of Mg(HB)2 shows a single symmetrical signal centered at 400.9 eV, corresponding to a N2-H3 species [START_REF] Alberas | Surface chemistry of hydrazine on Pt(111)[END_REF]. After the sample is heated at 140 °C under argon The spectra of Mg 2p and Mg KLL of Mg(HB)2 for the samples MgHB140 and MgHB400 was obtained (SM. Figure S4). The Mg 2p spectra of all samples presents a symmetrical signal centered at 50.0 ± 0.3 eV. As reported in the literature, the Mg KLL Auger signal of a Mg compound is composed of two main transitions, where the second peak has a higher intensity [START_REF] Fuggle | X-ray excited Auger and photoelectron spectra of magnesium, some alloys of magnesium and its oxide[END_REF]. The kinetic energy reported for metallic Mg is 1185 eV, so in this case the Mg 2+ state of the atom is confirmed, appearing at a lower value. The position of the Auger peaks at 1180 and 1175 eV suggest the formation of MgO [START_REF] Fuggle | X-ray excited Auger and photoelectron spectra of magnesium, some alloys of magnesium and its oxide[END_REF][START_REF] Crociani | Study of magnesium boride films obtained from Mg(BH4)2 by CVD[END_REF][START_REF] Crociani | Chemical composition of magnesium boride films obtained by CVD[END_REF]. However, the peak centered at 50.0 eV does not match with the expected value of MgO (at 51.0±0. When the Mg(HB)2 sample and the one heated at 140 °C were being analyzed by XPS, the evolution of the sample was observed due to the X-ray beam. We compared the spectra of the pristine samples with the spectra after some time under X-ray irradiation. As shown in Figure 8a, the B-H signal of Mg(HB)2 decreased in intensity and broadened, indicating a dehydrogenation of the sample. This indicates an easy decomposition of the sample due to the exposure to the Xray beam. In the case of MgHB140, the original signal merged in a single curve that was deconvoluted in three peaks. The apparition of the peak at 190.5 eV indicates the formation of B-N polymeric compounds, such as polyborazylene-like ones. The sample MgHB400 did not present any changes before and after the XPS analysis (not shown). It is evident that these samples decompose under the action of the X-ray beam. Based on these results, and in our experience with similar materials, we conclude that the analysis of borane compounds by XPS technique is hard, due to the prompt evolution (instability) of the samples under the X-ray beam.

The B-O signal is still present and is centered at 191.5 eV. As previously mentioned, we associate this signal to the formation of BNxOy species due to the probable exposure of the sample to air during transportation. Mg(HB)2 was heated under isothermal conditions at 80, 100 and 120 °C in order to evaluate the dehydrogenation rate of the compound. As shown in Figure 9, the decomposition of Mg(HB)2 is a single step process. The three curves present the same behavior. The curves of 80 and 100 °C present an induction period of 18 min. After this, the sample starts to release H2. A linear regression for the first steeper step of the dehydrogenation was performed (indicated by dashed rectangles in Figure 9) to calculate the initial rates of dehydrogenation. The dehydrogenation rates are 0.011, 0.013 and 0.037 equiv. H2 min -1 for 80, 100 and 120 °C respectively. As expected, increasing the temperature increases the rate of generation of H2. However, even at 120 °C, the equiv. H2 released are not huge. After 120 min of heat treatment, the samples under isothermal conditions at 80, 100 and 120 °C release only 0.15, 0.23 and 0.40 equiv. H2 respectively.

Decomposition of Mg(HB)2 under isothermal conditions

Regarding the dehydrogenation properties of Mg(HB)2 at these conditions, the performance of Mg(HB)2 is lower compared with other hydrazinidoboranes (SM, Figure S5) [START_REF] Moury | Sodium hydrazinidoborane: A chemical hydrogen-storage material[END_REF][START_REF] Castilla-Martinez | Rubidium hydrazinidoborane: Synthesis, characterization and hydrogen release properties[END_REF][START_REF] Moury | Hydrazine borane: Synthesis, characterization, and application prospects in chemical hydrogen storage[END_REF]. Even if we compare it with the parent HB at 100 °C, Mg(HB)2 releases only a third of the quantity of gases released by HB after 1 h of heat treatment (0.2 vs. 0.65 respectively). This indicates that the introduction of the Mg 2+ cation changed the behavior of HB, but it did not succeed in releasing more H2 at lower temperatures. In other words, unlike any other HB derivative, Mg(HB)2 is more thermally stable than HB.

The gases released by Mg(HB)2 during the isothermal experiments at 80 and 100 °C were analyzed by GC-MS (SM, Figure S6 and Figure S7). In our conditions, the presence of H2 is confirmed. As we cannot avoid the introduction of small quantities of air when injecting the sample, air was injected in the chromatogram as reference. The signals observed between 1 and 2 min belong to the retention time of N2 and O2 of air. The MS spectra for both samples show the presence of H2, N2 and O2. It is difficult to affirm if the N2 detected belongs only to the air, or if the gases released by the sample have a contribution to this signal. It is noticeable that under isothermal conditions and at 80 and 100 °C, no NH3 and no N2H4 were detected.

The solid residues recovered after the isothermal experiments were analyzed by FTIR, PXRD and MAS NMR. The FTIR spectra of the solid residues show that, in concordance with the isothermal experiments, the dehydrogenation of the samples happened to a small extent (SM, Figure S8). The N-H and B-H stretching bands are still present in the spectra at 80, 100 and 120 °C. The PXRD analysis showed that there are no changes in the structure of the sample; all of them are amorphous (SM, Figure S9). The 11 B MAS NMR spectra of the solid residues were compared with that of Mg(HB)2 (SM, Figure S10). In agreement with the FTIR and PXRD analyses, there are no visible changes in the spectra. The NBH3 environment is the main signal for the solid residues treated at 80 and 100 °C. This indicates that the BH3 moiety of Mg(HB)2 is stable up to 120 °C, and that the H2 generated might be mostly due to the N2H3 moiety.

Based on the previous results, it is likely that in a closed system and up to 140 °C, H2 is released mainly by homopolar interactions (H δ+ •••H δ+ ) of the N2H3 moiety, as the BH3 environment remained unchanged. The species detected in the N 1s XPS spectrum of MgHB140 also supports this affirmation, where Mg(HB)2 was heated in a closed stainless steel reactor. This is in contrast with ammonia borane and other boron-and nitrogen-based compounds, where the first dehydrogenation step typically involves both heteropolar and homopolar interactions [START_REF] Kumar | Solid-state hydrogen rich boronnitrogen compounds for energy storage[END_REF][START_REF] Wolstenholme | Thermal desorption of hydrogen from ammonia borane: Unexpected role of homopolar B-H•••H-B interactions[END_REF]. It is the first time that we have detected this phenomenon in the dehydrogenation behavior of hydrazinidoboranes.

The low equiv. H2 estimated by the isothermal experiments explains why all the spectra of the compound are pretty similar up to this temperature. However, under an "open" system (TGA),

where the produced gases are being carried by the gas of the apparatus, a mass loss of 6 wt. % was detected. This is a phenomenon that has been frequently observed for amidoboranes/hydrazinidoboranes: the different thermal behavior of the compounds analyzed in a closed and an open system.

Stability of Mg(HB)2

Mg(HB)2 was stored under inert atmosphere and analyzed after 5 months of its synthesis by FTIR and 11 B MAS NMR (SM, Figure S11), and compared with the fresh sample. The spectra of both analyses show that there are no visible changes after the 5 months. Mg(HB)2 is thus stable over long periods of time.

The behavior of Mg(HB)2 was also analyzed under air atmosphere. A few milligrams were put in contact with air for 10 min and the powder was analyzed by FTIR. Surprisingly, the FTIR spectrum of the sample resembled the HB spectrum. Further analyses were carried out in order to understand this behavior.

Mg(HB)2 was exposed again to air for 10 min and immediately, it was put into an inert atmosphere. After, 1,4-dioxane was added to the sample. Part of the sample was solubilized and the other part precipitated. The suspension was centrifuged and separated. In the case of the part that was solubilized, the 1,4-dioxane was extracted and a white powder was obtained, and it was analyzed by FTIR and liquid 1 H NMR. The insoluble precipitate was dried under dynamic vacuum for 24 h and analyzed by FTIR.

The solid powder obtained after extraction of the solvent was identified as HB, based on the FTIR and the 1 H NMR spectra (SM, Figure S12). These results indicate that Mg(HB)2 is sensitive to air and it can undergo a reversible reaction when it is taken out of an inert atmosphere, because it can react with the water present in the air. The following reaction is proposed:

Mg N 2 H 3 BH 3 2 + 2H 2 O → 2N 2 H 4 BH 3 + Mg OH 2 (7)
Regarding the spectrum of the solid precipitate, it resembles that of Mg(HB)2 (SM, Figure S13).

However, a band appeared above 3600 cm -1 (O-H stretching). This can be explained by the formation of Mg(OH)2. This also correlates with the detected signals in the XPS analysis (SM, Figure S4).

Hydrogen storage properties and perspectives

As previously mentioned, Mg(HB)2, loses 6 % of weight between 60-120 °C, mainly due to the emission of N2 and some H2. A higher release of H2 was detected with a sharper signal by the MS analysis at 218 °C. This is a different behavior than observed in previous alkali hydrazinidoboranes or other composites. For example, a mixture of MgH2 and HB was prepared by ball milling and further analyzed [START_REF] Pylypko | Metal hydride-hydrazine borane: Towards hydrazinidoboranes or composites as hydrogen carriers[END_REF]. Regarding the thermal behavior of the mixture, the mass loss is similar to that of HB. However, H2 was released from 40 °C, showing a slight destabilization of HB due to the incorporation of MgH2. In a similar way, some studies were performed in a mixture of MgH2 and AB [START_REF] Nakagawa | Ammonia Borane-Metal Hydride) composites: Systematic understanding of dehydrogenation properties[END_REF][START_REF] Kang | Promoted hydrogen release from ammonia borane by mechanically milling with magnesium hydride: A new destabilizing approach[END_REF]. The destabilization of the mixture was demonstrated, where it released H2 at lower temperatures in comparison with neat AB, and suppressed some of the gaseous byproducts.

We also compared the dehydrogenation behavior of Mg(HB)2 with its analogous amidoborane.

Magnesium amidoborane Mg(AB)2 is a crystalline solid that releases about 10 wt. % H up to 300 °C [START_REF] Luo | Synthesis, formation mechanism, and dehydrogenation properties of the long-sought Mg(NH2BH3)2 compound[END_REF]. However, in comparison with other amidoboranes, Mg(AB)2 starts to release H2 at a higher temperature (i.e. it is more stable). It seems that in order to release H2, Mg(AB)2 must overcome a large energetic barrier. The larger Pauling electronegativity of Mg, in comparison to other elements, is the origin of this barrier [START_REF] Luedtke | Hydrogen release studies of alkali metal amidoboranes[END_REF]. Interestingly, Mg(HB)2 presents a similar higher thermal stability in comparison with the parent HB and other MHBs. This feature, together with the stability over time of this compound, might favor the potential use of this material for H2 storage applications at temperatures such as 150-250 °C. Otherwise, Mg(HB)2 might be considered as ceramic precursors. For example, it is known that AB and HB can be used as precursors of boron nitride (BN) [START_REF] Frueh | Pyrolytic decomposition of ammonia borane to boron nitride[END_REF][START_REF] Manelis | Combustion and thermal decomposition of hydrazine borane[END_REF]. The use of an alkali/alkaline earth hydrazinidoborane as precursor of BN might lead to the incorporation of the alkali or alkaline earth cation into the BN structure. Such functionalized BN structures have been proposed as potential materials for hydrogen storage [START_REF] Noura | A theoretical first principles computational investigation into the potential of aluminum-doped boron nitride nanotubes for hydrogen storage[END_REF][START_REF] Ma | First-principles study of hydrogen storage on Ca-decorated defective boron nitride nanosheets[END_REF].

We also have to mention another drawback about boron-and nitrogen-based materials for hydrogen storage applications: the regeneration of the dehydrogenated solid. As the dehydrogenation of these compounds is exothermic, the rehydrogenation is thermodynamically unfavorable. Different attempts have been proposed for the regeneration of AB [START_REF] Hajari | Metal-free rapid dehydrogenation kinetics and better regeneration yield of ammonia borane[END_REF][START_REF] Tang | Regeneration of alkaline metal amidoboranes with high purity[END_REF][START_REF] Tan | Reductive dechlorination of BCl3 for efficient ammonia borane regeneration[END_REF], but implementing a cost-effective and efficient method has not been achieved yet. This is still a big challenge, if not the biggest, for boron-and nitrogen-based materials. A last issue is the purity of the H2 released by these compounds. Many amidoboranes/hydrazinidoboranes release H2 polluted with NH3. The gas stream would require a purification system to deliver a highly pure H2.

Conclusion

In this work, Mg(HB)2 was obtained by an alternative synthesis route, which is the reaction between HB and n-dibutyl magnesium in THF. The new hydrazinidoborane was identified by different spectroscopy techniques. Mg(HB)2 is a compound with a good stability over time and under inert atmosphere, but it showed a rapid evolution under the irradiation of a X-ray beam.

Unlike any of the previous derivatives of HB, Mg(HB)2 is thermally more stable than the parent HB. Also, when Mg(HB)2 is put into contact with air, the compound goes through a reversible process to form HB and Mg(OH)2.

On the one hand, the thermal characterization under isothermal conditions showed that the dehydrogenation of Mg(HB)2 is a one-step process (with an induction period of time), and it happens to a limited extent up to 120 °C, releasing only 0.40 equiv. H2. Also under these conditions, the only byproduct detected was N2. In contrast with other amidoboranes/hydrazinidoboranes, it appears that Mg(HB)2 releases H2 due to the homopolar interaction between N2H3 groups when the compound is heated in a closed system. On the other hand, the TGA-MS analysis showed the release of different byproducts along with H2 (N2, NH3

and N2H4) and a considerable mass loss (16.6 wt. %) up to 400 °C. This indicates again the different thermal behavior of amidoboranes/hydrazinidoboranes depending on the conditions of the analysis (open/closed system).

Based on previous works, it is evident that the alkaline earth derivatives of HB are difficult to synthesize. Even if the magnesium derivative has a high content of H2, it shows the production of undesired byproducts during their decomposition (N2, NH3, N2H4). This makes Mg(HB)2, like the previously reported Ca(HB)2, unsuitable for hydrogen storage at near-ambient conditions.

Other prospects have been suggested, such as using Mg(HB)2 as precursor of boron nitridederived ceramics for H2 storage, for example. It is likely that the Mg 2+ in the molecule could have an impact on the properties of the ceramics after heat treatment.

Figure 1 .

 1 Figure 1. FTIR spectra of HB and Mg(HB)2. The bands have been assigned.

Figure 2 .

 2 Figure 2. 11 B MAS NMR spectra of HB and Mg(HB)2. The chemical shifts in ppm are indicated.

  10.5 wt. % H. If we consider a total dehydrogenation of the sample, this means that 6.1 wt. % of the mass loss is due to the emission of N2, NH3 and N2H4. At these conditions, no other volatile compounds were detected (i.e. B2H6 or B3N3H6). A similar behavior was reported for calcium hydrazinidoborane[START_REF] Ould-Amara | Calcium hydrazinidoborane: Synthesis, characterization, and promises for hydrogen storage[END_REF].

Figure 3 .

 3 Figure 3. TGA-MS and DSC curves of Mg(HB)2 (heating ramp of 5 °C min -1 ). m/z = 2, 17, 28 and 32 for H2, NH3, N2, and N2H4 respectively. The temperature in °C is indicated.

Figure 4 .

 4 Figure 4. Proposed Mg 2+ driven hydride-transfer mechanism of the possible formation of [Mg(N2H3)2BH2] + [BH4] -as reaction intermediate

Figure 5 .

 5 Figure 5. 11 B MAS NMR spectra of Mg(HB)2, MgHB140 and MgHB400. The chemical shifts in ppm are indicated.

Figure 6 .

 6 Figure 6. PXRD patterns of Mg(HB)2, MgHB140 and MgHB400. The * indicates a diffraction peak of an unidentified compound. The @ indicates a diffraction peak that might belong to MgO. The # are bands assigned to the Kapton film used to protect the sample from air.

  intensity of the B-H signal decreases in the B 1s spectrum. The signal of the B-O species remains in the spectrum. In the case of the N 1s spectrum, the curve was deconvoluted into two signals, one centered at 400.7 eV which corresponds to the N2-H3 species, and a second one centered at 401.8 eV. This last signal is attributed to a N2Hx (1<x<3) species[START_REF] Alberas | Surface chemistry of hydrazine on Pt(111)[END_REF]. This suggests a partial dehydrogenation of the N2H3 moiety of the molecule. At 400 °C, the B 1s spectrum presents the disappearance of the B-H signal and it shows a new signal at 190.5 eV, characteristic of B-N bonds in polyborazylene or boron nitride, in agreement with the 11 B MAS NMR analysis[START_REF] Marincel | Scalable purification of boron nitride nanotubes via wetthermal etching[END_REF][START_REF] Badi | High temperature dielectric properties of (BxNyOz) thin films deposited using ion source assisted physical vapor deposition[END_REF][START_REF] Bachmann | A HR-XPS study of the formation of h-BN on Ni(111) from the two precursors, ammonia borane and borazine[END_REF]. The N 1s spectrum of MgHB400 shows remaining species with N-H bonds, but the main new signal is centered at 398.1 eV, associated to the polyborazylene/boron nitride-like compounds.

Figure 7 .

 7 Figure 7. XPS spectra of Mg(HB)2, MgHB140 and MgHB400 for a) B 1s and b) N 1s. The curves were deconvoluted with a Gaussian fit. The value of the binding energy in eV is indicated for each signal along with the associated species.

  2 eV) or of Mg(OH)2 (49.3 eV) [62]. This might indicate a different bonding like Mg-N. Nevertheless, as the diffraction pattern presented in Figure 6 also suggested the formation of MgO, we do not discard the contribution of a small quantity of MgO or Mg(OH)2 to these signals. The formation of these compounds might occur if the sample comes in contact with air at some point between the synthesis and the analyses (as previously explained, this might happen during transportation of the sample).

Figure 8 .

 8 Figure 8. Evolution of the B 1s XPS spectra of a) Mg(HB)2 and b) MgHB140. The spectra in dashed lines in the lower part of the graphics correspond to the evolved sample after some time under the X-ray beam. The spectra were deconvoluted with a Gaussian fit, and the binding energies (eV) and the assigned species are indicated on the figure.

Figure 9 .

 9 Figure 9. Time evolution of H2 release from Mg(HB)2 under heating at constant temperature (80, 100 and 120 °C). The initial faster release of H2 is indicated by the dashed rectangles.

Acknowledgments

The authors want to acknowledge the CONACyT (Mexican National Council for Science and Technology) for the scholarship of CACM. The authors acknowledge Sabine Devautour-Vinot (University of Montpellier) for the ion conductivity experiments performed for this work. A last acknowledgment for Christophe Charmette and Jim Cartier (University of Montpellier) for their valuable help with the GS-MS measurements.


Marguerite De

La Bigne

Eric Cattan

Sofiane Ghenna

Sébastien Grondel

Olivier Thomas

Olivier Thomas Design

Design and optimisation of a vibrating wing insect-size air vehicle

de niveau recherche, publiés ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

4-NAV Architectures

Two NAV architectures and their simplified models:

m 2 m 3 k 2 k 3 m 1 k 1 m 2 m 3 k 2 k 3 m 1 (a) (b) k 1
Frequency difference for the two geometries:

5-Optimisation

Study of µ 2 = m 2 m 1 : Study of ω3 and µ 3 :

• µ 2 = m 2 m 1 ≪ 1 • ω2 = ω 2 ω 1 function of ω3 = ω 3 ω 1 and µ 3 = m 3 m 1

2-Modal Superposition

We are looking for a combination of the flapping and twisting modes that gives maximum amplitude to the quadrature.

m 2 m 1 k 2 k 1
Dimensionless motion equations (2 degree of freedom):

ẍ1 + 2ξ 1 ẋ1 + (1 + µω 2 )x 1 -µω 2 x2 = cos( Ωt ), (1) ẍ2 + 2ξ 2 ẋ2 + ω2 (x 2 -x1 ) = 0, (2)
Criteria:

two resonances close together and at the same amplitude anti-resonance with a not too low amplitude ratio between the amplitude of the leading edge and the magnet of ≈ 1 6

6-First Validation Magnet position

The rigid bodies assumption is valid: only the compliant links deform.

We can achieve high amplitudes: angles of 70 • peak to peak.

  La Bigne 1,2 , É. Cattan 2 , S. Ghenna 2 ,S. Grondel 2 , O.Thomas 1 . 1 Arts et Metiers Institute of Technology, LISPEN, F-59000, Lille, France 2 Université Polytechnique des Hauts-de-France, IEMN, F-59313, Valenciennes, France 1-Context State of the art: Only 2 projects have succeeded in taking off a NAV with a mass of 100 mg: Shanghai [Zou 2018] and Harvard [Wood 2019]. They are both based on passive twisting to imitate insect flight. Insect flight [Dickinson 1999]It is a complex mechanism that can be reduced to a combination of flapping and twisting modes.It generates the larger lift when flapping and twisting are in phase quadrature.

  snapshots of the large amplitude motion of a simple prototype 7-Future Work Optimisation, fabrication and testing of a new generation of NAV. 8-Bibliographies Colin.M, Conception d'un nano-drone à ailes vibrantes. Thèse, HESAM Université, 2021. Dickinson, M. H. et F. T. Muijres, The aerodynamics and control of free flight manoeuvres in Drosophila, Philosophical Transactions of the Royal Society B: Biological Sciences 371.1704, 2016. Faux, D., Thomas, O., Cattan, É., and Grondel, S, Two modes resonant combined motion for insect wings kinematics reproduction and lift generation, EPL 121.6, 2018. Zou, Y., W. Zhang, S. Zhou, X. Ke, F. Cui et W. Liu, Monolithic fabrication of an insect-scale self-lifting flapping-wing robot, Micro & Nano Letters 13.2, 267-269, 2018. Wood, R. J., Liftoff of a 60mg flapping-wing MAV, IEEE/RSJ. International Conference on Intelligent Robots and Systems 2007, San Diego, CA, USA,1889-1894, 2007.