Introduction

Ni-Mn-based Heusler alloys exhibit diffusionless phase transformations from a cubic high temperature austenite to a low temperature martensitic phase, which provide the opportunity for more energy efficient magnetocaloric refrigeration1 as well as large stroke actuation by magnetically induced reorientation of twin boundaries2. They manifest outstanding functional magnetic properties, such as low transformation hysteresis losses3 and very low actuation fields4 only when the martensitic structure is modulated. In modulated structures the atomic positions deviate in a quite periodic way from a simple tetragonal structure. The origin of the modulation is not well-understood, with two competing explanations put forward, so far5,6,7,8.

The first explanation considers the electronic instability of the austenite phase. Fermi surface nesting within the cubic unit cell results in a soft phonon. This means that a lattice vibrational mode with a specific wave vector can be excited at a very low energy, which allows for an easy shearing of lattice planes9,10,11. In this picture, the modulations are interpreted as large shear movements that are frozen in the equilibrium martensitic phase.

The second explanation considers the phase boundary between cubic austenite and tetragonal martensite, which is required to form during a first order transition. To minimise the elastic strain energy at the phase boundary, twinning is necessary, i.e., the orientation of the tetragonal unit cells must alternate along the phase boundary. The different orientations of martensitic unit cells are connected by twin boundaries. If the elastic energy dominates over the twin boundary energy, it is beneficial to reduce the spacing of the twin boundaries to nanoscale. In the adaptive concept of Khachaturian et al.12, modulated martensite represents the shortest twinning periodicity, given by the lattice parameters. In Ni-Mn-Ga11,13,14, the modulated structure is considered to be metastable because microstructural defects like twin boundaries have an excess energy, which can drive a transition towards the tetragonal ground state15.

The adaptive concept is successful in describing the lattice constants of modulated martensite16, its magnetocrystalline anisotropy15, and the difference of twinning stress13 and twin boundary energy17 between modulated and tetragonal martensite. However, the concept has major shortcomings: it is not explaining why arrangements of nanotwin boundaries are periodic at all because irregular arrangements of nanotwin boundaries could also fulfil the elastic constraints at a phase boundary. Moreover, the preference of particular modulations, which are often stable with respect to temperature18 and cycle number19, cannot be derived from the concept. A particular shortcoming of the adaptive concept is that it cannot explain the absence of nanotwins that exhibit a width of only one lattice plane. But also the soft phonon concept has a major shortcoming. A soft phonon is a shear instability of {101} planes, but the energetically favoured transformation path follows part of the classical Bain transformation path20, which occurs by elongation and compression along the cubic < 001 > axes. As both, shear and strain, are movements in different directions, it is not clear how the atoms move towards a modulated martensite. These aspects suggest that neither of the two concepts can sufficiently describe the transformational and functional properties of modulated martensite completely.

To address this deficiency and explain key functional properties of these Heusler alloys, we used large-scale density functional theory (DFT) calculations on the Ni2MnGa prototype system. We first briefly summarize the geometry and constraints of adaptive martensite. Then, we sought to verify the existence of an interaction between nanotwin boundaries and determined the oscillating interaction energy. We investigated the formation of the so-called a/b twin boundaries at the mesoscale to explore the effects of the interaction energy on the hierarchical martensitic microstructure. We also explored the role of nanotwin ordering in the hysteresis during a martensitic transition. Following this, we sought to understand the origin of the oscillating interaction energy and the stability of different modulations. Finally, we analysed the relaxation of the atoms within the lattice to understand the connection between soft phonons and nanotwinning.

Adaptive Nanotwinning in a Nutshell

In Fig. 1, we sketch how austenite (A) and different modulated martensites (M) are related through the central constraint of length conservation. Minimising the elastic energy at the phase boundary requires that the cubic lattice of austenite must be matched by the twinned martensite. For instance, the 14M martensite consists of simple, non-modulated (NM) tetragonal martensite twins with a c/a|NM = 1.26. Twin boundaries are introduced every two long (n) and five short \((\bar{m})\) lattice planes16. This arrangement of long and short axes retains an invariant, i.e. unstrained plane, the so-called habit plane that forms the phase boundary. It is favourable in terms of elastic energy; more details are described in refs13,14,15,21. 10M martensite, discussed later in this paper, follows the same principle. The c/a|NM ratio is, however, reduced to 1.16 and twin boundaries are introduced after two and three lattice planes22. In case of a negligible twin boundary energy compared to the elastic energy, the modulation (n + m) should be the smallest possible number with n and m being integers.

Figure 1
figure 1

