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

Module alignment_tensor

source code

Module for the manipulation of alignment tensors.

Functions [hide private]
numpy array or float
calc_chi_tensor(A, B0, T)
Convert the alignment tensor into the magnetic susceptibility (chi) tensor.
source code
 
dAi_dAxx(A)
The dAi/dAxx gradient.
source code
 
dAi_dAyy(A)
The dAi/dAyy gradient.
source code
 
dAi_dAxy(A)
The dAi/dAxy gradient.
source code
 
dAi_dAxz(A)
The dAi/dAxz gradient.
source code
 
dAi_dAyz(A)
The dAi/dAyz gradient.
source code
float
kappa(nuc1='15N', nuc2='1H')
Function for calculating the kappa constant.
source code
 
maxA(tensor)
Find the maximal alignment - the Azz component in the alignment frame.
source code
 
to_5D(vector_5D, tensor)
Convert the rank-2 3D alignment tensor matrix to the 5D vector format.
source code
 
to_tensor(tensor, vector_5D)
Convert the 5D vector alignment tensor form to the rank-2 3D matrix from.
source code
Variables [hide private]
  __package__ = 'lib.alignment'

Imports: pi, eigvals, periodic_table, h_bar, kB, mu0


Function Details [hide private]

calc_chi_tensor(A, B0, T)

source code 

Convert the alignment tensor into the magnetic susceptibility (chi) tensor.

A can be either the full tensor (3D or 5D), a component Aij of the tensor, Aa, or Ar, anything that can be multiplied by the constants to convert from one to the other.

Parameters:
  • A (numpy array or float) - The alignment tensor or alignment tensor component.
  • B0 (float) - The magnetic field strength in Hz.
  • T (float) - The temperature in Kalvin.
Returns: numpy array or float
A multiplied by the PCS constant.

dAi_dAxx(A)

source code 

The dAi/dAxx gradient.

This function will modify the A matrix to be equal to:

 dAi   | 1  0  0 |
---- = | 0  0  0 |
dAxx   | 0  0 -1 |
Parameters:
  • A (numpy rank-2 3D tensor) - The alignment tensor object.

dAi_dAyy(A)

source code 

The dAi/dAyy gradient.

This function will modify the A matrix to be equal to:

 dAi   | 0  0  0 |
---- = | 0  1  0 |
dAyy   | 0  0 -1 |
Parameters:
  • A (numpy rank-2 3D tensor) - The alignment tensor object.

dAi_dAxy(A)

source code 

The dAi/dAxy gradient.

This function will modify the A matrix to be equal to:

 dAi   | 0  1  0 |
---- = | 1  0  0 |
dAxy   | 0  0  0 |
Parameters:
  • A (numpy rank-2 3D tensor) - The alignment tensor object.

dAi_dAxz(A)

source code 

The dAi/dAxz gradient.

This function will modify the A matrix to be equal to:

 dAi   | 0  0  1 |
---- = | 0  0  0 |
dAxz   | 1  0  0 |
Parameters:
  • A (numpy rank-2 3D tensor) - The alignment tensor object.

dAi_dAyz(A)

source code 

The dAi/dAyz gradient.

This function will modify the A matrix to be equal to:

 dAi   | 0  0  0 |
---- = | 0  0  1 |
dAyz   | 0  1  0 |
Parameters:
  • A (numpy rank-2 3D tensor) - The alignment tensor object.

kappa(nuc1='15N', nuc2='1H')

source code 

Function for calculating the kappa constant.

The kappa constant is:

   kappa = -3/(8pi^2).gI.gS.mu0.h_bar,

where gI and gS are the gyromagnetic ratios of the I and S spins, mu0 is the permeability of free space, and h_bar is Planck's constant divided by 2pi.

Parameters:
  • nuc1 (str) - The first nucleus type.
  • nuc2 (str) - The first nucleus type.
Returns: float
The kappa constant value.

maxA(tensor)

source code 

Find the maximal alignment - the Azz component in the alignment frame.

Parameters:
  • tensor (numpy rank-2 3D tensor) - The alignment tensor object.
Returns:
The Azz component in the alignment frame.

to_5D(vector_5D, tensor)

source code 

Convert the rank-2 3D alignment tensor matrix to the 5D vector format.

Parameters:
  • vector_5D (numpy 5D vector) - The 5D vector object to populate. The vector format is {Axx, Ayy, Axy, Axz, Ayz}.
  • tensor (numpy rank-2 3D tensor) - The alignment tensor object.

to_tensor(tensor, vector_5D)

source code 

Convert the 5D vector alignment tensor form to the rank-2 3D matrix from.

Parameters:
  • tensor (numpy rank-2 3D tensor) - The alignment tensor object, in matrix format, to populate.
  • vector_5D (numpy 5D vector) - The 5D vector object. The vector format is {Axx, Ayy, Axy, Axz, Ayz}.