## Introduction

The pyrochlore lattice of vertex-sharing tetrahedra is a recurring motif in many classes of geometrically frustrated materials1,2,3,4,5. Among these, systems for which each vertex is associated with an Ising variable ($$e=\pm 1$$, say) and which obey a constant-sum rule on each tetrahedron ($$\mathop{\sum}\limits_{i}{e}_{i}=0$$) form the particularly intriguing family of ‘ices’6. (Cubic) water ice7 and spin-ice Dy2Ti2O78 are two examples (Fig. 1a, b); many others are known9,10,11,12. Common to all ice-like states is a huge configurational degeneracy—reflected in the Pauling entropy13,14—that in principle allows these systems to be exploited in data storage and manipulation15. Moreover, the constant-sum rule ($$\equiv$$ ‘ice rule’16) leads to an effective gauge field that can in turn drive a variety of remarkable physics6,17,18,19. For example, violations of this rule (excitations of the gauge field) behave as emergent quasiparticles that interact with one another via an effective Coulomb potential6,20. These particles represent a fractionalisation of the underlying Ising variable, such that in the spin-ices they behave as magnetic monopoles (i.e., fractionalised magnetic dipoles)21,22. The manipulation of monopoles with external fields is thought to be a promising avenue for developing novel spintronic devices23.

Of particular practical importance in seeking to apply this unusual physics is the energy scale that governs a given ice-like phase. How difficult is it to invert Ising states? And how strictly are ice rules obeyed? In water ice, the energies are simply too high: hydrogen-bond inversion is usually sluggish and ice rule violations are exceedingly rare ($$\sim$$1 ppm at 260 K)24,25,26. By contrast, spin-ices remain dynamic to very low temperatures (< 1 K), but the energy cost of defect formation is comparably small20,27. Hence spin-ice physics is usually constrained to the single-Kelvin regime, which is one reason why there is increasing interest in generating transition-metal analogues with stronger magnetic coupling28.

Similarly motivated by the potential impact of identifying ice-like phases with more advantageous energetics, we study the molecular framework material cadmium cyanide, Cd(CN)2, a well-known negative thermal expansion (NTE) material29,30. Its anticuprite structure contains cyanide ions situated on the vertices of a pair of interpenetrating pyrochlore lattices31 (Fig. 1c). At ambient temperature, the crystal symmetry is $${Pn}\bar{3}m$$ and the system is isostructural with high-pressure proton-disordered ice-VII32: the O position is occupied by Cd and the (average) H position by CN, with head-to-tail orientational disorder33. Solid-state NMR spectroscopy and single-crystal X-ray diffuse scattering measurements, together with density-functional theory (DFT) calculations, have collectively identified Cd(CN)2 as a candidate ice34,35,36. The orientation of each individual CN ion acts as an Ising variable, and the constant-sum rule reflects a preference for each Cd atom to bind two C and two N atoms36, evoking the ice rules.

What is entirely unknown is whether CN flipping is possible in Cd(CN)2, and hence whether the system is capable—even in principle—of exhibiting spin-ice physics. In fact, our collective understanding of the lattice dynamics of this system is conspicuously poor. For example, on cooling to $$\sim$$130 K, the material exhibits a displacive phase transition that is not only uncharacterised36, but is entirely unexpected: DFT calculations find no evidence of lattice instabilities in the parent phase35,37. From an experimental viewpoint, there are a number of reasons why structural and dynamical studies of Cd(CN)2 are particularly complicated: one is the inability for X-ray scattering measurements to distinguish CN orientations, especially in the presence of electron-rich Cd2+ ions38; a second is the extreme sensitivity of Cd(CN)2 to damage from X-ray beams, which affects the reproducibility of phase transition and thermal expansion behaviour39,40; a third is the (in)famously high neutron absorption cross-section of natural-abundance Cd41, complicating both elastic and inelastic neutron-scattering measurements; and a fourth is the insensitivity of spin–lattice relaxation and the time-averaged chemical shift anisotropy for 180° jumps of the CN ions, which renders typical NMR experiments inconclusive.

