After a lot more work on the Octave branch, it is now ready for merging, and Wavepacket is ready for another major release.
Though it was altogether a lot of work, the Octave support went rather smoothly for all but a few areas.
Installation instructions
Windows
- Download the Octave Windows installer from the official download site and run it.
- This also contains a few packages that you will need for Wavepacket. You are done.
Linux
- Install Octave through the package manager, e.g. for Debian "apt install octave"
- You need the additional packages "io" and "statistics". These are often also packaged. For Debian, you can just run "apt install octave-statistics". If your system does not contain these packages, you need to download and install these manually from OctaveForge.
That is it. Run Octave by clicking on the corresponding menu entry / icon or type "octave" in a console, and continue as with Matlab.
Limitations
Although the support is generally good, not everything works with Octave yet.
Things that do not work
- qm_matrix does not work. This includes all the optimal control functionality. This is a direct consequence of the limited support for loading/saving, see the next item
- plot_reduced_1d does not work under more recent Octave versions (>= 6), unless you turn off the plotting of expectation values. This is caused by an Octave bug.
Things that mostly work
- Loading/Saving.
The concept in wavepacket is that you can save not only your state (wavefunction, trajectories etc.), but also the "context", that is all global variables, so that, when loading, you get a context structure that allows you, e.g., to inspect the original grid, Hamiltonian etc. Now Octave has the problem that if you save an object, it stores all the data, but looses the type identity; if you try to load this object again, you get a generic structure that does not know which object it was.
A consequence is that you cannot load the grid or the Hamiltonian again, because these are represented as instances of specific grid or operator types.
In most cases, this should not be a serious issue. Most demos, in particular, do not inspect the context in detail and never notice a problem, presumably, this feature is also somewhat arcane for the normal user, and you can work around the limitation by setting up your global variables as before (running the original qm_init()) before loading your state. It does, however, break all the optimal control code under Octave, because this code actually relies on the context data.
- Plotting
Altogether, plotting works. However...
- ...be aware that plotting in Octave is generally uglier, more brittle and considerably slower than in Matlab. Especially for complex plots, plotting can easily take twice as long as with Matlab.
- As an example, contour plots under Matlab are tolerant with small imaginary artefacts (on the order of 1e-14), while the same fails under Octave. There may be places here and there where this may crop up; if you come across a plotting problem, please report it, so that we can fix the remaining issues.
- ...there are several strange artefacts depending on the system and machine. For example, plotting under Windows sometimes (?) draws everything in thin lines and only then in bold lines, leading to some flickering. Under Linux, the plots can sometimes behave a little strange if you drag them around, and with intensive toying I even managed to bring down the X server once.
- there is currently no support for videos. If you turn on Video output, the plots for the different time steps are written to individual jpeg files.
- due to abysmal drawing speed, the Octave plots do not draw one-dimensional wavefunctions color-coded with the phase, but use fixed colors.
Things that are strange
- On Burkhard's machine, Octave makes a long pause (~30s) without doing anything whenever he starts a calculation. I could not reproduce this problem on another machine, so it is currently unclear if this is a widespread problem. If you notice this issue, please give us feedback, then we need to priorize a solution for this problem.
Edited: One more plotting problem cropped up, more precision in plotting problems.