SebWouters / CheMPS2

CheMPS2: a spin-adapted implementation of DMRG for ab initio quantum chemistry
GNU General Public License v2.0
70 stars 34 forks source link

key errors while running CheMPS2/integrals/pyscf/example3.py #18

Closed dingld closed 9 years ago

dingld commented 9 years ago

It turned out normal while running example.py and example2.py, but things went wrong with example3.py(Both pyscf and chemps2 are the master-versions up to now)

1)File "/home/luod/github.soft/CheMPS2-master/integrals/pyscf/call_chemps2.py", line 14, in call_chemps2 Group = CheMPS2_groupnamemapping[ GroupName ] KeyError: 'Dooh'

I was guessing that something was wrong changing mf.mol.symmetry to mf.mol.groupname, so I manually changed the value in python script. -- mf.mol.groupname='C1' and I got the second error

2)CheMPS2-master/CheMPS2/Hamiltonian.cpp:52: CheMPS2::Hamiltonian::Hamiltonian(int, int, const int *): Assertion `OrbIrreps[cnt]<nIrreps' failed.

I am confused now

dingld commented 9 years ago

By the way, I just tested the intergace provided in pyscf, and got similiar complaints

File "/home/luod/github.soft/pyscf/future/dmrgscf/chemps2.py", line 74, in kernel numpy.array(self.orbsym)) File "PyCheMPS2.pyx", line 64, in PyCheMPS2.PyHamiltonian.cinit (PyCheMPS2.cpp:2536) ValueError: Buffer dtype mismatch, expected 'int' but got 'long'

the pyscf was compiled using gnu-compiler with -Dmkl off, chemps2 using g++ with -Dmkl on

sunqm commented 9 years ago

For the second error

File "PyCheMPS2.pyx", line 64, in PyCheMPS2.PyHamiltonian.cinit (PyCheMPS2.cpp:2536) ValueError: Buffer dtype mismatch, expected 'int' but got 'long'

It's a bug in the interface. Please checkout the updates in the latest commit.

Qiming

SebWouters commented 9 years ago

Hi Luo Di,

I was able to reproduce your error and fixed it in commit c9b9e269797618ffba3c8be435528eb037a5157f .

@sunqm : Line https://github.com/SebWouters/CheMPS2/blob/c9b9e269797618ffba3c8be435528eb037a5157f/integrals/pyscf/dmrgci.py#L34 returned [0 0 0 0 3 2 5 5 5 5 6 7] which are D2h irreps even if the symmetry label is Dooh, am I correct?

Best wishes, Seb

sunqm commented 9 years ago

For Dooh, Coov symmetry, small transformation is needed, eg https://github.com/sunqm/pyscf/blob/master/future/dmrgscf/dmrgci.py#L452. More info of the Dooh -> D2h mapping can be found in https://github.com/sunqm/pyscf/blob/master/symm/basis.py#L128

Qiming

SebWouters commented 9 years ago

Thanks! Adjusted in cfa6205e9ab2cb2f27c9ddaee220c7a767746f43 .