Package lib :: Package alignment :: Module rdc
[hide private]
[frames] | no frames]

Module rdc

source code

Module for the calculation of RDCs.

Functions [hide private]
float
ave_rdc_5D(dj, vect, N, A, weights=None)
Calculate the ensemble average RDC, using the 5D tensor.
source code
float
ave_rdc_tensor(dj, vect, N, A, weights=None)
Calculate the ensemble average RDC, using the 3D tensor.
source code
float
ave_rdc_tensor_dDij_dAmn(dj, vect, N, dAi_dAmn, weights=None)
Calculate the ensemble average RDC gradient element for Amn, using the 3D tensor.
source code
float
ave_rdc_tensor_pseudoatom(dj, vect, N, A, weights=None)
Calculate the ensemble and pseudo-atom averaged RDC, using the 3D tensor.
source code
float
ave_rdc_tensor_pseudoatom_dDij_dAmn(dj, vect, N, dAi_dAmn, weights=None)
Calculate the ensemble and pseudo-atom average RDC gradient element for Amn, using the 3D tensor.
source code
float
rdc_tensor(dj, mu, A)
Calculate the RDC, using the 3D alignment tensor.
source code
Variables [hide private]
  __package__ = 'lib.alignment'

Imports: dot, sum


Function Details [hide private]

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

source code 

Calculate the ensemble average RDC, using the 5D tensor.

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

                _N_
                \ 
   Dij(theta) =  >  pc . RDC_ijc (theta),
                /__
                c=1

