SlaterReader
Date: 2019-10-22

org.jmol.adapter.readers.quantum

## Class SlaterReader

- java.lang.Object
- - org.jmol.adapter.smarter.AtomSetCollectionReader
  - - org.jmol.adapter.readers.quantum.BasisFunctionReader
    - - org.jmol.adapter.readers.quantum.SlaterReader

- All Implemented Interfaces:
    javajs.api.GenericLineReader
  Direct Known Subclasses:
    AdfReader, DgridReader, MopacSlaterReader

      abstract class SlaterReader
      extends BasisFunctionReader

  Author:
    hansonr

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `(package private) class` | `SlaterReader.OrbitalSorter`
    `(package private) class` | `SlaterReader.SlaterSorter`

    - ### Nested classes/interfaces inherited from class org.jmol.adapter.readers.quantum.BasisFunctionReader

      `BasisFunctionReader.MOEnergySorter`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static double` | `_1_4pi`
    `private static double[]` | `dfact2`
    `private static double[]` | `fact1`
    `protected SlaterData[]` | `slaterArray`
    `protected javajs.util.Lst<SlaterData>` | `slaters`

    - ### Fields inherited from class org.jmol.adapter.readers.quantum.BasisFunctionReader

      `alphaBeta, dfCoefMaps, ignoreMOs, moData, nCoef, nOrbitals, orbitalMaps, orbitals, shells`

    - ### Fields inherited from class org.jmol.adapter.smarter.AtomSetCollectionReader

      `addedData, addedDataKey, addVibrations, allowPDBFilter, ANGSTROMS_PER_BOHR, applySymmetryToBonds, asc, baseAtomIndex, binaryDoc, bsFilter, bsModels, calculationType, continuing, debugging, desiredModelNumber, desiredSpaceGroupIndex, desiredVibrationNumber, doApplySymmetry, doCentralize, doCheckUnitCell, doConvertToFractional, doPackUnitCell, doProcessLines, doReadMolecularOrbitals, dssr, fileName, fileOffset, filePath, fileScaling, fillRange, filter, filterHetero, fixJavaFloat, forcePacked, getHeader, haveAtomFilter, haveModel, havePartialChargeFilter, htParams, ignoreFileSpaceGroupName, ignoreFileSymmetryOperators, ignoreFileUnitCell, ignoreStructure, iHaveFractionalCoordinates, iHaveSymmetryOperators, iHaveUnitCell, isBinary, isConcatenated, isDSSP1, isFinalized, isMolecular, isPrimitive, isSequential, isTrajectory, latticeCells, latticeScaling, latticeType, line, lstNCS, matUnitCellOrientation, modDim, modelNumber, ms, mustFinalizeModelSet, next, out, packingError, prevline, primitiveToCrystal, ptLine, ptSupercell, reader, readerName, requiresBSFilter, reverseModels, rotateHexCell, sgName, stateScriptVersionInt, strSupercell, symmetry, templateAtomCount, thisBiomolecule, trajectorySteps, unitCellOffset, unitCellParams, useAltNames, useFileModelNumbers, validation, vibrationNumber, vibsFractional, vwr`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SlaterReader()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addSlater(int iAtom, int a, int b, int c, int d, double zeta, float coef)` We build two data structures for each slater: int[] slaterInfo[] = {iatom, a, b, c, d} float[] slaterData[] = {zeta, coef} where psi = (coef)(x^a)(y^b)(z^c)(r^d)exp(-zeta*r) Mopac: a == -2 ==> z^2 ==> (coef)(2z^2-x^2-y^2)(r^d)exp(-zeta*r) and: b == -2 ==> (coef)(x^2-y^2)(r^d)exp(-zeta*r)
    `protected void` | `addSlater(SlaterData sd, int n)`
    `private static double` | `fact(double f, double zeta, int n)` Sincere thanks to Miroslav Kohout (DGRID) for helping me get this right -- Bob Hanson, 1/5/2010 slater scaling based on zeta, n, l, and x y z exponents.
    `protected static double` | `getSlaterConstCartesian(int n, double zeta, int el, int ex, int ey, int ez)` scales slater using double factorials involving quantum number n, l, and xyz exponents.
    `protected static double` | `getSlaterConstDSpherical(int n, double zeta, int ex, int ey)` spherical scaling factors specifically for x2-y2 and z2 orbitals see http://openmopac.net/Manual/real_spherical_harmonics.html dz2 sqrt((1/2p)(5/8))(2cos2(q) -sin2(q)) sqrt(5/16p)(3z2-r2)/r2 dxz sqrt((1/2p)(15/4))(cos(q)sin(q))cos(f) sqrt(15/4p)(xz)/r2 dyz sqrt((1/2p)(15/4))(cos(q)sin(q))sin(f) sqrt(15/4p)(yz)/r2 dx2-y2 sqrt((1/2p)(15/16))sin2(q)cos2(f) sqrt(15/16p)(x2-y2)/r2 dxy sqrt((1/2p)(15/16))sin2(q)sin2(f) sqrt(15/4p)(xy)/r2 The fact() method returns sqrt(15/4p) for both z2 and x2-y2.
    `protected double` | `scaleSlater(int ex, int ey, int ez, int er, double zeta)` Perform implementation-specific scaling.
    `protected void` | `setMOs(java.lang.String units)`
    `protected void` | `setSlaters(boolean doScale, boolean doSort)` after the vectors intinfo and floatinfo are completed, we
    `protected void` | `sortOrbitalCoefficients(int[] pointers)` sorts coefficients by atomic number for speed later
    `protected void` | `sortOrbitals()` sorts orbitals by energy rather than by symmetry so that we can use "MO HOMO" "MO HOMO - 1" "MO LUMO"

    - ### Methods inherited from class org.jmol.adapter.readers.quantum.BasisFunctionReader

      `canonicalizeQuantumSubshellTag, clearOrbitals, discardPreviousAtoms, enableShell, filterMO, fixSlaterTypes, getDfCoefMaps, getDFMap, getQuantumShellTag, getQuantumShellTagID, getQuantumShellTagIDSpherical, setMO`

    - ### Methods inherited from class org.jmol.adapter.smarter.AtomSetCollectionReader

      `addAtomXYZSymName, addExplicitLatticeVector, addJmolScript, addSites, addSiteScript, appendLoadNote, appendUunitCellInfo, applySymmetryAndSetTrajectory, applySymTrajASCR, checkCurrentLineForScript, checkFilterKey, checkLastModel, checkLine, checkLineForScript, clearUnitCell, cloneLastAtomSet, discardLinesUntilBlank, discardLinesUntilContains, discardLinesUntilContains2, discardLinesUntilNonBlank, discardLinesUntilStartsWith, doGetModel, doGetVibration, doPreSymmetry, fill3x3, fillDataBlock, fillDataBlockFixed, fillFloatArray, fillFrequencyData, filterAtom, filterReject, finalizeMOData, finalizeModelSet, finalizeReaderASCR, finalizeSubclassReader, finalizeSubclassSymmetry, forceSymmetry, fractionalizeCoordinates, getElementSymbol, getFilter, getFortranFormatLengths, getInterface, getNewSymmetry, getStrings, getSymmetry, getTokens, getTokensFloat, initializeReader, initializeSymmetry, initializeSymmetryOptions, initializeTrajectoryFile, isLastModel, newAtomSet, parseFloat, parseFloatRange, parseFloatStr, parseInt, parseIntAt, parseIntRange, parseIntStr, parseToken, parseTokenNext, parseTokenRange, parseTokenStr, processBinaryDocument, processDOM, rd, read3Vectors, readDataObject, readLines, readNextLine, rejectAtomName, RL, set2D, setAtomCoord, setAtomCoordScaled, setAtomCoordTokens, setAtomCoordXYZ, setChainID, setElementAndIsotope, setFilter, setFilterAtomTypeStr, setFractionalCoordinates, setIsPDB, setLoadNote, setModelPDB, setSpaceGroupName, setSymmetryOperator, setTransform, setUnitCell, setUnitCellItem, setup, setupASCR`

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

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

