Cubic Spline Interpolation Library in C++

This afternoon I was looking around for a cubic interpolation routine to do some data analysis. The numerical recipes one works fine but I also found a nice library from the website of Tino Kluge which works (so far anyway) very nicely indeed. It is as simple as including a header file, defining a set of (sorted) [latex]x_i[/latex] and their corresponding [latex]y_i[/latex] (for example using the vector class from the STL), declaring an instance of that class and calling the classes routine “set_points”. Below is the example provided on the authors website.

#include <cstdio>
#include <cstdlib>
#include <vector>
#include "spline.h"

int main(int argc, char** argv) {

std::vector<double> X(5), Y(5);
X[0]=0.1; X[1]=0.4; X[2]=1.2; X[3]=1.8; X[4]=2.0;
Y[0]=0.1; Y[1]=0.7; Y[2]=0.6; Y[3]=1.1; Y[4]=0.9;

tk::spline s;
s.set_points(X,Y); // currently it is required that X is already sorted

double x=1.5;

printf("spline at %f is %f\n", x, s(x));


The header is available from the authors website at the following link along with a some example programs and the explanation of the mathematics (see here). Many thanks to the author for providing it under the GNU GPLv2 licence.

Math symbols are rendered by MathJax which requires JavaScript.

Laser Induced Magnetization Reversal for Detection in Optical Interconnects

The use of optical interconnects has become a front runner to replace more traditional (usually Cu based) electrical interconnects in many modern devices. One of the major drawbacks of optical interconnects is overcoming the need for photodetectors and (power hungry) amplifiers at the receiver. Such detection is in most cases performed by CMOS circuits or direct band gap semiconductors. As part of a collaboration lead by engineers at Purdue University, IN, USA a new use of ultrafast heat induced switching, originally published in Nature Communications, has been proposed as a means of using optical signals directly with standard CMOS circuits.

Schematic view of focusing of the laser beam on the detecting MTJ.
Schematic view of focusing of the laser beam on the detecting MTJ.


The data is transmitted using femtosecond laser pulses that induce magnetisation reversal in a magnetic tunnel junction (MTJ) in the receiver. The proposed scheme offers almost a 40% energy improvement over current technology and speeds of up to 5 GBits/sec for a single link. The preprint of the article can be found on arXiv (or downloaded from this link).

Temperature Dependent Ferromagnetic Resonance in FePt

Ferromagnetic resonance (FMR) is a technique for measuring the magnetic properties of materials such as, damping, gyromagnetic ratio and anisotropy. The underlying theory was outlined as long ago as the 1950’s by Charles Kittel and has since been extensively studied both experimentally and theoretically. The temperature dependence of ferromagnetic resonance curves and the properties derived from them can often be tricky to predict. By using the Landau-Lifshitz-Bloch (LLB) equation that describes the time-dependence of an ensemble of magnetic moments in a spatially averaged way, we have derived in a recently published article a new equation for the power absorbed during ferromagnetic resonance.

This paper predicts a number of temperature dependent magnetic properties using input functions into the LLB that have been parameterised from ab-initio calculations through atomistic spin dynamics simulations. This provides a link directly between electronic structure calculations to macroscopic observables.

As well as studying the properties analytically we have also extended the model to incorporate the effects of exchange between the macrospins, demagnetising fields and stochastic thermal fluctuations. By utilising GPU acceleration large magnetic structures can be simulated for the long times required to get good enough averages to simulate ferromagnetic resonance. Our results of simulating FMR in thin films have shown that there is a strong variation in the damping when the film thickness is varied. The thinner films show the largest damping at high temperatures due to the dominance of the demagnetising fields. This has a knock on effect in terms of the dynamic properties such as the reversal times, an important property in magnetic storages devices utilising heat assisted magnetic recording.

The GPU model that we have developed is capable of calculating a wide range of scenarios for large magnetic systems for long time-scales. This paves the way for new theoretical studies that can be compared to experimental measurements.