aoterodelaroza / critic2

Analysis of quantum chemical interactions in molecules and solids.
Other
97 stars 35 forks source link

Restrict open computations not allowed #34

Closed mvfbarrionuevo closed 4 years ago

mvfbarrionuevo commented 4 years ago

Hi @aoterodelaroza, first of all, thanks for such a great job and for making critic the best free tool for the AIM community.

I'm not sure if this should be an issue, so I apologize in advance if I am missing something.

I used to compute much of my crystal or molecular structures using QE and never happened to me to get in trouble when using critic2. But now I was conducting some calculations in a different program, the Orca suit. I haven't noticed if critic2 is capable of reading Orca output, but since critic2 is able to read wfn and wfx, I exported the electron density of my computed structure in both formats and none of them seem to work.

The system I am working with is a copper complex that is usually done with ROHF method. Here are some of the errors I got when trying to load any of those file formats:

1) loading wfn: ERROR(wfn_read_wfn): restricted-open wfn files not supported 2) loading wfx: ERROR(wfn_read_wfx): Number of Occupied Molecular Orbitals tag not found

As we see in the first case it seems that critic2 can't handle ROHF wfn, is that right? I thought perhaps by trying with wfx things could be different, but then I got a new kind of error. The wfx output error is a little odd for me since the tag "Number of Occupied Molecular Orbitals" is present in the file.

The actual critic input I made was:

molecule N_ROHF.xt load N_ROHF.xt yt

Where xt may be replaced by wfn or wfx. I appreciate any help on this. Kind regards from Brazil :)

aoterodelaroza commented 4 years ago

Hi @mvfbarrionuevo: ROHF wavefunctions are at present not implemented, that I remember. But it is not outside the realm of possibility to do it. The wfx error is probably indicating this as well, except a bail-out for the ROHF case has not been explicitly incorporated into the code. I'll add this to the TODO list - it would be interesting that ROHF worked, at least with the wfx format. (Note: you can also use molden-style files in principle, but I believe there are several versions of molden file formats that are not entirely compatible, and I have never tried the orca format... in any case, I don't think ROHF is implemented with molden files either).

mvfbarrionuevo commented 4 years ago

Thanks for replying @aoterodelaroza. Yes, I did try the molden file format printed by Orca, but it also fails to count the alpha electrons. A possible workaround I found was to print the electron density of the system as a cube file and that worked pretty nicely. So, it may not be necessary to bother yourself with this task within your TODO list. I wondered if the wfx should work, and since I couldn't get it to work I thought it would be good to ask for help. Thanks once again for your help :)

aoterodelaroza commented 4 years ago

I think this is fixed in the last push I did. psi4 doesn't write molden ROHF files (or rather, it writes them as if they were UHF), so I'm not sure how that'll go. But wfn and wfx (and fchk) should work. Could you please pull and try again?

mvfbarrionuevo commented 4 years ago

@aoterodelaroza, it did work smoothly! Thanks a lot for your help, I didn't expect you were so fast at fixing it (I don't have a good idea how hard it can be to do so). I'm amazed by critic2, thanks for your work and for helping me out with this.

Now, just out of the context I was wondering about the possibility of using critic2 to compute the volume and average of a specific NCI domain by using critic2, i.e., integrate a real space function within RDG isosurface. Is this possible? Nonetheless, I also wonder if it would be possible to compute the volume of cavities within a given structure. I was doing it by a not so easy route using marching cubes and programming everything in python. For that, I took a promolecular electronic density from critic2 (as a testing example) and rendered it within a range of isosurface values until the space domain desired were sampled, then I used marching cubes to compute both: volume, area. Well, for me it was no trivial task, so I just wondered if I missed something from critic2 that could make it easier. Any thoughts would be highly appreciated. Thanks once again. :+1:

aoterodelaroza commented 4 years ago

Glad you like it :). For integrating the volume of NCI blobs or any other features: the easiest way is to load a field on a uniform grid that has ones if a point is inside the feature you want and zero if it doesn't. The cell integral of this field is approximately the value you want. For instance, if you have the rdg in a cube and you want to integrate the zones with rdg lower than 0.2, then you do:

load as "$rdg < 0.2"

and in the output you need to look for:

  Cell integral (grid SUM) = 26.10716821

You can combine several of this by taking products of conditionals (e.g. rdg lower than this and promolecular density higher than that, ($rdg < 0.2) * ($0 > 0.1)) and you can also use structural variables to incorporate structural information (e.g. consider only the points that are at a distance x of an atom of type y). It would have to be a weird thing if it can't be calculated in this way without additional programming. But let me know the specifics if you can't do it and I can give you a hand.

mvfbarrionuevo commented 4 years ago

That sounds really great! Thanks for pointing me that. I will give it a try and see what I can get. I will be reaching you later. Thanks again! :)