Geometry of austenite (A) and 10M and 14M modulations occurring in Ni-Mn-Ga with a \({(2\bar{3})}_{2}\) and \({(2\bar{5})}_{2}\) stacking, respectively. The tetragonal NM martensitic and cubic austenitic building blocks are marked by coloured areas and their lattice parameters. To form an elastically compatible phase boundary with the austenite, the tetragonal martensite introduces twin boundaries at the nanoscale (thick lines), which mirror the building blocks, i.e. a quarter of the NM unit cell. For each modulation, a combination of n long and m short sides of the tetragonal building blocks keeps the lengths of austenite and modulated martensite invariant, as sketched by the horizontal lines. With increasing tetragonal distortion c/a|NM of the underlying tetragonal building block, a higher number n + m of tetragonal building blocks is required.

Twinning can also occur within a unit cell; thus, it is appropriate to consider a martensitic “building block”, which has just half the length and width of an ordered Heusler unit cell. In Zhdanov notation, these periodic arrangements are denoted as \({(n\bar{m})}_{2}\), where n and m are the number of tetragonal building blocks of different orientation, which are connected by (101)NM twin boundaries. If n + m is odd, the structure must be repeated to conform with chemical ordering. If n is unequal m, the unit cell becomes monoclinic. The modulated structure is then represented as 2(n + m)M. The stacking sequences corresponding to the most common modulations are \({(2\bar{3})}_{2}\) (10M) and \({(2\bar{5})}_{2}\) (14M). One observes larger m and thus larger c/a|NM at compositions with higher electron density and higher transformation temperatures23,24.

Conservation of length at the habit plane is approximately described by the equation \(n\,{c}_{{\rm{N}}{\rm{M}}}+m\,{a}_{{\rm{N}}{\rm{M}}}\,=\)\((n\,+\,m)\,{b}_{{\rm{M}}}\,=\,(n\,+\,m)\,{a}_{{\rm{A}}}\), where bM is commonly identified as the middle lattice constant of the modulated martensite of monoclinic crystal symmetry12. For a given tetragonal distortion c/a|NM and aA, this equation can in general not be fulfilled by small integer numbers n and m but there is a small “remainder”. Accordingly, the condition for an exact match at the habit plane bM = aA is not fulfilled and there is a small misfit, which can be closed by faults in the n-m stacking sequence12. As a hierarchical twin-within-twins microstructure forms in martensite13,14,25, we will call the twin boundaries occurring at the atomic scale “nanotwin” boundaries in order to distinguish them from twin boundaries occurring at larger length scale.

Results and Discussion

Oscillating interaction energy of nanotwins in dependency of their spacing

For many types of microstructural defects there is some kind of interaction, which results in the formation of new patterns. A well-known example from metal physics is the interaction between dislocations, resulting in the formation of periodic grain boundary networks26, most directly observable during polygonization of bent single crystals27. For twin boundaries, however, no such interaction is known yet. To prove the existence of an interaction between nanotwin boundaries, we used DFT to investigate the total twin boundary energy γtot. γtot represents the excess energy for connecting two martensitic variants of a given width n by a twin boundary divided by the interface area. Using the energy difference between a nanotwinned structure and the non-modulated reference (see Methods), we decomposed γtot into two parts: 1) a bare formation energy of an isolated twin interface γ, connecting two variants of infinite length, and 2) the interaction energy γn between neighbouring twin boundaries that are n lattice planes apart.

All twins consisted of stoichiometric Ni2MnGa with a tetragonal distortion of c/a|NM = 1.26, which is the ground state according to previous DFT calculations28,29,30,31. (see Supplementary Information for other c/a|NM). In a first series, we considered a symmetric arrangement of twin boundaries \((n\bar{n})\) and varied the spacing of both twin boundaries from n = 1 to 12 (Fig. 2). The triangles represent the case of ideal twin boundaries, where the atoms in each twin were fixed to positions obtained from a simple mirroring of the NM martensite. The corresponding γtot showed a pronounced oscillatory pattern, which proved a short range interaction between nanotwin boundaries. For n ≥ 5, oscillations diminished and thus γ was obtained by averaging the total interface energies for n ≥ 5. The decomposition of γtot into interface and interaction contribution also holds if neighbouring twins are of arbitrary width n and m. For n > 1, the corresponding γn and γm can be summed up (crosses in Fig. 2) to obtain the effective interaction energy of a \({(n\bar{m})}_{2}\) arrangement (diamonds). We thus suggest that it is sufficient to consider only the pairwise interaction energy and to neglect further terms.

Figure 2
figure 2

Oscillating interface energy of nanotwin boundaries γtot separated by n martensitic building blocks. The γtot of ideal symmetric \((n\bar{n})\) twins (triangles) was decomposed into the oscillations interaction of nanotwins, γn, at small n, and into a constant contribution γ at large n. The latter describes the pure nanotwin boundary formation energy. The martensitic building blocks had a tetragonal distortion of c/a|NM = 1.26. Asymmetric \({(n\bar{m})}_{2}\) arrangements (diamonds) could be predicted from the superposition of the respective γtot obtained from the symmetric \((n\bar{n})\) and \((m\bar{m})\) cases (crosses), proving the additive relation. We used n + m = 14 building blocks where the twin boundaries were separated by n and m = 14 − n building blocks, respectively. As this geometry contains twice as many nanotwin boundaries compared to the symmetric one, the offset was 2 × γ. Upon structural optimisation (circles), γtot decreased rather uniformly, i.e. independent of n, indicating that relaxations were confined to the interface.

Finally, we allowed for relaxation with respect to all four monoclinic parameters of the simulation box and atomic positions (circles). This resulted in a nearly constant shift by −0.8 meV/Å2 for all n, thus γ = 0.5 meV/Å2 now included all structural relaxations caused by the placement of the twin boundary. The oscillating pattern did not change, proving that the interaction between nanotwins was stable with respect to the slight displacement of the atoms.

A pronounced minimum of the interaction energy was obtained for n = 2. We found a substantial increase in interaction energy from n = 2 to n = 1 in agreement with the absence of modulation with n = 1 in experiments. Compared to a disordered arrangement of nanotwin boundaries, which contains a broad distribution of n, arrangements with a maximum number of twins with n = 2 were favourable in terms of the total energy. This explains why all experimentally observed ordered modulations contain double-layered twins.

Our disentangling of interaction and twin boundary energy gives a better understanding of the observed modulations compared to previous work, which considered only a positive twin boundary energy11,15. Surprisingly, after optimisation, we obtained a slightly negative γtot for double layered twins, which become the global energy minimum. The optimum \((2\bar{2})\) stacking exhibits orthorhombic symmetry and is called 4O. Indeed, there are several experimental reports on the 4O phase in metamagnetic Heusler alloys, where 4O is always observed together with other modulations32,33. In a recent independent work, the geometry and electronic structure of the 4O phase is described in more detail34. We will discuss the origin of the negative γtot for n = 2 in section 6. Interface- and interaction energies between the twin boundaries determined here were within the range of thermal energies. Hence, thermal fluctuations will likely affect the arrangement of the twin boundaries when transforming to the modulated state of martensite.

Formation of a M /b M twin boundaries by ordering nanotwins

What are the consequences of the interaction energy on the martensitic microstructure beyond the length scale of nanotwinning? Does the integer number of building blocks within a periodic modulation induce a new type of twin boundary at mesoscopic length scale? To find out, we reconsidered the slightly different length of a complete \({(2\bar{5})}_{2}\) modulation compared to seven austenitic unit cells along the habit plane. This misfit can be closed by stacking faults12 that are inserted with a substantially larger period than the modulation period. As this stacking fault period is not solely defined by the lattice constants of martensite but also depends on the austenite, the arrangement is incommensurate when measuring a completely martensitic sample, which is in agreement with several diffraction experiments5,22,62. Compared to a periodic \({(2\bar{5})}_{2}\) stacking sequence, the presence of stacking faults increases the energy of an incommensurate nanotwin arrangement. In addition, one has to consider that the martensitic transformation of the technologically most interesting alloys occurs in vicinity or even well above room temperature. At finite temperatures, entropy further disturbs the periodic arrangement owing to the large number of possible configurations. For simplicity, we considered a disordered arrangement of nanotwins as a starting point, which was only constrained by the total n/m-ratio of all short vs. all long axes, adapting to the austenite. We proposed that this disordered state is an intermediate state between the propagating phase boundary connecting austenite and ordered martensite. It may also be an intermediate state with respect to time and temperature. In Fig. 3 we illustrate consequences of the transition from a disordered (a) to an ordered (b) arrangement of nanotwins. This transition was driven by minimization of the total interaction energy at low temperatures. Ordering proceeded by the movement of twin boundaries, which is easily possible by moving line defects that are known as disconnections across a twin boundary plane35. We identified two possible types of order – \({(2\bar{5})}_{2}\) and \({(5\bar{2})}_{2}\) – and were able to reveal the mirror symmetry between both kinds by highlighting the common modulated unit cells (in red in Fig. 3b). When using the lattice axis of the 14M unit cell21, the mirror plane exchanged a14M with b14M. We infer that ordering of nanotwins result in the formation of a14M/b14M twin boundaries between the different orientations of ordered modulated martensite.

Figure 3
figure 3

