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
MPO from MPS #212
base: v2
Are you sure you want to change the base?
MPO from MPS #212
Conversation
Hi, thanks for the pull request. May I ask what your use case for adding this function is? I ask because in general, it is better to treat this type of object in a "sparse" way, i.e. instead of explicitly forming the MPO from the outer product of the MPS tensors, it is better to treat the MPS tensors separately. Since that is the case, I worry that adding this function may encourage people to use this method instead of doing it in a more efficient way. Possibly a better thing to do would be to make a special class, like Cheers, |
We are using this to develop a MPO optimization algorithm related to density matrices and various operators: basically, optimizing A via Tr[rho.A]. The idea was to explorie a model of mixed states made out of convex combinations of pure states (GHZ and W in particular), and this format seemed sufficient for that purpose. I agree that a sparse representation would probably be ideal for MPO representation of pure states, but anything beyond that would require the full fledged MPO (as far as I can understand the problem here). I suppose we could create a sparse class, which could be converted on the fly when such manipulations take place. But I honestly don't know where I'd begin with that approach. This all may be an obscure usage that won't warrant an inclusion, but we figured it could be helpful to share. |
I see, you would like this function as a way to help create your starting density matrix |
Yes, exactly. We're doing rhoW = |W><W| and rhoGHZ = |GHZ><GHZ|, then mixing them to get our mixed state MPO.
That would be a good idea, and should cover your concerns. There's really no reason to use this unless you will truly be dealing with a mixed state. |
One thing we could do is give this function a name besides |
I see. That's a fair point. As of now it's implemented as a constructor under MPO. Should I then just create an isolated Actually, given your considerations, perhaps it may be semantically better to move this into the MPS class as an instance's method instead, so that the syntax makes it clear you're converting a given MPS to a MPO via an outer product. If that sounds reasonable, let me know and I'll make the appropriate changes. Cheers! |
I think it is best to just group it with other MPO functions/constructors, in mps/mpo.h and mps/mpo.cc, since I would consider it a specialized MPO constructor. What you can do is model it off of the We could think about adding an optional Args to it, to allow people to request properties of the resulting MPO (like a maximum bond dimension, custom link type, etc), but that could be added later. Thanks for the contributions! |
Extension to MPO class to allow creation of MPOs from a MPS, and extra features.
Collaboration by Thiago O. Maciel.