Hi!
I was trying to use the qml.qchem.inport() to convert dmrg result from block2 to a state vector. But when I try to run the example:
mol = gto.M(atom=[[‘H’, (0, 0, 0)], [‘H’, (0,0,0.71)]], basis=‘sto3g’)
mf = scf.RHF(mol).run()
mc = mcscf.CASCI(mf, 2, 2)
ncas, n_elec, spin, ecore, h1e, g2e, orb_sym = itg.get_rhf_integrals(mf, mc.ncore, mc.ncas, g2e_symm=8)
driver = DMRGDriver(scratch=“./tmp”, symm_type=SymmetryTypes.SU2)
driver.initialize_system(n_sites=ncas, n_elec=n_elec, spin=spin, orb_sym=orb_sym)
mpo = driver.get_qc_mpo(h1e=h1e, g2e=g2e, ecore=ecore)
ket = driver.get_random_mps(tag=“GS”)
wavefunction = driver.get_csf_coefficients(ket)
wf_dmrg = import_state(wavefunction, tol=1e-1)
print(wf_dmrg)
It returns the following error message:
ValueError Traceback (most recent call last)
Cell In[16], line 10
8 ket = driver.get_random_mps(tag=“GS”)
9 wavefunction = driver.get_csf_coefficients(ket)
—> 10 wf_dmrg = import_state(wavefunction, tol=1e-1)
11 print(wf_dmrg)
File ~/anaconda3/lib/python3.11/site-packages/pennylane/qchem/convert.py:615, in import_state(solver, tol)
613 wf_dict = _dmrg_state(solver, tol=tol)
614 else:
→ 615 raise ValueError(
616 “For tuple input, the supported objects are”
617 " tuple(list[str], array[float]) for SHCI calculations with Dice library and "
618 “tuple(list[int], array[float]) for DMRG calculations with the Block2 library.”
619 )
620 else:
621 raise ValueError(
622 “The supported objects are RCISD, UCISD, RCCSD, and UCCSD for restricted and”
623 " unrestricted configuration interaction and coupled cluster calculations, and"
624 " tuple(list[str], array[float]) for SHCI calculations with Dice library and "
625 “tuple(list[int], array[float]) for DMRG calculations with the Block2 library.”
626 )
ValueError: For tuple input, the supported objects are tuple(list[str], array[float]) for SHCI calculations with Dice library and tuple(list[int], array[float]) for DMRG calculations with the Block2 library.
I wonder if it’s because it didn’t use it correctly or there is some problem in the code? Thanks!