Here, we show that Cd(CN)2 indeed exhibits analogous behaviour to magnetic spin-ices, and does so on a temperature scale that is nearly two orders of magnitude greater. The electric dipole moments of cyanide ions in Cd(CN)2 assume the role of magnetic pseudospins, with the difference in energy scale reflecting the increased strength of electric vs magnetic dipolar interactions. As a result, spin-ice physics influences the structural behaviour of Cd(CN)2 even at room temperature.

## Results

### Experimental evidence of cyanide flips

Using a recently devised synthetic route to isotopically enriched Cd(CN)239, we prepared a polycrystalline sample of 114Cd(CN)2 suitable for neutron-scattering measurements. This sample has allowed us for the first time to characterise the structure of Cd(CN)2 and its temperature dependence without the complications of X-ray sensitivity. Our results are shown in Fig. 2a, b. On cooling from room temperature, the $${Pn}\bar{3}m$$ cubic unit cell of ambient-phase Cd(CN)2 expands (hence NTE), until at Tc = 130 K a structural phase transition occurs. We find the low-temperature phase to have tetragonal $$I{4}_{1}/{amd}$$ symmetry and to be isostructural to hydrogen-ordered ice-VIII (Fig. 2c)32. Specifically, its crystal symmetry now allows for long-range CN orientational order, and we do indeed find progressive ordering on cooling—evidenced by a systematic change in scattering density at the two crystallographically-distinct C/N sites—until an apparent orientational glass transition at Tg $$\sim$$ 80 K (Fig. 2d; Supplementary Figure 1; Supplementary Discussion). No further structural transitions were observed to 10 K; note this contrasts the behaviour observed in X-ray diffraction studies, where X-ray exposure induces a variety of complex phases at low temperatures40. The non-equilibrium nature of the 80 K glass transition observed here was verified by repeated heating/cooling cycles, which showed subtle but sensible history dependencies (Supplementary Methods; Supplementary Figure 2). The crucial point of course is that we observe the emergence of CN orientational order; this is possible only if CN flips are thermally accessible, which is clearly the case for T > Tg. This finding is corroborated by 2D 113Cd NMR measurements taken using a natural-abundance Cd(CN)2 sample, which show explicitly the activation of CN flips with a characteristic jump rate of about 10 Hz at 60 °C (Fig. 2e). Hence, our experimental data establish Cd(CN)2 as a genuine candidate for spin-ice physics.

### Spin-ice model

We proceed to determine whether a suitable spin-ice Hamiltonian can succeed in capturing the key behaviour of Cd(CN)2, and in turn be tested against further experimental observations. Our starting point is the anisotropic Heisenberg model first proposed in ref. 42:

$${\mathscr{H}}={\mathscr{-}}{J}_{\text{eff}} \mathop {\sum} \limits_{i,j}{{\bf{S}}}_{i}\cdot {{\bf{S}}}_{j}-\Delta \mathop{\sum} \limits_{i}{S}_{i\parallel }^{2},$$
(1)

where the pairwise sum is over nearest-neighbour spin sites $$i,j$$. This model develops spin-ice behaviour at $$T \sim O({J}_{\text{eff}})$$ for large $$\Delta$$ (strong single-ion anisotropy) and for ferromagnetic nearest-neighbour (effective) exchange interactions $${J}_{\text{eff}} > 0$$. Its ground state is ordered for all finite $$\Delta$$, with the ordering transition temperature suppressed as the Ising limit is approached ($$\triangle \to \infty$$)42. In our mapping, the unit vectors $${{\bf{S}}}_{i}$$ represent CN dipole orientations and behave as classical Heisenberg pseudospins. We use continuous rather than Ising variables because thermal fluctuations mean the Cd–CN–Cd linkages will not be entirely linear at the temperature ranges we have probed experimentally43. Ising-like anisotropy is introduced by the second term in Eq. (1): $${S}_{i\parallel }$$ denotes the projection of CN orientation vector $${{\bf{S}}}_{i}$$ onto the unit vector spanning its two connected Cd centres. The parameter $$\Delta$$ arises from the local crystal field at the CN site and describes the barrier height to CN flipping. The exchange term in Eq. (1) will have two main contributions for Cd(CN)2: one is a chemical bonding or covalency term—we denote this component by J—and the second arises from dipole–dipole interactions. Since electric and magnetic dipolar interactions have the same functional form, we can make use of the established results for the pyrochlore lattice44,45 that long-range dipolar interactions can be effectively truncated at nearest neighbour and are described by an effective exchange term $$-5D{\sum }_{i,j}{{\bf{S}}}_{i}\cdot {{\bf{S}}}_{j}$$. Here, $$D$$ is the electric dipole interaction strength. Taking into account the dipolar coupling between the two interpenetrating pyrochlore lattices in Cd(CN)2 we arrive at our model Hamiltonian:

