# Discrepancy between complex gradients calculate with Zygote.jl and Python's Jax

**URL:** https://discourse.julialang.org/t/discrepancy-between-complex-gradients-calculate-with-zygote-jl-and-pythons-jax/114301
**Category:** General Usage
**Tags:** zygote
**Created:** [May 15, 2024, 2:07pm UTC](https://discourse.julialang.org/t/discrepancy-between-complex-gradients-calculate-with-zygote-jl-and-pythons-jax/114301 "2024-05-15T14:07:17Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)
#### Post date: [May 15, 2024, 3:05pm UTC](https://discourse.julialang.org/t/discrepancy-between-complex-gradients-calculate-with-zygote-jl-and-pythons-jax/114301/3 "2024-05-15T15:05:46Z")

</div>

The solutions are conjugates of each other.  
If I remember rightly, whether a gradient should return a jacobian transpose, or a jacobian adjoint (i.e. conjugate transpose) is a matter of debate/convention.

in 2020 @Mason did a deep dive on the topic:

> [@Taking Complex Autodiff Seriously in ChainRules](https://discourse.julialang.org/t/taking-complex-autodiff-seriously-in-chainrules/39317):
>
> So these conversations have been starting up recently again on the Slack #autodiff channel and in places like [https://github.com/JuliaDiff/ChainRulesCore.jl/issues/159](https://github.com/JuliaDiff/ChainRulesCore.jl/issues/159). I think there’s a lot of misconceptions out there about the derivatives of functions of complex numbers, caused in part by confusing notation and in part by many people’s education about complex numbers focusing too heavily on the holomorphic case. However, in an AD system where we want to deal with general code, we can not limi…

including Wirtinger Derivatives.  
Our convention come out of that discussion.

---

_[View the full topic](https://discourse.julialang.org/t/discrepancy-between-complex-gradients-calculate-with-zygote-jl-and-pythons-jax/114301)._
