Skip to content

Computing correlation matrix and local observables #122

Answered by hczhai
Shovan-Physics asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for pointing out the issue. If you update block2 to version 0.5.3rc18, the DMRGDriver.get_npdm can work for custom Hamiltonians and custom operators. For Bose-Hubbard model, one can write

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]

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Shovan-Physics
Comment options

Answer selected by Shovan-Physics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants