It has turned out that we don't need pot.empty.m, dip.empty.m ... any more. Instead, the class definitions pot.generic, dip.generic ... should simply have a property named empty which is by default set to 'true'. And the (non-empty!) potentials, dipoles etc inheriting from them should set this variable to 'false'. This logical variable allows easy testing whether a potential is empty ("free particle"), e.g.,
if hamilt.pot{m,n}.empty
and similarly for the dipole moments etc ...
Caution with the adi ⇆ dia transformations, see here
Caution also with the transformation to the Floquet representation, see here, and the shallow copy of objects involved there!
All the changes discussed here are to be done in pretty much the same way in the following package folders:
This ticket aims at solving the problems encountered already earlier, see ticket #233 from 2020 for which we found no satisfactory solution back then
Last edit: Burkhard Schmidt 2023-02-02
In the qm_init.m files of some demo examples we find the following
hamilt.dip{p} = cell(N);
where N is the number of coupled states. How can we avoid that?
Maybe we can use try-catch wrt. isempty(hamilt.dip{p}{N,N})? If this throws an error, then hamilt.dip{p}{N,N}=[] to set the size of the cell matrix
Last edit: Burkhard Schmidt 2023-02-07