$${\mathscr{H}}={\mathscr{-}}{J}_{\text{eff}}\mathop{\sum} _{i,j}{{\bf{S}}}_{i}\cdot {{\bf{S}}}_{j}+D\mathop{\sum} _{i,{j}^{{\prime} }}{{\bf{S}}}_{i}\cdot {{\bf{S}}}_{{j}^{{\prime} }}-\Delta \mathop{\sum} _{i}{S}_{i\parallel }^{2},$$
(2)

where $${J}_{\text{eff}}=J+5D$$ (Fig. 3a). The sums in the first two terms of Eq. (2) are taken over nearest neighbours in, respectively, the same ($$i,j$$) and alternate ($$i,{j}^{{\prime} }$$) lattices. The dipolar coupling coefficients $$D$$ that enter these terms are identical because nearest-neighbour CN pairs lie at equivalent distances ($$=a/\sqrt{2}$$) whether they belong to the same or to different pyrochlore lattices (in the cubic phase); the difference in prefactors (–5 and +1, respectively) is a geometric result.

A combination of quantum chemical (QC) calculations and 113Cd NMR measurements allows us to estimate the magnitude of the various parameters in Eq. (2) relevant to Cd(CN)2. We determined the QC energies of a range of small single- and double-network Cd(CN)2 unit cells with different CN orientation decorations. The energies of these configurations can be interpreted in terms of $${J}_{\text{eff}}$$ and $$D$$, giving $${J}_{\text{eff}}$$ = 191 K and $$D$$ = 93 K (Fig. 3b). An alternative measure of $${J}_{\text{eff}}$$ comes from 113Cd NMR spectroscopy, by translating the proportions of CdCnN4–n coordination environments observed at room temperature to the corresponding relative free energies. The data of ref. 34 give $${J}_{\text{eff}}$$ = 168 K; our own measurements give $${J}_{\text{eff}}$$ = 205 K. The value of $$D$$ is harder to measure experimentally, but since the CN ion carries a dipole moment of 1.0 D, we can calculate $$D$$ = 85 K from the crystal structure. The flipping barrier height $$\Delta$$ was determined computationally using nudged elastic band calculations46 to trace the energy profile during a single CN flip. The lowest-barrier mechanism involves a C-bridged Cd–(CN)–Cd transition state and a barrier height $$\Delta$$ = 12,800 K (Fig. 3c; Supplementary Figure 3). This value should be treated as an upper bound, given that we cannot entirely rule out alternate mechanisms involving correlated flips. 1D selective 113Cd EXSY measurements allow us to track experimentally the rate of CN flips at different temperatures; by collecting build-up curves over the range 62–85 °C we obtain $$\Delta$$ = 8800 ± 600 K (Fig. 3d; Supplementary Figures 410). The very narrow temperature window is a result of quite severe experimental constraints (see Supplementary Methods). Collectively, there is good consistency between QC and experimental results. As it happens, the key physics of Eq. (2) are surprisingly tolerant to variations in $$J,D,\triangle$$ values, but we take the experimental results ($${J}_{\text{eff}}$$ = 205 K, $$D$$ = 85 K, $$\triangle$$ = 8800 K) as representative. Remarkably, the relative energy scales of these different terms mirror those in spin-ice Dy2Ti2O7, for which $${J}_{\text{eff}}$$ = 3.3 K, $$D$$ = 1.41 K and $$\triangle \sim$$ 200 K44,47; we have $$D/{J}_{\text{eff}}$$ = 0.41 (0.43) and $$\triangle /{J}_{\text{eff}}$$ = 48 (67) for Dy2Ti2O7 (Cd(CN)2). The key difference is that the absolute energies are ~60 times larger in Cd(CN)2 than in an archetypal spin-ice such as Dy2Ti2O7.

