-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add mps_add
function
#1
Conversation
Thanks for the nice work! Could you modify the pull request by additionally taking these suggestions into account?
|
Thanks for the feedback! I've updated the code accordingly. |
Thanks again! Minor additional point: the local variable qsite is allocated but not freed; actually, instead of allocating this array, one can directly pass psi->qsite to allocate_empty_mps (since it creates its own copy internally). |
I've removed the |
Final minor point: currently the automatic unit test does not run due to const qnumber qsite_chi[d] in the unit test; please use an explicit integer here as well, i.e., const qnumber qsite_chi[2] |
Ah yes, sorry for that. |
Interesting. Locally |
There is a problem in the "qnumber_all_equal" assertions: the first argument should be the logical dimension instead of "ndim", for example, assert(qnumber_all_equal(chi_a.dim_logical[0], ...)). Also, in the unit test, the quantum number sector qnum_sector = encode_quantum_number_pair(q_pnum, q_spin) leads to MPS which are logical zero vectors (since the quantum number restriction cannot be satisfied); instead, you can set qnum_sector to a small integer. |
Thanks! I've now squash-merged the pull request into the main branch. |
Great - thanks for the patience and sorry for the hiccups! |
Changelog
mps_add
function (More or less a 1:1 copy of the PyTeNet implementation)test_mps_add
test function (Generate Random MPS ➡mps_add
➡ Compare state-vectors)README.md
(Add dependency installation instructions for MacOS).vscode/
to.gitignore