veloxchem package

Submodules

veloxchem.blockdavidson module

class veloxchem.blockdavidson.BlockDavidsonSolver

Bases: object

Implements block Davidson solver for symmetric eigenvalues/eigenvectors problems i.e. A * X = e X. Reference: SIAM J. Sci. Comput. 15 (1994), 62-76.

Instance variables
  • neigenpairs: The number of eigenpairs of A matrix determined by solver.

  • sigma_matrices: The sigma vectors A * X in matrix format {A * X_0, A * X_1,…}.

  • trial_matrices: The trial vectors in matrix format {X_0, X_1,…}.

add_iteration_data(sig_mat, trial_mat, iteration)

Add sigma and trial vectors to sigma and trial matrices for specific iteration.

Parameters
  • sig_mat – The sigma vectors {A * X_i} i = 0..l.

  • trial_mat – The trial vectors {X_i} i = 0..l.

  • iteration – The index of block Davidson iteration.

check_convergence(conv_thresh)

Checks if residual norm is bellow given convergence threshold for all requested eigenpairs of symmetric A matrix.

Parameters

conv_thresh – The convergence threshold for the solver.

Returns

The true if residual norms are converged for all eigenpairs, false otherwise.

comp_residual_vectors()

Computes residual vectors and their norms by diagonalizing interaction matrix in reduced space.

comp_trial_vectors(diag_mat)

Computes new trial vectors by applying Davidson preconditioner to residual vectors.

Parameters

diag_mat – The approximate diagonal of symmetric A matrix as column matrix.

Returns

The trial vectors.

compute(diag_mat)

Computes new set of trial vectors by solving eigenvalues problem by diagonalizing interaction matrix in reduced space.

Parameters

diag_mat – The approximate diagonal of symmetric A matrix as column matrix.

Returns

The new set of trial vectors.

get_eigenvalues()

Gets smallest eigenvalues of symmetric A matrix and associated residual norms.

Returns

tuple (eigenvalues, residual norms).

max_min_residual_norms()

Determines maximum and minumum residual norms within set of requested eigenpairs.

Returns

tuple (max. residual norm, min. residual norm).

project_trial_vectors(tvecs)

Projects out trial vector components already present in reduced space expansion and renormalizes resulting trial vectors.

Parameters

tvecs – The trial vectors.

reduced_space_size()

Gets number of trial vectors in residual space.

Returns

The number of trial vectors in residual space.

veloxchem.c2diis module

class veloxchem.c2diis.CTwoDiis

Bases: object

Implements direct inversion of the iterative subspace in C2 form proposed by H. Seller.

Instance variables
  • error_vectors: The list of error vectors.

comp_bmatrix()

Computes B-matrix of C2-DIIS method using error vectors.

Returns

The B-matrix.

compute_error_vectors(fock_matrices, density_matrices, overlap_matrix, oao_matrix)

Computes error vectors for list of AO Fock matrices using (FDS - SDF) in orthogonal AO basis.

Parameters
  • fock_matrices – The list of AO Fock matrices.

  • density_matrices – The list of AO density matrices.

  • overlap_matrix – The overlap matrix.

  • oao_matrix – The orthogonalization matrix.

compute_unrestricted_error_vectors(fock_matrices, fock_matrices_beta, density_matrices, density_matrices_beta, overlap_matrix, oao_matrix)

Computes error vectors for list of AO Fock matrices using (FDS - SDF) in orthogonal AO basis.

Parameters
  • fock_matrices – The list of AO Fock matrices (alpha spin).

  • fock_matrices_beta – The list of AO Fock matrices (beta spin).

  • density_matrices – The list of AO density matrices (alpha spin).

  • density_matrices_beta – The list of AO density matrices (beta spin).

  • overlap_matrix – The overlap matrix.

  • oao_matrix – The orthogonalization matrix.

compute_weights()

Computes C2-DIIS weights from error vectors using H. Sellers method (Int. J. Quantum Chem., vol. 45, pp. 31-41, 1993).

Returns

The array of C2-DIIS weights with smallest residual error.

norm_bvectors(bvectors)

Normalizes B-matrix eigenvectors by rescaling them to 1.0.

Parameters

bvectors – The array of B-matrix eigenvectors.

Returns

The normalized B-matrix eigenvectors.

pick_weights(weights)

Picks normalize B-matrix eigenvector with smallest residual error by computing residual error for all eigenvectors of B_matrix.

Parameters

bvectors – The array of B-matrix eigenvectors.

Returns

The normalized B-matrix eigenvector.

veloxchem.c6solver module

class veloxchem.c6solver.C6Solver(comm, ostream)

Bases: object

Implements the complex linear response solver.

Parameters
  • comm – The MPI communicator.

  • ostream – The output stream.

Instance variables
  • a_operator: The A operator.

  • a_components: Cartesian components of the A operator.

  • b_operator: The B operator.

  • b_components: Cartesian components of the B operator.

  • n_points: The number of integration points.

  • w0: The transformation function prefactor.

  • qq_type: The electron repulsion integrals screening scheme.

  • eri_thresh: The electron repulsion integrals screening threshold.

  • dft: The flag for running DFT.

  • grid_level: The accuracy level of DFT grid.

  • xcfun: The XC functional.

  • pe: The flag for running polarizable embedding calculation.

  • potfile: The name of the potential file for polarizable embedding.

  • use_split_comm: The flag for using split communicators.

  • max_iter: The maximum number of solver iterations.

  • conv_thresh: The convergence threshold for the solver.

  • cur_iter: Index of the current iteration.

  • is_converged: The flag for convergence.

  • small_thresh: The norm threshold for a vector to be considered a zero vector.

  • lindep_thresh: The threshold for removing linear dependence in the trial vectors.

  • comm: The MPI communicator.

  • rank: The MPI rank.

  • nodes: Number of MPI processes.

  • ostream: The output stream.

  • restart: The flag for restarting from checkpoint file.

  • checkpoint_file: The name of checkpoint file.

  • checkpoint_time: The timer of checkpoint file.

  • timing: The flag for printing timing information.

  • profiling: The flag for printing profiling information.

check_convergence(relative_residual_norm)

Checks convergence.

Parameters

relative_residual_norm – Relative residual norms.

compute(molecule, basis, scf_tensors)

Solves for the response vector iteratively while checking the residuals for convergence.

Parameters
  • molecule – The molecule.

  • basis – The AO basis.

  • scf_tensors – The dictionary of tensors from converged SCF wavefunction.

Returns

A dictionary containing response functions and solutions.

decomp_grad(grad)

Decomposes gradient into gerade and ungerade parts.

Parameters

grad – The trial vectors.

Returns

A tuple containing gerade and ungerade parts of vectors.

decomp_trials(vecs)

Decomposes trial vectors into their 2 respective non-zero parts (real ungerade and imaginary gerade).

Parameters

vecs – The trial vectors.

Returns

A tuple containing respective non-zero parts of the trial vectors.

get_precond(orb_ene, nocc, norb, iw)

Constructs the preconditioner matrix.

Parameters
  • orb_ene – The orbital energies.

  • nocc – The number of doubly occupied orbitals.

  • norb – The number of orbitals.

  • iw – The imaginary frequency.

Returns

The preconditioner matrix.

initial_guess(v1, precond)

Creating initial guess (un-orthonormalized trials) out of gradients.

Parameters
  • v1 – The dictionary containing (operator, imaginary frequency) as keys and right-hand sides as values.

  • precond – The preconditioner matrices.

Returns

The initial guess.

preconditioning(precond, v_in)

Creates trial vectors out of residuals and the preconditioner matrix.

Parameters
  • precond – The preconditioner matrix.

  • v_in – The input trial vectors.

Returns

The trail vectors after preconditioning.

print_convergence()

Prints information after convergence.

print_header()

Prints C6 solver setup header to output stream.

print_iteration(relative_residual_norm, nvs)

Prints information of the iteration.

Parameters
  • relative_residual_norm – Relative residual norms.

  • nvs – A list of tuples containing operator component, imaginary frequency, and property.

print_timing()

Prints timing for the C6 solver.

setup_trials(vectors, pre=None, bger=None, bung=None, res_norm=None, renormalize=True)

Computes orthonormalized trial vectors. Takes set of vectors, preconditioner matrix, gerade and ungerade subspaces as input arguments.

Parameters
  • vectors – The set of vectors.

  • pre – The preconditioner matrix.

  • bger – The gerade subspace.

  • bung – The ungerade subspace.

  • res_norm – The relative residual norm.

  • renormalize – The flag for normalization.

Returns

The orthonormalized gerade and ungerade trial vectors.

update_settings(rsp_dict, method_dict={})

Updates response and method settings in C6 solver.

Parameters
  • rsp_dict – The dictionary of response dict.

  • method_dict – The dictionary of method rsp_dict.

veloxchem.cppsolver module

class veloxchem.cppsolver.ComplexResponse(comm, ostream)

Bases: object

Implements the complex linear response solver.

Parameters
  • comm – The MPI communicator.

  • ostream – The output stream.

Instance variables
  • a_operator: The A operator.

  • a_components: Cartesian components of the A operator.

  • b_operator: The B operator.

  • b_components: Cartesian components of the B operator.

  • frequencies: The frequencies.

  • damping: The damping parameter.

  • qq_type: The electron repulsion integrals screening scheme.

  • eri_thresh: The electron repulsion integrals screening threshold.

  • dft: The flag for running DFT.

  • grid_level: The accuracy level of DFT grid.

  • xcfun: The XC functional.

  • pe: The flag for running polarizable embedding calculation.

  • potfile: The name of the potential file for polarizable embedding.

  • use_split_comm: The flag for using split communicators.

  • max_iter: The maximum number of solver iterations.

  • conv_thresh: The convergence threshold for the solver.

  • cur_iter: Index of the current iteration.

  • is_converged: The flag for convergence.

  • small_thresh: The norm threshold for a vector to be considered a zero vector.

  • lindep_thresh: The threshold for removing linear dependence in the trial vectors.

  • comm: The MPI communicator.

  • rank: The MPI rank.

  • nodes: Number of MPI processes.

  • ostream: The output stream.

  • restart: The flag for restarting from checkpoint file.

  • checkpoint_file: The name of checkpoint file.

  • checkpoint_time: The timer of checkpoint file.

  • timing: The flag for printing timing information.

  • profiling: The flag for printing profiling information.

assemble_subsp(realvec, imagvec)

