A tutorial on automatic differentiation with complex numbers

Nicholas Krämer
{"title":"A tutorial on automatic differentiation with complex numbers","authors":"Nicholas Krämer","doi":"arxiv-2409.06752","DOIUrl":null,"url":null,"abstract":"Automatic differentiation is everywhere, but there exists only minimal\ndocumentation of how it works in complex arithmetic beyond stating \"derivatives\nin $\\mathbb{C}^d$\" $\\cong$ \"derivatives in $\\mathbb{R}^{2d}$\" and, at best,\nshallow references to Wirtinger calculus. Unfortunately, the equivalence\n$\\mathbb{C}^d \\cong \\mathbb{R}^{2d}$ becomes insufficient as soon as we need to\nderive custom gradient rules, e.g., to avoid differentiating \"through\"\nexpensive linear algebra functions or differential equation simulators. To\ncombat such a lack of documentation, this article surveys forward- and\nreverse-mode automatic differentiation with complex numbers, covering topics\nsuch as Wirtinger derivatives, a modified chain rule, and different gradient\nconventions while explicitly avoiding holomorphicity and the Cauchy--Riemann\nequations (which would be far too restrictive). To be precise, we will derive,\nexplain, and implement a complex version of Jacobian-vector and vector-Jacobian\nproducts almost entirely with linear algebra without relying on complex\nanalysis or differential geometry. This tutorial is a call to action, for users\nand developers alike, to take complex values seriously when implementing custom\ngradient propagation rules -- the manuscript explains how.","PeriodicalId":501162,"journal":{"name":"arXiv - MATH - Numerical Analysis","volume":"171 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-09-10","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - MATH - Numerical Analysis","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2409.06752","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Automatic differentiation is everywhere, but there exists only minimal documentation of how it works in complex arithmetic beyond stating "derivatives in $\mathbb{C}^d$" $\cong$ "derivatives in $\mathbb{R}^{2d}$" and, at best, shallow references to Wirtinger calculus. Unfortunately, the equivalence $\mathbb{C}^d \cong \mathbb{R}^{2d}$ becomes insufficient as soon as we need to derive custom gradient rules, e.g., to avoid differentiating "through" expensive linear algebra functions or differential equation simulators. To combat such a lack of documentation, this article surveys forward- and reverse-mode automatic differentiation with complex numbers, covering topics such as Wirtinger derivatives, a modified chain rule, and different gradient conventions while explicitly avoiding holomorphicity and the Cauchy--Riemann equations (which would be far too restrictive). To be precise, we will derive, explain, and implement a complex version of Jacobian-vector and vector-Jacobian products almost entirely with linear algebra without relying on complex analysis or differential geometry. This tutorial is a call to action, for users and developers alike, to take complex values seriously when implementing custom gradient propagation rules -- the manuscript explains how.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
复数自动微分教程
自动微分无处不在,但关于它如何在复杂算术中起作用,除了说明"$\mathbb{C}^d$中的导数"$\cong$"$\mathbb{R}^{2d}$中的导数 "以及充其量浅显地引用维廷格微积分之外,只有极少的文档。不幸的是,一旦我们需要导出自定义梯度规则,例如,为了避免 "通过 "昂贵的线性代数函数或微分方程模拟器进行微分,等价$mathbb{C}^d \cong \mathbb{R}^{2d}$就变得不够了。为了解决文献缺乏的问题,本文研究了复数的正向和反向自动微分,涵盖了 Wirtinger 导数、修正的链式规则和不同的梯度约定等主题,同时明确避免了全形性和 Cauchy--Rieman 问题(限制性太大)。准确地说,我们将推导、解释和实现复杂版本的雅各布向量和向量-雅各布积,几乎完全使用线性代数,而不依赖复杂分析或微分几何。本教程呼吁用户和开发人员在实施自定义梯度传播规则时,认真对待复杂值--手稿将解释如何实现。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
A Lightweight, Geometrically Flexible Fast Algorithm for the Evaluation of Layer and Volume Potentials Adaptive Time-Step Semi-Implicit One-Step Taylor Scheme for Stiff Ordinary Differential Equations Conditions aux limites fortement non lin{é}aires pour les {é}quations d'Euler de la dynamique des gaz Fully guaranteed and computable error bounds on the energy for periodic Kohn-Sham equations with convex density functionals A novel Mortar Method Integration using Radial Basis Functions
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1