# Enzyme AD with matrix exponential

**URL:** <https://discourse.julialang.org/t/enzyme-ad-with-matrix-exponential/123094>\
**Category:** Quantum\
**Tags:** enzyme\
**Created:** [November 26, 2024, 12:05pm UTC](https://discourse.julialang.org/t/enzyme-ad-with-matrix-exponential/123094 "2024-11-26T12:05:11Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [April 5, 2025, 12:41am UTC](https://discourse.julialang.org/t/enzyme-ad-with-matrix-exponential/123094/21 "2025-04-05T00:41:31Z")

</div>

> [@mofeing](#):
>
> we don’t yet support matrix exponential because that requires eigendecomposition and we don’t yet support matrix factorizations (but it’s around top 3 of my priorities)

Most don’t use an eigendecomposition.

It’s probably easiest to differentiate the ExponentialUtiltiies.jl implementation, but the missing part will be Lapack balance.

---

<div class="post-metadata">

**Author:** ![mofeing](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mofeing/32/47619_2.png) [@mofeing](https://discourse.julialang.org/u/mofeing)\
**Post date:** [April 5, 2025, 1:48am UTC](https://discourse.julialang.org/t/enzyme-ad-with-matrix-exponential/123094/22 "2025-04-05T01:48:05Z")

</div>

We overlay the Enzyme.autodiff function, so Reactant is not using the mechanism in Enzyme.jl but directly calling the Enzyme C-function and only the MLIR part as of right now. This means that currently you can’t define custom frules/rrules; we only diff the MLIR that we can trace.

This sth we want to fix in the near/mid-term.

---

<div class="post-metadata">

**Author:** ![LorenzoFioroni](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lorenzofioroni/32/213290_2.png) [@LorenzoFioroni](https://discourse.julialang.org/u/LorenzoFioroni)\
**Post date:** [April 6, 2025, 10:43pm UTC](https://discourse.julialang.org/t/enzyme-ad-with-matrix-exponential/123094/23 "2025-04-06T22:43:00Z")

</div>

> [@mofeing](#):
>
> We overlay the Enzyme.autodiff function, so Reactant is not using the mechanism in [Enzyme.jl](https://juliaregistries.github.io/General/packages/redirect_to_repo/Enzyme) but directly calling the Enzyme C-function and only the MLIR part as of right now. This means that currently you can’t define custom frules/rrules; we only diff the MLIR that we can trace.

Ok, I understand. Thanks for the explanation

[Previous page](https://discourse.julialang.org/t/enzyme-ad-with-matrix-exponential/123094.md?page=1)
