Difference between revisions of "Hfc display.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(Update function See also links and function index membership)
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Ellipsoid plots of hyperfine coupling tensors and their eigensystems.
+
{{DISPLAYTITLE:hfc_display.m}} __NOTOC__
 +
Draws hyperfine tensors and their eigensystems. Two styles are implemented:
  
==Syntax==
+
;A. Ellipsoids (symmetric tensors only):
  
    hfc_display(props,atoms,scaling_factor,conmatrix)
+
:1. A unit sphere in a Cartesian space is scaled by abs(Axx) in the x direction, abs(Ayy) in the y direction and abs(Azz) in the z direction, where Axx, Ayy, Azz are the eigenvalues of the HFC tensor in units of milliTesla.
  
==Description==
+
:2. A set of axes is drawn inside the sphere with a red axis for a positive eigenvalue, and a blue axis for a negative one.
  
This function takes the information loaded from quantum chemistry packages by the various parser functions ([[gparse.m|gparse]], [[oparse.m|oparse]], etc.) and uses it to create ellipsoid plots of hyperfine coupling tensors. Every ellipsoid is drawn in the following way:
+
:3. The sphere is translated to the point of corresponding nucleus and rotated into the molecular frame of reference.
  
# A unit sphere in a Cartesian space is scaled by abs(Axx) in the x direction, abs(Ayy) in the y direction and abs(Azz) in the z direction, where Axx, Ayy, Azz are the eigenvalues of the hyperfine coupling tensor in units of mT.
+
;B. Spherical harmonics (default):
# A set of axes is drawn inside the sphere with red axis for positive eigenvalues and blue for negative ones.
 
# The sphere is translated to the point of corresponding atom and rotated into the molecular frame.
 
  
==Arguments==
+
:1. The matrix is converted into irreducible spherical tensor operator coefficients.
  
                    props -  output of the quantum chemistry package output parser function
+
:2. The coefficients are placed in front of the corresponding spherical harmonics, which are plotted in three dimensions and translated to the point of the corresponding nucleus.
  
                    atoms -  a cell array of element symbols, indicating the atoms for which
+
==Syntax==
                            the hyperfine coupling tensors should be visualized, e.g. {'C','H'}
 
 
 
          scaling_factor -  scaling factor, connecting the mT scale to the length units in
 
                            Angstrom that are used in the molecule plot, usually of the order of 0.01
 
  
                conmatrix -  optional binary connectivity matrix, with 1 if a pair of atoms should be
+
    hfc_display(props,atoms,scaling,conmatrix,options)
                            connected by a bond in the resulting plot and zero otherwise. If you are
 
                            happy with the default bond drawing threshold of 1.6 Angstrom, specify an
 
                            empty matrix here.
 
  
==Returns==
+
==Parameters==
  
The function creates a figure.
+
              props - output of [[gparse.m]] function
 +
 +
              atoms - a cell array of element symbols,
 +
                      indicating the atoms for which
 +
                      the hyperfine tensors should be
 +
                      visualised, e.g. {'C','H'}
 +
 +
            scaling - a factor to scale the tensors
 +
                      by for visualisation
 +
 +
          conmatrix - binary connectivity matrix, 1
 +
                      if a pair of atoms should be
 +
                      connected by a bond. If an em-
 +
                      pty vector is supplied, 1.6
 +
                      Angstrom cutoff distance is used
 +
 +
      options.style - 'ellipsoids' or 'harmonics'
 +
 +
    options.kill_iso - set to true() to eliminate the
 +
                      isotropic parts of tensors be-
 +
                      fore plotting
  
 
==Examples==
 
==Examples==
 
+
The following figure is produced by /examples/visualisation/hfc_pyrene.m - (left) ellipsoid plot; (right) spherical harmonic plot.
The following figure is produced by /examples/visualisation/hfc_pyrene.m
 
  
 
[[File:hfc_pyrene.png]]
 
[[File:hfc_pyrene.png]]
  
 
==Notes==
 
==Notes==
 +
Only Gaussian quantum chemistry package is supported at the moment - send an email to [[Ilya Kuprov]] if you are using something else.
  
# Software OpenGL is forced internally because hardware OpenGL works badly with transparency in Matlab.
+
==See also==
# Antisymmetric components of the hyperfine coupling tensors are ignored.
+
[[cst_display.m]], [[volplot.m]], [[molplot.m]], [[conmat.m]], [[gparse.m]], [[efg_display.m]], [[Import,_export,_and_visualisation]]
# Only Gaussian quantum chemistry package is supported at the moment - send an email to [[Ilya Kuprov]] if you are using somethng else.
 
 
 
 
 
''Revision 3284, authors: [[Ilya Kuprov]]''
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Draws hyperfine tensors and their eigensystems. Takes the props
 
structure from the output of [[gparse.m|gparse]] function. Every ellipsoid is drawn in the following way:
 
 
 
1. A unit sphere in a Cartesian space is scaled by abs(Axx) in
 
the x direction, abs(Ayy) in the y direction and abs(Azz) in
 
the z direction, where Axx, Ayy, Azz are the eigenvalues of
 
the HFC tensor in units of milliTesla.
 
 
 
2. A set of axes is drawn inside the sphere with red axis for
 
positive eigenvalues and blue for negative ones.
 
 
 
3. The sphere is translated to the point of corresponding atom
 
and rotated into the molecular frame.
 
 
 
Arguments:
 
 
 
                    props -  output of gparse function
 
 
 
                    atoms -  a cell array of element symbols,
 
                            indicating the atoms for which
 
                            the hyperfine tensors should be
 
                            visualized
 
 
 
          scaling_factor -  a factor to scale the tensors
 
                            by for visualization
 
 
 
                conmatrix -  binary connectivity matrix, 1
 
                            if a pair of atoms should be
 
                            connected by a bond
 
  
Note: software OpenGL is set as default, switch to hardware on
+
''Version 2.6, authors: [[Ilya Kuprov]]''
systems with good hardware graphics.
 

Latest revision as of 19:37, 6 June 2026

Draws hyperfine tensors and their eigensystems. Two styles are implemented:

A. Ellipsoids (symmetric tensors only)
1. A unit sphere in a Cartesian space is scaled by abs(Axx) in the x direction, abs(Ayy) in the y direction and abs(Azz) in the z direction, where Axx, Ayy, Azz are the eigenvalues of the HFC tensor in units of milliTesla.
2. A set of axes is drawn inside the sphere with a red axis for a positive eigenvalue, and a blue axis for a negative one.
3. The sphere is translated to the point of corresponding nucleus and rotated into the molecular frame of reference.
B. Spherical harmonics (default)
1. The matrix is converted into irreducible spherical tensor operator coefficients.
2. The coefficients are placed in front of the corresponding spherical harmonics, which are plotted in three dimensions and translated to the point of the corresponding nucleus.

Syntax

    hfc_display(props,atoms,scaling,conmatrix,options)

Parameters

              props - output of gparse.m function

              atoms - a cell array of element symbols,
                      indicating the atoms for which
                      the hyperfine tensors should be
                      visualised, e.g. {'C','H'}

            scaling - a factor to scale the tensors
                      by for visualisation

          conmatrix - binary connectivity matrix, 1
                      if a pair of atoms should be
                      connected by a bond. If an em-
                      pty vector is supplied, 1.6 
                      Angstrom cutoff distance is used

      options.style - 'ellipsoids' or 'harmonics'

   options.kill_iso - set to true() to eliminate the
                      isotropic parts of tensors be-
                      fore plotting

Examples

The following figure is produced by /examples/visualisation/hfc_pyrene.m - (left) ellipsoid plot; (right) spherical harmonic plot.

Hfc pyrene.png

Notes

Only Gaussian quantum chemistry package is supported at the moment - send an email to Ilya Kuprov if you are using something else.

See also

cst_display.m, volplot.m, molplot.m, conmat.m, gparse.m, efg_display.m, Import,_export,_and_visualisation

Version 2.6, authors: Ilya Kuprov