Open micdol opened 2 years ago
Reading the LigthField code now I see
LigthField
__add__
__sub__
__mul__
so all math operations which are implemented so far are carried out on re and im representation, yet we store data as amp and phase. This leads to conversion back and forth on each call.
re
im
amp
phase
__mul__ can be simply refactored to
self.amplitde *= other.amplitude self.phase += other.phase
however I see no improvement for __add__ and __sub__.
I'd analyze whether this for of data storage is the best for us.
Ideas:
Also I'd think whether we can just keep phase between [0, 2π) or [-π, π)
[0, 2π)
[-π, π)
Reading the
LigthField
code now I see__add__
__sub__
__mul__
so all math operations which are implemented so far are carried out on
re
andim
representation, yet we store data asamp
andphase
. This leads to conversion back and forth on each call.__mul__
can be simply refactored tohowever I see no improvement for
__add__
and__sub__
.I'd analyze whether this for of data storage is the best for us.
Ideas: