This page lists some of Mathematica’s built-in functionality which may lead to confusion/problems, or which are unusual for a quantum physicist.
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.
</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
.
Mathematica’s built in KroneckerProduct[]
does not work as one might expect for vectors:
The output is not $|i\rangle\otimes |j\rangle$, but the outer product $|i\rangle\langle j|$, and without complex conjugation (!!).