Schematic view how minimizing the total interaction energy results in a transition from a disordered arrangement of nanotwins to periodic 14M arrangements connected by mesoscopic a14M/b14M twin boundaries. a) Starting point was an irregular arrangement of nanotwin boundaries (dotted lines) connecting two different orientations of the tetragonal building blocks (marked in light and dark blue). b) Without changing the number of building blocks for each direction, an almost regular arrangement was possible, which minimised the interaction energy. This is illustrated for the 14M martensite exhibiting an ideal \({(2\bar{5})}_{2}\) stacking sequence. Though at both sides of the a14M/b14M twin boundary (TB) a \({(2\bar{5})}_{2}\) stacking occurs, on the left side these are two light and five dark variants and on the right side five light and two dark ones. Thus, the orientation of the 14M unit cells (marked in red) is mirrored by the a14M/b14M twin boundary.

In addition to their geometry, we could also predict the spacing of a14M/b14M twin boundaries. Because a martensitic transition is diffusionless, ordering should not change the total number of unit cells. Moreover, ordering and the formation of a14M/b14M twin boundaries should not alter the total number of each variant orientation because this would affect the length at the habit plane. On one hand, this fixed the length ratio of the variants a14M vs. b14M. On the other hand, because b14M <aA <a14M, the formation of a14M/b14M twin boundaries allowed for a fine compensation of the remaining strain at the phase boundary, which is not compensated for by a fully ordered 14M structure. The difference between a14M and b14M lattice parameters15 is 7% and thus introducing aM/bM twin boundaries could compensate a substantial strain in order to minimise elastic energy. An a14M/b14M twin boundary represented a stacking fault, requiring additional interaction energy compared to the ideal stacking sequence. As no further disturbance of the lattice occurs, the excess energy of an aM/bM twin boundary is expected to be low and in the same order of the interaction energy. Because a14M/b14M twin boundaries compensated substantial strain at very low twin boundary energy they could be introduced at high density, following the concept sketched in section 1. This agrees with recent reports of rather narrow spacings of these mesoscopic twin boundaries on 10M4,25.

The concept of ordering of nanotwins could explain some of the features of a martensitic microstructure up to the continuum length scale limit. In terms of the commonly observed hierarchical twin-within-twins microstructure11,13,14, a14M/b14M twinning was found to represent the second smallest level of twinning. The a14M/b14M twin boundaries were parallel to nanotwin boundaries, which is uncommon for two hierarchical levels of twin boundaries because this alignment does compensate the same strain component. The a14M/b14M twin boundaries must thus have a different origin than common twinning. This is in agreement with the strain minimization and the interaction of nanotwin boundaries of the ordering process discussed above.

Ordering contributed to hysteresis losses

Does ordering nanotwins contribute to undesired macroscopic properties of a martensitic sample, such as hysteresis? Understanding and minimising hysteresis is crucial in order to use these materials in magnetocaloric refrigeration applications and as a conventional shape memory material. Hysteresis losses do not only reduce efficiency but may completely inhibit the reversibility in the low magnetic fields that is achievable by permanent magnets.

In a previous section, we established that ordering was driven by the minimization of the total interaction energy and one must expect that this gain of energy will be dissipated during cooling. It amounts to 3.9 MJ/m³ during cooling for the interaction energies of 14M (Fig. 2, for details see Supplementary Information). However, this is only a part of the experimentally observed hysteresis loss, considering that also nucleation and volume change during a martensitic transformation contribute to the hysteresis.

As a microscopic explanation for hysteresis, ordering nanotwins also provided the mechanism behind the so-called λ2 = 1 approach, which predicts a minimum hysteresis when the middle eigenvalue of the transformation matrix approaches one36,37. At the continuum level, the approach describes the compatibility of a single austenite/martensite interface, which is required during a first order phase transformation because both phases can coexist. Each interface is a defect within the microstructure and thus requires an excess energy, which is dissipated after the complete transformation of the sample. The same dissipation occurs again during the reverse transformation, which relates to hysteresis. For adaptive martensites, the λ2 = 1 criterion is fulfilled if \(n\,{a}_{{\rm{N}}{\rm{M}}}\,+\,m\,{c}_{{\rm{N}}{\rm{M}}}\,=\,(n\,+\,m)\,{a}_{{\rm{A}}}\). If this criterion was met precisely, the material could transform directly to a \({(2\bar{5})}_{2}\) stacking and neither ordering nor a14M/b14M twin boundaries were required. Deviations from this ideal situation increased the misfit, which increased disorder and thus hysteresis losses in agreement with the λ2 = 1 approach.

However, the λ2 = 1 approach must be expanded. It considers only the phase boundary, but not the volume transformed. As the two-dimensional phase boundary has a negligible contribution to the total energy compared to the volume, it does not allow quantifying hysteresis losses. In contrast, the volume was considered in the concept of ordering because the interaction energy was dissipated throughout the sample when ordering follows the phase boundary. Ordering nanotwins thus helps overcome the shortcoming of the λ2 = 1 approach, and we regard it essential to understand hysteresis in modulated martensite.

