-
Notifications
You must be signed in to change notification settings - Fork 7
Add docs for matrix functions and exponential
#251
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
Merged
+46
−2
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
efbbdbd
add docs
sanderdemeyer 4b7d05d
Update docs/src/user_interface/matrix_functions.md
sanderdemeyer dc28447
separate decompositions and matrix functions
sanderdemeyer 16f62b6
Merge branch 'docs' of https://github.com/sanderdemeyer/MatrixAlgebra…
sanderdemeyer 8788b2b
change docs
sanderdemeyer bd45f9b
Update docs/src/user_interface/matrix_functions.md
sanderdemeyer 79ba9b9
Update docs/src/user_interface/matrix_functions.md
sanderdemeyer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,37 @@ | ||
| ```@meta | ||
| CurrentModule = MatrixAlgebraKit | ||
| CollapsedDocStrings = true | ||
| ``` | ||
|
|
||
| # Matrix functions | ||
|
|
||
| Coming soon... | ||
| Another class of matrix algebra methods consists of calculating some function of a single input `A`. | ||
| In order to streamline these functions, they all follow a similar common code pattern. | ||
| For a given function `f`, this consists of the following methods: | ||
|
|
||
| ```julia | ||
| f(A; kwargs...) -> F... | ||
| f!(A, [F]; kwargs...) -> F... | ||
| ``` | ||
|
|
||
| Here, the input matrix is always the first argument, and optionally the output can be provided as well. | ||
| The keywords are algorithm-specific, and can be used to influence the behavior of the algorithms. | ||
| For a full description of how to select and configure algorithms, see [Algorithm Selection](@ref sec_algorithmselection). | ||
| Importantly, for generic code patterns it is recommended to always use the output `F` explicitly, since some implementations may not be able to reuse the provided memory. | ||
| Additionally, the `f!` method typically assumes that it is allowed to destroy the input `A`, and making use of the contents of `A` afterwards should be deemed as undefined behavior. | ||
|
|
||
| ## Exponential | ||
|
|
||
| The [exponential](https://en.wikipedia.org/wiki/Matrix_exponential) of a square matrix `A` is used in many scientific applications, as it arises in the solution of an autonomous linear differential equation. | ||
| An implementation for the matrix exponential based on a Padé approximation is available in `LinearAlgebra`, and can be accessed by the algorithm [`MatrixFunctionViaLA`](@ref). | ||
| For more generic data types, the exponential can be calculated by first calculating the (hermitian) eigenvalue decomposition, and then computing | ||
| the scalar exponential of the diagonal elements. | ||
| This strategy is implemented via the algorithms [`MatrixFunctionViaEig`](@ref) and [`MatrixFunctionViaEigh`](@ref), and call `eig_full` and `eigh_full`, respectively. | ||
| Additionally, in order to calculate `exp(τ * A)`, the function `exponential` can be called with `(τ, A)`, using the same algorithms as before. | ||
|
|
||
| ```@docs; canonical=false | ||
| exponential | ||
| MatrixAlgebraKit.MatrixFunctionViaLA | ||
| MatrixAlgebraKit.MatrixFunctionViaEig | ||
| MatrixAlgebraKit.MatrixFunctionViaEigh | ||
| ``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to specifically separate out the matrix functions from the decompositions? It might be more clear to keep these separate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea. A suggestion on how to do this is in the latest commit.