Custom (sum of) Operators

How do I use this algorithm? What does that parameter do?
Post Reply
dorf
Posts: 32
Joined: 16 Feb 2021, 16:34

Custom (sum of) Operators

Post by dorf »

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.
User avatar
Johannes
Site Admin
Posts: 413
Joined: 21 Jul 2018, 12:52
Location: TU Munich

Re: Custom (sum of) Operators

Post by Johannes »

A bit late, but better late than never ;-)
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...
dorf
Posts: 32
Joined: 16 Feb 2021, 16:34

Re: Custom (sum of) Operators

Post by dorf »

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. :oops:
User avatar
HelgannuanO
Posts: 1
Joined: 07 Jul 2021, 07:25

-

Post by HelgannuanO »

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.
Post Reply