Hi,
is there an easy way to make custom operators and apply them to a MPS via 'mps.apply_local_op()'?
Let's say I want to apply S^x_i + S^y_i+1 - const*Id. Is there some functionality that I can construct this operator, give a name to it, and then apply it?
The 'const' is evaluated at runtime, so defining a new operator class or something in the source code probably wouldn't work for me.
Custom (sum of) Operators
Re: Custom (sum of) Operators
A bit late, but better late than never ![Wink ;-)](./images/smilies/icon_e_wink.gif)
apply_local_op accepts an operator that acts on n neighboring sites, for example for two sites with legs
You can use the brand-new function tenpy.networks.site.kron to create the corresponding bond operator from the single-site operators.
They can be added/scaled as desired.
When the terms become too long-range, it will eventually become cheaper to combine them into an MPO and apply that one, but with nearest-neighbor terms, you're definitely not in that limit...
![Wink ;-)](./images/smilies/icon_e_wink.gif)
apply_local_op accepts an operator that acts on n neighboring sites, for example for two sites with legs
'p0', 'p1', 'p0*', 'p1*'
.You can use the brand-new function tenpy.networks.site.kron to create the corresponding bond operator from the single-site operators.
They can be added/scaled as desired.
When the terms become too long-range, it will eventually become cheaper to combine them into an MPO and apply that one, but with nearest-neighbor terms, you're definitely not in that limit...
Re: Custom (sum of) Operators
Thank you very much for your reply and that new functionality!
However, I didn't quite get how to construct the operator for two different sites.
Reading the documentation it seems that I have to pass an array of strings to kron(), which will be translated into some local operators (e.g. 'Sz' for the SpinHalfSite). But how do I pass the sites that they should act on? Or do I have to save the local operator in the MPO-class? I'm sorry but I'm only familiar with the apply_local_op, which is a method of an MPS.![Embarrassed :oops:](./images/smilies/icon_redface.gif)
However, I didn't quite get how to construct the operator for two different sites.
Reading the documentation it seems that I have to pass an array of strings to kron(), which will be translated into some local operators (e.g. 'Sz' for the SpinHalfSite). But how do I pass the sites that they should act on? Or do I have to save the local operator in the MPO-class? I'm sorry but I'm only familiar with the apply_local_op, which is a method of an MPS.
![Embarrassed :oops:](./images/smilies/icon_redface.gif)
- HelgannuanO
- Posts: 1
- Joined: 07 Jul 2021, 07:25
-
Anybody know where to get custom fender badges for the engine size that look like the originals?
I have a 496 and I need new badges anyway.
I have a 496 and I need new badges anyway.