Package maths_fns :: Module pcs
[hide private]
[frames] | no frames]

Module pcs

source code

Module for the calculation of pseudocontact shifts.

Functions [hide private]
float
ave_pcs_tensor(dj, vect, N, A, weights=None)
Calculate the ensemble average PCS, using the 3D tensor.
source code
float
ave_pcs_tensor_ddeltaij_dAmn(dj, vect, N, dAi_dAmn, weights=None)
Calculate the ensemble average PCS gradient element for Amn, using the 3D tensor.
source code
float
pcs_tensor(dj, mu, A)
Calculate the PCS, using the 3D alignment tensor.
source code
Variables [hide private]
  __package__ = 'maths_fns'

Imports: dot, sum


Function Details [hide private]

ave_pcs_tensor(dj, vect, N, A, weights=None)

source code 

Calculate the ensemble average PCS, using the 3D tensor.

This function calculates the average PCS for a set of XH bond vectors from a structural ensemble, using the 3D tensorial form of the alignment tensor. The formula for this ensemble average PCS value is:

                        _N_
                        \                   T
   <delta_ij(theta)>  =  >  pc . djc . mu_jc . Ai . mu_jc,
                        /__
                        c=1

where:

  • i is the alignment tensor index,
  • j is the index over spins,
  • c is the index over the states or multiple structures,
  • N is the total number of states or structures,
  • theta is the parameter vector,
  • djc is the PCS constant for spin j and state c,
  • pc is the population probability or weight associated with state c (equally weighted to 1/N if weights are not provided),
  • mu_jc is the unit vector corresponding to spin j and state c,
  • Ai is the alignment tensor.

The PCS constant is defined as:

        mu0 15kT   1
   dj = --- ----- ---- ,
        4pi Bo**2 r**3

where:

  • mu0 is the permeability of free space,
  • k is Boltzmann's constant,
  • T is the absolute temperature,
  • Bo is the magnetic field strength,
  • r is the distance between the paramagnetic centre (electron spin) and the nuclear spin.
Parameters:
  • dj (numpy rank-1 array) - The PCS constants for each structure c for spin j. This should be an array with indices corresponding to c.
  • vect (numpy matrix) - The electron-nuclear unit vector matrix. The first dimension corresponds to the structural index, the second dimension is the coordinates of the unit vector. The vectors should be parallel to the vector connecting the paramagnetic centre to the nuclear spin.
  • N (int) - The total number of structures.
  • A (numpy rank-2 3D tensor) - The alignment tensor.
  • weights (numpy rank-1 array) - The weights for each member of the ensemble (the last member need not be supplied).
Returns: float
The average PCS value.

ave_pcs_tensor_ddeltaij_dAmn(dj, vect, N, dAi_dAmn, weights=None)

source code 

Calculate the ensemble average PCS gradient element for Amn, using the 3D tensor.

This function calculates the average PCS gradient for a set of electron-nuclear spin unit vectors (paramagnetic to the nuclear spin) from a structural ensemble, using the 3D tensorial form of the alignment tensor. The formula for this ensemble average PCS gradient element is:

                       _N_
   ddelta_ij(theta)    \                   T   dAi
   ----------------  =  >  pc . djc . mu_jc . ---- . mu_jc,
         dAmn          /__                    dAmn
                       c=1

where:

  • i is the alignment tensor index,
  • j is the index over spins,
  • m, the index over the first dimension of the alignment tensor m = {x, y, z}.
  • n, the index over the second dimension of the alignment tensor n = {x, y, z},
  • c is the index over the states or multiple structures,
  • theta is the parameter vector,
  • Amn is the matrix element of the alignment tensor,
  • djc is the PCS constant for spin j and state c,
  • N is the total number of states or structures,
  • pc is the population probability or weight associated with state c (equally weighted to 1/N if weights are not provided),
  • mu_jc is the unit vector corresponding to spin j and state c,
  • dAi/dAmn is the partial derivative of the alignment tensor with respect to element Amn.
Parameters:
  • dj (numpy rank-1 array) - The PCS constants for each structure c for spin j. This should be an array with indices corresponding to c.
  • vect (numpy matrix) - The electron-nuclear unit vector matrix. The first dimension corresponds to the structural index, the second dimension is the coordinates of the unit vector. The vectors should be parallel to the vector connecting the paramagnetic centre to the nuclear spin.
  • N (int) - The total number of structures.
  • dAi_dAmn (numpy rank-2 3D tensor) - The alignment tensor derivative with respect to parameter Amn.
  • weights (numpy rank-1 array) - The weights for each member of the ensemble (the last member need not be supplied).
Returns: float
The average PCS gradient element.

pcs_tensor(dj, mu, A)

source code 

Calculate the PCS, using the 3D alignment tensor.

The PCS value is:

                               T
   delta_ij(theta)  = dj . mu_j . Ai . mu_j,

where:

  • i is the alignment tensor index,
  • j is the index over spins,
  • theta is the parameter vector,
  • dj is the PCS constant for spin j,
  • mu_j i the unit vector corresponding to spin j,
  • Ai is the alignment tensor.

The PCS constant is defined as:

        mu0 15kT   1
   dj = --- ----- ---- ,
        4pi Bo**2 r**3

where:

  • mu0 is the permeability of free space,
  • k is Boltzmann's constant,
  • T is the absolute temperature,
  • Bo is the magnetic field strength,
  • r is the distance between the paramagnetic centre (electron spin) and the nuclear spin.
Parameters:
  • dj (float) - The PCS constant for spin j.
  • mu (numpy rank-1 3D array) - The unit vector connecting the electron and nuclear spins.
  • A (numpy rank-2 3D tensor) - The alignment tensor.
Returns: float
The PCS value.