Program structure

Program structure

import veloxchem as vlx
* Warning * Setting MKL_THREADING_LAYER to "GNU".

The VeloxChem program adopts a layered Python/C++ language structure.

veloxchem-structure

You can use the standard functions to get a more detailed view of the Python layer. The help function will give you a package description, stating the copyright agreement.

help(vlx)
Help on package veloxchem:

NAME
    veloxchem

DESCRIPTION
    #                           VELOXCHEM 1.0-RC2
    #         ----------------------------------------------------
    #                     An Electronic Structure Code
    #
    #  Copyright © 2018-2021 by VeloxChem developers. All rights reserved.
    #  Contact: https://veloxchem.org/contact
    #
    #  SPDX-License-Identifier: LGPL-3.0-or-later
    #
    #  This file is part of VeloxChem.
    #
    #  VeloxChem is free software: you can redistribute it and/or modify it under
    #  the terms of the GNU Lesser General Public License as published by the Free
    #  Software Foundation, either version 3 of the License, or (at your option)
    #  any later version.
    #
    #  VeloxChem is distributed in the hope that it will be useful, but WITHOUT
    #  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    #  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
    #  License for more details.
    #
    #  You should have received a copy of the GNU Lesser General Public License
    #  along with VeloxChem. If not, see <https://www.gnu.org/licenses/>.

PACKAGE CONTENTS
    __main__
    aodensitymatrix
    aofockmatrix
    batchsize
    blockdavidson
    c2diis
    c6solver
    checkpoint
    cli
    cppsolver
    cubicgrid
    cubicresponsedriver
    denguess
    distributedarray
    environ
    errorhandler
    excitondriver
    firstorderprop
    forcefieldgenerator
    gradientdriver
    hessiandriver
    inputparser
    linearsolver
    loprop
    lreigensolver
    lrsolver
    main
    mklconf
    mointsdriver
    molecularbasis
    molecularorbitals
    molecule
    mp2driver
    mpitask
    nonlinearsolver
    numerovdriver
    openmmdriver
    openmmgradientdriver
    optimizationdriver
    optimizationengine
    orbitalviewer
    outputstream
    polembed
    profiler
    pulsedrsp
    qqscheme
    quadraticresponsedriver
    respchargesdriver
    rspabsorption
    rspc6
    rspcdspec
    rspcustomproperty
    rspdriver
    rsplinabscross
    rsppolarizability
    rspproperty
    rspshg
    rsptpa
    scfdriver
    scfgradientdriver
    scfhessiandriver
    scfrestdriver
    scfrestopendriver
    scfunrestdriver
    shgdriver
    signalhandler
    slurminfo
    subcommunicators
    tdaexcidriver
    tpadriver
    tpafulldriver
    tpareddriver
    trajectorydriver
    veloxchemlib
    visualizationdriver
    xtbdriver
    xtbgradientdriver
    xtbhessiandriver

FUNCTIONS
    ao_matrix_to_dalton(...) method of builtins.PyCapsule instance
        ao_matrix_to_dalton(matrix: CDenseMatrix, basis: veloxchem.veloxchemlib.MolecularBasis, molecule: veloxchem.veloxchemlib.Molecule) -> CDenseMatrix
        
        Transforms AO matrix from VeloxChem to Dalton format.
    
    ao_matrix_to_veloxchem(...) method of builtins.PyCapsule instance
        ao_matrix_to_veloxchem(matrix: CDenseMatrix, basis: veloxchem.veloxchemlib.MolecularBasis, molecule: veloxchem.veloxchemlib.Molecule) -> CDenseMatrix
        
        Transforms AO matrix from Dalton to VeloxChem format.
    
    available_functionals(...) method of builtins.PyCapsule instance
        available_functionals() -> List[str]
        
        Gets a list of available exchange-correlation functionals.
    
    bohr_in_angstroms(...) method of builtins.PyCapsule instance
        bohr_in_angstroms() -> float
        
        Gets Bohr value in Angstroms.
    
    dipole_in_debye(...) method of builtins.PyCapsule instance
        dipole_in_debye() -> float
        
        Gets convertion factor for dipole moment (a.u. -> Debye).
    
    extinction_coefficient_from_beta(...) method of builtins.PyCapsule instance
        extinction_coefficient_from_beta() -> float
        
        Gets factor needed for the calculation of the extinction coefficent from the electric-dipole magnetic-dipole polarizability beta.
    
    fine_structure_constant(...) method of builtins.PyCapsule instance
        fine_structure_constant() -> float
        
        Gets fine-structure constant.
    
    get_basis_function_indices_for_atom(...) method of builtins.PyCapsule instance
        get_basis_function_indices_for_atom(molecule: veloxchem.veloxchemlib.Molecule, basis: veloxchem.veloxchemlib.MolecularBasis, atomIdx: int) -> List[List[int]]
        
        Gets basis function indices for an atom.
    
    hartree_in_ev(...) method of builtins.PyCapsule instance
        hartree_in_ev() -> float
        
        Gets Hartree value in electronvolts.
    
    hartree_in_kcalpermol(...) method of builtins.PyCapsule instance
        hartree_in_kcalpermol() -> float
        
        Gets Hartree value in kcal/mol.
    
    hartree_in_wavenumbers(...) method of builtins.PyCapsule instance
        hartree_in_wavenumbers() -> float
        
        Gets Hartree value in reciprocal cm.
    
    mathconst_pi(...) method of builtins.PyCapsule instance
        mathconst_pi() -> float
        
        Gets value of PI constant.
    
    mpi_initialized(...) method of builtins.PyCapsule instance
        mpi_initialized() -> bool
        
        Check if MPI has been initialized.
    
    mpi_master(...) method of builtins.PyCapsule instance
        mpi_master() -> int
        
        Gets default rank of master MPI process.
    
    rotatory_strength_in_cgs(...) method of builtins.PyCapsule instance
        rotatory_strength_in_cgs() -> float
        
        Gets convertion factor for rotatory strength (a.u. -> 10^-40 cgs).

