# Recent Posts - What I've been saying

## Writing a Tensor class in Modern C++

As promised in my article about the mathematics of solving the multidimensional Poisson equation, I am beginning writing about the process of writing a parallelized solution to the Poisson Equation by successive over-relaxation. This article will be about writing a tensor class in modern C++, as we will need a multidimensional grid for our Poisson solver.

Mathematically speaking, a Tensor is a multidimensional object over some appropriate field. In this case we will be considering simple fields, real numbers (to floating-point precision), integers (modulo some appropriate power of 2) and complex numbers. Tensors are mathematically-rich objects, with their own notation and algebras embedded in Ricci calculus, but here we will only be writing a basic Tensor class equipped with a few useful operators, however, it is an easily extendable object, so can easily be modified for most general purposes. Read more »

## Proving the det(AB) = det(A)det(B) relation using the Levi-Cevita tensor

I recently had to prove that $$\det(\mathbf{A}\mathbf{B}) = \det(\mathbf{A})\det(\mathbf{B})$$

I thought that it would be an interesting exercise to show this using the standard definition of the determinant of a matrix that physicists usually give (using Einstein summation):

$$\det(\mathbf{A}) \triangleq \varepsilon^{i_{1}\cdots i_{n}} a_{1 i_{1}} \cdots a_{n i_{n}}$$

We note that if we denote $\mathbf{C} = \mathbf{A}\mathbf{B}$, then we have $c_{ij} = a_{ik}b_{kj}$, and thus:

\begin{align*}\det(\mathbf{C}) &= \varepsilon^{i_{1}\cdots i_{n}}c_{1 i_{1}}\cdots c_{n i_{n}} \\ &= \varepsilon^{i_{1}\cdots i_{n}} a_{1 k_{1}}b_{k_{1} i_{1}} \cdots a_{n k_{n}}b_{k_{n} i_{n}} \\ &= a_{1 k_{1}}\cdots a_{n k_{n}} \varepsilon^{i_{1} \cdots i_{n}}b_{k_{1} i_{1}}\cdots b_{k_{n} i_{n}}\end{align*}

Designed and Produced by Thomas Russell © 2014-2017