Magnetic origin of the interaction energy

What is the microscopic origin of the oscillating interaction energy? Twin boundaries as atomically sharp planar defects can give rise to considerable Friedel like oscillations38, which will modify the charge density in perpendicular directions. The superposition of perturbations from repeated planar interfaces may result in a periodic redistribution of charges, which can favour specific distances between the twin walls. As a consequence of the strong Coulomb interaction between electrons and ions, we would then expect oscillatory relaxations perpendicular to the twin boundaries, which we did not observe here. Instead, we see displacements rather within the interface plane, as worked out in detail in section 7. However, since the spin channels are not degenerate, we may also consider magnetic perturbations, which involve charge-neutral oscillations. Indeed, an oscillatory variation of the magnetic moments in the 6M, 10M and 14M along [101] has been reported in earlier DFT calculations39,40. Inspecting the magnetic moments in the nanotwinned structures (see Supplementary Information), we observed a significant decrease of about 7% in the magnetic moments of Ni atoms at the twin interface. In the adjacent lattice planes, a reduction of around 5% remained. The magnetisation has essentially recovered in the next-nearest plane, whereas only minor oscillations were visible further away. The effective interface width was thus below three lattice planes; interfaces overlapped only at a distance of n = 4 and below.

The Ni moments are stabilized by their exchange with the neighbouring Mn electrons. In turn, the magnetic exchange coupling between Mn atoms depends on the interatomic spacing41,42. Here, Ruderman-Kittel-Kasuya-Yosida-like oscillations are identified43,44,45. These result in alternating positive (ferromagnetic) and negative (antiferromagnetic) exchange interactions Jij between two atoms i and j of NM martensite, which we observed here (Fig. 4, left panel) in agreement with previous reports44,45,46. Significant antiferromagnetic interactions between the Mn atoms appear up to interatomic distances of 10.2 Å, which corresponds to approximately five (110) lattice planes with d = 2.10 Å. The right panel shows the interactions present in 4O, which exhibits a dense \((2\bar{2})\) stacking and was most favoured by interaction energy. Comparing the exchange constants of both structures, we could identify two competing trends. First, the ferromagnetic Jij of neighbouring Ni-Mn and Mn-Mn pairs of 4O decreased by about 1 meV when compared to NM, which destabilised the 4O. Conversely, we also found a much smaller number of frustrated (negative) antiferromagnetic interactions in the 4O compared to the NM. Summing up all Mn-Mn and Mn-Ni exchange constants over a distance from 2.5 to 19 Å finally yielded a substantial contribution of about 6 meV/f.u. in favour of the 4O, which was of similar magnitude as the total energy difference. This suggestes that the twin interaction originates from frustrated antiferromagnetic exchange in the NM and explaines the frequent observation of n = 2 in experiment.

Figure 4
figure 4

The magnetic origin of the interaction energy. Magnetic exchange constants Jij within (a) the tetragonal NM martensite with c/a|NM=1.25 and (b) the optimised 4O demonstrating the decrease of magnetic frustration in 4O. Exchange constants between pairs of Mn atoms are marked by blue circles and between Mn and Ni atoms by red squares. Positive values conform with the ferromagnetic order and negative values are frustrated and increase the energy. The saturation of the colours corresponds to the occurrence N of the respective interaction relative to one formula unit Ni2MnGa, indicating their impact on the total energy. For clarity, the multiplicity of selected interactions is marked explicitly by small numbers close to the symbols.

Twin boundary energy determined the phase sequence: A → 10M → 14M → NM/4O

Why do only particular types of modulations (as described in section 1) occur and not any other types? Are some modulations stabilised by a negative twin boundary energy rather than the common consideration of a twin boundary as a defect requiring excess energy? To understand which modulations are favoured, we calculated the energy difference of \({(n\bar{m})}_{2}\) nanotwinned arrangements with respect to an austenite unit cell in dependence of the tetragonal distortion of the underlying tetragonal building block c/a|NM. Relaxation was allowed for all ions within the simulation cell, but change in cell size was not. We start the discussion of the results presented in Fig. 5 from the right-hand side of the figure. The \((2\bar{2})\) nanotwinning modulation, or 4O, was found to be lowest in energy, in accordance with Fig. 2. Its global energy minimum was located around c/a|NM = 1.25, which is about 5 meV/f.u. below the fully optimised NM martensite. This was still a rather small difference in energy, which depends on the magnetic state, as shown above. It was further diminished by 1 meV/f.u., when we took into account the zero-point energy of the lattice vibrations. Most important was that the 4O does not fulfil adaptivity47, which means that 4O could not form directly, but only as a result of a complex, long-range ordering process. In other words, the kinetics (i.e. huge hysteresis) hindered the formation of 4O, an aspect that should be taken into account in addition to thermodynamics.

Figure 5
figure 5

Nanotwinning provided an effective relaxation path, optimising the energy of martensite along the entire Bain path. Comparison of the energy of NM martensite exhibiting tetragonal distortion c/a|NM (black line) with the corresponding relaxed \({(n\bar{m})}_{2}\) nanotwins (coloured circles). The values are given relative to the energy of austenite EA. Because nanotwins were lower in energy than their NM building blocks, they formed an effective way for relaxation towards the martensite ground state. The inset shows the corresponding average twin boundary energy γtot(c/a) calculated from the interpolation of the total energy in the main figure and the corresponding interface area and density of each \({(n\bar{m})}_{2}\) arrangement. It favoured the 10M for c/a|NM < 1.09, the 14M for 1.09 < c/a|NM < 1.18 and the 4O at larger tetragonal distortions.

The \({(2\bar{3})}_{2}\), \((2\bar{4})\) and \({(2\bar{5})}_{2}\) modulations exhibited the next lowest energies. They were found to be almost degenerated, which agrees with the high density of stacking faults one observes in the 14M martensite48. At c/a|NM = 1.26 the energy of NM was equally low. Indeed, a microstructural transformation from nanotwinned martensite towards NM, which proceeds by the coarsening of twin boundaries has been reported13. This process requires a simultaneous annihilation of twin boundaries, which increases the energy barrier compared to the movement of a single nanotwin boundary required for the ordering. This is consistent with experiment, where a transformation from A to 14M and then to NM is often observed at large c/a|NM and low temperatures23,24.

For c/a|NM < 1.22, all modulations, except \({(2\bar{1})}_{2}\), were found to be significantly lower in energy than the intermediate NM building blocks from which they were constructed. This corresponded to a negative γTB (Fig. 5, inset). This underlined - apart from the clear indication that nanotwins can be thermodynamically stable – that nanotwinning provides an effective relaxation channel towards an NM ground state. Our calculations revealed that the \({(2\bar{5})}_{2}\) modulation exhibits the lowest γtot. The 14M even outperformed the 4O, which had the lowest total energy, but a higher interface density. Because γtot naturally varied with c/a|NM, this eventually changed above c/a|NM = 1.18 in favour of the 4O, while for c/a|NM < 1.09, interfaces in a \({(2\bar{3})}_{2}\) sequence were preferred. The sequence of structures obtained was 10M→14M→NM or 4O with increasing c/a|NM, which is in agreement with the compositional trend found in many Ni-Mn-based Heusler systems49.

For c/a|NM → 1, the energy did not approach zero for some structures. This is expected from the adaptive model where all twin arrangements should become equivalent. However, the energetic order of the modulations agrees well with other recent ab initio surveys, which consider soft phonons31,50. This indicates an independent source of lattice relaxation, i.e. the instability of the transverse acoustic (TA2) phonon branch around the reciprocal lattice vector q = 1/3 [101]. It is associated with the formation of the 6M premartensite51,52,53,54,55,56 and originates from parallel nesting sheets of the Fermi surface9,10,57,58,59. The soft phonon results in a sinusoidal modulation of the atomic positions, which repeats once within three building blocks and is thus commensurate with a \((3\bar{3})\) or \((2\bar{4})\) twin structure. Despite the higher energy compared to 14M and NM martensites, the 6M and also the 10M are stabilized at finite temperatures by vibrational entropy6,60. The \({(2\bar{3})}_{2}\) and to a lesser extent the \({(2\bar{5})}_{2}\,\,\,\)modulation also benefit from a soft phonon. It is described by reciprocal vectors of q = 2/5 [101] and q = 2/7 [101], respectively, because the modulations need to complete a second period to account for the chemical order according to the odd number of lattice planes. In contrast, \({(2\bar{1})}_{2}\) and \((2\bar{2})\) stacking (4O) cannot benefit from the soft phonon. This made 10M the energetically most favoured structure for a low tetragonal distortion. At a c/a|NM ratio of 1.16 adaptivity is also fulfilled15, maximising compatibility to austenite. Thus, both requirements, i.e. phase stability and an easy transformation path, explained the formation of 10M and its presence beyond c/a|NM = 1.09.

Soft phonons facilitated the transition to a nanotwinned martensite

The decrease in energy with increasing c/a|NM for 14M (Fig. 5) implies that the tetragonality is an appropriate parameter to describe the transformation path towards modulated martensite. To understand this path better, we examined the relaxation in more detail (Fig. 6). Relaxation became small for c/a|NM > 1.16 and there was hardly any visible difference at c/a|NM = 1.21. Therefore, it was appropriate to use the concept of twinning at the atomic scale, as the adaptive concept postulates. Yet, at low c/a|NM ratios, substantial movements of complete lattice planes occurred in a sinusoidal rather than zig-zag manner. This suggests a physical picture where soft phonons within the austenite start a movement as a linear instability that ultimately ends in a nanotwinned martensite at large atomic displacements.