Assembles subspace out of real and imaginary parts of trials, if their norm exceeds a certain threshold (zero vectors shouldn’t be added).

Parameters
  • realvec – The real part of trial vectors.

  • imagvec – The imaginary part of trial vectors.

Returns

The assembled trial vectors.

check_convergence(relative_residual_norm)

Checks convergence.

Parameters

relative_residual_norm – Relative residual norms.

compute(molecule, basis, scf_tensors, v1=None)

Solves for the response vector iteratively while checking the residuals for convergence.

Parameters
  • molecule – The molecule.

  • basis – The AO basis.

  • scf_tensors – The dictionary of tensors from converged SCF wavefunction.

  • v1 – The gradients on the right-hand side. If not provided, v1 will be computed for the B operator.

Returns

A dictionary containing response functions, solutions, and kappas.

decomp_grad(grad)

Decomposes gradient into gerade and ungerade parts.

Parameters

grad – The trial vectors.

Returns

A tuple containing gerade and ungerade parts of vectors.

decomp_trials(vecs)

Decomposes trial vectors into their 4 respective parts (real gerade, real ungerade, imaginary gerade, and imaginary ungerade).

Parameters

vecs – The trial vectors.

Returns

A tuple containing respective parts of the trial vectors.

get_precond(orb_ene, nocc, norb, w, d)

Constructs the preconditioner matrix.

Parameters
  • orb_ene – The orbital energies.

  • nocc – The number of doubly occupied orbitals.

  • norb – The number of orbitals.

  • w – The frequency.

  • d – The damping parameter.

Returns

The preconditioner matrix.

initial_guess(v1, d, freqs, precond)

Creating initial guess (un-orthonormalized trials) out of gradients.

Parameters
  • v1 – The dictionary containing (operator, frequency) as keys and right-hand sides as values.

  • d – The damping parameter.

  • freqs – The frequencies.

  • precond – The preconditioner matrices.

Returns

The initial guess.

preconditioning(precond, v_in)

Creates trial vectors out of residuals and the preconditioner matrix.

Parameters
  • precond – The preconditioner matrix.

  • v_in – The input trial vectors.

Returns

The trail vectors after preconditioning.

print_convergence()

Prints information after convergence.

print_header()

Prints complex linear response solver setup header to output stream.

print_iteration(relative_residual_norm, nvs)

Prints information of the iteration.

Parameters
  • relative_residual_norm – Relative residual norms.

  • nvs – A list of tuples containing operator component, frequency, and property.

print_timing()

Prints timing for the complex response solver.

setup_trials(vectors, pre=None, bger=None, bung=None, res_norm=None, renormalize=True)

Computes orthonormalized trial vectors. Takes set of vectors, preconditioner matrix, gerade and ungerade subspaces as input arguments.

Parameters
  • vectors – The set of vectors.

  • pre – The preconditioner matrix.

  • bger – The gerade subspace.

  • bung – The ungerade subspace.

  • res_norm – The relative residual norm.

  • renormalize – The flag for normalization.

Returns

The orthonormalized gerade and ungerade trial vectors.

update_settings(rsp_dict, method_dict={})

Updates response and method settings in complex liner response solver.

Parameters
  • rsp_dict – The dictionary of response dict.

  • method_dict – The dictionary of method rsp_dict.

veloxchem.denguess module

class veloxchem.denguess.DensityGuess(guess_type='SAD', checkpoint_file=None)

Bases: object

Implements initial density guess generator with set of different methods for generation of initial density.

Parameters
  • guess_type – The type of initial guess.

  • checkpoint_file – The name of checkpoint file.

property guess_type

Getter function for protected guess_type attribute.

prcmo_density(molecule, ao_basis, red_basis, red_orbs)

Computes initial AO density from molecular orbitals obtained by inserting molecular orbitals from reduced basis into molecular orbitals in full AO basis.

Parameters
  • molecule – The molecule.

  • ao_basis – The AO basis.

  • red_basis – The reduced AO basis for generation of molecular orbitals.

  • red_orbs – The molecular orbitals in reduced AO basis.

Returns

The AO density matrix from PRCMO.

restart_density(molecule, rank, ostream)

Reads initial molecular orbitals and AO density from checkpoint file.

Parameters
  • molecule – The molecule.

  • rank – The rank of the MPI process.

  • ostream – The output stream.

Returns

The AO density matrix to restart from.

sad_density(molecule, ao_basis, min_basis, overlap_matrix, restricted, comm, ostream)

Computes initial AO density using superposition of atomic densities scheme.

Parameters
  • molecule – The molecule.

  • ao_basis – The AO basis.

  • min_basis – The minimal AO basis for generation of atomic densities.

  • overlap_matrix – The AO overlap matrix.

  • restricted – The flag for generating restricted initial guess.

  • comm – The local MPI communicator.

  • ostream – The output stream.

Returns

The AO density matrix from SAD initial guess.

validate_checkpoint(rank, comm, nuclear_charges, basis_set, restricted)

Validates the checkpoint file by checking nuclear charges and basis set.

Parameters
  • rank – The rank of the MPI process.

  • comm – The MPI communicator.

  • nuclear_charges – Numpy array of the nuclear charges.

  • basis_set – Name of the AO basis.

  • restricted – The flag for restricted molecular orbitals.

Returns

Validity of the checkpoint file.

veloxchem.errorhandler module

veloxchem.errorhandler.assert_msg_critical(condition, msg='')

Asserts that the condition is true. Otherwise terminates the program with an error message.

Parameters
  • condition – The condition.

  • msg – The error message.

veloxchem.excitondriver module

class veloxchem.excitondriver.ExcitonModelDriver(comm, ostream)

Bases: object

Implements the exciton model.

Parameters
  • comm – The MPI communicator.

  • ostream – The output stream.

Instance variables
  • H: The exciton model Hamiltonian matrix.

  • trans_dipoles: The diabatic electric transition dipole moments in length form.

  • velo_trans_dipoles: The diabatic electric transition dipole moments in velocity form.

  • magn_trans_dipoles: The diabatic magnetic transition dipole moments.

  • center_of_mass: The center of mass of the whole system.

  • state_info: Information of the diabatic excited states.

  • monomers: The monomer dictionaries.

  • natoms: The list containing number of atoms in each monomer.

  • charges: The list containing net charges of each monomer.

  • qq_type: The electron repulsion integrals screening scheme.

  • eri_thresh: The electron repulsion integrals screening threshold.

  • dft: The flag for running DFT.

  • grid_level: The accuracy level of DFT grid.

  • xcfun_label: The name of XC functional.

  • scf_conv_thresh: The convergence threshold for the SCF driver.

  • scf_max_iter: The maximum number of SCF iterations.

  • nstates: The number of locally excited states for each monomer.

  • ct_nocc: The number of occupied orbitals to be involved in charge-transfer excited states.

  • ct_nvir: The number of virtual orbitals to be involved in charge-transfer excited states.

  • tda_conv_thresh: The convergence threshold for the TDA driver.

  • tda_max_iter: The maximum number of TDA iterations.

  • comm: The MPI communicator.

  • rank: The MPI rank.

  • nodes: Number of MPI processes.

  • ostream: The output stream.

  • restart: The flag for restarting from checkpoint file.

  • checkpoint_file: Name of the exciton model checkpoint file.

compute(molecule, basis, min_basis)

Executes exciton model calculation and writes checkpoint file.

Parameters
  • molecule – The molecule.

  • basis – The AO basis.

  • min_basis – The minimal AO basis for generating initial guess.

print_absorption(title, eigvals, osc_str)

Prints absorption spectrum.

Parameters
  • title – The title.

  • eigvals – The eigenvalues (adiabatic excitation energies).

  • osc_str – The oscillator strengths.

print_banner(title)

Prints header.

Parameters

title – The text to be shown in the header.

print_ecd(title, rot_str)

Prints electronic circular dichroism spectrum.

Parameters
  • title – The title.

  • rot_str – The rotatory strengths in 10**(-40) (esu**2)*(cm**2).

print_title(num_LE, num_CT)

Prints exciton model title.

Parameters
  • num_LE – The total number of locally excited states.

  • num_CT – The total number of charge-transfer excited states.

update_settings(exciton_dict, method_dict={})

Updates settings in exciton model driver.

Parameters

exciton_dict – The settings dictionary.

veloxchem.inputparser module

class veloxchem.inputparser.InputParser(filename, outname=None)

Bases: object

Implements the input parser and provides functions for parsing VeloxChem input files into a format, which passes the needed information to the rest of the program.

Parameters
  • filename – The name of the input file.

  • outname – The name of the output file.

Instance variables
  • input_dict: The input dictionary.

  • success_monitor: The monitor for successful parsing.

  • filename: The name of the input file.

  • is_basis_set: The flag for parsing a basis set file.

  • basis_set_name: The name of the basis set.

clear_interspace()

Deletes content that is not within a group.

convert_dict()

Converting the list of lists into a dictionary with groupnames as keys and group content as a dictionary itself. The geometry definition of the molecule group is stored in a different dictionary. Converting the molecular structure into the required format.

empty_group_check()

Checks for any empty groups.

get_dict()

Gets the input dictonary.

Returns

A dictionary containing all information form the input file.

groupsplit()

Creates a list in which every element is a list itself containing every line of a group, while deleting ‘@’ and @end’ tags.

incomplete_group_check()

Checks for any incomplete groups.

parse()

Calls every function needed for the parsing process depending on the success of the parsing in different stages.

read_file()

Reads and stores content of selected file as a string type. Deletes comments (marked by ‘!’) and unnecassary whitespace.

veloxchem.inputparser.parse_frequencies(input_frequencies)

Parses frequencies input for response solver. Input example: “0.0 - 0.2525 (0.0025), 0.5 - 1.0 (0.02), 2.0”

Parameters

input_frequencies – The string of input frequencies.

veloxchem.lreigensolver module

class veloxchem.lreigensolver.LinearResponseEigenSolver(comm, ostream)

Bases: object

Implements linear response eigensolver.

Parameters
  • comm – The MPI communicator.

  • ostream – The output stream.

Instance variables
  • nstates: Number of excited states.

  • eri_thresh: The electron repulsion integrals screening threshold.

  • qq_type: The electron repulsion integrals screening scheme.

  • dft: The flag for running DFT.

  • grid_level: The accuracy level of DFT grid.

  • xcfun: The XC functional.

  • pe: The flag for running polarizable embedding calculation.

  • potfile: The name of the potential file for polarizable embedding.

  • use_split_comm: The flag for using split communicators.

  • conv_thresh: The convergence threshold for the solver.

  • max_iter: The maximum number of solver iterations.

  • cur_iter: Index of the current iteration.

  • small_thresh: The norm threshold for a vector to be considered a zero vector.

  • lindep_thresh: The threshold for removing linear dependence in the trial vectors.

  • is_converged: The flag for convergence.

  • comm: The MPI communicator.

  • rank: The MPI rank.

  • nodes: Number of MPI processes.

  • ostream: The output stream.

  • restart: The flag for restarting from checkpoint file.

  • checkpoint_file: The name of checkpoint file.

  • checkpoint_time: The timer of checkpoint file.

  • timing: The flag for printing timing information.

  • profiling: The flag for printing profiling information.

check_convergence(relative_residual_norm)

Checks convergence.

Parameters

relative_residual_norm – Relative residual norms.

compute(molecule, basis, scf_tensors)

Performs linear response calculation for a molecule and a basis set.

Parameters
  • molecule – The molecule.

  • basis – The AO basis set.

  • scf_tensors – The dictionary of tensors from converged SCF wavefunction.

Returns

A dictionary containing eigenvalues, eigenvectors, transition dipole moments, oscillator strengths and rotatory strengths.

decomp_trials(vecs)

Decomposes trial vectors into gerade and ungerade parts.

Parameters

vecs – The trial vectors.

Returns

A tuple containing gerade and ungerade parts of the trial vectors.

get_precond(orb_ene, nocc, norb, w)

Constructs the preconditioner matrix.

Parameters
  • orb_ene – The orbital energies.

  • nocc – The number of doubly occupied orbitals.

  • norb – The number of orbitals.

  • w – The frequency.

Returns

The preconditioner matrix.

initial_excitations(nstates, ea, nocc, norb)

Gets initial guess for excitations.

Parameters
  • nstates – Number of excited states.

  • ea – Orbital energies.

  • nocc – Number of occupied orbitals.

  • norb – Number of orbitals.

Returns

A list of initial excitations (excitation energy and vector).

preconditioning(precond, v_in)

Creates trial vectors out of residuals and the preconditioner matrix.

Parameters
  • precond – The preconditioner matrix.

  • v_in – The input trial vectors.

Returns

The trail vectors after preconditioning.

print_convergence()

Prints information after convergence.

print_header()

Prints linear response eigensolver setup header to output stream.

print_iteration(relative_residual_norm, converged, ws)

Prints information of the iteration.

Parameters
  • relative_residual_norm – Relative residual norms.

  • converged – Flags of converged excitations.

  • ws – Excitation energies.

print_timing()

Prints timing for the linear response eigensolver.

setup_trials(excitations, converged={}, precond=None, bger=None, bung=None, renormalize=True)

Computes orthonormalized trial vectors.

Parameters
  • excitations – The set of excitations.

  • converged – The flags of converged excitations.

  • precond – The preconditioner.

  • bger – The gerade subspace.

  • bung – The ungerade subspace.

  • renormalize – The flag for normalization.

Returns

The orthonormalized gerade and ungerade trial vectors.

update_settings(rsp_dict, method_dict={})

Updates response and method settings in linear response eigensolver.

Parameters
  • rsp_dict – The dictionary of response dict.

  • method_dict – The dictionary of method rsp_dict.

veloxchem.lrmatvecdriver module

class veloxchem.lrmatvecdriver.LinearResponseMatrixVectorDriver(comm, use_split_comm=False)

Bases: object

Implements linear response matrix-vector driver.

Parameters
  • comm – The MPI communicator.

  • use_split_comm – The flag for using split communicators.

Instance variables
  • comm: The MPI communicator.

  • rank: The MPI rank.

  • nodes: Number of MPI processes.

  • use_split_comm: The flag for using split communicators.

  • split_comm_ratio: The list of ratios for split communicators.

  • eri_thresh: The electron repulsion integrals screening threshold.

  • qq_type: The electron repulsion integrals screening scheme.

  • dft: The flag for running DFT.

  • xcfun: The XC functional.

  • pe: The flag for running polarizable embedding calculation.

  • potfile: The name of the potential file for polarizable embedding.

comp_lr_fock(fock, dens, molecule, basis, screening, molgrid, gs_density, V_es, pe_drv, timing_dict)

Computes Fock/Fxc matrix (2e part) for linear response calculation.

Parameters
  • fock – The Fock matrix (2e part).

  • dens – The density matrix.

  • molecule – The molecule.

  • basis – The basis set.

  • screening – The screening container object.

  • molgrid – The molecular grid for XC contributtion computation.

  • gs_density – The ground state density matrix.

  • V_es – The polarizable embedding matrix.

  • pe_drv – The polarizable embedding driver.

comp_lr_fock_split_comm(fock, dens, molecule, basis, screening, molgrid, gs_density, V_es, pe_drv)

Computes linear response Fock/Fxc matrix on split communicators.

Parameters
  • fock – The Fock matrix (2e part).

  • dens – The density matrix.

  • molecule – The molecule.

  • basis – The basis set.

  • screening – The screening container object.

  • molgrid – The molecular grid for XC contributtion computation.

  • gs_density – The ground state density matrix.

  • V_es – The polarizable embedding matrix.

  • pe_drv – The polarizable embedding driver.

e2n_half_size(vecs_ger, vecs_ung, tensors, screening, molecule, basis, molgrid, gs_density, V_es, pe_drv, timing_dict)

Computes the E2 b matrix vector product.

Parameters
  • vecs_ger – The gerade trial vectors in half-size.

  • vecs_ung – The ungerade trial vectors in half-size.

  • tensors – The dictionary of tensors from converged SCF wavefunction.

  • screening – The electron repulsion integrals screening pattern.

  • molecule – The molecule.

  • basis – The AO basis set.

  • molgrid – The molecular grid for XC contributtion computation.

  • gs_density – The ground state density matrix.

  • V_es – The polarizable embedding matrix.

  • pe_drv – The polarizable embedding driver.

Returns

The gerade and ungerade E2 b matrix vector product in half-size.

update_settings(eri_thresh, qq_type, dft, xcfun, pe, potfile)

Updates settings in linear response matrix-vector solver.

Parameters
  • eri_thresh – The electron repulsion integrals screening threshold.

  • qq_type – The electron repulsion integrals screening scheme.

  • dft – The flag for running DFT.

  • xcfun – The XC functional.

  • pe – The flag for running polarizable embedding calculation.

  • potfile – The name of the potential file for polarizable embedding.

veloxchem.lrmatvecdriver.construct_ed_sd(orb_ene, nocc, norb)

Gets the E0 and S0 diagonal elements as arrays.

Parameters
  • orb_ene – Orbital energies.

  • nocc – Number of occupied orbitals.

  • norb – Number of orbitals.

Returns

The E0 and S0 diagonal elements as numpy arrays.

veloxchem.lrmatvecdriver.construct_ed_sd_half(orb_ene, nocc, norb)

Gets the upper half of E0 and S0 diagonal elements as arrays.

Parameters
  • orb_ene – Orbital energies.

  • nocc – Number of occupied orbitals.

  • norb – Number of orbitals.

Returns

The upper half of E0 and S0 diagonal elements as numpy arrays.

veloxchem.lrmatvecdriver.get_complex_rhs(operator, components, molecule, basis, scf_tensors, rank, comm)

Creates right-hand side of linear response equations.

Parameters
  • operator – The string for the operator.

  • components – The string for Cartesian components.

  • molecule – The molecule.

  • basis – The AO basis set.

  • scf_tensors – The dictionary of tensors from converged SCF wavefunction.

  • rank – Rank of the MPI process.

  • comm – The MPI communicator.

Returns

The right-hand sides (gradients).

veloxchem.lrmatvecdriver.get_rhs(operator, components, molecule, basis, scf_tensors, rank, comm)

Creates right-hand side of linear response equations.

Parameters
  • operator – The string for the operator.

  • components – The string for Cartesian components.

  • molecule – The molecule.

  • basis – The AO basis set.

  • scf_tensors – The dictionary of tensors from converged SCF wavefunction.

  • rank – Rank of the MPI process.

  • comm – The MPI communicator.

Returns

The right-hand sides (gradients).

veloxchem.lrmatvecdriver.lrmat2vec(mat, nocc, norb)

Converts matrices to vectors.

Parameters
  • mat – The matrices.

  • nocc – Number of occupied orbitals.

  • norb – Number of orbitals.

Returns

The vectors.

veloxchem.lrmatvecdriver.lrvec2mat(vec, nocc, norb)

Converts vectors to matrices.

Parameters
  • vec – The vectors.

  • nocc – Number of occupied orbitals.

  • norb – Number of orbitals.

Returns

The matrices.

veloxchem.lrmatvecdriver.normalize(vecs)

Normalizes vectors by dividing by vector norm.

Parameters
  • vecs – The vectors.

  • Retruns – The normalized vectors.

veloxchem.lrmatvecdriver.normalize_half(vecs)

Normalizes half-sized vectors by dividing by vector norm.

Parameters
  • vecs – The half-sized vectors.

  • Retruns – The normalized vectors.

veloxchem.lrmatvecdriver.orthogonalize_gram_schmidt(tvecs)

Applies modified Gram Schmidt orthogonalization to trial vectors.

Parameters

tvecs – The trial vectors.

Returns

The orthogonalized trial vectors.

veloxchem.lrmatvecdriver.orthogonalize_gram_schmidt_half(tvecs)

Applies modified Gram Schmidt orthogonalization to trial vectors.

Parameters

tvecs – The trial vectors.

Returns

The orthogonalized trial vectors.

veloxchem.lrmatvecdriver.read_rsp_hdf5(fname, labels, e_nuc, nuclear_charges, basis_set, dft_func_label, potfile_text, ostream)

Reads response vectors from checkpoint file. Nuclear charges and basis set will be used to validate the checkpoint file.

Parameters
  • fname – Name of the checkpoint file.

  • labels – The list of labels for trial vecotrs and transformed vectors.

  • e_nuc – Nuclear repulsion energy.

  • nuclear_charges – Nuclear charges of the molecule.

  • basis_set – Name of the AO basis set.

  • dft_func_label – Name of the density functional.

  • potfile_text – Text in the potential file.

  • ostream – The output stream.

Returns

The trial vectors and transformed vectors.

veloxchem.lrmatvecdriver.remove_linear_dependence(basis, threshold)

Removes linear dependence in a set of vectors.

Parameters
  • basis – The set of vectors.

  • threshold – The threshold for removing linear dependence.

Returns

The new set of vectors.

veloxchem.lrmatvecdriver.remove_linear_dependence_half(basis, threshold)

Removes linear dependence in a set of symmetrized vectors.

Parameters
  • basis – The set of upper parts of symmetrized vectors.

  • threshold – The threshold for removing linear dependence.

Returns

The new set of vectors.

veloxchem.lrmatvecdriver.write_rsp_hdf5(fname, arrays, labels, e_nuc, nuclear_charges, basis_set, dft_func_label, potfile_text, ostream)

Writes response vectors to checkpoint file. Nuclear charges and basis set can also be written to the checkpoint file.

Parameters
  • fname – Name of the checkpoint file.

  • arrays – The response vectors.

  • labels – The list of labels for trial vecotrs and transformed vectors.

  • e_nuc – Nuclear repulsion energy.

  • nuclear_charges – Nuclear charges of the molecule.

  • basis_set – Name of the AO basis set.

  • dft_func_label – Name of the density functional.

  • potfile_text – Text in the potential file.

  • ostream – The output stream.

veloxchem.lrsolver module

class veloxchem.lrsolver.LinearResponseSolver(comm, ostream)

Bases: object

Implements linear response solver.

Parameters
  • comm – The MPI communicator.

  • ostream – The output stream.

Instance variables
  • a_operator: The A operator.

  • a_components: Cartesian components of the A operator.

  • b_operator: The B operator.

  • b_components: Cartesian components of the B operator.

  • frequencies: The frequencies.

  • eri_thresh: The electron repulsion integrals screening threshold.

  • qq_type: The electron repulsion integrals screening scheme.

  • dft: The flag for running DFT.

  • grid_level: The accuracy level of DFT grid.

  • xcfun: The XC functional.

  • pe: The flag for running polarizable embedding calculation.

  • potfile: The name of the potential file for polarizable embedding.

  • use_split_comm: The flag for using split communicators.

  • conv_thresh: The convergence threshold for the solver.

  • max_iter: The maximum number of solver iterations.

  • cur_iter: Index of the current iteration.

  • small_thresh: The norm threshold for a vector to be considered a zero vector.

  • lindep_thresh: The threshold for removing linear dependence in the trial vectors.

  • is_converged: The flag for convergence.

  • comm: The MPI communicator.

  • rank: The MPI rank.

  • nodes: Number of MPI processes.

  • ostream: The output stream.

  • restart: The flag for restarting from checkpoint file.

  • checkpoint_file: The name of checkpoint file.

  • checkpoint_time: The timer of checkpoint file.

  • timing: The flag for printing timing information.

  • profiling: The flag for printing profiling information.

check_convergence(relative_residual_norm)

Checks convergence.

Parameters

relative_residual_norm – Relative residual norms.

compute(molecule, basis, scf_tensors, v1=None)

Performs linear response calculation for a molecule and a basis set.

Parameters
  • molecule – The molecule.

  • basis – The AO basis set.

  • scf_tensors – The dictionary of tensors from converged SCF wavefunction.

  • v1 – The gradients on the right-hand side. If not provided, v1 will be computed for the B operator.

Returns

A dictionary containing response functions, solutions, and kappas.

decomp_grad(grad)

Decomposes gradient into gerade and ungerade parts.

Parameters

grad – The gradient.

Returns

A tuple containing gerade and ungerade parts of gradient.

decomp_trials(vecs)

Decomposes trial vectors into gerade and ungerade parts.

Parameters

vecs – The trial vectors.

Returns

A tuple containing gerade and ungerade parts of the trial vectors.

get_precond(orb_ene, nocc, norb, w)

Constructs the preconditioner matrix.

Parameters
  • orb_ene – The orbital energies.

  • nocc – The number of doubly occupied orbitals.

  • norb – The number of orbitals.

  • w – The frequency.

Returns

The preconditioner matrix.

initial_guess(v1, freqs, precond)

Creating initial guess for the linear response solver.

Parameters
  • v1 – The dictionary containing (operator, frequency) as keys and right-hand sides as values.

  • freq – The frequencies.

  • precond – The preconditioner.

Returns

The initial guess.

preconditioning(precond, v_in)

Creates trial vectors out of residuals and the preconditioner matrix.

Parameters
  • precond – The preconditioner matrix.

  • v_in – The input trial vectors.

Returns

The trail vectors after preconditioning.

print_convergence()

Prints information after convergence.

print_header()

Prints linear response solver setup header to output stream.

print_iteration(relative_residual_norm, converged, nvs)

Prints information of the iteration.

Parameters
  • relative_residual_norm – Relative residual norms.

  • converge – Flags for converged vectors.

  • nvs – A list of tuples containing operator component, frequency, and property.

print_timing()

Prints timing for the linear response eigensolver.

setup_trials(vectors, converged={}, precond=None, bger=None, bung=None, renormalize=True)

Computes orthonormalized trial vectors.

Parameters
  • vectors – The set of vectors.

  • converged – The flags for converged vectors.

  • precond – The preconditioner.

  • bger – The gerade subspace.

  • bung – The ungerade subspace.

  • renormalize – The flag for normalization.

Returns

The orthonormalized gerade and ungerade trial vectors.

update_settings(rsp_dict, method_dict={})

Updates response and method settings in linear response solver.

Parameters
  • rsp_dict – The dictionary of response dict.

  • method_dict – The dictionary of method rsp_dict.

veloxchem.mointsdriver module

class veloxchem.mointsdriver.MOIntegralsDriver(comm, ostream)

Bases: object

Implements MO integrals driver.

Parameters
  • comm – The MPI communicator.

  • ostream – The output stream.

Instance variable
  • qq_type: The electron repulsion integrals screening scheme.

  • eri_thresh: The electron repulsion integrals screening threshold.

  • num_matrices: Number of Fock matrices to be computed.

  • batch_size: Batch size for computing Fock matrices.

  • comm: The MPI communicator.

  • rank: The MPI rank.

  • nodes: Number of MPI processes.

  • ostream: The output stream.

collect_moints_batches(moints_batch, grps)

Collects MO integrals to the master node.

Parameters
  • moints_batch – The MO integrals batch.

  • grps – The color group for creating MPI subcommunicators.

Returns

The collected MO integrals batch.

compute(molecule, ao_basis, mol_orbs, mints_type, grps)

Performs MO integrals calculation for a molecule and a basis set.

Parameters
  • molecule – The molecule.

  • ao_basis – The AO basis set.

  • mol_orbs – The molecular orbitals.

  • mints_type – The type of MO integrals to be calculated.

  • grps – The color group for creating MPI subcommunicators.

Returns

The computed MO integrals batch.

compute_in_mem(molecule, basis, mol_orbs, mints_type)

Performs in-memory MO integrals calculation for a molecule and a basis set.

Parameters
  • molecule – The molecule.

  • basis – The AO basis set.

  • mol_orbs – The molecular orbitals.

  • mints_type – The type of MO integrals to be calculated.

Returns

The computed MO integrals.

get_batch_dimensions(vec_ids)

Gets the dimension of the batches.

Parameters

vec_ids – The list of vector id.

Returns

The tuple containing the position and the dimension of the batch.

get_external_indexes(mints_type)

Gets external indices.

Parameters

mints_type – Type of MO integrals.

Returns

The external indices.

get_moints_type(mints_type)

Gets MO integrals type.

Parameters

mints_type – Type of MO integrals.

Returns

The MO integrals type.

get_num_orbitals(mol_orbs, molecule)

Gets number of occupied and virtual orbitals.

Parameters
  • mol_orbs – The molecular orbitals.

  • molecule – The molecule.

Returns

The number of occupied and virtual orbitals.

get_transformation_vectors(mints_type, mol_orbs, molecule)

Gets transformation matrices.

Parameters
  • mints_type – Type of MO integrals.

  • mol_orbs – The molecular orbitals.

  • molecule – The molecule.

Returns

The tuple containing transformation matrices.

print_finish(start_time)

Prints header for the MO integrals driver.

Parameters

start_time – The starting time of the calculation.

print_header()

Prints header for the MO integrals driver.

set_fock_matrices_type(mints_type, fock_matrices)

Sets Fock matrix types.

Parameters
  • mints_type – Type of MO integrals.

  • fock_matrices – The Fock matrices.

set_orbital_pairs(mints_type, mol_orbs, molecule)

Sets up bra and ket orbitals list.

Parameters
  • mints_type – Type of MO integrals.

  • mol_orbs – The molecular orbitals.

  • molecule – The molecule.

Returns

The tuple containing the lists of bra and ket ids.

use_symmetry(mints_type)

Checks if symmetry is used.

Parameters

mints_type – Type of MO integrals.

Returns

Whether symmetry is used.

veloxchem.mp2driver module

class veloxchem.mp2driver.Mp2Driver(comm, ostream)

Bases: object

Implements MP2 driver.

Parameters
  • comm – The MPI communicator.

  • ostream – The output stream.

Instance variable
  • e_mp2: The MP2 correlation energy.

  • comm: The MPI communicator.

  • rank: The MPI rank.

  • nodes: Number of MPI processes.

  • qq_type: The electron repulsion integrals screening scheme.

  • eri_thresh: The electron repulsion integrals screening threshold.

  • batch_size: The number of Fock matrices in each batch.

  • comm_size: The size of each subcommunicator.

  • ostream: The output stream.

  • conventional: The flag for using conventional (in-memory) AO-to-MO integral transformation.

compute(molecule, ao_basis, mol_orbs)

Performs MP2 calculation.

Parameters
  • molecule – The molecule.

  • ao_basis – The AO basis set.

  • mol_orbs – The molecular orbitals.

compute_conventional(molecule, ao_basis, mol_orbs)

Performs conventional MP2 calculation.

Parameters
  • molecule – The molecule.

  • ao_basis – The AO basis set.

  • mol_orbs – The molecular orbitals.

compute_distributed(molecule, basis, mol_orbs)

Performs MP2 calculation via distributed Fock builds.

Parameters
  • molecule – The molecule.

  • basis – The AO basis set.

  • mol_orbs – The molecular orbitals.

print_header(num_matrices)

Prints header for the MP2 driver.

Parameters

num_matrices – The number of Fock matrices to be computed.

update_settings(mp2_dict)

Updates settings in MP2 driver.

Parameters

mp2_dict – The dictionary of MP2 settings.

veloxchem.mpitask module

class veloxchem.mpitask.MpiTask(fname_list, mpi_comm)

Bases: object

Implements the MPI task.

Parameters
  • fname_list – List of the intput/output filenames.

  • mpi_comm – The MPI communicator.

Instance variable
  • mpi_comm: The MPI communicator.

  • mpi_rank: The MPI rank.

  • mpi_size: Number of MPI processes.

  • molecule: The molecule.

  • ao_basis: The AO basis set.

  • min_basis: The minimal AO basis set for generating initial guess.

  • ostream: The output stream.

  • input_dict: The input dictionary.

  • start_time: The start time of the task.

finish()

Finalizes the MPI task.

veloxchem.outputstream module

class veloxchem.outputstream.OutputStream(filename=None, width=122)

Bases: object

Implements the output stream.

Parameters
  • filename – Name of the output file (or sys.stdout).

  • width – Width of the output.

Instance variables
  • width: Width of the output.

  • buffer_lines: The buffered lines of output.

  • stream: The stream to which output is printed.

  • state: The flag for writing to the stream.

flush()

Flushes the buffered output to stream.

get_state()
Returns

State of the output stream.

static header(line, width)

Gets the header string.

Parameters
  • line – The line of text.

  • width – Width of the output.

Returns

The header string.

static info(line, width)

Gets the information string.

Parameters
  • line – The line of text.

  • width – Width of the output.

Returns

The information string.

print_blank()

Prints a blank line to stream.

print_block(block_lines)

Prints a block of lines to stream.

Parameters

block_lines – The multiple lines of text.

print_finish_header(start_time)

Prints finish header to output stream.

Parameters

start_time – The start time of the computation.

print_header(line)

Prints a header line to stream.

Parameters

line – The line of text.

print_info(line)

Prints an information line to stream.

Parameters

line – The line of text.

print_line(line)

Prints the line to stream.

Parameters

line – The line of text.

print_separator()

Prints a separator line to stream.

print_start_header(num_nodes)

Prints start header to output stream.

Parameters

num_nodes – The number of MPI processes.

print_title(line)

Prints a title line to stream.

Parameters

line – The line of text.

static title(line, width)

Gets the title string.

Parameters
  • line – The line of text.

  • width – Width of the output.

Returns

The title string.

static tsep(width)

Gets the separator string.

Parameters

width – Width of the output.

Returns

The separator string.

veloxchem.polembed module

class veloxchem.polembed.PolEmbed(molecule, basis, comm, potfile, iso_pol=True)

Bases: object

Implements interface to the CPPE library.

Parameters
  • molecule – The molecule.

  • basis – The AO basis set.

  • comm – The MPI communicator.

  • potfile – The name of the potential file for polarizable embedding.

  • iso_pol – The flag for using isotropic polarizability.

Instance variables
  • molecule: The molecule.

  • basis: The AO basis set.

  • comm: The MPI communicator.

  • rank: The rank of MPI process.

  • nodes: The number of MPI processes.

  • V_es: The multipole contribution to Fock matrix.

  • options: The CPPE options object.

  • cppe_state: The CPPE state object.

  • polarizable_coords: The coordinates of the polarizable sites.

compute_electric_field_value(dm)

Computes electric field at the polarizable sites.

Parameters

dm – The density matrix.

Returns

The electric field.

compute_induction_operator(moments)

Computes contribution from induction operator.

Parameters

moments – The induced moments.

Returns

The induction contribution to Fock matrix.

compute_multipole_potential_integrals()

Computes contribution from multipoles.

Returns

The multipole contribution to Fock matrix.

get_pe_contribution(dm, elec_only=False)

Computes contributions from polarizable embedding.

Parameters
  • dm – The density matrix.

  • elec_only – The flag for computing electronic contribution only.

Returns

The polarizable embedding contributions to energy and Fock matrix.

print_callback(output)

Handles the output from the CPPE library.

Parameters

output – The output from the CPPE library.

veloxchem.pulsedrsp module

class veloxchem.pulsedrsp.PulsedResponse(comm, ostream)

Bases: object

Pulsed Reponse class for computing molecular responses to a resonant or non-resonant laser pulse.

Parameters
  • comm – The MPI communicator.

  • ostream – The output stream.

Instance variable
  • comm: The MPI communicator.

  • rank: The MPI rank.

  • nodes: The number of MPI processes.

  • ostream: The output stream.

  • field_cutoff_ratio: Float - Ratio between the smallest field amplitude to be included in the calculation wrt. the maximum field amplitude. Frequencies with associated field amplitudes smaller than this ratio will NOT be included in the calculation.

  • envelope: String - Envelope of the of pulse - available arguments: [‘gaussian’, ]

  • number_pulses: Integer - The number of different pulse settings to expect ‘N’. Currently limited to one.

  • pulse_widths: List of floats (len(N)) - pulse widths in [au].

  • carrier_frequencies: List of floats (len(N)) - carrier frequencies in [au].

  • field_max: List of floats (len(N)) - pulse amplitudes in [au].

  • centers: List of floats (len(N)) - time centers for the pulses in [au].

  • pol_dir: string - polarization directions, arguments given in combinations of x, y and z - e.g.: ‘x’ for [1 0 0], yz for [0 1 1].

  • frequency_range: List of frequencies to map solution to. Given as range: ‘start-end(df)’ in [au], e.g. 0.2-0.4(0.007) for 0.2 -> 0.4 au in steps of 0.007 au. Zero-padding will be applied if range does not start at 0.

  • CEP: List of floats (len(N)) - carrier envelope phases in [radians].

  • h5file: String - optional - name of requested h5 formatted result file.

  • ascii: String - optional - name of requested ASCII formatted file.

apply_zero_pad(results)

Adds zeros between 0 and the requested start frequency with dw increments.

The zero padding may be necessary due to:
  1. the limited number of frequencies for which the complex response function is being computed as dictated by “field_cutoff_ratio”

  2. the need for extending the frequency range to achieve higher temporal resolution

Example of zero padding:

w: 0~~~zero_pad~~~|===DATA===|~~~zero_pad~~~end_freq

Parameters

results – A dictionary containing properties, solutions and kappas (the results dict from .compute()).

Returns

A dictionary containing properties, solutions and kappas and zeropadded properties.

compute(molecule, ao_basis, scf_tensors)

Invoke complex response solver to compute complex response function at requested frequencies

Parameters
  • molecule – The molecule.

  • aobasis – The AO basis.

  • scf_tensors – The dictionary of tensors from converged SCF wavefunction.

Returns

A dictionary containing properties, solutions and kappas and possibly zeropadded properties if requested (self.zero_pad).

gauss_env_pulse_w(w, F0, t0, delta_t, w_carrier, cep)

Gaussian pulse from frequency domain input.

Parameters
  • w – np.array - list of frequencies.

  • F0 – float - pulse amplitude in [au].

  • t0 – float - time center for pulse in [au].

  • delta_t – float - pulse width in [au].

  • w_carrier – float - carrier frequency in [au].

  • cep – float - carrier envelope phases in [radians].

Returns

Numpy array of the pulse amplitude in the frequency domain.

A footer to be printed after finalizing the calculation.

print_header()

Prints Pulsed Lionear Response calculation setup details to output stream.

update_settings(settings, cpp_settings)

Updates settings in PulsedRespnse

Parameters
  • settings – The settings dictionary for the driver.

  • cpp_settings – The settings dictionary for complex response driver.

verify_freqs(frequencies)

Takes a list or nd-array of frequencies and verifies that it have or can be extended to include zero frequency

Parameters

frequencies – List of frequencies.

Returns

Numpy array of zero-padded frequencies and numpy array of truncated frequencies.

write_ascii(fname)

Writes the Pulsed response vectors to the specified output file in ASCII format.

Parameters

fname – Name of the checkpoint file.

Returns

The ASCII file saved contains the the amplitudes for all frequencies for each of the following directions:

  • ’xx’, ‘xy’, ‘xz’, ‘yx’, ‘yy’, ‘yz’, ‘zx’, ‘zy’, ‘zz’

    => Amplitudes for all directions

write_hdf5(fname)

Writes the Pulsed response vectors to the specified output file in h5 format.

Parameters

fname – Name of the checkpoint file.

Returns

The h5 file saved contains the following datasets:
  • amplitudes

    The pulse amplitudes for the calculated truncated_freqs

  • zero_padded

    Is the dataset zero padded or not

  • ’xx’, ‘xy’, ‘xz’, ‘yx’, ‘yy’, ‘yz’, ‘zx’, ‘zy’, ‘zz’

    => Amplitudes for all directions

  • zero_padded_freqs

    The zero padded frequency list

  • zero_padded_amplitudes

    The pulse amplitudes for the calculated frequencies zero padded to match th zero padded frequencies.

veloxchem.qqscheme module

veloxchem.qqscheme.get_qq_scheme(qq_type)

Converts screening scheme string to C++ enum.

Parameters

qq_type – The label of electron repulsion integrals screening scheme.

Returns

The C++ enum with screening scheme.

veloxchem.qqscheme.get_qq_type(qq_type)

Gets string with type of electron repulsion integrals screening scheme (Cauchy Schwarz and it’s variations).

Parameters

qq_type – The label of electron repulsion integrals screening scheme.

Returns

The string with type of electron repulsion integrals screening scheme.

veloxchem.rspabsorption module

class veloxchem.rspabsorption.Absorption(rsp_dict, method_dict={})

Bases: veloxchem.rspproperty.ResponseProperty

Implements the absorption property.

Parameters
  • rsp_dict – The dictionary of response input.

  • method_dict – The dictionary of method settings.

Instance variables
  • rsp_dict: The dictionary of response input.

  • method_dict: The dictionary of method settings.

  • rsp_property: The dictionary of response property.

get_property(key)

Gets excitation energies, CI vectors, or oscillator stengths.

Parameters

key – The keyword to the absorption property.

Returns

The absorption property.

print_absorption(ostream, spin_str, title)

Prints absorption to output stream.

Parameters
  • ostream – The output stream.

  • spin_str – The string representation of spin.

  • title – The title to be printed to the output stream.

print_ecd(ostream, spin_str, title)

Prints electronic circular dichroism to output stream.

Parameters
  • ostream – The output stream.

  • spin_str – The string representation of spin.

  • title – The title to be printed to the output stream.

print_property(ostream)

Prints absorption to output stream.

Parameters

ostream – The output stream.

print_transition_dipoles(ostream, spin_str, title, trans_dipoles)

Prints transition dipole moments to output stream.

Parameters
  • ostream – The output stream.

  • spin_str – The string representation of spin.

  • title – The title to be printed to the output stream.

  • trans_dipoles – The transition dipole moments.

veloxchem.rspc6 module

class veloxchem.rspc6.C6(rsp_dict, method_dict={})

Bases: veloxchem.rspproperty.ResponseProperty

Implements the C6 property.

Parameters
  • rsp_dict – The dictionary of response input.

  • method_dict – The dictionary of method settings.

Instance variables
  • rsp_dict: The dictionary of response input.

  • method_dict: The dictionary of method settings.

  • rsp_property: The dictionary of response property.

get_property(key)

Gets excitation energies, CI vectors, or oscillator stengths.

Parameters

key – The keyword to the C6 property.

Returns

The C6 property.

integrate(rsp_property, imagfreqs, points, weights, w0)

Calculates the C6 value with a Gauss-Legendre quadrature for the integral in the Casimir-Polder relation using integration by substitution.

Parameters
  • imagfreqs – The list of imaginary frequencies.

  • points – The list of integration points.

  • weights – The list of weights for integration points.

  • w0 – A constant conversion factor.

Returns

The C6 value.

print_property(ostream)

Prints response property to output stream.

Parameters

ostream – The output stream.

veloxchem.rspcdspec module

class veloxchem.rspcdspec.CircularDichroismSpectrum(rsp_dict, method_dict={})

Bases: veloxchem.rspproperty.ResponseProperty

Implements the circular dichroism spectrum property.

Parameters
  • rsp_dict – The dictionary of response input.

  • method_dict – The dictionary of method settings.

Instance variables
  • rsp_dict: The dictionary of response input.

  • method_dict: The dictionary of method settings.

  • rsp_property: The dictionary of response property.

get_property(key)

Gets response functions or solutions.

Parameters

key – The keyword ‘response_functions’ or ‘solutions’.

Returns

The response functions or solutions.

print_property(ostream)

Prints response property to output stream.

Parameters

ostream – The output stream.

veloxchem.rspdriver module

class veloxchem.rspdriver.ResponseDriver(comm, ostream)

Bases: object

Implements response driver for molecular property calculations using conventional Hartree-Fock/Kohn-Sham response theory.

Parameters
  • comm – The MPI communicator.

  • ostream – The output stream.

Instance variables
  • prop_type: The type of the property to be calculated.

  • tamm_dancoff: The flag for using Tamm-Dancoff approximation.

  • rsp_dict: The dictionary of response input.

  • method_dict: The dictionary of method settings.

  • comm: The MPI communicator.

  • rank: The rank of MPI process.

  • nodes: The number of MPI processes.

compute(molecule, ao_basis, scf_tensors)

Performs molecular property calculation using molecular data

Parameters
  • molecule – The molecule.

  • ao_basis – The AO basis set.

  • scf_tensors – The dictionary of tensors from converged SCF wavefunction.

Returns

The results from the actual response solver.

prop_str()

Gets string with type of molecular property calculation (Excited states, linear and non-linear spectroscopies).

Returns

The string with type of molecular property calculation.

update_settings(rsp_dict, method_dict={})

Updates settings in response solver.

Parameters
  • rsp_dict – The dictionary of response input.

  • method_dict – The dictionary of method settings.

veloxchem.rsplinabscross module

class veloxchem.rsplinabscross.LinearAbsorptionCrossSection(rsp_dict, method_dict={})

Bases: veloxchem.rspproperty.ResponseProperty

Implements the linear absorption cross-section property.

Parameters
  • rsp_dict – The dictionary of response input.

  • method_dict – The dictionary of method settings.

Instance variables
  • rsp_dict: The dictionary of response input.

  • method_dict: The dictionary of method settings.

  • rsp_property: The dictionary of response property.

get_property(key)

Gets response functions or solutions.

Parameters

key – The keyword ‘response_functions’ or ‘solutions’.

Returns

The response functions or solutions.

print_property(ostream)

Prints response property to output stream.

Parameters

ostream – The output stream.

veloxchem.rsppolarizability module

class veloxchem.rsppolarizability.Polarizability(rsp_dict, method_dict={})

Bases: veloxchem.rspproperty.ResponseProperty

Implements the polarizability property.

Parameters
  • rsp_dict – The dictionary of response input.

  • method_dict – The dictionary of method settings.

Instance variables
  • rsp_dict: The dictionary of response input.

  • method_dict: The dictionary of method settings.

  • rsp_property: The dictionary of response property.

get_property(key)

Gets response functions or solutions.

Parameters

key – The keyword ‘response_functions’ or ‘solutions’.

Returns

The response functions or solutions.

print_property(ostream)

Prints polarizability to output stream.

Parameters

ostream – The output stream.

veloxchem.rspproperty module

class veloxchem.rspproperty.ResponseProperty(rsp_dict, method_dict={})

Bases: object

Implements the base class for response property/spectroscopy.

Parameters
  • rsp_dict – The input dictionary that defines the property/spectroscopy.

  • method_dict – The dictionary of method settings.

Instance variables
  • rsp_dict: The dictionary of response input.

  • method_dict: The dictionary of method settings.

  • rsp_driver: The response driver.

  • rsp_property: The dictionary of response property.

compute(molecule, basis, scf_tensors)
Parameters
  • molecule – The molecule.

  • basis – The AO basis set.

  • scf_tensors – The dictionary of tensors from converged SCF wavefunction.

get_property(key)

Gets response property/spectroscopy.

Parameters

key – The keyword for the property.

Returns

The property.

init_driver(comm, ostream)

Initializes response driver.

Parameters
  • comm – The MPI communicator.

  • ostream – The output stream.

print_property(ostream)

Prints response property/spectroscopy to output stream.

Parameters

ostream – The output stream.

veloxchem.scfdriver module

class veloxchem.scfdriver.ScfDriver(comm, ostream)

Bases: object

Implements SCF method with C2-DIIS and two-level C2-DIIS convergence accelerators.

Parameters
  • comm – The MPI communicator.

  • ostream – The output stream.

Instance variables
  • den_guess: The initial density guess driver.

  • acc_type: The type of SCF convergence accelerator.

  • max_err_vecs: The maximum number of error vectors.

  • max_iter: The maximum number of SCF iterations.

  • first_step: The flag for first step in two-level C2-DIIS convergence acceleration.

  • qq_type: The electron repulsion integrals screening scheme.

  • qq_dyn: The flag for enabling dynamic thresholds in electron repulsion integrals screening scheme.

  • conv_thresh: The SCF convergence threshold.

  • eri_thresh: The electron repulsion integrals screening threshold.

  • ovl_thresh: The atomic orbitals linear dependency threshold.

  • diis_thresh: The C2-DIIS switch on threshold.

  • use_level_shift: The flag for usage of level shifting in SCF iterations.

  • iter_data: The list of SCF iteration data (electronic energy, electronic energy change, gradient, density change).

  • is_converged: The flag for SCF convergence.

  • skip_iter: The flag for SCF iteration data storage.

  • old_energy: The electronic energy of previous SCF iteration.

  • num_iter: The current number of SCF iterations.

  • fock_matrices: The list of stored Fock/Kohn-Sham matrices.

  • den_matrices: The list of stored density matrices.

  • density: The current density matrix.

  • mol_orbs: The current molecular orbitals.

  • nuc_energy: The nuclear repulsion energy of molecule.

  • comm: The MPI communicator.

  • rank: The rank of MPI process.

  • nodes: The number of MPI processes.

  • restart: The flag for restarting from checkpoint file.

  • checkpoint_file: The name of checkpoint file.

  • checkpoint_time: The timer of checkpoint file.

  • ref_mol_orbs: The reference molecular orbitals read from checkpoint file.

  • restricted: The flag for restricted SCF.

  • dft: The flag for running DFT.

  • grid_level: The accuracy level of DFT grid.

  • xcfun: The XC functional.

  • molgrid: The molecular grid.

  • pe: The flag for running polarizable embedding calculation.

  • V_es: The polarizable embedding matrix.

  • potfile: The name of the potential file for polarizable embedding.

  • pe_summary: The summary string for polarizable embedding.

  • use_split_comm: The flag for using split communicators.

  • split_comm_ratio: The list of ratios for split communicators.

  • timing: The flag for printing timing information.

  • profiling: The flag for printing profiling information.

add_iter_data(e_ee, e_kin, e_en, e_grad, diff_den)

Adds SCF iteration data (electronic energy, electronic energy change, electronic gradient, density difference) to SCF iterations list.

Parameters
  • e_ee – The electronic energy.

  • e_kin – The kinetic energy.

  • e_en – The nuclear potential energy.

  • e_grad – The electronic energy gradient.

  • diff_den – The density change with respect to previous SCF iteration.

check_convergence()

Sets SCF convergence flag by checking if convergence condition for electronic gradient is fullfiled.

comp_2e_fock(fock_mat, den_mat, molecule, basis, screening, e_grad=None)

Computes Fock/Kohn-Sham matrix (only 2e part).

Parameters
  • fock_mat – The AO Fock matrix (only 2e-part).

  • den_mat – The AO density matrix.

  • molecule – The molecule.

  • basis – The basis set.

  • screening – The screening container object.

  • e_grad – The electronic gradient.

Returns

The AO Kohn-Sham (Vxc) matrix.

comp_2e_fock_single_comm(fock_mat, den_mat, molecule, basis, screening, e_grad=None)

Computes Fock/Kohn-Sham matrix on single communicator.

Parameters
  • fock_mat – The AO Fock matrix (only 2e-part).

  • den_mat – The AO density matrix.

  • molecule – The molecule.

  • basis – The basis set.

  • screening – The screening container object.

  • e_grad – The electronic gradient.

Returns

The AO Kohn-Sham (Vxc) matrix.

comp_2e_fock_split_comm(fock_mat, den_mat, molecule, basis, screening, e_grad=None)

Computes Fock/Kohn-Sham matrix on split communicators.

Parameters
  • fock_mat – The AO Fock matrix (only 2e-part).

  • den_mat – The AO density matrix.

  • molecule – The molecule.

  • basis – The basis set.

  • screening – The screening container object.

  • e_grad – The electronic gradient.

Returns

The AO Kohn-Sham (Vxc) matrix.

comp_density_change(den_mat, old_den_mat)

Computes norm of density change between two density matrices.

Parameters
  • den_mat – The current density matrix.

  • old_den_mat – The previous density matrix.

Returns

The norm of change between two density matrices.

comp_diis(molecule, ao_basis, min_basis)

Performs SCF calculation with C2-DIIS acceleration.

Parameters
  • molecule – The molecule.

  • ao_basis – The AO basis set.

  • min_basis – The minimal AO basis set.

comp_energy(fock_mat, vxc_mat, e_pe, kin_mat, npot_mat, den_mat)

Computes SCF energy components: electronic energy, kinetic energy, and nuclear potential energy.

Parameters
  • fock_mat – The Fock/Kohn-Sham matrix (only 2e-part).

  • vxc_mat – The Vxc matrix.

  • e_pe – The polarizable embedding energy.

  • kin_mat – The kinetic energy matrix.

  • npot_mat – The nuclear potential matrix.

  • den_mat – The density matrix.

Returns

The tuple (electronic energy, kinetic energy, nuclear potential energy).

comp_full_fock(fock_mat, vxc_mat, pe_mat, kin_mat, npot_mat)

Computes full Fock/Kohn-Sham matrix by adding to 2e-part of Fock/Kohn-Sham matrix the kinetic energy and nuclear potential matrices.

Parameters
  • fock_mat – The Fock/Kohn-Sham matrix (2e-part).

  • vxc_mat – The Vxc matrix.

  • pe_mat – The polarizable embedding matrix.

  • kin_mat – The kinetic energy matrix.

  • npot_mat – The nuclear potential matrix.

comp_gradient(fock_mat, ovl_mat, den_mat, oao_mat)

Computes electronic gradient using Fock/Kohn-Sham matrix.

Parameters
  • fock_mat – The Fock/Kohn-Sham matrix.

  • ovl_mat – The overlap matrix.

  • den_mat – The density matrix.

  • oao_mat – The orthogonalization matrix.

Returns

The electronic gradient.

comp_guess_density(molecule, ao_basis, min_basis, ovl_mat)

Computes initial density guess for SCF using superposition of atomic densities or molecular orbitals projection methods.

Parameters
  • molecule – The molecule.

  • ao_basis – The AO basis set.

  • min_basis – The minimal AO basis set.

  • ovl_mat – The overlap matrix between minimal and full AO basis.

Returns

The density matrix.

comp_npot_mat_split_comm(molecule, basis)

Computes one-electron nuclear potential integral on split communicators.

Parameters
  • molecule – The molecule.

  • ao_basis – The AO basis set.

Returns

The one-electron nuclear potential matrix.

comp_one_ints(molecule, basis)

Computes one-electron integrals (overlap, kinetic energy and nuclear potential) using molecular data.

Parameters
  • molecule – The molecule.

  • ao_basis – The AO basis set.

Returns

The one-electron integrals.

compute(molecule, ao_basis, min_basis=None)

Performs SCF calculation using molecular data.

Parameters
  • molecule – The molecule.

  • ao_basis – The AO basis set.

  • min_basis – The minimal AO basis set.

compute_s2(molecule, smat, mol_orbs)

Computes expectation value of the S**2 operator.

Parameters
  • molecule – The molecule.

  • smat – The overlap matrix (numpy array).

  • mol_orbs – The molecular orbitals.

Returns

Expectation value <S**2>.

delete_mos(mol_orbs, mol_eigs)

Generates trimmed molecular orbital by deleting MOs with coeficients exceeding 1.0 / sqrt(ovl_thresh).

Parameters
  • mol_orbs – The molecular orbitals.

  • mol_eigs – The eigenvalues of molecular orbitals.

Returns

The tuple (trimmed molecular orbitals, eigenvalues).

gen_molecular_orbitals(fock_mat, oao_mat)

Generates molecular orbital by diagonalizing Fock/Kohn-Sham matrix.

Parameters
  • fock_mat – The Fock/Kohn-Sham matrix.

  • oao_mat – The orthogonalization matrix.

Returns

The molecular orbitals.

gen_new_density(molecule)

Generates density matrix from current molecular orbitals.

Parameters

molecule – The molecule.

Returns

The density matrix.

get_acc_type()

Gets string with type of SCF convergence accelerator (DIIS or two level DIIS).

Returns

The string with type of SCF convergence accelerator.

get_dyn_threshold(e_grad)

Computes screening threshold for electron repulsion integrals based on value of electronic gradient.

Parameters

e_grad – The electronic gradient.

Returns

The screening threshold.

get_effective_fock(fock_mat, ovl_mat, oao_mat)

Computes effective Fock/Kohn-Sham matrix in OAO basis by applying Lowdin or canonical orthogonalization to AO Fock/Kohn-Sham matrix.

Parameters
  • fock_mat – The Fock/Kohn-Sham matrix.

  • ovl_mat – The overlap matrix.

  • oao_mat – The orthogonalization matrix.

Returns

The effective Fock/Kohn-Sham matrix.

get_guess_type()

Gets string with type of initial guess (superposition of atomic densities or projection of molecular orbitals).

Returns

The string with type of initial guess.

get_qq_dyn()

Gets string with application method (static or dynamic) of electron repulsion integrals screening.

Returns

The string with application method of electron repulsion integrals screening.

get_scf_energy()

Gets SCF energy from previous SCF iteration.

Returns

The SCF energy.

get_scf_range()

Creates range of SCF iterations from maximum number of SCF iterations.

Returns

The range of SCF iterations.

get_scf_type()

Gets string with type of SCF calculation (defined in derrived classes).

Returns

The string with type of SCF calculation.

need_min_basis()

Determines if minimal AO basis is needed in SCF calculation. Usage of two level DIIS accelerator or superposition of atomic densities initial guess requires minimal AO basis.

Returns

The flag for need of minimal AO basis.

print_energy_components()

Prints SCF energy components to output stream.

print_ground_state(molecule, s2)

Prints ground state information to output stream.

Parameters
  • molecule – The molecule.

  • s2 – The expectation value of S**2.

print_header()

Prints SCF calculation setup details to output stream,

print_iter_data(i)

Prints SCF iteration data to output stream,

Parameters

i – The current SCF iteration.

print_scf_energy()

Prints SCF energy information to output stream.

print_scf_finish(start_time)

Prints SCF calculation finish message to output stream,

Parameters

start_time – The start time of SCF calculation.

print_scf_title()

Prints SCF cycles header to output stream.

print_timing()

Prints timing breakdown for the scf driver.

set_skip_iter_flag(i, e_grad)

Sets SCF iteration skiping flag based on iteration number and C2-DIIS switch on threshold.

Parameters
  • i – The number of current SCF iteration.

  • e_grad – The electronic gradient at current SCF iteration.

store_diis_data(i, fock_mat, den_mat)

Stores Fock/Kohn-Sham and density matrices for current iteration.

Parameters
  • i – The number of current SCF iteration.

  • fock_mat – The Fock/Kohn-Sham matrix.

  • den_mat – The density matrix.

update_fock_type(fock_mat)

Updates Fock matrix to fit selected functional in Kohn-Sham calculations.

Parameters

fock_mat – The Fock/Kohn-Sham matrix.

update_mol_orbs_phase()

Updates phase of molecular orbitals.

update_settings(scf_dict, method_dict={})

Updates settings in SCF driver.

Parameters
  • scf_dict – The input dictionary of scf group.

  • method_dict – The input dicitonary of method settings group.

write_checkpoint(nuclear_charges, basis_set)

Writes molecular orbitals to checkpoint file.

Parameters
  • nuclear_charges – The nuclear charges.

  • basis_set – Name of the basis set.

veloxchem.scfrestdriver module

class veloxchem.scfrestdriver.ScfRestrictedDriver(comm, ostream)

Bases: veloxchem.scfdriver.ScfDriver

Implements spin restricted closed shell SCF method with C2-DIIS and two-level C2-DIIS convergence accelerators.

Parameters
  • comm – The MPI communicator.

  • ostream – The output stream.

comp_density_change(den_mat, old_den_mat)

Computes norm of spin restricted closed shell density change between two density matrices. Overloaded base class method.

Parameters
  • den_mat – The current density matrix.

  • old_den_mat – The previous density matrix.

Returns

The norm of change between two density matrices.

comp_gradient(fock_mat, ovl_mat, den_mat, oao_mat)

Computes spin restricted closed shell electronic gradient using Fock/Kohn-Sham matrix. Overloaded base class method.

Parameters
  • fock_mat – The Fock/Kohn-Sham matrix.

  • ovl_mat – The overlap matrix.

  • den_mat – The density matrix.

  • oao_mat – The orthogonalization matrix.

Returns

The electronic gradient.

gen_molecular_orbitals(fock_mat, oao_mat)

Generates spin restricted molecular orbital by diagonalizing spin restricted closed shell Fock/Kohn-Sham matrix. Overloaded base class method.

Parameters
  • fock_mat – The Fock/Kohn-Sham matrix.

  • oao_mat – The orthogonalization matrix.

Returns

The molecular orbitals.

get_effective_fock(fock_mat, ovl_mat, oao_mat)

Computes effective spin restricted closed shell Fock/Kohn-Sham matrix in OAO basis by applying Lowdin or canonical orthogonalization to AO Fock/Kohn-Sham matrix. Overloaded base class method.

Parameters
  • fock_mat – The Fock/Kohn-Sham matrix.

  • ovl_mat – The overlap matrix.

  • oao_mat – The orthogonalization matrix.

Returns

The effective Fock/Kohn-Sham matrix.

get_scaled_fock(weights)

Computes effective spin restricted closed shell Fock/Kohn-Sham matrix by summing Fock/Kohn-Sham matrices scalwd with weigths.

Parameters

weights – The weights of Fock/Kohn-Sham matrices.

Returns

The scaled Fock/Kohn-Sham matrix.

get_scf_type()

Gets string for spin restricted closed shell SCF calculation. Overloaded base class method.

Returns

The string for spin restricted closed shell SCF calculation.

store_diis_data(i, fock_mat, den_mat)

Stores spin restricted closed shell Fock/Kohn-Sham and density matrices for current iteration. Overloaded base class method.

Parameters
  • i – The number of current SCF iteration.

  • fock_mat – The Fock/Kohn-Sham matrix.

  • den_mat – The density matrix.

