Skip to content

Change SU2 -> SZ symmetry for excited states #83

Answered by hczhai
piariane asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for using the block2 package.

As the error message indicates, mps_change_to_sz is supposed to be used in the SU2 mode. But since you put driver.symm_type = SymmetryTypes.SZ in the first iteration in the for loop, driver will be in the SZ mode during the second iteration. To solve the problem, you may put driver.symm_type = SymmetryTypes.SZ outside the loop, and make sure all mps_change_to_sz is done before driver.symm_type = SymmetryTypes.SZ. The following is an example script:

# Split states
kets = [driver.split_mps(ket, ir, tag="KET-%d" % ir) for ir in range(ket.nroots)]

# Change from SU(2) to SZ symmetry in order to calculate orbital entropies
zkets = [driver.mps_change_to_sz(ket

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@piariane
Comment options

Answer selected by piariane
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