SebWouters / CheMPS2

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

writing 2-rdm #45

Closed loriab closed 7 years ago

loriab commented 7 years ago

Hi @SebWouters, There's a request over at the forum for printing out the 2-RDM from psi4. I'm glad to oblige and have located the correct object, but the requester also mentioned being able to write to file through chemps2 --twodmfile=$filename on the binary. I pulled the current version and tried it out but it doesn't recognize the option, nor can I find it in the code. Thought I'd check with you and see if there was a version issue going on.

http://forum.psicode.org/t/printing-or-disking-out-dmrg-2pdm-in-psi4/272/4?u=loriab

SebWouters commented 7 years ago

Hi Lori,

I'm on holiday now, in the middle of nowhere. I will answer this weekend when I'm back :-).

There's a function CheMPS2::TwoDM::something to print the 2-RDM if I'm not mistaken.

Best wishes, Sebastian

SebWouters commented 7 years ago

Hi @loriab,

It's the function

void CheMPS2::TwoDM::write2DMAfile(const string filename) const;

which is accessible via

theDMRG->get2DM()->write2DMAfile( filename );

I've deprecated the command line option

--twodmfile

in v1.7 onwards. But you can include it again in the psi4 interface if you like.

Best wishes, Sebastian

loriab commented 7 years ago

Thanks, Sebastian, I had found the function and started to get it into place in https://github.com/loriab/psi4/commit/aa277681bba3f7c21da969d8f55e931abf495847 but the existing psi4 interface doesn't have a TwoDM object, and I had trouble extracting a SyBookkeeper to initialize one. That's why I thought it might be a versioning issue. Can I extract a SyBookkeeper from theDMRG?

SebWouters commented 7 years ago

Hi @loriab

From the current API, I wouldn't know why you need the SyBookkeeper or create a TwoDM object yourself?

Just use

theDMRG->get2DM()->write2DMAfile( filename );