QchemReader
Date: 2019-10-22

org.jmol.adapter.readers.quantum

## Class QchemReader

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

- All Implemented Interfaces:
    javajs.api.GenericLineReader

      public class QchemReader
      extends MOReader

  A reader for Q-Chem 2.1 and 3.2 Q-Chem is a quantum chemistry program developed by Q-Chem, Inc. (http://www.q-chem.com/)

  Molecular coordinates, normal coordinates of vibrations and MOs are read.

  In order to get the output required for MO reading make sure that the $rem block has

  `print_general_basis TRUE
  print_orbitals TRUE`

  This reader was developed from only a few output files, and therefore, is not guaranteed to properly read all Q-chem output. If you have problems, please contact the author of this code, not the developers of Q-chem.

  This is a hacked version of Miguel's GaussianReader

  Version:
    1.1, 1.0
  Author:
    Rene P.F Kanters (rkanters@richmond.edu), Steven E. Wheeler (swheele2@ccqc.uga.edu)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected class` | `QchemReader.MOInfo`

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

      `BasisFunctionReader.MOEnergySorter`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private QchemReader.MOInfo[]` | `alphas`
    `private QchemReader.MOInfo[]` | `betas`
    `private int` | `calculationNumber` The number of the job being interpreted.
    `private static java.lang.String` | `DC_LIST`
    `private boolean` | `dFixed`
    `(package private) java.lang.String` | `dList`
    `private static java.lang.String` | `DS_LIST`
    `(package private) boolean` | `dSpherical`
    `private static java.lang.String` | `FC_LIST`
    `private boolean` | `fFixed`
    `(package private) java.lang.String` | `fList`
    `private static java.lang.String` | `FS_LIST`
    `(package private) boolean` | `fSpherical`
    `private boolean` | `isFirstJob`
    `private int` | `nBasis`

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

      `allowNoOrbitals, energyUnits, gaussianCount, gaussians, haveNboCharges, haveNboOrbitals, HEADER_GAMESS_OCCUPANCIES, HEADER_GAMESS_ORIGINAL, HEADER_GAMESS_UK_MO, HEADER_NONE, moTypes, orbitalsRead, shellCount`

    - ### 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
    `QchemReader()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `checkLine()`
    `protected void` | `initializeReader()`
    `private void` | `readAtoms()`
    `private void` | `readBasis()`
    `private void` | `readCalculationType()`
    `private void` | `readEnergy()`
    `private void` | `readESym(boolean haveSym)`
    `private void` | `readFrequencies()` Interprets the Harmonic frequencies section.
    `private int` | `readMOs(boolean restricted, QchemReader.MOInfo[] moInfos)`
    `private void` | `readPartialCharges()`
    `private void` | `readQchemMolecularOrbitals()`

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

      `addCoef, addMOData, checkAndRemoveFilterKey, checkNboLine, getMOHeader, getNboTypes, readMolecularOrbitals, setMOData`

    - ### 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, 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, 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

    - #### calculationNumber

          private int calculationNumber

      The number of the job being interpreted.

    - #### isFirstJob

          private boolean isFirstJob

    - #### alphas

          private QchemReader.MOInfo[] alphas

    - #### betas

          private QchemReader.MOInfo[] betas

    - #### nBasis

          private int nBasis

    - #### dFixed

          private boolean dFixed

    - #### fFixed

          private boolean fFixed

    - #### DC_LIST

          private static java.lang.String DC_LIST

    - #### DS_LIST

          private static java.lang.String DS_LIST

    - #### FC_LIST

          private static java.lang.String FC_LIST

    - #### FS_LIST

          private static java.lang.String FS_LIST

    - #### dList

          java.lang.String dList

    - #### fList

          java.lang.String fList

    - #### dSpherical

          boolean dSpherical

    - #### fSpherical

          boolean fSpherical

  - ### Constructor Detail

    - #### QchemReader

          public QchemReader()

  - ### Method Detail

    - #### initializeReader

          protected void initializeReader()

      Overrides:
        `initializeReader` in class `MOReader`

    - #### checkLine

          protected boolean checkLine()
                               throws java.lang.Exception

      Overrides:
        `checkLine` in class `AtomSetCollectionReader`
      Returns:
        true if need to read new line
      Throws:
        `java.lang.Exception`

    - #### readCalculationType

          private void readCalculationType()

    - #### readAtoms

          private void readAtoms()
                          throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### readFrequencies

          private void readFrequencies()
                                throws java.lang.Exception,
                                       java.io.IOException

      Interprets the Harmonic frequencies section.

      The vectors are added to a clone of the last read AtomSet. Only the Frequencies, reduced masses, force constants and IR intensities are set as properties for each of the frequency type AtomSet generated.

      Throws:
        `java.lang.Exception` - If no frequences were encountered
        `java.io.IOException` - If an I/O error occurs

    - #### readPartialCharges

          private void readPartialCharges()
                                   throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### readEnergy

          private void readEnergy()

    - #### readBasis

          private void readBasis()
                          throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### readESym

          private void readESym(boolean haveSym)
                         throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### readQchemMolecularOrbitals

          private void readQchemMolecularOrbitals()
                                           throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### readMOs

          private int readMOs(boolean restricted,
                              QchemReader.MOInfo[] moInfos)
                       throws java.lang.Exception

      Throws:
        `java.lang.Exception`