Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Err and correctly handle complex returns in reverse mode #1309

Merged
merged 3 commits into from
Feb 28, 2024
Merged

Conversation

wsmoses
Copy link
Member

@wsmoses wsmoses commented Feb 26, 2024

Copy link

@MasonProtter MasonProtter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff! One area that might be good to discuss, but we could also just skip is discussing that for general non-holomorphic functions, you can compute the pair of derivatives (d/dz, d/dz̄) instead of (d/dx, d/dy). For a holomorphic function you'll have df/dz̄ = 0 and for an anti-holomorphic function you'll get df/dz = 0

In general these things can be computed as

df/dz = (pullback(f, z)(1)' + pullback(f, z)(im)' * im)/2
df/dz̄ = (pullback(f, z)(1)' + pullback(f, z)(im)' * im)/2

People sometimes call this pair of derivatives 'Wirtinger' derivatives.

If you want I can try to write a quick paragraph on it for the docs.

docs/src/index.md Outdated Show resolved Hide resolved
docs/src/index.md Outdated Show resolved Hide resolved
docs/src/index.md Outdated Show resolved Hide resolved
@wsmoses wsmoses force-pushed the cmplxret branch 26 times, most recently from bda432e to 03cdcec Compare February 27, 2024 23:43
@wsmoses wsmoses force-pushed the cmplxret branch 2 times, most recently from 2749370 to d6accd9 Compare February 28, 2024 04:46
@wsmoses wsmoses merged commit 599658d into main Feb 28, 2024
1 of 44 checks passed
@wsmoses wsmoses deleted the cmplxret branch February 28, 2024 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect sign for imaginary part of derivative of functions returning complex numbers
2 participants