where:

  • i is the alignment tensor index,
  • j is the index over spins,
  • theta is the parameter vector consisting of the alignment tensor parameters {Axx, Ayy, Axy, Axz, Ayz} for each alignment,
  • c is the index over the states or multiple structures,
  • N is the total number of states or structures,
  • pc is the population probability or weight associated with state c (equally weighted to
  • RDC_ijc is the back-calculated RDC value for alignment tensor i, spin system j and structure c.

The back-calculated RDC is given by the formula:

   RDC_ijc(theta) = (x_jc**2 - z_jc**2)Axx_i + (y_jc**2 - z_jc**2)Ayy_i + 2x_jc.y_jc.Axy_i + 2x_jc.z_jc.Axz_i + 2y_jc.z_jc.Ayz_i.
Parameters:
  • dj (float) - The dipolar constant for spin j.
  • vect (numpy matrix) - The unit XH bond vector matrix. The first dimension corresponds to the structural index, the second dimension is the coordinates of the unit vector.
  • N (int) - The total number of structures.
  • A (numpy 5D vector) - The 5D vector object. The vector format is {Axx, Ayy, Axy, Axz, Ayz}.
  • weights (numpy rank-1 array) - The weights for each member of the ensemble (the last member need not be supplied).
Returns: float
The average RDC value.

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

source code 

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

This function calculates the average RDC 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 RDC value is:

                    _N_
                    \             T
   Dij(theta)  = dj  >  pc . 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,
  • theta is the parameter vector,
  • dj is the dipolar constant for spin j,
  • 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,
  • Ai is the alignment tensor.

The dipolar constant is defined as:

   dj = 3 / (2pi) d',

where the factor of 2pi is to convert from units of rad.s^-1 to Hertz, the factor of 3 is associated with the alignment tensor and the pure dipolar constant in SI units is:

          mu0 gI.gS.h_bar
   d' = - --- ----------- ,
          4pi    r**3

where:

  • mu0 is the permeability of free space,
  • gI and gS are the gyromagnetic ratios of the I and S spins,
  • h_bar is Dirac's constant which is equal to Planck's constant divided by 2pi,
  • r is the distance between the two spins.
Parameters:
  • dj (float) - The dipolar constant for spin j.
  • vect (numpy matrix) - The unit XH bond vector matrix. The first dimension corresponds to the structural index, the second dimension is the coordinates of the unit vector.
  • N (int) - The total number of structures.
  • A (numpy rank-2 3D tensor) - The alignment tensor.
  • weights (numpy rank-1 array or None) - The weights for each member of the ensemble (the last member need not be supplied).
Returns: float
The average RDC value.

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

source code 

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

This function calculates the average RDC gradient 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 RDC gradient element is:

                     _N_
   dDij(theta)       \             T   dAi
   -----------  = dj  >  pc . 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,
  • dj is the dipolar constant for spin j,
  • 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 (float) - The dipolar constant for spin j.
  • vect (numpy matrix) - The unit XH bond vector matrix. The first dimension corresponds to the structural index, the second dimension is the coordinates of the unit vector.
  • 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 RDC gradient element.

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

source code 

Calculate the ensemble and pseudo-atom averaged RDC, using the 3D tensor.

This function calculates the average RDC for a set of XH bond vectors from a structural ensemble, using the 3D tensorial form of the alignment tensor. The RDC for each pseudo-atom is calculated and then averaged. The formula for this ensemble and pseudo-atom average RDC value is:

                    _N_        _M_
                    \        1 \         T
   Dij(theta)  = dj  >  pc . -  >  mu_jcd . Ai . mu_jcd,
                    /__      M /__
                    c=1        d=1

where:

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

The dipolar constant is defined as:

   dj = 3 / (2pi) d',

where the factor of 2pi is to convert from units of rad.s^-1 to Hertz, the factor of 3 is associated with the alignment tensor and the pure dipolar constant in SI units is:

          mu0 gI.gS.h_bar
   d' = - --- ----------- ,
          4pi    r**3

where:

  • mu0 is the permeability of free space,
  • gI and gS are the gyromagnetic ratios of the I and S spins,
  • h_bar is Dirac's constant which is equal to Planck's constant divided by 2pi,
  • r is the distance between the two spins.
Parameters:
  • dj (list of float) - The dipolar constant for spin j.
  • vect (numpy matrix) - The unit vector matrix. The first dimension corresponds to the structural index, the second dimension to the pseudo-atom index, and the third dimension is the coordinates of the unit vector.
  • N (int) - The total number of structures.
  • A (numpy rank-2 3D tensor) - The alignment tensor.
  • weights (numpy rank-1 array or None) - The weights for each member of the ensemble (the last member need not be supplied).
Returns: float
The average RDC value.

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

source code 

Calculate the ensemble and pseudo-atom average RDC gradient element for Amn, using the 3D tensor.

This function calculates the average RDC gradient 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 RDC gradient element is:

                     _N_        _M_
   dDij(theta)       \        1 \         T   dAi
   -----------  = dj  >  pc . -  >  mu_jcd . ---- . mu_jcd,
      dAmn           /__      M /__          dAmn
                     c=1        d=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,
  • d is the index over the pseudo-atoms,
  • theta is the parameter vector,
  • Amn is the matrix element of the alignment tensor,
  • dj is the dipolar constant for spin j,
  • N is the total number of states or structures,
  • M is the total number of pseudo-atoms,
  • 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 (float) - The dipolar constant for spin j.
  • vect (numpy matrix) - The unit XH bond vector matrix. The first dimension corresponds to the structural index, the second dimension is the coordinates of the unit vector.
  • 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 RDC gradient element.

rdc_tensor(dj, mu, A)

source code 

Calculate the RDC, using the 3D alignment tensor.

The RDC value is:

                          T
   Dij(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 dipolar constant for spin j,
  • mu_j i the unit vector corresponding to spin j,
  • Ai is the alignment tensor.

The dipolar constant is defined as:

   dj = 3 / (2pi) d',

where the factor of 2pi is to convert from units of rad.s^-1 to Hertz, the factor of 3 is associated with the alignment tensor and the pure dipolar constant in SI units is:

          mu0 gI.gS.h_bar
   d' = - --- ----------- ,
          4pi    r**3

where:

  • mu0 is the permeability of free space,
  • gI and gS are the gyromagnetic ratios of the I and S spins,
  • h_bar is Dirac's constant which is equal to Planck's constant divided by 2pi,
  • r is the distance between the two spins.
Parameters:
  • dj (float) - The dipolar constant for spin j.
  • mu (numpy rank-1 3D array) - The unit XH bond vector.
  • A (numpy rank-2 3D tensor) - The alignment tensor.
Returns: float
The RDC value.