JuliaDiff / JuliaDiff/ChainRulesCore.jl

Efficient complex differentiation by structured 2x2 matrices

Open
#87 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Complex Differentiation
Dominant language
Julia
Stars
267
Forks
66
PR merge metrics
No merged PRs in 30d

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) = ...

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the proposed Holomorphic type and the Base.:* dispatch with Complex values, then compare the listed holomorphic, anti-holomorphic, C->R, R->C, and general matrix forms. The issue does not name files or tests; done requires an agreed structured-matrix design and coverage for the listed forms without the proposed basis transformation.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.