Open
Description
For efficient complex differentiation, we need to express the following structured matrices:
holomorphic:
[a -b]
[b a]
anti-holomorphic:
[a b]
[b -a]
C->R:
[a b]
[0 0]
R->C:
[0 0]
[a b]
general:
[a c]
[b d]
Wirtinger derivative archives this by doing a basis transformation from x, y
to z, z̄
. However, that would introduce more FLOPs, since you need to transform them to x, y
when multiplying a complex number. I.e. (x = z+z̄)
and (y = i(z - z̄))
IMO, structured matrices are far more transparent than Wirtinger derivative, and they don't require a change of basis before multiplying with a complex number.
To implement structured matrices, we could do
struct Holomorphic{T,S}
a::T
b::S
end
Base.:*(::Holomorphic, ::Complex) = ...