-
Notifications
You must be signed in to change notification settings - Fork 45
Add OperatorStyle and GeometryStyle
#352
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
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
fa91804
add styles
AFeuerpfeil 1334fcb
start rewrite
AFeuerpfeil 140005f
start defining the styles
AFeuerpfeil bd6ccdf
implement styles for states and operators and add tests
AFeuerpfeil 5be03c3
Merge pull request #1 from AFeuerpfeil/pr-mpo-styles
AFeuerpfeil 0896113
add include styles
AFeuerpfeil 6350c96
fix InfiniteMPO test
AFeuerpfeil 50793bf
dispatch styles on type and rename IsfiniteStyle to GeometryStyle
AFeuerpfeil 7226788
readd Base.isfinite for AbstractMPS, MPO and MPOHamiltonian
AFeuerpfeil c206de8
add tests for styles of types
AFeuerpfeil 07f579c
fix include order
AFeuerpfeil d278a3a
fix OperatorStyle for MPOHamiltonian
AFeuerpfeil ea5366c
Add WindowStyle and increase code coverage
AFeuerpfeil 18b5ef2
fix test and hopefully also runic
AFeuerpfeil 5af3060
more tests
AFeuerpfeil 8f72c21
fix other tests
AFeuerpfeil 9b7905c
make GeometryStyle names more descriptive
AFeuerpfeil bb74ee8
implement changes
AFeuerpfeil 692f895
remove unnecessary Base.isfinite definitions, because it is already d…
AFeuerpfeil 38db5da
fix braille tests
AFeuerpfeil 5d1f975
addd
AFeuerpfeil abcf6a6
revert unnecessary changes
AFeuerpfeil 0718f63
update style docs
lkdvos ffc50d5
fix formatting
lkdvos 776748b
more formatting
lkdvos 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
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
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
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
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 |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| """ | ||
| abstract type OperatorStyle | ||
| OperatorStyle(x) | ||
| OperatorStyle(::Type{T}) | ||
|
|
||
| Trait to describe the operator behavior of the input `x` or type `T`, which can be either | ||
| * `MPOStyle()`: product of local factors; | ||
| * `HamiltonianStyle()`: sum of local terms. | ||
| """ | ||
| abstract type OperatorStyle end | ||
lkdvos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| OperatorStyle(x) = OperatorStyle(typeof(x)) | ||
| OperatorStyle(T::Type) = throw(MethodError(OperatorStyle, T)) # avoid stackoverflow if not defined | ||
|
|
||
| struct MPOStyle <: OperatorStyle end | ||
| struct HamiltonianStyle <: OperatorStyle end | ||
|
|
||
| @doc (@doc OperatorStyle) MPOStyle | ||
| @doc (@doc OperatorStyle) HamiltonianStyle | ||
|
|
||
| """ | ||
lkdvos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| abstract type GeometryStyle | ||
| GeometryStyle(x) | ||
| GeometryStyle(::Type{T}) | ||
|
|
||
| Trait to describe the geometry of the input `x` or type `T`, which can be either | ||
| * `FiniteChainStyle()`: object is defined on a finite chain; | ||
| * `InfiniteChainStyle()`: object is defined on an infinite chain. | ||
| """ | ||
| abstract type GeometryStyle end | ||
| GeometryStyle(x) = GeometryStyle(typeof(x)) | ||
| GeometryStyle(T::Type) = throw(MethodError(GeometryStyle, T)) # avoid stackoverflow if not defined | ||
|
|
||
| struct FiniteChainStyle <: GeometryStyle end | ||
| struct InfiniteChainStyle <: GeometryStyle end | ||
|
|
||
| @doc (@doc GeometryStyle) FiniteChainStyle | ||
| @doc (@doc GeometryStyle) InfiniteChainStyle | ||
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.