-
Dear Huanchen, I am trying to save Hamiltonian MPO and reload it in the successive DMRG calculations. In the initial run, I save the MPO using the following code: algo_type=MPOAlgorithmTypes.FastBipartite, iprint=1) mpo.save_data('Ham.bin') and then in the successive run, I reload the MPO by: mpo.load_data('Ham.bin') energy = driver.dmrg(mpo, mps, n_sweeps=sweep_num, bond_dims=[M] * sweep_num, But I get the following error: Can you help? Best, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
In order to reproduce the problem and save time guessing the context, please provide the complete Python script for saving and loading MPO, respectively. |
Beta Was this translation helpful? Give feedback.
-
Here they are. I first run the following code to produce MPO and initial MPS:
Then I reload MPO and MPS to do DMRG:
This gives the error: |
Beta Was this translation helpful? Give feedback.
Thanks for providing the details.
The problem is that the symmetry mode used in
from block2.sany import *; mpo = MPO(0)
(real custom symmetry) does not match the actual symmetry mode in your scriptsymm_type=SymmetryTypes.SAny | SymmetryTypes.CPX
(complex custom symmetry).To solve the problem, you can remove
from block2.sany import *
and changempo = MPO(0)
tompo = driver.bw.bs.MPO(0)
.