update_fock_type(fock_mat)

Updates Fock matrix to fit selected functional in Kohn-Sham calculations.

Parameters

fock_mat – The Fock/Kohn-Sham matrix.

veloxchem.scfunrestdriver module

class veloxchem.scfunrestdriver.ScfUnrestrictedDriver(comm, ostream)

Bases: veloxchem.scfdriver.ScfDriver

Implements spin unrestricted open shell SCF method with C2-DIIS and two-level C2-DIIS convergence accelerators.

Parameters
  • comm – The MPI communicator.

  • ostream – The output stream.

comp_density_change(den_mat, old_den_mat)

Computes norm of spin unrestricted open shell density change between two density matrices. Overloaded base class method.

Parameters
  • den_mat – The current density matrix.

  • old_den_mat – The previous density matrix.

Returns

The norm of change between two density matrices.

comp_gradient(fock_mat, ovl_mat, den_mat, oao_mat)

Computes spin unrestricted open shell electronic gradient using Fock/Kohn-Sham matrix. Overloaded base class method.

Parameters
  • fock_mat – The Fock/Kohn-Sham matrix.

  • ovl_mat – The overlap matrix.

  • den_mat – The density matrix.

  • oao_mat – The orthogonalization matrix.

Returns

The electronic gradient.

compute_s2(molecule, smat, mol_orbs)

Computes expectation value of the S**2 operator.

Parameters
  • molecule – The molecule.

  • smat – The overlap matrix (numpy array).

  • mol_orbs – The molecular orbitals.

Returns

Expectation value <S**2>.

gen_molecular_orbitals(fock_mat, oao_mat)

Generates spin unrestricted molecular orbital by diagonalizing spin unrestricted open shell Fock/Kohn-Sham matrix. Overloaded base class method.

Parameters
  • fock_mat – The Fock/Kohn-Sham matrix.

  • oao_mat – The orthogonalization matrix.

Returns

The molecular orbitals.

get_effective_fock(fock_mat, ovl_mat, oao_mat)

Computes effective spin unrestricted open shell Fock/Kohn-Sham matrix in OAO basis by applying Lowdin or canonical orthogonalization to AO Fock/Kohn-Sham matrix. Overloaded base class method.

Parameters
  • fock_mat – The Fock/Kohn-Sham matrix.

  • ovl_mat – The overlap matrix.

  • oao_mat – The orthogonalization matrix.

Returns

The effective Fock/Kohn-Sham matrices.

get_scaled_fock(weights)

Computes effective spin unrestricted open shell Fock/Kohn-Sham matrix by summing Fock/Kohn-Sham matrices scalwd with weigths.

Parameters

weights – The weights of Fock/Kohn-Sham matrices.

Returns

The scaled Fock/Kohn-Sham matrices.

get_scf_type()

Gets string for spin unrestricted open shell SCF calculation. Overloaded base class method.

Returns

The string for spin unrestricted open shell SCF calculation.

store_diis_data(i, fock_mat, den_mat)

Stores spin unrestricted open shell Fock/Kohn-Sham and density matrices for current iteration. Overloaded base class method.

Parameters
  • i – The number of current SCF iteration.

  • fock_mat – The Fock/Kohn-Sham matrix.

  • den_mat – The density matrix.

veloxchem.subcommunicators module

class veloxchem.subcommunicators.SubCommunicators(global_comm, grps)

Bases: object

Implements the MPI subcommunicator.

Parameters
  • global_comm – The global communicator.

  • grps – The color group for creating MPI subcommunicators.

Instance variables
  • local_comm: The local subcommunicator.

  • cross_comm: The cross subcommunicator consisting of the local master nodes.

veloxchem.tdaexcidriver module

class veloxchem.tdaexcidriver.TDAExciDriver(comm, ostream)

Bases: object

Implements TDA excited states computation schheme for Hartree-Fock/Kohn-Sham level of theory.

Parameters
  • comm – The MPI communicator.

  • ostream – The output stream.

Instance variables
  • nstates: The number of excited states determined by driver.

  • eri_thresh: The electron repulsion integrals screening threshold.

  • qq_type: The electron repulsion integrals screening scheme.

  • dft: The flag for running DFT.

  • grid_level: The accuracy level of DFT grid.

  • xcfun: The XC functional.

  • pe: The flag for running polarizable embedding calculation.

  • potfile: The name of the potential file for polarizable embedding.

  • use_split_comm: The flag for using split communicators.

  • conv_thresh: The excited states convergence threshold.

  • max_iter: The maximum number of excited states driver iterations.

  • cur_iter: The current number of excited states driver iterations.

  • solver: The eigenvalues solver.

  • is_converged: The flag for excited states convergence.

  • rank: The rank of MPI process.

  • nodes: The number of MPI processes.

  • ostream: The output stream.

  • restart: The flag for restarting from checkpoint file.

  • checkpoint_file: The name of checkpoint file.

  • checkpoint_time: The timer of checkpoint file.

check_convergence(iteration)

Checks convergence of excitation energies and set convergence flag on all processes within MPI communicator.

Parameters

iteration – The current excited states solver iteration.

comp_angular_momentum_ints(molecule, basis)

Computes one-electron angular momentum integrals.

Parameters
  • molecule – The molecule.

  • basis – The AO basis set.

Returns

The Cartesian components of one-electron angular momentum integrals.

comp_dipole_ints(molecule, basis)

Computes one-electron dipole integrals.

Parameters
  • molecule – The molecule.

  • basis – The AO basis set.

Returns

The Cartesian components of one-electron dipole integrals.

comp_elec_trans_dipoles(dipole_ints, eigvecs, mo_occ, mo_vir)

Computes electric transition dipole moments in length form.

Parameters
  • dipole_ints – One-electron dipole integrals.

  • eigvecs – The CI vectors.

  • mo_occ – The occupied MO coefficients.

  • mo_vir – The virtual MO coefficients.

Returns

The electric transition dipole moments in length form.

comp_linear_momentum_ints(molecule, basis)

Computes one-electron linear momentum integrals.

Parameters
  • molecule – The molecule.

  • basis – The AO basis set.

Returns

The Cartesian components of one-electron linear momentum integrals.

comp_magn_trans_dipoles(angmom_ints, eigvecs, mo_occ, mo_vir)

Computes magnetic transition dipole moments.

Parameters
  • angmom_ints – One-electron angular momentum integrals.

  • eigvecs – The CI vectors.

  • mo_occ – The occupied MO coefficients.

  • mo_vir – The virtual MO coefficients.

Returns

The magnetic transition dipole moments.

comp_oscillator_strengths(transition_dipoles, eigvals)

Computes oscillator strengths.

Parameters
  • transition_dipoles – The electric transition dipole moments in length form.

  • eigvals – The excitation energies.

Returns

The oscillator strengths.

comp_rotatory_strengths(velo_trans_dipoles, magn_trans_dipoles)

Computes rotatory strengths in CGS unit.

Parameters
  • velo_trans_dipoles – The electric transition dipole moments in velocity form.

  • magn_trans_dipoles – The magnetic transition dipole moments.

Returns

The rotatory strengths in CGS unit.

comp_velo_trans_dipoles(linmom_ints, eigvals, eigvecs, mo_occ, mo_vir)

Computes electric transition dipole moments in velocity form.

Parameters
  • linmom_ints – One-electron linear momentum integrals.

  • eigvals – The excitation energies.

  • eigvecs – The CI vectors.

  • mo_occ – The occupied MO coefficients.

  • mo_vir – The virtual MO coefficients.

Returns

The electric transition dipole moments in velocity form.

compute(molecule, basis, scf_tensors)

Performs TDA excited states calculation using molecular data.

Parameters
  • molecule – The molecule.

  • basis – The AO basis set.

  • scf_tensors – The dictionary of tensors from converged SCF wavefunction.

Returns

A dictionary containing eigenvalues, eigenvectors, transition dipole moments, oscillator strengths and rotatory strengths.

convert_to_trial_matrix(trial_vecs)

Converts set of Z vectors from std::vector<CExcitationVector> to numpy 2D array.

Parameters

trial_vecs – The Z vectors as std::vector<CExcitationVector>.

Returns

The 2D Numpy array.

convert_to_trial_vectors(mol_orbs, molecule, zvecs)

Converts set of Z vectors from numpy 2D array to std::vector<CExcitationVector>.

Parameters
  • mol_orbs – The molecular orbitals.

  • molecule – The molecule.

  • zvecs – The Z vectors as 2D Numpy array.

Returns

The Z vectors as std::vector<CExcitationVector>.

gen_trial_vectors(mol_orbs, molecule)

Generates set of TDA trial vectors for given number of excited states by selecting primitive excitations wirh lowest approximate energies E_ai = e_a-e_i.

Parameters
  • mol_orbs – The molecular orbitals.

  • molecule – The molecule.

Returns

tuple (approximate diagonal of symmetric A, set of trial vectors).

get_densities(trial_vecs, tensors, molecule)

Computes the ground-state and transition densities, and initializes the Fock matrix.

Parameters
  • trial_vecs – The Z vectors as std::vector<CExcitationVector>.

  • tensors – The dictionary of tensors from converged SCF wavefunction.

  • molecule – The molecule.

Returns

The initialized Fock matrix, the transition density matrix, and the ground-state density matrix.

get_sigmas(fock, tensors, molecule, trial_mat)

Computes the sigma vectors.

Parameters
  • fock – The Fock matrix.

  • tensors – The dictionary of tensors from converged SCF wavefunction.

  • molecule – The molecule.

  • trial_mat – The trial vectors as 2D Numpy array.

Returns

The sigma vectors as 2D Numpy array.

print_excited_states(start_time)

Prints excited states information to output stream.

Parameters

start_time – The start time of SCF calculation.

print_header()

Prints TDA driver setup header to output stream.

print_iter_data(iteration)

Prints excited states solver iteration data to output stream.

Parameters

iteration – The current excited states solver iteration.

update_settings(rsp_dict, method_dict={})

Updates response and method settings in TDA excited states computation driver.

Parameters
  • rsp_dict – The dictionary of response dict.

  • method_dict – The dictionary of method settings.

veloxchem.veloxchem module

veloxchem.veloxchem.main = <Mock id='140194831122728'>

Module contents

veloxchem.module_path = '/home/www/sites/docs.veloxchem.org/src/docs/Reference Guide/veloxchem'
veloxchem.ncores = 1