### Rationalisation of experimental observations

We used these parameters to drive a series of classical Monte Carlo (MC) pseudospin simulations. Our model is subtly different to its spin-ice analogues in the sense that we have two interacting pyrochlore lattices. Nevertheless, as for the related spin-ice model42, we also observe an ordering transition on cooling, with Tc = 121 K (Fig. 4a). As in ref. 42, each pyrochlore sublattice develops a nonzero magnetisation parallel to one of the cubic axes, but the two sublattice magnetisations now oppose to give a low-temperature state that is collectively antiferromagnetic. The enhancement in Tc relative to the single-network spin-ice model indicates the dipolar interaction between lattices favours ordering. On translating pseudospins into CN orientations, the corresponding (now antiferroelectric) state for Cd(CN)2 is described by $$I{4}_{1}/{amd}$$ symmetry. So the Hamiltonian of Eq. (2) drives precisely the same phase transition we observe experimentally, in terms of both nature and temperature scale. Importantly, the same transition occurs for all sets of our QC interaction parameters; it is only the value of Tc that differs (if at all). Of course, longer-range interactions, strain coupling and anharmonicity—all of which are omitted in our simple model—may mean the low-temperature $$I{4}_{1}/{amd}$$ model is not the true ground state. In fact, we may never know, since CN reorientations are experimentally inaccessible at temperatures below 80 K, and our different QC calculations also give a range of competing ice-rules-observing ground states whose energies differ by much less than this amount.

Just how well are other aspects of the structural behaviour of ambient-phase Cd(CN)2 described by our simple spin-ice model? In Fig. 4a, we show the temperature-dependent populations of CdCnN4–n coordination environments expected as a function of temperature from our MC simulations. We find good consistency with the trends we determine from experimental neutron pair distribution function (PDF) and magic-angle spinning (MAS) 113Cd NMR measurements, although the absolute variation over the accessible temperature range is relatively low (Fig. 4a–c; Supplementary Figure 11). In both cases, there are strong experimental constraints (e.g., long count times, high backgrounds) that limit the number of data points measurable and the temperatures to which they correspond; likewise, the low-temperature phase transition complicates interpretation of the neutron PDF for T < Tc. Additional support for our interpretation comes from X-ray diffuse scattering, which is indirectly sensitive to CN orientation distributions via induced Cd displacements: for example, Cd centres coordinated by two C and two N atoms displace by $$\sim$$0.5 Å along a $$\left\langle 100\right\rangle$$ axis towards the C atoms36, whereas those surrounded by four C or four N remain on their high-symmetry sites. So the pseudospin orientations from our 298 K MC simulations can be used to infer a corresponding configuration of Cd displacements, which in turn allows calculation of the expected X-ray diffuse scattering pattern. We find excellent agreement with experiment, as shown in Fig. 4d. The corresponding neutron-scattering calculation, for which there as yet no comparable single-crystal experimental measurements, is provided as Supplementary Figure 12.

## Discussion