Figure 6
figure 6

Transition of a soft phonon to nanotwinning with increasing tetragonal distortion c/a|NM. The positions of atoms within an ideal 14M modulation are depicted by solid circles while the relaxed positions are shown by open circles. Ni atoms are coloured in red and Mn atoms in blue. The Ga atoms are hidden beneath the Mn atoms and relaxed very similar. The arrows, illustrating the direction and the magnitude of the movement of the atoms, are enlarged by a factor of 5 for better visibility. We observed a sinusoidal pattern for small c/a|NM on the left-hand side according to the phonon instability, while only slight relaxations were found for the nanotwins on the right-hand side at the twin boundary. Relaxation perpendicular to the picture plane was negligible (less than 0.01% of a lattice constant). This projection uses the smallest unit cell of modulated martensite (2M) in contrast to the L21 description of Fig. 1.

To characterize this transition from soft phonons to nanotwinning quantitatively, we calculated the discrete sine Fourier transformation coefficients of the relaxed atomic positions and compared them with the unrelaxed ones (Fig. 7, left; calculation details are described in the Supplementary Information). For low tetragonal distortions, the only dominant amplitude was found at a wavelength of c/2. With increasing c/a|NM, the relative difference of the c/2 coefficients between the ideal and optimised twins was observed to decrease quickly. In contrast, the higher order coefficients were found to increase constantly, which was required to reproduce the zig-zag manner of nanotwinning. An identical behaviour was also observed for 10M (see Supplementary Information) and appears, therefore, to be of general nature.

The variation in c/2 at low c/a|NM can be understood from the TA2 phonon branch in [110] direction (Fig. 7, right panel). As demonstrated previously61, first-principles calculations match the experimental phonon dispersion obtained from inelastic neutron scattering extremely well in this system. The imaginary frequencies of the TA2 phonon in the cubic phase imply a dynamic instability favouring a sinusoidal modulation in the tetragonal building blocks. This anomaly is related to extend nesting of parallel sheets at the Fermi surface originating from non-bonding \({\rm{N}}{\rm{i}} \mbox{-} {d}_{{x}^{2}-{y}^{2}}\) and \({d}_{3{z}^{2}-{r}^{2}}\) orbitals, which form a pronounced peak in the minority spin density of states right below the Fermi level. We observed that the region of imaginary frequencies in [101] direction widened slightly for very small tetragonal distortions. Here, soft phonons were found to stabilise 6M, 10M, and 14M - but not 4O, which would correspond to q = 0.5. With increasing c/a|NM, the imaginary part was found to be smaller while the minimum shifts towards smaller q, i.e. longer wavelengths. Around c/a|NM = 1.1, the non-bonding \({\rm{N}}{\rm{i}} \mbox{-} {d}_{{x}^{2}-{y}^{2}}\) states pass the Fermi level, becoming unoccupied further on59. As a result, the dynamic instability vanished completely above c/a|NM = 1.11, which suggests that the twinned structures were not supported by soft phonons for larger c/a|NM. Instead, they became intrinsically stable, maintained by their favourable twin boundary energies.

Figure 7
figure 7

Quantifying the transition from a sinosoidal phonon instability to a zig-zag like nanotwinning. Left: Discrete since Fourier transform of the relaxed lattice position in 14M. The coefficients describe the average amplitude of motion perpendicular to the modulation vector c. While the bottom axis gives the wavelength with respect to the full 2M-based unit cell of modulated martensite (long c-axis), the top one uses the reduced 2M description. The coefficient c/2 corresponds to the first harmonic, describing a pure sine wave, while the higher order coefficients reproduced the zig-zag arrangement of the nanotwin boundaries. The inset shows the variation of the relaxed (solid lines) and unrelaxed coefficients (dashed lines) in dependence of c/a|NM demonstrating the gradual transition from a sinusoidal to a nanotwinned character. Right: TA2 phonon branch in [101] direction for different c/a|NM. For better visibility, the branches are consecutively shifted upwards by 1 meV and the imaginary parts of the dispersions (plotted as negative values) are presented as dashed areas. The data for c/a|NM = 1 is taken from ref.61.

Dynamic instability and nanotwinning decreased the energy of martensite, and our results showed that for small c/a|NM both effects can be present at the same time – they are not mutually exclusive. Our computational approach considered only phonons, which were commensurate with the underlying twin structure. This, however, was only a technical limitation. In principle, twinned structures can combine with incommensurate modulations observed at comparatively small tetragonal distortions62,63,64.

