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
[WIP] [experimental] mps simulator backend #3583
Conversation
Hello. You may have forgotten to update the changelog!
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Utheta = np.tensordot(U_site, theta, axes=([1], [1])) # i [i*], vL [i] vR | ||
Utheta = np.transpose(Utheta, [1, 0, 2]) # i vL vR >> vL i vR | ||
|
||
# no truncation (unsure atm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused here, do I need to do any SVD for single site updates? In single-site DMRG yes, but here this is different. Maybe @chaeyeunpark knows about this?
(tests with full state vector simulator agree atm)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will have a look in the new year. I also want to tag @ikurecic here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know now it is wrong, curious to know how to do it for single site (atm I am just forcing a two-site update)
This comment was marked as outdated.
This comment was marked as outdated.
# if you get an error message "LinAlgError: SVD did not converge", | ||
# uncomment the following line. (This requires TeNPy to be installed.) | ||
# from tenpy.linalg.svd_robust import svd # (works like scipy.linalg.svd) | ||
|
||
from tenpy.linalg.svd_robust import svd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be annoying for people to test, I needed it for some examples that wouldnt converge otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few suggestions here. If this SVD algorithm (in tenpy) is not difficult, we can make our own version. Otherwise, we should make tenpy
an optional dependency. It is still strange that svd
in scipy
is not robust enough.
pennylane/devices/experimental/custom_device_3_numpydev/python_device_mps.py
Show resolved
Hide resolved
Latest update lets you construct an MPO operator for a long distance 2-site operators (e.g. |
Integration of MPO-MPS contraction complete. Added some basic explicit testing for my own sanity, see pennylane/devices/tests/test_mpssim.py capabilities/restrictions are currently:
Edit: Support |
check out the demo.ipynb (or for always the latest version go "Files changed" => "demo.ipynb" => "View file")
Rough prototype, likely wont become a PennyLane feature.
A simple MPS simulator to showcase this approach's benefits.
[
The purpose of this PR is exploration and prototyping. I.e. this is a brute force prototype written in basic numpy, so dont expect clean nor optimized code. Though most theory is already well established, there are still some choices to be made. In particular how to treat long-range interactions. My current preference is writing long-distance gates as MPOs (see #3583 (comment) as well as iTensor forum discussion)
In particular things that may be improved: