Introducing dummy classdef's for empty pot|amo|sbc|nip|dip|pol allows easy testing for these classes simply by Matlab's isa command, e.g.,
if ~isa(hamilt.pot{m,n},'pot.empty')
Note , however, that upon transforming from diabatic to adiabatic representation things may change. For example, in a simulation of a free system interacting (through permanent or induced) dipole) with external field(s), the corresponding dressed (adiabatic) potential will be non-zero, even though the class is still pot.empty. Hence, in many cases throughout the WavePacket codes, you will still find Matlab's isempty command instead, e.g.,
if ~isempty (hamilt.pot{m,n}.dvr)
even though originally this ticket was intended to replace those ;-(
Exceptions for potential energy function ?!?
Should we delete lines 53/54 from Sources/+pot/generic.m ?!?
Yes, done!
Hence, no exceptions for potential energy function
Last edit: Burkhard Schmidt 2020-02-28
The matlab.mixin.Copyable class is an abstract handle class that provides a copy method for copying handle objects. The copy method makes a shallow copy of the object. This is used in WavePacket in +tmp/@efield/floquet.m . Hence, both in +pot/generic.m and in +dip.generic.m you'll find the followeing first code line
classdef generic < matlab.mixin.Copyable
After having introduced the copying of handle objects within +tmp/@efield/floquet.m, the next step would be to do the same also for @wave/adiabatic.m. Also for @traj/adiabatic.m ?!?
No, maybe this is not a good idea. Because the type of the potential changes ...
Last edit: Burkhard Schmidt 2023-01-26
Closing this ticket because we have a new idea, see ticket #283 from 2023.
Last edit: Burkhard Schmidt 2023-02-02