public Complex[] getWavefunctionCoeffs(int index, double energy) {
        ComplexMatrix mx = getPropagationMatrix(index, energy);
        if (index == 1) {
            return new Complex[]{Complex.fromDouble(0), mx.getElem(1, 0)};
        }
        return new Complex[]{mx.getElem(0, 0), mx.getElem(1, 0)};
    }