Understanding Memory

Before diving into how BLAS is written to be fast, it’s essential to understand memory. Specifically, how data is stored in memory and how it is fed to the processor, which performs the computations. All BLAS does is optimize these two operations for a specific computer architecture. CORAL, for instance, targets AArch64 architectures.

Future posts on BLAS will refer back to concepts explained here.

The content in this post is heavily taken from What Every Programmer Should Know About Memory by Ulrich Drepper. It’s phenomenal. Unless otherwise linked, all numerical values come from this paper.

What is CORAL?

In the past few months I’ve become immensely interested in scientific computing and writing fast code. I started CORAL as a project to learn both at the same time. And learn Rust.

CORAL stands for COre Rust Architecture for Linear algebra. It is an implementation of the Basic Linear Algebra Subprograms, or BLAS, in pure Rust. It is written for AArch64 architectures only.

BLAS is the set of the most common low-level operations, “kernels”, for linear algebra. Most numerical routines involve linear algebra; it is clear that a useful BLAS must be as fast as possible. These kernels naturally separate into three levels, each monumentally more difficult than the last.

Hamiltonian Programming

This is a long post. On mobile some equations may go overfull.

The goal of this post is to elegantly program the Spin Hamiltonian governing recombination in Silicon Carbide. Our system involves two electrons and two nuclei.

We define our orthonormal basis as follows:

The ${\uparrow, \downarrow}$ spin basis is called the Zeeman basis. I define the basis with the two electrons coupled and the nuclei in the Zeeman Basis as the coupled basis. Every state in our two-electron + two-nuclei system is given by

My project at NASA

My work revolves around Electrically Detected Magnetic Resonance (EDMR). It’s a method to detect small magnetic fields electrically. In principle it’s very simple.

Say we have a semiconductor, like silicon carbide. This semiconductor, made by nature or in a lab, is never perfect. There may exist some missing atoms, or extra atoms, deep in its molecular structure. These defects provide some extra electrons, or extra holes, which can be used for quantum sensing. In EDMR, they are used to measure magnetic fields electrically. I’ll now walk through how this is done in silicon carbide (4H-SiC) specifically.