So, the key ingredients for magnetic spin-ices—namely, single-ion anisotropy and magnetic dipolar interactions—are mapped onto their electrostatic analogues in Cd(CN)2 with a concomitant transformation in energy scale. The phase behaviour of this non-magnetic system—a ‘dipolar structural spin-ice’—obeys a closely related physics to that of the spin-ices themselves. Ordinarily, key experimental signatures of the spin-ice state are measurements of the residual Pauling entropy and/or observation of a set of ‘pinch-points’ in the magnetic diffuse scattering pattern that arises from the underlying gauge symmetry48,49. The stability window of cubic Cd(CN)2 is unfortunately too high in energy (Tc $$\simeq {J}_{\text{eff}}/2$$) for the system ever to delve deep within the spin-ice state, and so there is no scope for observing either feature here. In any case, we do not yet have access to single-crystal 114Cd(CN)2 samples that would allow the issue of pinch-point scattering to be tested experimentally. What we can do is to calculate from our MC simulations the effective magnetic (neutron) diffuse scattering for an analogous spin model; the corresponding room temperature pattern is shown in Fig. 4e. The purpose of this calculation is to compare the pairwise psuedospin correlation functions that develop in our model, as reflected in the effective magnetic scattering function $${S}_{\text{mag}}({\bf{Q}})$$, with those of conventional spin-ices. As expected, there are no pinch-point features, but the scattering is far from featureless and its form reflects the presence of spin-ice correlations even at room temperature. In fact, the scattering shows even more structure than that for the simple Ising pyrochlore ferromagnet (spin-ice ground state) at the same relative temperature T $$\simeq 1.5{J}_{\text{eff}}$$, and resembles the inelastic contribution for strongly fluctuating spin-ices such as Pr2Zr2O750.

Other aspects of spin-ice physics are also relevant to Cd(CN)2. The C-rich or N-rich Cd coordination environments assume the role of emergent monopoles49; they represent a fractionalisation of the molecular cyanide ion and must interact via a Coulomb potential6 (perhaps unsurprising given the electrostatic origin of the spin-ice state in Cd(CN)2). One might hope to manipulate monopole distributions by the application of an external electric field. Remarkably, the soft phonon mode responsible for the $${Pn}\bar{3}m$$ to $$I{4}_{1}/{amd}$$ transition is also a manifestation of spin-ice physics42. This explains why ordered models do not show any lattice instabilities in DFT calculations, and points to the intriguing interplay between (long timescale) CN flips and (short timescale) lattice dynamics that is itself reminiscent of extreme rotovibrational coupling51. Inelastic neutron-scattering measurements of the dynamics of Cd(CN)2 are an obvious avenue for future study.

We finish by asking: to what extent might this behaviour be expected to generalise to other, related materials? Zn(CN)2, for example, is isostructural to Cd(CN)2 but does not show the same phase complexity29. Our QC calculations explain why: $${J}_{\text{eff}}$$ is smaller and $$\triangle$$ larger than for Cd(CN)2—in each case, a consequence of increased covalency and higher charge density at the Zn site. So, ice rules are not so strongly enforced, nor are CN reorientations thermally accessible; indeed the increase in $$\triangle$$ also reflects the reduced NTE effect in Zn(CN)2 observed experimentally29. Single-network s-Cd(CN)252 is likely to be the more interesting analogue since its behaviour may be describable in terms of the simpler and more strongly frustrated Dy2Ti2O7 Hamiltonian of Eq. (1). If the parameters $${J}_{\text{eff}}$$ and $$\triangle$$ are comparable to those in Cd(CN)2 itself, one expects the system never to order experimentally, since the phase transition temperature should be suppressed below the onset of orientational glass formation. This is consistent with the absence of any phase transition in variable-temperature (100–300 K) X-ray diffraction measurements52. Cd(CN)2 also forms a very large array of host–guest structures, many of which are based on the pyrochlore lattice53. This presents the unexpected possibility of tuning spin-ice behaviour via guest (de)sorption. The substitution of CN for Br—as explored historically in the context of alkali cyanide quadrupolar spin-glass analogues54—will have an effect equivalent to doping a spin-ice with non-magnetic impurities. Likewise, pressure is an as-yet unexplored variable for spin-ice physics that is now suddenly accessible given the shift in temperature scale. One way or the other, our study has reinforced the concept that materials with strongly-correlated structural disorder can mirror the remarkable physics of exotic electronic phases5. But it demonstrates also how the theory that underpins our understanding of the latter helps rationalise the phase behaviour of the former. Noting the empirical mapping between symmetry breaking in Cd(CN)2 and the VII/VIII proton-ordering transition in water ice55, for example, one might reasonably ask whether the phenomenology of spin-ices may yet shed light on the physics of their fundamentally important parent: water ice itself.

