Note: Strong overlap with [#92].
What and Why
We currently have three types of functors:
- some take a value (double) and return another value. These can be used, for example, as time-dependent functions.
- some take a tensor (grid) and return another tensor. These can be used for various utility functions, e.g. DvrOperator1D
- state generators. These take a grid class and create a one-dimensional wave function.
Now special state generators (FbrState) used to require the grid for some functionality. But these have been dropped and replaced by more specific generators. Hence, all state generators now actually only need a grid and return another grid. This in turn means, the three types of functors could be combined.
Ideas:
- move all the state generators to the functor package and have them take a RTensor as input
- Have every functor by default work with the single-item (double parameter) and tensor input
- Allow the functor to define a useful return value (RTensor/double or CTensor/cdouble). Then some functors may simply not be useful in certain situations.
- Consider having functors throw less often. Maybe they shoudl be used in strange circumstances?
Diff:
Diff:
Related
Tickets: #92