Implement Styles for AbstractMPS#356
Conversation
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
lkdvos
left a comment
There was a problem hiding this comment.
I'm a bit confused by the choice of methods you choose to dispatch through the style.
I was expecting this to be more applicable to the higher-level functions, rather than these very low-level functions instead. Note for example that you are still assuming that the AbstractMPS has fields AC and AR etc, so this isn't necessarily "generalizing" the implementations all that much.
Also for the normalize! function I'm a bit surprised, since in principle that isn't even very well-defined for the infinite case to begin with.
We can maybe rediscuss this a bit more on Monday, but I feel like in general this might not be the right kind of functions to look at, and rather we should focus on the larger algorithms instead.
Note that the goal is not to push everything through the styles, this really only makes sense if we can find implementations that are generic enough to begin with, since otherwise we will have to overload each specific case anyways.
| eachsite(ψ::AbstractMPS) = eachsite(GeometryStyle(ψ), ψ) | ||
|
|
||
| eachsite(::GeometryStyle, ψ::AbstractMPS) = eachindex(ψ) |
There was a problem hiding this comment.
Is there a benefit to having this go through the geometrystyle? It looks like we end up with the same fallback anyways, so I don't really see the point here
This PR implements the methods
AC2,dot,isapprox,norm,normalize(!)as well as the left and right fixedpoints for anAbstractMPSby dispatching onGeometryStyle. These functions are currently defined forFiniteMPSandInfiniteMPS. For other types ofAbstractMPS, there exist more specialized functions, so the dispatch onGeometryStyleis skipped making these changes non-breaking.Examples for the
Stylesystem arefor the
FiniteMPSandfor the
InfiniteMPS.