DATA
    __deployed__ = {'author': 'Roberto Di Remigio', 'build': '9', 'commit'...

VERSION
    1.0rc2

FILE
    /home/lixin/anaconda3/envs/echem/lib/python3.9/site-packages/veloxchem/__init__.py

Classes

The functionality of VeloxChem is built into the classes it implements. An overview of the available classes is provided with the dir function.

dir(vlx)
['AODensityMatrix',
 'AOFockMatrix',
 'Absorption',
 'AngularMomentumIntegralsDriver',
 'AtomBasis',
 'BasisFunction',
 'BlockDavidsonSolver',
 'C6',
 'C6Solver',
 'CircularDichroismSpectrum',
 'ComplexResponse',
 'CubicGrid',
 'CubicResponseDriver',
 'CustomProperty',
 'DenseMatrix',
 'DensityGridDriver',
 'DispersionModel',
 'ElectricDipoleIntegralsDriver',
 'ElectronRepulsionIntegralsDriver',
 'ExcitationVector',
 'ExcitonModelDriver',
 'FirstOrderProperties',
 'ForceFieldGenerator',
 'GradientDriver',
 'GridDriver',
 'HessianDriver',
 'InputParser',
 'KineticEnergyIntegralsDriver',
 'LinearAbsorptionCrossSection',
 'LinearMomentumIntegralsDriver',
 'LinearResponseEigenSolver',
 'LinearResponseSolver',
 'LoPropDriver',
 'MOIntegralsDriver',
 'MOIntsBatch',
 'MolecularBasis',
 'MolecularOrbitals',
 'Molecule',
 'Mp2Driver',
 'MpiTask',
 'NuclearPotentialIntegralsDriver',
 'NumerovDriver',
 'OpenMMDriver',
 'OpenMMGradientDriver',
 'OptimizationDriver',
 'OrbitalViewer',
 'OutputStream',
 'OverlapIntegralsDriver',
 'Polarizability',
 'QuadraticResponseDriver',
 'RespChargesDriver',
 'ResponseDriver',
 'ResponseProperty',
 'SADGuessDriver',
 'SHG',
 'SHGDriver',
 'ScfGradientDriver',
 'ScfHessianDriver',
 'ScfRestrictedDriver',
 'ScfRestrictedOpenDriver',
 'ScfUnrestrictedDriver',
 'SubCommunicators',
 'TDAExciDriver',
 'TPA',
 'TPAFullDriver',
 'TPAReducedDriver',
 'TwoIndexes',
 'VisualizationDriver',
 'XTBDriver',
 'XTBGradientDriver',
 'XTBHessianDriver',
 '__builtins__',
 '__cached__',
 '__deployed__',
 '__doc__',
 '__file__',
 '__loader__',
 '__name__',
 '__package__',
 '__path__',
 '__spec__',
 '__version__',
 'ao_matrix_to_dalton',
 'ao_matrix_to_veloxchem',
 'aodensitymatrix',
 'aofockmatrix',
 'assert_msg_critical',
 'available_functionals',
 'batchsize',
 'blockdavidson',
 'bohr_in_angstroms',
 'c2diis',
 'c6solver',
 'checkpoint',
 'configure_mkl_rt',
 'cppsolver',
 'cubicgrid',
 'cubicresponsedriver',
 'denguess',
 'denmat',
 'dipole_in_debye',
 'distributedarray',
 'environ',
 'ericut',
 'errorhandler',
 'excitondriver',
 'extinction_coefficient_from_beta',
 'fine_structure_constant',
 'firstorderprop',
 'fockmat',
 'forcefieldgenerator',
 'get_basis_function_indices_for_atom',
 'get_basis_path',
 'get_qq_scheme',
 'get_qq_type',
 'gradientdriver',
 'hartree_in_ev',
 'hartree_in_kcalpermol',
 'hartree_in_wavenumbers',
 'hessiandriver',
 'inputparser',
 'linearsolver',
 'loprop',
 'lreigensolver',
 'lrsolver',
 'mathconst_pi',
 'mklconf',
 'moints',
 'mointsdriver',
 'molecularbasis',
 'molecularorbitals',
 'molecule',
 'molorb',
 'mp2driver',
 'mpi_initialized',
 'mpi_master',
 'mpitask',
 'nonlinearsolver',
 'numerovdriver',
 'openmmdriver',
 'openmmgradientdriver',
 'optimizationdriver',
 'optimizationengine',
 'orbitalviewer',
 'outputstream',
 'profiler',
 'qqscheme',
 'quadraticresponsedriver',
 'respchargesdriver',
 'rotatory_strength_in_cgs',
 'rspabsorption',
 'rspc6',
 'rspcdspec',
 'rspcustomproperty',
 'rspdriver',
 'rsplinabscross',
 'rsppolarizability',
 'rspproperty',
 'rspshg',
 'rsptpa',
 'scfdriver',
 'scfgradientdriver',
 'scfhessiandriver',
 'scfrestdriver',
 'scfrestopendriver',
 'scfunrestdriver',
 'set_omp_num_threads',
 'set_vlxbasispath',
 'shgdriver',
 'signalhandler',
 'subcommunicators',
 'szblock',
 'tdaexcidriver',
 'tpadriver',
 'tpafulldriver',
 'tpareddriver',
 'veloxchemlib',
 'visualizationdriver',
 'xtbdriver',
 'xtbgradientdriver',
 'xtbhessiandriver']

Information about a specific class is available from the docstring.

print(vlx.ScfUnrestrictedDriver.__doc__)
    Implements spin unrestricted open shell SCF method with C2-DIIS and
    two-level C2-DIIS convergence accelerators.

    :param comm:
        The MPI communicator.
    :param ostream:
        The output stream.
    

Methods and properties

The actual calculations are performed by the methods in the classes. To list the properties and methods of a class, the dir function can be used as follows.

dir(vlx.ScfRestrictedDriver)
['__class__',
 '__delattr__',
 '__dict__',
 '__dir__',
 '__doc__',
 '__eq__',
 '__format__',
 '__ge__',
 '__getattribute__',
 '__gt__',
 '__hash__',
 '__init__',
 '__init_subclass__',
 '__le__',
 '__lt__',
 '__module__',
 '__ne__',
 '__new__',
 '__reduce__',
 '__reduce_ex__',
 '__repr__',
 '__setattr__',
 '__sizeof__',
 '__str__',
 '__subclasshook__',
 '__weakref__',
 'add_iter_data',
 'check_convergence',
 'comp_2e_fock',
 'comp_2e_fock_single_comm',
 'comp_2e_fock_split_comm',
 'comp_density_change',
 'comp_diis',
 'comp_energy',
 'comp_full_fock',
 'comp_gradient',
 'comp_guess_density',
 'comp_npot_mat_split_comm',
 'comp_one_ints',
 'compute',
 'compute_s2',
 'delete_mos',
 'gen_molecular_orbitals',
 'gen_new_density',
 'get_acc_type',
 'get_dyn_threshold',
 'get_effective_fock',
 'get_guess_type',
 'get_qq_dyn',
 'get_scaled_fock',
 'get_scf_energy',
 'get_scf_range',
 'get_scf_type',
 'graceful_exit',
 'need_graceful_exit',
 'print_energy_components',
 'print_ground_state',
 'print_header',
 'print_iter_data',
 'print_keywords',
 'print_scf_energy',
 'print_scf_finish',
 'print_scf_title',
 'set_skip_iter_flag',
 'set_start_orbitals',
 'store_diis_data',
 'update_fock_type',
 'update_mol_orbs_phase',
 'update_settings',
 'write_checkpoint',
 'write_final_hdf5']