The transformation mechanism described here overcomes several shortcomings of the original Bain concept. The Bain path only considers elongation and compression along the cubic <001> axes whereas the soft phonon results in {101} shear instabilities. The observed relaxation mechanism illustrated how shearing can result in a tetragonal distortion when nanotwinning is considered. Moreover, shearing occurred only in one single set of planes and no doubleshearing, as postulated by Bogers and Burgers65, was required. Therefore, we conclude that the concepts of adaptivity and ordering could resolve the major deficiency of the Bain concept already at the nanoscale, i.e. the absence of a habit plane.

Summary and Conclusions

Among martensitic Heusler alloys only modulated structures exhibit outstanding magnetocaloric and magnetic shape memory properties. In this work, we solved the controversy about the origin of the modulations by unifying both alternative explanations: Phonon softening in the austenite state initialized the movement of lattice planes, which seamingless ended in a nanotwinned, adaptive martensite. Our analysis of the relaxation process illustrated that both, shear and tetragonal strain occur simultaneously during the transformation to a modulated martensite. We identified the interaction energy between nanotwin boundaries as driving force for ordered arrangements of nanotwins. Ordering explained why modulations are periodic and allowed predicting the sequence A → 10M → 14M → NM/4O of all experimentally observed modulations. In particular, the 10M martensite was stabilized by the negative twin boundary energy found at intermediate transformation steps. The 4O was favoured by its negative interaction energy, which originated from frustrated magnetic exchange interactions being removed by the twinning.

Up to now, the precise relation between sinusoidal modulations as structural variations of tetragonal structures with c/a < 1 and non-modulated and nano-twinned martensite characterized by c/a > 1 remained unclear. In our work, we showed a way how both concepts can be combined seamlessly. Furthermore, we demonstrated that ordering nanotwins has key implications on the functional properties of martensitic Heusler alloys. The energy dissipated during ordering may provide an important contribution to macroscopic hysteresis losses. For magnetocaloric refrigeration, these losses must be as low as possible and thus we proposed to develop new alloy compositions with weak interaction energy. For magnetic shape memory alloys the formation of a/b twin boundaries by ordering explained a peculiar generation of twinning within the twin-within-twins hierarchy, which is decisive for the easy movement of mesoscopic twin boundaries. With these examples, ordering nanotwins demonstrated its versatility to explain key functional properties. We expect that the concept of interaction energy between nanotwin boundaries introduced in this work will help to sort the zoo of different modulations observed in various Heusler systems, since he interaction energy (in dependence of the c/a|NM ratio of the tetragonal building blocks) allows to describe all modulations and predict if they occur. As our work gave all relevant energy values for Ni2MnGa, this will also enable a detailed understanding of the dynamics of the ordering process, which is decisive for premartensitic and strain glass phenomena.

Computational Methods

The twin interfaces were constructed systematically from non-modulated tetragonal martensite applying the phenomenological theory of martensite66 as described in our previous work67,68. To comply with periodic boundary conditions for the DFT cell, an even number of complementary twin boundaries was always simulated. Spin-polarised density functional theory calculations were carried out using the VASP package69,70 as described in ref.30 with a plane wave cut-off Ecut = 460 eV, PBE exchange-correlation and projector augmented wave potentials with the basis 3d104s24p1 for Ga, 3p63d64s1 for Mn and 3p63d94s1 for Ni. Electronic self-consistency was assumed, if the energy difference between two consecutive steps reached values below 0.1 µeV. The convergence criterion for the optimisation of atomic positions and lattice parameters was set to 10 µeV, which usually ensures that the largest residual forces remain well below 0.01 eV/Å. During optimization, Brillouin zone integration was carried out with the Methfessel-Paxton broadening scheme with σ = 0.1 eV. Total energies were calculated using the tetrahedron method. Comparisons were made between supercells of the same number of atoms and similar extensions. The final k-mesh was chosen 16 × 12 in the twin plane and a division of 2 to 16 perpendicular to it, depending on the extension of the supercell in this direction. Phonon calculations were carried out via the so-called force constant approach using the VASP code in combination with the PHON utility71 as described earlier60,61. For the NM martensite, we calculated the forces from displacements of single atoms in 4 × 4 × 4 supercell (2 × 2 × 2 for the 4O) of the distorted Ni2MnGa primitive cell in opposite directions in combination with a 4 × 4 × 4 Monkhorst-Pack k-mesh (5 × 4 × 3 for the 4O). The magnetic exchange constants were calculated with the SPR-KKR multiple scattering code of Hubert Ebert72,73. For the NM, we used 2176 k-points in the irreducible Brillouin zone (192 for the 4O) and considered angular momenta up to lmax = 4 (f-states), using again the PBE exchange-correlation functional. The datasets generated during and analysed during the current study are available from the corresponding author on reasonable request.