## Methods

### Synthesis

We prepared a polycrystalline sample of isotopically enriched 114Cd(CN)2 following the method described in ref. 39. In all, 1 g of Hg(CN)2 and a stoichiometric excess of 114Cd metal (1 g) were added to one arm of a custom-made glass N-cell. Anhydrous NH3 gas (30 mL liquid volume) was condensed onto the mixture and stirred for 6 hours in an acetone/dry-ice bath with the temperature maintained between 240 and 250 K. The mixture was filtered through the porous frit separating the two Schlenk tubes of the N-cell under flowing ammonia gas to remove insoluble Hg. The resulting solution was allowed to evaporate, yielding a polycrystalline sample of 114Cd(NH3)2[114Cd(CN)4]. This solid was then heated at 80°C for 24 h to yield 114Cd(CN)2 as a white powder. The synthesis was carried out in three batches. The sample contains <2 wt% contamination with Hg(CN)2.

The Cd(CN)2 sample used for NMR measurements was prepared using natural-abundance Cd and the conventional synthesis route as described in ref. 29: stoichiometric quantities of Cd(NO3)2 and K2Cd(CN)4, each prepared as aqueous solutions, were combined and the resulting solution allowed to evaporate slowly. Single-crystals of Cd(CN)2 appear as the first precipitate; these were harvested, washed with H2O and ground to a fine powder.

### Neutron diffraction and total scattering

Time-of-flight powder neutron diffraction data were collected using the POLARIS diffractometer at the ISIS pulsed neutron and muon source, Rutherford Appleton Laboratory, UK56. In all, 1.0504 g of a polycrystalline sample of 114Cd(CN)2 was loaded into a 6 mm diameter thin-walled cylindrical vanadium sample can to a depth of 4 cm, which was then placed into a AS Scientific helium flow cryostat at a temperature of 300 K. A RhFe sensor was attached to the outside of the vanadium sample can to monitor the sample temperature throughout the experiment. Data collection consisted of a series of short duration ($$\sim$$10 min each) diffraction patterns every 10 K as the sample was cooled (cooling rate $$\sim$$0.5 K min–1) for Rietveld analysis (average crystal structure and unit cell determination), interspersed with much longer duration ($$\sim$$ 6 h each) data sets at 300, 250, 200, 150, 100, 50 and 10 K for total scattering analysis. Data reduction and normalisation were carried out using the MantidPlot software57 with the final processed files from the five Polaris detector banks covering a scattering range 0.5 < Q < 50 Å–1. Total scattering data were corrected and the pair distribution function G(r) was generated using the GUDRUN software58.

### Single-crystal X-ray diffuse scattering

