NMRCalculation
Date: 2019-10-22

org.jmol.quantum

## Class NMRCalculation

- java.lang.Object
- - org.jmol.quantum.NMRCalculation

- All Implemented Interfaces:
    JmolNMRInterface

      public class NMRCalculation
      extends java.lang.Object
      implements JmolNMRInterface

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static double` | `DIPOLAR_FACTOR`
    `private static double` | `e_charge`
    `private static double` | `h_bar_planck`
    `private static double` | `h_planck`
    `private java.util.Map<java.lang.String,double[]>` | `isotopeData` isotopeData keyed by nnnSym, for example: 1H, 19F, etc.; and also by element name itself: H, F, etc., for default
    `private static double` | `J_FACTOR`
    `private static int` | `MAGNETOGYRIC_RATIO`
    `private static double` | `Q_FACTOR`
    `private static int` | `QUADRUPOLE_MOMENT`
    `private static java.lang.String` | `resource` NOTE! Do not change this txt file! Instead, edit trunk/Jmol/_documents/nmr_data.xls and then clip its contents to org/jmol/quantum/nmr_data.txt.
    `private java.util.Map<java.lang.String,java.lang.Float>` | `shiftRefsPPM`
    `private Viewer` | `vwr`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NMRCalculation()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private javajs.util.BS` | `getAtomSiteBS(javajs.util.BS bsA)` Interaction tensors are not repeated for every possible combination.
    `float` | `getChemicalShift(Atom atom)` If shift reference has not been set, it defaults to 0 and just displays the negative of magnetic shielding
    `private void` | `getData()` Creates the data set necessary for doing NMR calculations.
    `float` | `getDipolarConstantHz(Atom a1, Atom a2)`
    `float` | `getDipolarCouplingHz(Atom a1, Atom a2, javajs.util.V3 vField)`
    `java.lang.Object` | `getInfo(java.lang.String what)`
    `private javajs.util.Lst<Tensor>` | `getInteractionTensorList(java.lang.String type, javajs.util.BS bsA)` Returns a list of tensors that are of the specified type and have both atomIndex1 and atomIndex2 in bsA.
    `private java.lang.String` | `getISCtype(Atom a1, java.lang.String type)`
    `float` | `getIsoOrAnisoHz(boolean isIso, Atom a1, Atom a2, java.lang.String type, Tensor isc)` If t is null, then a1, a2, and type are used to find the appropriate tensor.
    `private double` | `getIsotopeData(Atom a, int iType)` Get magnetogyricRatio (gamma/10^7 rad s^-1 T^-1) and quadrupoleMoment (Q/10^-2 fm^2) for a given isotope or for the default isotope of an element.
    `float` | `getJCouplingHz(Atom a1, Atom a2, java.lang.String type, Tensor isc)`
    `float` | `getMagneticShielding(Atom atom)`
    `java.util.Map<java.lang.String,java.lang.Integer>` | `getMinDistances(MeasurementData md)`
    `float` | `getQuadrupolarConstant(Tensor efg)` Quadrupolar constant, directly proportional to Vzz and dependent on the quadrupolar moment of the isotope considered
    `boolean` | `getState(javajs.util.SB sb)`
    `javajs.util.Lst<java.lang.Object>` | `getTensorInfo(java.lang.String tensorType, java.lang.String infoType, javajs.util.BS bs)`
    `javajs.util.BS` | `getUniqueTensorSet(javajs.util.BS bsAtoms)` An attempt to find unique atoms using tensors.
    `boolean` | `setChemicalShiftReference(java.lang.String element, float value)`
    `JmolNMRInterface` | `setViewer(Viewer vwr)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### MAGNETOGYRIC_RATIO

          private static final int MAGNETOGYRIC_RATIO

      See Also:
        Constant Field Values

    - #### QUADRUPOLE_MOMENT

          private static final int QUADRUPOLE_MOMENT

      See Also:
        Constant Field Values

    - #### e_charge

          private static final double e_charge

      See Also:
        Constant Field Values

    - #### h_planck

          private static final double h_planck

      See Also:
        Constant Field Values

    - #### h_bar_planck

          private static final double h_bar_planck

      See Also:
        Constant Field Values

    - #### DIPOLAR_FACTOR

          private static final double DIPOLAR_FACTOR

      See Also:
        Constant Field Values

    - #### J_FACTOR

          private static final double J_FACTOR

      See Also:
        Constant Field Values

    - #### Q_FACTOR

          private static final double Q_FACTOR

      See Also:
        Constant Field Values

    - #### vwr

          private Viewer vwr

    - #### isotopeData

          private java.util.Map<java.lang.String,double[]> isotopeData

      isotopeData keyed by nnnSym, for example: 1H, 19F, etc.; and also by element name itself: H, F, etc., for default

    - #### resource

          private static final java.lang.String resource

      NOTE! Do not change this txt file! Instead, edit trunk/Jmol/_documents/nmr_data.xls and then clip its contents to org/jmol/quantum/nmr_data.txt.
      See Also:
        Constant Field Values

    - #### shiftRefsPPM

          private java.util.Map<java.lang.String,java.lang.Float> shiftRefsPPM

  - ### Constructor Detail

    - #### NMRCalculation

          public NMRCalculation()

  - ### Method Detail

    - #### setViewer

          public JmolNMRInterface setViewer(Viewer vwr)

      Specified by:
        `setViewer` in interface `JmolNMRInterface`

    - #### getQuadrupolarConstant

          public float getQuadrupolarConstant(Tensor efg)

      Description copied from interface: `JmolNMRInterface`
      Quadrupolar constant, directly proportional to Vzz and dependent on the quadrupolar moment of the isotope considered
      Specified by:
        `getQuadrupolarConstant` in interface `JmolNMRInterface`
      Returns:
        float value

    - #### getInteractionTensorList

          private javajs.util.Lst<Tensor> getInteractionTensorList(java.lang.String type,
                                                                   javajs.util.BS bsA)

      Returns a list of tensors that are of the specified type and have both atomIndex1 and atomIndex2 in bsA. If there is just one atom specified, then the list is "all tensors involving this atom". We have to use atom sites, because interaction tensors are not duplicated.
      Parameters:
        `type` -
        `bsA` -
      Returns:
        list of Tensors

    - #### getAtomSiteBS

          private javajs.util.BS getAtomSiteBS(javajs.util.BS bsA)

      Interaction tensors are not repeated for every possible combination. They are just for the base atom set. These are identified as a.atomIndex == models[b.modelIndex].firstAtomIndex + b.atomSite - 1
      Parameters:
        `bsA` -
      Returns:
        new bs in terms of atom sites

    - #### getUniqueTensorSet

          public javajs.util.BS getUniqueTensorSet(javajs.util.BS bsAtoms)

      Description copied from interface: `JmolNMRInterface`
      An attempt to find unique atoms using tensors.
      Specified by:
        `getUniqueTensorSet` in interface `JmolNMRInterface`
      Returns:
        bitset of atoms

    - #### getJCouplingHz

          public float getJCouplingHz(Atom a1,
                                      Atom a2,
                                      java.lang.String type,
                                      Tensor isc)

    - #### getIsoOrAnisoHz

          public float getIsoOrAnisoHz(boolean isIso,
                                       Atom a1,
                                       Atom a2,
                                       java.lang.String type,
                                       Tensor isc)

      Description copied from interface: `JmolNMRInterface`
      If t is null, then a1, a2, and type are used to find the appropriate tensor.
      Specified by:
        `getIsoOrAnisoHz` in interface `JmolNMRInterface`
      Returns:
        0 if not found

    - #### getISCtype

          private java.lang.String getISCtype(Atom a1,
                                              java.lang.String type)

    - #### getDipolarConstantHz

          public float getDipolarConstantHz(Atom a1,
                                            Atom a2)

      Specified by:
        `getDipolarConstantHz` in interface `JmolNMRInterface`
      Returns:
        desired constant

    - #### getDipolarCouplingHz

          public float getDipolarCouplingHz(Atom a1,
                                            Atom a2,
                                            javajs.util.V3 vField)

      Specified by:
        `getDipolarCouplingHz` in interface `JmolNMRInterface`
      Returns:
        projected value

    - #### getIsotopeData

          private double getIsotopeData(Atom a,
                                        int iType)

      Get magnetogyricRatio (gamma/10^7 rad s^-1 T^-1) and quadrupoleMoment (Q/10^-2 fm^2) for a given isotope or for the default isotope of an element.
      Parameters:
        `a` -
        `iType` -
      Returns:
        g or Q

    - #### getData

          private void getData()

      Creates the data set necessary for doing NMR calculations. Values are retrievable using getProperty "nmrInfo" "Xx"; each entry is float[+/-isotopeNumber, g, Q], where [0] < 0 for the default value.

    - #### getInfo

          public java.lang.Object getInfo(java.lang.String what)

      Specified by:
        `getInfo` in interface `JmolNMRInterface`
      Parameters:
        `what` - "C" or "14C" or "all"
      Returns:
        list of double[isotopeNumber,g,Q] if no isotope number is given, or a single double[] if it does.

    - #### getChemicalShift

          public float getChemicalShift(Atom atom)

      Description copied from interface: `JmolNMRInterface`
      If shift reference has not been set, it defaults to 0 and just displays the negative of magnetic shielding
      Specified by:
        `getChemicalShift` in interface `JmolNMRInterface`
      Returns:
        value

    - #### getMagneticShielding

          public float getMagneticShielding(Atom atom)

      Specified by:
        `getMagneticShielding` in interface `JmolNMRInterface`

    - #### getState

          public boolean getState(javajs.util.SB sb)

      Specified by:
        `getState` in interface `JmolNMRInterface`

    - #### setChemicalShiftReference

          public boolean setChemicalShiftReference(java.lang.String element,
                                                   float value)

      Specified by:
        `setChemicalShiftReference` in interface `JmolNMRInterface`

    - #### getTensorInfo

          public javajs.util.Lst<java.lang.Object> getTensorInfo(java.lang.String tensorType,
                                                                 java.lang.String infoType,
                                                                 javajs.util.BS bs)

      Specified by:
        `getTensorInfo` in interface `JmolNMRInterface`

    - #### getMinDistances

          public java.util.Map<java.lang.String,java.lang.Integer> getMinDistances(MeasurementData md)

      Specified by:
        `getMinDistances` in interface `JmolNMRInterface`