Computing correlation matrix and local observables #122
-
Hi, I want to calculate two-site correlations for the Bose-Hubbard model: https://block2.readthedocs.io/en/latest/tutorial/custom-hamiltonians.html#Bose-Hubbard-Model. I find that
Computing the MPO for each term and using
I suppose it will be much faster if we could shift the orthogonality center of the MPS to Similarly, I would like to calculate expectations of some local operator (say the number fluctuation) at every site without having to form MPOs for all of them. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Thanks for pointing out the issue. If you update dm = driver.get_npdm(mps, npdm_expr='CD', fermionic_ops='', mask=[0, 1])[0]
dm = driver.get_npdm(mps, npdm_expr='NN', fermionic_ops='', mask=[0, 1])[0] |
Beta Was this translation helpful? Give feedback.
Thanks for pointing out the issue. If you update
block2
to version0.5.3rc18
, theDMRGDriver.get_npdm
can work for custom Hamiltonians and custom operators. For Bose-Hubbard model, one can write