https://atelierarith.github.io/AtelierArith_JuliaCon2025_talk/slide/slide.html#/title-slide
When you want to learn something about Julia, we need to do before reading Julia’s official documentation.
This requirements may be non-trivial for someone like me.
if you in Set(NativeEnglishSpeakers)
println("No problem :D.")
elseif you ∈ Set(GoodAtReadingEnglish)
println("It's Okay.")
else
# This block happens if `you` is `me`
lang = native_language(you) # e.g., Japanese
@assert lang ≠ "English"
println("Meh.")
println("It takes a lot of time to understand correctly in English.")
println("I want to read documentation in $(lang).")
end
A package for translating Julia docstrings using OpenAI API
julia> @doc exp
exp(x)
Compute the natural base exponential of x, in other words ℯ^x.
See also exp2, exp10, and cis.
Examples
≡≡≡≡≡≡≡≡
julia> exp(1.0)
2.718281828459045
julia> exp(im * pi) ≈ cis(pi)
true
exp(A::AbstractMatrix)
Compute the matrix exponential of A, defined as:
e^A = \sum_{n=0}^{\infty} \frac{A^n}{n!}.
For symmetric or Hermitian matrices A, an eigendecomposition (eigen) is used; otherwise, the scaling and squaring algorithm
(see [^H05]) is employed.
│ [^H05]
│
│ Nicholas J. Higham, "The squaring and scaling method for the matrix exponential revisited", SIAM Journal
│ on Matrix Analysis and Applications, 26(4), 2005, 1179-1193. doi:10.1137/090768539
│ (https://doi.org/10.1137/090768539)
Examples
≡≡≡≡≡≡≡≡
julia> A = Matrix(1.0I, 2, 2)
2×2 Matrix{Float64}:
1.0 0.0
0.0 1.0
julia> exp(A)
2×2 Matrix{Float64}:
2.71828 0.0
0.0 2.71828
A package for translating Julia docstrings using OpenAI API
julia> ENV["OPENAI_API_KEY"] = "sk-<blah>"
julia> using DocstringTranslation
julia> @switchlang! :ja
julia> @doc exp
exp(x)
xの自然基底指数を計算します。言い換えれば、ℯ^xです。
他にexp2、exp10、およびcisも参照してください。
例
≡≡
julia> exp(1.0)
2.718281828459045
julia> exp(im * pi) ≈ cis(pi)
true
exp(A::AbstractMatrix)
行列 A の行列指数関数を計算します。定義は次の通りです。
e^A = \sum_{n=0}^{\infty} \frac{A^n}{n!}.
対称行列またはエルミート行列 A
の場合は、固有分解(eigen)が使用され、それ以外の場合はスケーリングと平方化アルゴリズム([^\H05]を参照)が選択されます。
│ [^H05]
│
│ Nicholas J. Higham, "The squaring and scaling
│ method for the matrix exponential revisited",
│ SIAM Journal on Matrix Analysis and
│ Applications, 26(4), 2005, 1179-1193.
│ doi:10.1137/090768539
│ (https://doi.org/10.1137/090768539)
例
≡≡
julia> A = Matrix(1.0I, 2, 2)
2×2 Matrix{Float64}:
1.0 0.0
0.0 1.0
julia> exp(A)
2×2 Matrix{Float64}:
2.71828 0.0
0.0 2.71828
A package for translating Julia docstrings using OpenAI API
@doc exp
(Original)
julia> @doc exp
exp(x)
Compute the natural base exponential of x, in other words ℯ^x.
See also exp2, exp10, and cis.
Examples
≡≡≡≡≡≡≡≡
julia> exp(1.0)
2.718281828459045
julia> exp(im * pi) ≈ cis(pi)
true
exp(A::AbstractMatrix)
Compute the matrix exponential of A, defined as:
e^A = \sum_{n=0}^{\infty} \frac{A^n}{n!}.
For symmetric or Hermitian matrices A, an eigendecomposition (eigen) is used; otherwise, the scaling and squaring algorithm
(see [^H05]) is employed.
│ [^H05]
│
│ Nicholas J. Higham, "The squaring and scaling method for the matrix exponential revisited", SIAM Journal
│ on Matrix Analysis and Applications, 26(4), 2005, 1179-1193. doi:10.1137/090768539
│ (https://doi.org/10.1137/090768539)
Examples
≡≡≡≡≡≡≡≡
julia> A = Matrix(1.0I, 2, 2)
2×2 Matrix{Float64}:
1.0 0.0
0.0 1.0
julia> exp(A)
2×2 Matrix{Float64}:
2.71828 0.0
0.0 2.71828
@doc exp
(Translated into Japanese)
julia> ENV["OPENAI_API_KEY"] = "sk-<blah>"
julia> using DocstringTranslation
julia> @switchlang! :ja
julia> @doc exp
exp(x)
xの自然基底指数を計算します。言い換えれば、ℯ^xです。
他にexp2、exp10、およびcisも参照してください。
例
≡≡
julia> exp(1.0)
2.718281828459045
julia> exp(im * pi) ≈ cis(pi)
true
exp(A::AbstractMatrix)
行列 A の行列指数関数を計算します。定義は次の通りです。
e^A = \sum_{n=0}^{\infty} \frac{A^n}{n!}.
対称行列またはエルミート行列 A
の場合は、固有分解(eigen)が使用され、それ以外の場合はスケーリングと平方化アルゴリズム([^\H05]を参照)が選択されます。
│ [^H05]
│
│ Nicholas J. Higham, "The squaring and scaling
│ method for the matrix exponential revisited",
│ SIAM Journal on Matrix Analysis and
│ Applications, 26(4), 2005, 1179-1193.
│ doi:10.1137/090768539
│ (https://doi.org/10.1137/090768539)
例
≡≡
julia> A = Matrix(1.0I, 2, 2)
2×2 Matrix{Float64}:
1.0 0.0
0.0 1.0
julia> exp(A)
2×2 Matrix{Float64}:
2.71828 0.0
0.0 2.71828