aoterodelaroza/critic2

Definition scalar fields

Closed this issue · 3 comments

Hi,
I am confused about how scalar fields are being defined using molecule as input for critic2. For instance, when using something along these lines as input file

molecule benzene.fchk
load benzene.fchk id wfn READVIRTUAL
load as "$wfn" 150 150 150 id dens

Critic2 creates a grid with 150 grid centers in each direction, but I don't see how I could set the length of each grid axis. That being said, I don't know how to set the density of grid centers (in each direction) in advance. Ideally, I want to be able to make grids with the same grid center density in each direction. Is there a way to define either the length of the axis in each direction or the density of grid centers in each direction (something like grid centers / bohr)?

Thanks!

Molecules in critic2 are also treated as periodic systems, because critic was originally a program for solids and molecules are a bit of an afterthought. When you load the molecular structure with molecule, critic2 assigns a periodic cell that is by default 10 angstrom larger than the molecule in each direction. You can control this by passing the border you want after the molecule file name and you can also make the periodic cell cubic with the CUBIC keyword. See MOLECULE in the manual.

Grid scalar fields loaded with LOAD AS span the whole periodic cell. The number of points in each direction combined with the options above to set the dimensions of the cell are all there is. You have several options:

  • If the grid is meant to be written to a file, then you should check out the CUBE keyword, which allows you to control both the dimensions of the region (it needs not be equal to the periodic cell) and the number (or density) of points in each direction. You can then read back this cube:
MOLECULE bleh.cube
LOAD bleh.fchk id wfn READVIRTUAL
LOAD bleh.cube

and it will have the periodic cell will have the same dimensions as you gave in the CUBE keyword.

  • If the purpose is to calculate the grid and work with it directly, without the intervention of a cube file, then there aren't as many options. It would be easy to implement them, though, in a manner that is compatible with what CUBE does.

Thanks @aoterodelaroza !
Indeed the CUBE keyword is what I wanted. I am now mapping the field into a cube file and reading it back in, which works nicely.

I was confused by something in the manual: The manual entry for Grid (CUBE) says that the default units for defining end-points for a molecule system (loaded with molecule) is Angstrom. However the keyword for the density of points along an axes in the cube is given by bpp which means “bohr per point”. Maybe one can add that for a molecule system bpp is still really Bohr although the end-points are in Angstrom.

That's a good point. I've changed bpp to lpp (length per point) and pushed a modification to the code so it interprets lpp in bohr for crystals and in angstrom for molecules, to make it consistent with the rest of the keywords. I've also changed that particular section in the manual.