Single-crystal X-ray diffuse scattering data were measured on the beamline BM01 at the European Synchrotron Radiation Facility (ESRF), Grenoble, France. The measurement was performed at the wavelength 0.6975 Å using a Pilatus 2 M detector. The experiment consisted of two 360° scans: one optimised for the Bragg peaks and the second with stronger primary beam flux optimised for the diffuse scattering. The crystal orientation was determined using the programme XDS71 and the diffuse scattering reconstruction was performed in the programme Meerkat (available at https://github.com/aglie/meerkat). Bragg peaks were removed using the punch-and-fill method59.

### Solid-state magic-angle NMR

113Cd quantitative and exchange NMR spectra were acquired on an Avance III HD spectrometer (Bruker) at an external B0 field of 9.4 T ($${\upsilon }_{0}$$ = 88.7 MHz) using commercial 3.2 mm and 1.9 mm MAS triple resonance probes (Bruker). Further 1D exchange experiments were measured with a commercial 4 mm MAS triple resonance probe (Bruker) on an Avance II spectrometer (Bruker) at an external B0 field of 7.1 T ($${\upsilon }_{0}$$ = 66.58 MHz). The spinning speed was set to values between 8.25 and 22.222 kHz, so ensuring that no overlapping of signals or sidebands was observed.

Quantitative MAS spectra were obtained using single-pulse excitation with a 90° pulse of 2.5 µs. The recycle delay was adjusted so that the recovery of the longitudinal magnetisation was larger than 90%. Exchange measurements were acquired by a sequence of three 90° pulses (Supplementary Figure 4a) with a length between 1.75 and 2.5 µs. For the 1D exchange spectra, the first pulse was replaced by a Q5 Gaussian pulse cascade60 (Supplementary Figure 4b) of 2 ms (9.4 T) and 2.7 ms (7.1 T) duration to selectively excite one of the resonances by setting the transmitter frequency offset accordingly. The t1 delay was set to very short values of up to 2 µs. Exchange spectra were recorded with a 16-fold phase cycling, recycle delays were adjusted to provide at least 80% of the longitudinal magnetisation in equilibrium.

The 113Cd chemical shifts are reported with respect to (CH3)2Cd, using Cd(ClO4)2 as a secondary reference. The variable-temperature measurements were carried out using dry nitrogen for both drive and bearing; a constant stream of cold nitrogen aimed at the centre of the rotor allowed adjustment to the desired temperatures. For the exchange experiments, dry air was used instead of nitrogen. To reduce temperature gradients, the sample inside the 3.2 mm rotor was sandwiched between two layers of sodium chloride. For the 4 mm probe, a CRAMPS rotor was used. The resonances in NMR spectra were fitted by a Pseudo-Voigt line shape.

### QC calculations

Structure optimisation was performed primarily in the Quickstep module in CP2K (available at: https://www.cp2k.org/)61, with atoms and cell parameters allowed to relax simultaneously, and a double-ζ basis set62 and PBE-D3 functional with an 850 Ry cutoff (D3 here refers to the scheme of ref. 63,64. Self-consistent field cycles were converged to 10–6 eV and forces on atoms to 0.01 eV Å–1 or less. A 4×4×4 supercell was used for the optimisation within a gamma point sampling regime.

Influenced by the approach of ref. 35, we calculated energies for six separate configurations, constructed as follows. The first corresponded to the highest-symmetry version of the Cd(CN)2 structure with all Cd centres in CdC2N2 coordination environment; the second to that with CdCN3/CdC3N environments; and the third to that with CdC4/CdN4 environments. Then, for each of these three cases we generated an additional configuration containing a single Cd(CN)2 network (rather than the two interpenetrating nets in the native structure). These various configurations can be associated with the geometric parameter $$\gamma =\frac{2}{3}{(n-2)}^{2}$$, where $$n$$ is the number of C atoms in the Cd coordination sphere. It is straightforward to show that the configurational energy per mol Cd relative to that of the CdC2N2 ground state should vary as $$\gamma {J}_{\text{eff}}$$ for the single-network configurations, and as $$\gamma ({J}_{\text{eff}}+D)$$ for the interpenetrated networks. Consequently, it is possible to extract from the QC energies estimated values of $${J}_{\text{eff}}$$ and $$D$$. The corresponding energies and derived $${J}_{\text{eff}}$$, $$D$$ parameters are listed in Supplementary Table 1.

The low energy pathway for cyanide reorientation was obtained using CP2K61 and with the climbing-image nudged elastic band (CI-NEB) method. It was found that nine replicas along the pathway were sufficient to capture the barrier height (Supplementary Figure 3 and Supplementary Table 1); additional calculations using 13 and 19 images gave the same barrier as reported with a difference of <0.05 kJ mol–1.

### MC simulations

The MC simulations described in the text were carried out as follows, making use of custom code based on that described in ref. 65. Each MC configuration comprised 2048 pseudospins, arranged on the CN ion positions of an 8 × 8 × 8 supercell of the ambient-phase $${Pn}\bar{3}m$$ Cd(CN)2 unit cell. These pseudospins were unit vectors, and represented the orientation of a corresponding CN ion. MC simulations were initialised by assigning random orientations to each pseudospin and the configurational energy calculated according to Eq. (2). Each MC step involved determining a candidate pseudospin reorientation, which was then accepted or rejected according to the Metropolis MC criterion. The simulation temperature was initialised at 1000 K, and an equilibration time determined according to loss of autocorrelation in the pseudospin correlation function (we equilibrated configurations for 10 times as many steps as that estimated for decorrelation). Values at each temperature were averaged over five successive decorrelated MC configuration states before the temperature was reduced by a factor of 0.1. The system was again allowed to come to equilibrium, and the process repeated at the reduced temperature. As in previous MC studies of spin-ices42, we found the simulation struggled to equilibrate after cooling through its ordering phase transition. Of course, this did not prohibit us from identifying the existence and nature of the phase transition. Our MC simulations were repeated in full for five independent runs, and final values were taken as an average over these different runs.

Although our key results are based on the experimental values of $${J}_{\text{eff}}$$, $$D$$, $$\triangle$$, we found that all combinations of these parameters obtained in our additional QC calculations (Supplemenatry Discussion, Supplementary Table 1) gave qualitatively similar results, differing only in the numerical value of Tc. We did not, however, observe a transition for the Zn(CN)2 parameter set (Supplementary Table 2), which is consistent with the absence of any experimentally-observed phase transition in this material29.

### Diffuse scattering calculations

Geometry relaxation of 8 × 8 × 8 supercells of Cd(CN)2 was performed using the General Utility Lattice Programme (GULP)66, in order to simulate diffuse scattering based on a coupled CN-orientation/Cd-displacement model. Here, the basic idea was to use the CN orientations determined from our MC simulations to infer a corresponding set of Cd displacements as outlined in ref. 36: a Cd atom in a Td-symmetric CdC4 or CdN4 environment is not expected to displace strongly, but one in the C2v CdC2N2 environment displaces by $$\sim$$0.5 Å towards one edge of the coordination environment (for completeness we note that we saw the same effect in our QC calculations). As X-ray scattering measurements are insensitive to CN orientations, but sensitive to Cd displacements, we are then able to check whether the observed X-ray diffuse scattering patterns36 are nonetheless indirectly rationalisable in terms of the CN interaction model developed in our study.

The geometry optimisation was performed using GULP operating at constant pressure. The force-field parameters used were: harmonic bond potentials for Cd–(C/N) (k = 20 eV Å–2, req = 2.155 Å) and C–N (k = 60 eV Å–2, req = 1.148 Å); charges of +2, –1 and 0 qe for Cd, C and N, respectively; and a linear three-body term for the Cd–(C/N)–(N/C) bonds (kthree = 3 eV, isign = 1, n = 1). The corresponding X-ray diffuse scattering pattern was generated and the (hk0) slice is as shown in Fig. 4d. Note that the form of the diffuse scattering is insensitive to the specific force constants used; the values we used here were chosen to give sensible relaxed structures and magnitudes of Cd off-centreing. For completeness we also calculated the corresponding single-crystal neutron diffuse scattering pattern (Supplementary Figure 12), which—in the absence of large single-crystal samples of isotope-enriched Cd(CN)2—is yet to be measured experimentally.

### Effective magnetic neutron diffuse scattering calculations

The effective single-crystal magnetic diffuse scattering pattern shown in Fig. 4e was calculated using the SPINDIFF software, which is part of the SPINVERT distribution67. The input configurations were those generated in the MC simulations described above, carried out at 300 K. Pseudospins were assigned the magnetic form factor of Dy3+. Because the Cd(CN)2 structure contains two interpenetrating pyrochlore lattices, we calculated the effective scattering for each lattice independently and averaged over the two sets of calculated scattering intensities. This allowed direct comparison with the experimental magnetic diffuse scattering data for Dy2Ti2O7 as shown.