Open
Description
While writing ForwardDiff2.jl
I have encountered a problem with nested differentiation with the Wirtinger derivative.
Say if I have
x = Dual(Dual(1+1im, 1+0im), 1+0im)
how can I make hypot(value(x))
dispatch to the right place if there is
@scalar_rule(hypot(x::Real), sign(x))
@scalar_rule(hypot(x::Complex), Wirtinger(x' / 2Ω, x / 2Ω))
Neither Dual <: Number
or Dual <: Real
would work.
Maybe we need to have a trait-based system to handle Wirtinger derivatives?