- - ### Field Detail

    - #### slaters

          protected final javajs.util.Lst<SlaterData> slaters

    - #### slaterArray

          protected SlaterData[] slaterArray

    - #### _1_4pi

          private static final double _1_4pi

      See Also:
        Constant Field Values

    - #### fact1

          private static final double[] fact1

    - #### dfact2

          private static final double[] dfact2

  - ### Constructor Detail

    - #### SlaterReader

          SlaterReader()

  - ### Method Detail

    - #### addSlater

          protected final void addSlater(int iAtom,
                                         int a,
                                         int b,
                                         int c,
                                         int d,
                                         double zeta,
                                         float coef)

      We build two data structures for each slater: int[] slaterInfo[] = {iatom, a, b, c, d} float[] slaterData[] = {zeta, coef} where psi = (coef)(x^a)(y^b)(z^c)(r^d)exp(-zeta*r) Mopac: a == -2 ==> z^2 ==> (coef)(2z^2-x^2-y^2)(r^d)exp(-zeta*r) and: b == -2 ==> (coef)(x^2-y^2)(r^d)exp(-zeta*r)
      Parameters:
        `iAtom` - now 1-based
        `a` -
        `b` -
        `c` -
        `d` -
        `zeta` -
        `coef` -

    - #### addSlater

          protected void addSlater(SlaterData sd,
                                   int n)

    - #### setSlaters

          protected final void setSlaters(boolean doScale,
                                          boolean doSort)

      after the vectors intinfo and floatinfo are completed, we
      Parameters:
        `doScale` -
        `doSort` - TODO

    - #### setMOs

          protected final void setMOs(java.lang.String units)

    - #### sortOrbitalCoefficients

          protected void sortOrbitalCoefficients(int[] pointers)

      sorts coefficients by atomic number for speed later
      Parameters:
        `pointers` -

    - #### sortOrbitals

          protected void sortOrbitals()

      sorts orbitals by energy rather than by symmetry so that we can use "MO HOMO" "MO HOMO - 1" "MO LUMO"

    - #### scaleSlater

          protected double scaleSlater(int ex,
                                       int ey,
                                       int ez,
                                       int er,
                                       double zeta)

      Perform implementation-specific scaling. This method is subclassed in MopacReader to handle spherical slaters
      Parameters:
        `ex` -
        `ey` -
        `ez` -
        `er` -
        `zeta` -
      Returns:
        scaling factor

    - #### fact

          private static double fact(double f,
                                     double zeta,
                                     int n)

      Sincere thanks to Miroslav Kohout (DGRID) for helping me get this right -- Bob Hanson, 1/5/2010 slater scaling based on zeta, n, l, and x y z exponents. sqrt[(2zeta)^(2n + 1) * (2 el + 1)!! / (2 ex - 1)!! / (2 ey - 1)!! / (2 ez - 1)!! / 4pi / (2n)! ] The double factorials are precalculated.
      Parameters:
        `f` -
        `zeta` -
        `n` -
      Returns:
        scaled exponent

    - #### getSlaterConstCartesian

          protected static final double getSlaterConstCartesian(int n,
                                                                double zeta,
                                                                int el,
                                                                int ex,
                                                                int ey,
                                                                int ez)

      scales slater using double factorials involving quantum number n, l, and xyz exponents. fact2[x] is (2x - 1)!! Since x!! = 1 for x = 1, 0 or -1, we can just ignore this part for s and p orbitals, where x, y, and z are all 0 or 1. 7!! = 105 5!! = 15 3!! = 3 Numerators/4pi: all d orbitals: fact2[3] = (2*2 + 1)!! = 5!! = 15/4pi all f orbitals: fact2[4] = (2*3 + 1)!! = 7!! = 105/4pi Denominators: dxy, dyz, dxz all are 1 giving 15/4pi dx2, dy2, and dz2 all have one "2", giving 15/3!!/4pi or 5/4pi
      Parameters:
        `n` -
        `zeta` -
        `el` -
        `ex` -
        `ey` -
        `ez` -
      Returns:
        scaled exponent

    - #### getSlaterConstDSpherical

          protected static final double getSlaterConstDSpherical(int n,
                                                                 double zeta,
                                                                 int ex,
                                                                 int ey)

      spherical scaling factors specifically for x2-y2 and z2 orbitals see http://openmopac.net/Manual/real_spherical_harmonics.html dz2 sqrt((1/2p)(5/8))(2cos2(q) -sin2(q)) sqrt(5/16p)(3z2-r2)/r2 dxz sqrt((1/2p)(15/4))(cos(q)sin(q))cos(f) sqrt(15/4p)(xz)/r2 dyz sqrt((1/2p)(15/4))(cos(q)sin(q))sin(f) sqrt(15/4p)(yz)/r2 dx2-y2 sqrt((1/2p)(15/16))sin2(q)cos2(f) sqrt(15/16p)(x2-y2)/r2 dxy sqrt((1/2p)(15/16))sin2(q)sin2(f) sqrt(15/4p)(xy)/r2 The fact() method returns sqrt(15/4p) for both z2 and x2-y2. So now we ned to correct that with sqrt(1/12) for z2 and sqrt(1/4) for x2-y2. http://openmopac.net/Manual/real_spherical_harmonics.html Apply the appropriate scaling factor for spherical D orbitals. ex will be -2 for z2; ey will be -2 for x2-y2
      Parameters:
        `n` -
        `zeta` -
        `ex` -
        `ey` -
      Returns:
        scaling factor