This page lists some of Mathematica’s built-in functionality which may lead to confusion/problems, or which are unusual for a quantum physicist.

Symbolics vs. numerics


Normalization of eigenvectors

This is a very weird (and in my opinion) very serious issue of Mathematica.

<aside> ‼️ Eigenvectors yield different answers if the matrix has floating point entries or integers/symbols.


Screen Shot 2022-08-06 at 12.29.24.png

</aside>

The issue is normalization:

Any symbols ❌ Not normalized
No symbols, at least one floating-point ✅  Normalized
No symbols, all integer entries ❌ Not normalized

This happens because for floating points, Mathematica uses the standard linear algebra library BLAS. But in any other case, it uses its own diagonalization routine.

The reason behind this (I guess…) is that, for symbolic matrices the normalization factors are quite ugly.

But this can lead to a lot of confusion.

<aside> ✅ Solution in Melt In Melt, this is fixed with the functions Eigvecs & Eigsys Their syntax is exactly the same as Eigenvectors and Eigenvalues.

Kronecker product


Mathematica’s built in KroneckerProduct[] does not work as one might expect for vectors:

Screen Shot 2022-05-16 at 18.06.42.png

The output is not $|i\rangle\otimes |j\rangle$, but the outer product $|i\rangle\langle j|$, and without complex conjugation (!!).