-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/save-state
- Loading branch information
Showing
93 changed files
with
2,588 additions
and
3,111 deletions.
There are no files selected for viewing
This file contains 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 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,7 +1,7 @@ | ||
name = "Rimu" | ||
uuid = "c53c40cc-bd84-11e9-2cf4-a9fde2b9386e" | ||
authors = ["Joachim Brand <[email protected]>"] | ||
version = "0.13.0" | ||
version = "0.14.0" | ||
|
||
[deps] | ||
Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45" | ||
|
@@ -39,6 +39,7 @@ StrLiterals = "68059f60-971f-57ff-a2d0-18e7de9ccc84" | |
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76" | ||
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" | ||
TerminalLoggers = "5d786b92-1e48-4d6f-9151-6b4477ca9bed" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
TupleTools = "9d95972d-f1c8-5527-a6e0-b4b365fa01f6" | ||
VectorInterface = "409d34a3-91d5-4945-b6ec-7529ddf182d8" | ||
|
||
|
@@ -87,14 +88,13 @@ TOML = "1" | |
Tables = "1.9" | ||
TerminalLoggers = "0.1.4" | ||
TupleTools = "1" | ||
VectorInterface = "0.2, 0.3, 0.4" | ||
VectorInterface = "0.2, 0.3, 0.4, 0.5" | ||
julia = "1.9" | ||
|
||
[extras] | ||
Arpack = "7d9fca2a-8960-54d3-9f78-7d1dccf2cb97" | ||
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153" | ||
KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
||
[targets] | ||
test = ["Test"] |
This file contains 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 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 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 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 was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -0,0 +1,110 @@ | ||
# Advanced operator usage and custom Hamiltonians | ||
|
||
`Rimu` can be used to work with custom Hamiltonians and observables that are user-defined and | ||
not part of the `Rimu.jl` package. To make this possible and reliable, `Rimu` exposes a number | ||
of interfaces and provides helper functions to test compliance with the interfaces through the | ||
submodule [`Rimu.InterfaceTests`](@ref), see [Interface tests](@ref). This section covers the | ||
relevant interfaces, the interface functions as well as potentially useful helper functions. | ||
|
||
In order to define custom Hamiltonians or observables it is useful to know how the operator | ||
type hierarchy works in `Rimu`. For an example of how to implement custom Hamiltonians that | ||
are not part of the `Rimu.jl` package, see | ||
[`RimuLegacyHamiltonians.jl`](https://github.com/RimuQMC/RimuLegacyHamiltonians.jl). | ||
|
||
## Operator type hierarchy | ||
|
||
`Rimu` offers a hierarchy of abstract types that define interfaces with different requirements | ||
for operators: | ||
```julia | ||
AbstractHamiltonian <: AbstractOperator <: AbstractObservable | ||
``` | ||
The different abstract types have different requirements and are meant to be used for different purposes. | ||
- [`AbstractHamiltonian`](@ref)s are fully featured models that define a Hilbert space and a linear operator over a scalar field. They can be passed as a Hamiltonian into [`ProjectorMonteCarloProblem`](@ref) or [`ExactDiagonalizationProblem`](@ref). | ||
- [`AbstractOperator`](@ref) and [`AbstractObservable`](@ref) are supertypes of [`AbstractHamiltonian`](@ref) with less stringent conditions. They are useful for defining observables that can be used in a three-way `dot` product, or passed as observables into a [`ReplicaStrategy`](@ref) that can be inserted with the keyword `replica_strategy` into a [`ProjectorMonteCarloProblem`](@ref). | ||
|
||
## Hamiltonians interface | ||
|
||
Behind the implementation of a particular model is a more abstract interface for defining | ||
Hamiltonians. If you want to define a new model you should make use of this interface. A new | ||
model Hamiltonian should subtype to `AbstractHamiltonian` and implement the relevant methods. | ||
|
||
```@docs | ||
AbstractHamiltonian | ||
offdiagonals | ||
diagonal_element | ||
starting_address | ||
``` | ||
|
||
The following functions may be implemented instead of [`offdiagonals`](@ref). | ||
|
||
```@docs | ||
num_offdiagonals | ||
get_offdiagonal | ||
``` | ||
|
||
The following functions come with default implementations, but may be customized. | ||
|
||
```@docs | ||
random_offdiagonal | ||
Hamiltonians.LOStructure | ||
dimension | ||
has_adjoint | ||
allows_address_type | ||
Base.eltype | ||
VectorInterface.scalartype | ||
mul! | ||
``` | ||
|
||
This interface relies on unexported functionality, including | ||
```@docs | ||
Hamiltonians.adjoint | ||
Hamiltonians.dot | ||
Hamiltonians.AbstractOffdiagonals | ||
Hamiltonians.Offdiagonals | ||
Hamiltonians.check_address_type | ||
Hamiltonians.number_conserving_dimension | ||
Hamiltonians.number_conserving_bose_dimension | ||
Hamiltonians.number_conserving_fermi_dimension | ||
``` | ||
|
||
## Operator and observable interface | ||
|
||
```@docs | ||
AbstractObservable | ||
AbstractOperator | ||
``` | ||
|
||
## Interface tests | ||
Helper functions that can be used for testing the various interfaces are provided in the | ||
(unexported) submodule `Rimu.InterfaceTests`. | ||
|
||
```@docs | ||
Rimu.InterfaceTests | ||
``` | ||
|
||
### Testing functions | ||
```@docs | ||
Rimu.InterfaceTests.test_hamiltonian_interface | ||
Rimu.InterfaceTests.test_hamiltonian_structure | ||
Rimu.InterfaceTests.test_observable_interface | ||
Rimu.InterfaceTests.test_operator_interface | ||
``` | ||
|
||
## Utilities for harmonic oscillator models | ||
Useful utilities for harmonic oscillator in Cartesian basis, see [`HOCartesianContactInteractions`](@ref) | ||
and [`HOCartesianEnergyConservedPerDim`](@ref). | ||
```@docs | ||
get_all_blocks | ||
fock_to_cart | ||
``` | ||
Underlying integrals for the interaction matrix elements are implemented in the following unexported functions | ||
```@docs | ||
Hamiltonians.four_oscillator_integral_general | ||
Hamiltonians.ho_delta_potential | ||
Hamiltonians.log_abs_oscillator_zero | ||
``` | ||
|
||
## Index | ||
```@index | ||
Pages = ["custom_hamiltonians.md"] | ||
``` |
This file contains 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 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
Oops, something went wrong.