OK, that's a good question. Unfortunately the answer is hard, otherwise
I would have done it already.
The a[] and b[] coeffs are the Gaussian coefficients used for
calculating an atomic shape function in reciprocal space, i.e. for use
in a structure factor calculation.
The aw[] and bw[] coeffs are the corresponding Gaussian coefficients
used for calculating the electron density in real space.
For anisotropic atoms, you can't use bw, so the class constructs
uaninv[], which is a vector of aniso Gaussian coefficients which combine
both the ADP and shape function coefficients.
So this function:
ftype AtomShapeFn::rho( const Coord_orth& xyz ) const
{
// iso
const Coord_orth dxyz( xyz - coord_ );
if ( is_iso ) return rho( dxyz.lengthsq() );
// aniso
return occ_ * ( aw[0]*exp( uaninv[0].quad_form( dxyz ) ) +
aw[1]*exp( uaninv[1].quad_form( dxyz ) ) +
aw[2]*exp( uaninv[2].quad_form( dxyz ) ) +
aw[3]*exp( uaninv[3].quad_form( dxyz ) ) +
aw[4]*exp( uaninv[4].quad_form( dxyz ) ) +
aw[5]*exp( uaninv[5].quad_form( dxyz ) ) );
}
returns the electron density at position xyz in the cell due to the atom
located at coord_. The corresponding isotropic form is simple, but when
you want aniso density, you need to construct the quadratic form of the
difference coodinate with the U_aniso tensor.
To implement the corresponding gradient function, there are two possible
approaches:
1. Calculate it by finite difference methods, using 4 calls to the above
function. This is computationally wasteful and less precise, but simple
to do, and you should always do this anyway as a cross-check of the
analytical approach.
2. Calculate is analytically by differentiating the above expression
with respect to dxyz.x(), dxyz.y(), dxyz.z(). This will probably be
about twice as fast as the above method, and more precise.
If you can do this, I'll be very glad to incorporate the code. If you
get stuck, get back to me and I'll see if I can do it, although I am
pressed for time at the moment.
Kevin
Athanasios Dousis wrote:
Hello all,
I have the latest Clipper libraries (v2.0), and I'd like to calculate
the Agarwal density gradients for anisotropic atomic displacement
parameters. Unfortunately, the method
clipper::AtomShapeFn::rho_grad(...) only works for the isotropic ADP's.
Is there code available for the anisotropic parameters? If no, do you
have any advice on how to implement the density gradients? I understand
how to do this in principle, but I'm somewhat confused by the aw[.] and
bw[.] coefficients in the code. Are these related to the Jacobian
determinant of the reciprocal-real space transformation?
Also, please let me know if there is a more appropriate forum to ask
this question.
Thank you,
Nasos Dousis