Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
165 lines (94 sloc) 3.47 KB

Compiling

For compiling spin.cpp you need

make and g++ 4.1 or later
the superlu shared library and header files (libsuperlu3-dev in Debian)
the eigen linear algebra library from http://eigen.tuxfamily.org/, either the development track leading to 3.0, or the 3.0 stable branch (when it exists). If you have problems building the program, revert eigen to revision 2223.

You might need to adjust the paths to superlu and eigen in Makefile.

Once the prerequisites are in place, typing make should build the program into a binary called spin.

Running

To run a single simulation with spin, type

   ./spin <options>

where the following options exist:

-r 0.1

sets the spin-orbit coupling strength relative to the hopping parameter, in units of 2 a t (a = lattice constant).

-s 0.0

sets the ratio of spin-orbit coupling strengths left/right from the interface

-b 0.0

sets the strength of magnetic field in Tesla (not well tested)

-e 2.0

sets the Fermi energy, in units of the hopping parameter.

-n 19

sets the nice level of the process.

-o filename

write to filename instead of STDOUT

-p 50

angle of the interface in degrees

-q

be quiet.

For running a sweep over a certain parameter (and distributed among multiple hosts), you can run

    perl run.pl alpha

This varies the parameter alpha (spin-orbit coupling strength) within a range of parameters defined in run.pl.

The output looks like this:

    Writing data to `data/266'
    START: (wvbh070) alpha0.0000 ( 266)
    START: (wvbh072) alpha0.0020 ( 266)
    START: (wvbh071) alpha0.0010 ( 266)
    START: (wvbh073) alpha0.0030 ( 266)
    START: (wvbh074) alpha0.0050 ( 266)

This creates a directory called data/266 where a file is written for each data point.

Additionally to alpha you can run over phi (interface angle), scale (ratio of spin-orbit interactions left and right) and energy (Fermi energy).

Plotting the results

You can plot a data series with the command

    perl plot.pl 266diff | xmgrace -nxy -

where 266 is the number of the dataset, and diff is the data selector. The following selectors are available:

uu

Transmission matrix element T_{spinup 2 <-- spinup 1}

ud

Transmission matrix element T_{spindown 2 <-- spinup 1}

du

Transmission matrix element T_{spindup 2 <-- spindown 1}

dd

Transmission matrix element T_{spindown 2 <-- spindown 1}

diff

uu - dd

rel

(uu - dd) / (uu + dd)

You can combine multiple data series, provided that they run over the same parameter and same values:

    perl plot.pl 266rel 1234diff

Source code management

This file, the program code and the TeX code for my thesis are under version control with git, the stupid content tracker. See http://git-scm.com/ for more information on git.

Source files

The following C++ source files are of interest:

spin.cpp

Main program; contains all the things that are of interest to a physicist.

math-utils.h

Contains some auxiliary functions for converting between BLAS implementations and solving mathematical problems.

Makefile

Controls the how the program is built, and contains paths to the various components (Eigen, SuperLU)