veloxchem package

Submodules

veloxchem.batchsize module

veloxchem.batchsize.get_batch_size(input_batch_size, n_total, n_ao, comm)

Gets batch size for Fock matrix computation.

Parameters
  • input_batch_size – The batch size from input.

  • n_total – The total number of Fock matrices.

  • n_ao – The number of atomic orbitals in one Fock matrix.

  • comm – The communicator.

Returns

The batch size for Fock matrix computation..

veloxchem.batchsize.get_number_of_batches(n_total, batch_size, comm)

Gets number of batches for Fock matrix computation.

Parameters
  • n_total – The total number of Fock matrices.

  • batch_size – The batch size for Fock matrix computation.

  • comm – The communicator.

Returns

The number of batches for Fock matrix computation.

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

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=None, ostream=None)

Bases: veloxchem.linearsolver.LinearSolver

Implements the C6 value 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.

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.

get_full_solution_vector(solution)

Gets a full solution vector from the distributed solution.

Parameters

solution – The distributed solution as a tuple.

Returns

The full solution vector.

get_precond(orb_ene, nocc, norb, iw)

Constructs the preconditioners.

Parameters
  • orb_ene – The orbital energies.

  • nocc – The number of doubly occupied orbitals.

  • norb – The number of orbitals.

  • iw – The imaginary frequency.

Returns

The distributed preconditioners.

precond_trials(vectors, precond)

Applies preconditioner to distributed trial vectors.

Parameters
  • vectors – The set of vectors.

  • precond – The preconditioner.

Returns

The preconditioned gerade and ungerade trial vectors.

preconditioning(precond, v_in)

Applies preconditioner to a tuple of distributed trial vectors.

Parameters
  • precond – The preconditioner.

  • v_in – The input trial vectors.

Returns

A tuple of distributed trail vectors after preconditioning.

print_iteration(relative_residual_norm, xvs)

Prints information of the iteration.

Parameters
  • relative_residual_norm – Relative residual norms.

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

update_settings(rsp_dict, method_dict=None)

Updates response and method settings in C6 solver.

Parameters
  • rsp_dict – The dictionary of response dict.

  • method_dict – The dictionary of method settings.

veloxchem.checkpoint module

veloxchem.checkpoint.append_rsp_solution_hdf5(fname, key, vec)

Appends a solution vector to checkpoint file.

Parameters
  • fname – The name of the checkpoint file.

  • key – The key for the solution vector.

  • vec – The solution vector.

veloxchem.checkpoint.check_distributed_focks(fname, keys, freqs)

Checks validity of the checkpoint file for distributed Fock matrices.

Parameters
  • fname – Name of the checkpoint file.

  • keys – The keys.

  • freqs – The frequencies.

Returns

True if the checkpoint file is valid, False otherwise.

veloxchem.checkpoint.check_rsp_hdf5(fname, labels, molecule, basis, dft_dict, pe_dict)

Checks validity of the 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.

  • molecule – The molecule.

  • basis – The AO basis set.

  • dft_dict – The dictionary containing DFT information.

  • pe_dict – The dictionary containing PE information.

Returns

True if the checkpoint file is valid, False otherwise.

veloxchem.checkpoint.read_distributed_focks(fname, keys, freqs, comm, ostream)

Reads distributed Fock matrices from checkpoint file.

Parameters
  • fname – Name of the checkpoint file.

  • keys – The keys.

  • freqs – The frequencies.

  • comm – The MPI communicator.

  • ostream – The output stream.

Returns

A dictionary containing the distributed Fock matrices.

veloxchem.checkpoint.read_rsp_hdf5(fname, labels, molecule, basis, dft_dict, pe_dict, 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.

  • molecule – The molecule.

  • basis – The AO basis set.

  • dft_dict – The dictionary containing DFT information.

  • pe_dict – The dictionary containing PE information.

  • ostream – The output stream.

Returns

The trial vectors and transformed vectors.

veloxchem.checkpoint.write_distributed_focks(fname, focks, keys, freqs, comm, ostream)

Writes distributed Fock matrices to checkpoint file.

Parameters
  • fname – Name of the checkpoint file.

  • focks – The dictionary containing the distributed Fock matrices.

  • keys – The keys.

  • freqs – The frequencies.

  • comm – The MPI communicator.

  • ostream – The output stream.

Returns

True if checkpoint file is written. False if checkpoint file is not valid.

veloxchem.checkpoint.write_rsp_hdf5(fname, arrays, labels, molecule, basis, dft_dict, pe_dict, 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.

  • molecule – The molecule.

  • basis – The AO basis set.

  • dft_dict – The dictionary containing DFT information.

  • pe_dict – The dictionary containing PE information.

  • ostream – The output stream.

Returns

True if checkpoint file is written. False if checkpoint file is not valid.

veloxchem.cli module

veloxchem.cli.cli()

Generate command-line argument parser.

Returns

The parser.

veloxchem.cppsolver module

class veloxchem.cppsolver.ComplexResponse(comm=None, ostream=None)

Bases: veloxchem.linearsolver.LinearSolver

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.

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 a dictionarry containing solutions and kappa values when called from a non-linear response module.

get_full_solution_vector(solution)

Gets a full solution vector from the distributed solution.

Parameters

solution – The distributed solution as a tuple.

Returns

The full solution vector.

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

Constructs the preconditioners.

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 distributed preconditioners.

precond_trials(vectors, precond)

Applies preconditioner to distributed trial vectors.

Parameters
  • vectors – The set of vectors.

  • precond – The preconditioner.

Returns

The preconditioned gerade and ungerade trial vectors.

preconditioning(precond, v_in)

Applies preconditioner to a tuple of distributed trial vectors.

Parameters
  • precond – The preconditioner.

  • v_in – The input trial vectors.

Returns

A tuple of distributed trail vectors after preconditioning.

print_iteration(relative_residual_norm, xvs)

Prints information of the iteration.

Parameters
  • relative_residual_norm – Relative residual norms.

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

update_settings(rsp_dict, method_dict=None)

Updates response and method settings in complex liner response solver.

Parameters
  • rsp_dict – The dictionary of response dict.

  • method_dict – The dictionary of method settings.

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.deprecations module

veloxchem.distributedarray module

class veloxchem.distributedarray.DistributedArray(array, comm, distribute=True)

Bases: object

Impements distributed array.

Parameters
  • array – The numpy array stored on the master node.

  • comm – The communicator.

  • distribute – The flag for distributing the array via scatter.

Instance variable
  • comm: The communicator.

  • rank: The MPI rank.

  • nodes: Number of MPI processes.

  • data: The numpy array stored in the distributed array.

append(dist_array, axis=None)

Appends a distributed array to self.

Parameters
  • dist_array – The distributed array.

  • axis – The axis parameter as in numpy.append.

append_to_hdf5_file(fname, label)

Appends an array to checkpoint file.

Parameters
  • fname – The name of the checkpoint file.

  • label – The label for the array.

Returns

The time spent in writing to checkpoint file.

array()

Returns the numpy array stored in the object.

Returns

The numpy array.

dot(i, dist_array, j)

Returns the dot product between a column vector in self and a column vector in a distributed array.

Parameters
  • i – The column index in self.

  • dist_array – The distributed array.

  • j – The column index in dist_array.

Returns

The dot product.

get_column(col_index)

Gets a column as a distributed 1D array.

Parameters

col_index – The index of the column.

Returns

A distributed 1D array.

get_full_vector(col=None)

Gets a full column vector from a distributed array.

Param

col: The column index (used only when self.data.ndim is 2).

Returns

The full vector on the master node, None on other nodes.

matmul_AB_no_gather(array, factor=None)

Computes matrix-matrix multiplication between self and a numpy array that is available on all nodes.

Parameters
  • array – The numpy array.

  • factor – The factor to be multiplied to the result.

Returns

A distributed array.

matmul_AtB(dist_array, factor=None)

Computes matrix-matrix multiplication between self.T and a distributed array.

Parameters
  • dist_array – The distributed array.

  • factor – The factor to be multiplied to the result.

Returns

A numpy array on the master node, None on other nodes.

matmul_AtB_allreduce(dist_array, factor=None)

Computes matrix-matrix multiplication between self.T and a distributed array, and makes the result available on all nodes.

Parameters
  • dist_array – The distributed array.

  • factor – The factor to be multiplied to the result.

Returns

A numpy array that is available on all nodes.

norm(axis=None)

Returns the norm of the distributed array along axis.

Parameters

axis – The axis.

Returns

The norm along axis.

classmethod read_from_hdf5_file(fname, label, comm)

Reads an array from checkpoint file and returns a distributed array.

Parameters
  • fname – The name of the checkpoint file.

  • label – The label for the array.

  • comm – The communicator.

Returns

The distributed array.

shape(axis)

Returns the shape of the distributed array along axis.

Parameters

axis – The axis.

Returns

The shape along axis.

squared_norm(axis=None)

Returns the squared norm of the distributed array along axis.

Parameters

axis – The axis.

Returns

The squared norm along axis.

veloxchem.environ module

veloxchem.environ.get_basis_path()

Returns location of basis files within module.

Returns

The location of basis files within module.

veloxchem.environ.set_omp_num_threads(ncores=None)

Sets number of OpenMP threads.

Parameters

ncores – The number of cores available for OpenMP threads.

veloxchem.environ.set_vlxbasispath()

Sets location of basis files.

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=None, ostream=None)

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=None)

Updates settings in exciton model driver.

Parameters

exciton_dict – The settings dictionary.

veloxchem.gradientdriver module

class veloxchem.gradientdriver.GradientDriver(comm, ostream)

Bases: object

Implements gradient driver.

Parameters
  • comm – The MPI communicator.

  • ostream – The output stream.

Instance variables
  • gradient: The gradient.

  • flag: The type of gradient driver.

compute(molecule, ao_basis=None, min_basis=None)

Performs calculation of numerical gradient.

Parameters
  • molecule – The molecule.

  • ao_basis – The AO basis set.

  • min_basis – The minimal AO basis set.

get_gradient()

Gets the gradient.

Returns

The gradient.

print_geometry(molecule)

Prints the gradient.

Parameters

molecule – The molecule.

print_gradient(molecule, labels)

Prints the gradient.

Parameters
  • molecule – The molecule.

  • labels – The atom labels.

print_header()

Prints gradient calculation setup details to output stream.

veloxchem.inputparser module

exception veloxchem.inputparser.InputError

Bases: Exception

class veloxchem.inputparser.InputParser(inpname, 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
  • inpname – The name of the input file.

  • outname – The name of the output file.

Instance variables
  • input_dict: The input dictionary.

  • inpname: The name of the input file.

  • outname: The name of the output file.

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

  • basis_set_name: The name of the basis set.

get_dict()

Gets the input dictonary.

Returns

A dictionary containing all information form the input file.

parse()

Parses the input file.

veloxchem.inputparser.parse_bool(input_bool)

Parses input boolean.

Parameters

input_bool – The input.

Returns

A boolean.

veloxchem.inputparser.parse_input(obj, keyword_types, input_dictionary)

Parses input keywords for object. - ‘str’ for string input, such as ‘checkpoint_file: mycheckpoint.h5’ - ‘str_upper’ for uppercase string input, such as ‘qq_type: QQ_DEN’ - ‘str_lower’ for lowercase string input, such as ‘coordsys: tric’ - ‘int’ for integer input, such as ‘max_iter: 300’ - ‘float’ for floating-point input, such as ‘eri_thresh: 1.0e-12’ - ‘bool’ for floating-point input, such as ‘restart: no’ - ‘list’ for multi-line input, such as ‘constraints’ - ‘seq_fixed_int’ for fixed-length integer sequence, such as ‘cube_points: 80,80,80’ - ‘seq_fixed’ for fixed-length sequence, such as ‘cube_origin: 0.0,0.0,0.0’ - ‘seq_range’ for sequence with range, such as ‘frequencies: 0.0-0.1(0.02)’

Parameters
  • obj – The object.

  • keyword_types – The data type associated with keyword.

  • input_dictionary – The input dictionary.

veloxchem.inputparser.parse_list(input_list)

Parses input list.

Parameters

input_list – The input.

Returns

A list.

veloxchem.inputparser.parse_seq_fixed(input_seq, flag='float')

Parses input sequence that has fixed number of elements, using comma and/or white space as delimiter.

Parameters
  • input_seq – The input sequence.

  • flag – The flag for int/float.

Returns

A tuple.

veloxchem.inputparser.parse_seq_range(input_seq)

Parses input sequence that is specified by range. Input example: ‘0.0 - 0.2525 (0.0025), 0.5 - 1.0 (0.02), 2.0’

Parameters

input_seq – The input sequence.

Returns

A tuple.

veloxchem.inputparser.parse_str(input_str, flag=None)

Parses input string.

Parameters
  • input_str – The input.

  • flag – The flag for upper/lower case.

Returns

A string.

veloxchem.linearsolver module

class veloxchem.linearsolver.LinearSolver(comm, ostream)

Bases: object

Implements linear solver.

Parameters
  • comm – The MPI communicator.

  • use_split_comm – The flag for using split communicators.

Instance variables
  • eri_thresh: The electron repulsion integrals screening threshold.

  • qq_type: The electron repulsion integrals screening scheme.

  • batch_size: The batch size for computation of Fock matrices.

  • 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.

  • pe_options: The dictionary with options for polarizable embedding.

  • use_split_comm: The flag for using split communicators.

  • split_comm_ratio: The list of ratios for split communicators.

  • electric_field: The static electric field.

  • 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.

  • program_start_time: The start time of the program.

  • maximum_hours: The timelimit in hours.

  • timing: The flag for printing timing information.

  • profiling: The flag for printing profiling information.

  • memory_profiling: The flag for printing memory usage.

  • memory_tracing: The flag for tracing memory allocation.

  • filename: The filename.

  • dist_bger: The distributed gerade trial vectors.

  • dist_bung: The distributed ungerade trial vectors.

  • dist_e2bger: The distributed gerade sigma vectors.

  • dist_e2bung: The distributed ungerade sigma vectors.

  • nonlinear: The flag for running linear solver in nonlinear response.

  • dist_fock_ger: The distributed gerade Fock matrices in MO.

  • dist_fock_ung: The distributed ungerade Fock matrices in MO.

append_fock_matrices(fock_ger, fock_ung)

Appends distributed Fock matrices in MO.

Parameters
  • fock_ger – The distributed gerade Fock matrices in MO.

  • fock_ung – The distributed ungerade Fock matrices in MO.

append_sigma_vectors(e2bger, e2bung)

Appends distributed sigma (E2 b) vectors.

Parameters
  • e2bger – The distributed gerade sigma vectors.

  • e2bung – The distributed ungerade sigma vectors.

append_trial_vectors(bger, bung)

Appends distributed trial vectors.

Parameters
  • bger – The distributed gerade trial vectors.

  • bung – The distributed ungerade trial vectors.

check_convergence(relative_residual_norm)

Checks convergence.

Parameters

relative_residual_norm – Relative residual norms.

comp_lr_fock(fock, dens, molecule, basis, eri_dict, dft_dict, pe_dict, 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.

  • eri_dict – The dictionary containing ERI information.

  • dft_dict – The dictionary containing DFT information.

  • pe_dict – The dictionary containing PE information.

  • timing_dict – The dictionary containing timing information.

comp_lr_fock_split_comm(fock, dens, molecule, basis, eri_dict, dft_dict, pe_dict)

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.

  • eri_dict – The dictionary containing ERI information.

  • dft_dict – The dictionary containing DFT information.

  • pe_dict – The dictionary containing PE information.

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

Solves for the linear equations.

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, etc.

static 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.

decomp_grad(grad)

Decomposes gradient into gerade and ungerade parts.

Parameters

grad – The gradient.

Returns

A tuple containing gerade and ungerade parts of gradient.

e2n_half_size(vecs_ger, vecs_ung, molecule, basis, scf_tensors, eri_dict, dft_dict, pe_dict, 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.

  • molecule – The molecule.

  • basis – The AO basis set.

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

  • eri_dict – The dictionary containing ERI information.

  • dft_dict – The dictionary containing DFT information.

  • pe_dict – The dictionary containing PE information.

  • timing_dict – The dictionary containing timing information.

Returns

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

get_complex_prop_grad(operator, components, molecule, basis, scf_tensors)

Computes complex property gradients for 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.

Returns

The complex property gradients.

get_detach_attach_densities(z_mat, y_mat, mo_occ, mo_vir)

Gets the detachment and attachment densities.

Parameters
  • z_mat – The excitation vector in matrix form (N_occ x N_virt).

  • y_mat – The de-excitation vector in matrix form (N_occ x N_virt).

  • mo_occ – The MO coefficients of occupied orbitals.

  • mo_vir – The MO coefficients of virtual orbitals.

Returns

The detachment and attachment densities.

get_nto(t_mat, mo_occ, mo_vir)

Gets the natural transition orbitals.

Parameters
  • t_mat – The excitation vector in matrix form (N_occ x N_virt).

  • mo_occ – The MO coefficients of occupied orbitals.

  • mo_vir – The MO coefficients of virtual orbitals.

Returns

The lambda values (1D array) and the NTO coefficients (2D array).

get_precond(orb_ene, nocc, norb, w)
get_prop_grad(operator, components, molecule, basis, scf_tensors)

Computes property gradients for 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.

Returns

The property gradients.

graceful_exit(molecule, basis, dft_dict, pe_dict, labels)

Gracefully exits the program.

Parameters
  • molecule – The molecule.

  • basis – The basis set.

  • dft_dict – The dictionary containing DFT information.

  • pe_dict – The dictionary containing PE information.

  • labels – The list of labels.

Returns

The return code.

init_dft(molecule, scf_tensors)

Initializes DFT.

Parameters
  • molecule – The molecule.

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

Returns

The dictionary of DFT information.

init_eri(molecule, basis)

Initializes ERI.

Parameters
  • molecule – The molecule.

  • basis – The AO basis set.

Returns

The dictionary of ERI information.

init_pe(molecule, basis)

Initializes polarizable embedding.

Parameters
  • molecule – The molecule.

  • basis – The AO basis set.

Returns

The dictionary of polarizable embedding information.

static lrmat2vec(mat, nocc, norb)

Converts matrices to vectors.

Parameters
  • mat – The matrices.

  • nocc – Number of occupied orbitals.

  • norb – Number of orbitals.

Returns

The vectors.

static lrvec2mat(vec, nocc, norb)

Converts vectors to matrices.

Parameters
  • vec – The vectors.

  • nocc – Number of occupied orbitals.

  • norb – Number of orbitals.

Returns

The matrices.

need_graceful_exit(next_iter_in_hours)

Checks if a graceful exit is needed.

Param

next_iter_in_hours: The predicted time for the next iteration in hours.

Returns

True if a graceful exit is needed, False otherwise.

static normalize(vecs)

Normalizes vectors by dividing by vector norm.

Parameters
  • vecs – The vectors.

  • Retruns – The normalized vectors.

normalize_half_distributed(vecs)

Normalizes half-sized vectors by dividing by vector norm.

Parameters
  • vecs – The half-sized vectors.

  • Retruns – The normalized vectors.

static orthogonalize_gram_schmidt(tvecs)

Applies modified Gram Schmidt orthogonalization to trial vectors.

Parameters

tvecs – The trial vectors.

Returns

The orthogonalized trial vectors.

orthogonalize_gram_schmidt_half_distributed(tvecs)

Applies modified Gram Schmidt orthogonalization to trial vectors.

Parameters

tvecs – The trial vectors.

Returns

The orthogonalized trial vectors.

precond_trials(vectors, precond)

Applies preconditioner to trial vectors.

Parameters
  • vectors – The set of vectors.

  • precond – The preconditioner.

Returns

The preconditioned trial vectors.

preconditioning(precond, v_in)
print_convergence(title)

Prints information after convergence.

Parameters

title – The name of the solver.

print_header(title, nstates=None, n_freqs=None, n_points=None)

Prints linear response solver setup header to output stream.

Parameters
  • title – The name of the solver.

  • nstates – The number of excited states (TDA/RPA).

  • n_freqs – The number of frequencies (LR/CPP).

  • n_points – The number of integration points (C6).

print_iteration(relative_residual_norm, xvs)
read_vectors(rsp_vector_labels)

Reads vectors from checkpoint file.

Parameters

rsp_vector_labels – The list of labels of vectors.

static 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.

remove_linear_dependence_half_distributed(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.

setup_trials(vectors, precond, dist_bger=None, dist_bung=None, renormalize=True)

Computes orthonormalized trial vectors.

Parameters
  • vectors – The set of vectors.

  • precond – The preconditioner.

  • dist_bger – The distributed gerade subspace.

  • dist_bung – The distributed ungerade subspace.

  • renormalize – The flag for normalization.

Returns

The orthonormalized gerade and ungerade trial vectors.

update_settings(rsp_dict, method_dict=None)

Updates response and method settings in linear solver.

Parameters
  • rsp_dict – The dictionary of response dict.

  • method_dict – The dictionary of method settings.

write_checkpoint(molecule, basis, dft_dict, pe_dict, labels)

Writes checkpoint file.

Parameters
  • molecule – The molecule.

  • basis – The basis set.

  • dft_dict – The dictionary containing DFT information.

  • pe_dict – The dictionary containing PE information.

  • labels – The list of labels.

write_detach_attach_cubes(cubic_grid, molecule, basis, root, dens_DA)

Writes cube files for detachment and attachment densities.

Parameters
  • cubic_grid – The cubic grid.

  • molecule – The molecule.

  • basis – The AO basis set.

  • root – The index of the root (0-based).

  • dens_DA – The AODensityMatrix object containing detachment and attachment densities.

Returns

The list containing the names of the cube files.

write_nto_cubes(cubic_grid, molecule, basis, root, lam_diag, nto_mo, nto_pairs=None, nto_thresh=0.1)

Writes cube files for natural transition orbitals.

Parameters
  • cubic_grid – The cubic grid.

  • molecule – The molecule.

  • basis – The AO basis set.

  • root – The index of the root (0-based).

  • lam_diag – The lambda values (1D array).

  • nto_mo – The NTO coefficients (2D array).

  • nto_pairs – The number of NTO pairs.

  • nto_thresh – The threshold for writing NTO to cube file.

Returns

The list containing the names of the cube files.

veloxchem.loprop module

class veloxchem.loprop.LoPropDriver(task)

Bases: object

compute()
count_contracted()
get_coordinates()
get_cpa()
get_opa()

Returns list of occupied for case of single atom i.e. first row 1s, second row 1s, 2s, 2p, whole shell

save_coordinates()
save_density()
save_orbital_info()
save_overlap()
update_settings()
veloxchem.loprop.count_contracted(atombasis: list) → dict

Given atomic block in basis filei format return dict which maps angular momentum to number of contracted >>> count_contracted(‘S: 1 1

1.0 1.9 ‘)

{‘S’: 1}

veloxchem.loprop.count_contracted_on_atom(atombasis: dict) → int

Returns total contracted given angular momentum count >>> count_contracted_on_atom({‘S’: 1}) 1 >>> count_contracted_no_atom({‘S’: 2, ‘P’: 1}) 5

veloxchem.loprop.get_basis_file(basis)

veloxchem.lreigensolver module

class veloxchem.lreigensolver.LinearResponseEigenSolver(comm=None, ostream=None)

Bases: veloxchem.linearsolver.LinearSolver

Implements linear response eigensolver.

Parameters
  • comm – The MPI communicator.

  • ostream – The output stream.

Instance variables
  • nstates: Number of excited states.

  • nto: The flag for natural transition orbital analysis.

  • nto_pairs: The number of NTO pairs in NTO analysis.

  • detach_attach: The flag for detachment/attachment density analysis.

  • cube_origin: The origin of cubic grid points.

  • cube_stepsize: The step size of cubic grid points in X, Y and Z directions.

  • cube_points: The number of cubic grid points in X, Y and Z directions.

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.

get_e2(molecule, basis, scf_tensors)

Calculates the E[2] matrix.

Parameters
  • molecule – The molecule.

  • basis – The AO basis set.

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

Returns

The E[2] matrix as numpy array.

get_full_solution_vector(solution)

Gets a full solution vector from the distributed solution.

Parameters

solution – The distributed solution as a tuple.

Returns

The full solution vector.

get_precond(orb_ene, nocc, norb, w)

Constructs the preconditioners.

Parameters
  • orb_ene – The orbital energies.

  • nocc – The number of doubly occupied orbitals.

  • norb – The number of orbitals.

  • w – The frequency.

Returns

The distributed preconditioners.

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 distributed vector).

precond_trials(excitations, precond)

Applies preconditioner to distributed trial vectors.

Parameters
  • excitations – The set of excitations.

  • precond – The preconditioner.

Returns

The preconditioned gerade and ungerade trial vectors.

preconditioning(precond, v_in)

Applies preconditioner to a tuple of distributed trial vectors.

Parameters
  • precond – The preconditioner.

  • v_in – The input trial vectors.

Returns

A tuple of distributed trail vectors after preconditioning.

print_iteration(relative_residual_norm, ws)

Prints information of the iteration.

Parameters
  • relative_residual_norm – Relative residual norms.

  • ws – Excitation energies.

update_settings(rsp_dict, method_dict=None)

Updates response and method settings in linear response eigensolver.

Parameters
  • rsp_dict – The dictionary of response dict.

  • method_dict – The dictionary of method settings.

veloxchem.lrsolver module

class veloxchem.lrsolver.LinearResponseSolver(comm=None, ostream=None)

Bases: veloxchem.linearsolver.LinearSolver

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.

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 response functions, solutions and a dictionarry containing solutions and kappa values when called from a non-linear response module.

get_full_solution_vector(solution)

Gets a full solution vector from the distributed solution.

Parameters

solution – The distributed solution as a tuple.

Returns

The full solution vector.

get_precond(orb_ene, nocc, norb, w)

Constructs the preconditioners.

Parameters
  • orb_ene – The orbital energies.

  • nocc – The number of doubly occupied orbitals.

  • norb – The number of orbitals.

  • w – The frequency.

Returns

The distributed preconditioners.

precond_trials(vectors, precond)

Applies preconditioner to distributed trial vectors.

Parameters
  • vectors – The set of vectors.

  • precond – The preconditioner.

Returns

The preconditioned gerade and ungerade trial vectors.

preconditioning(precond, v_in)

Applies preconditioner to a tuple of distributed trial vectors.

Parameters
  • precond – The preconditioner.

  • v_in – The input trial vectors.

Returns

A tuple of distributed trail vectors after preconditioning.

print_iteration(relative_residual_norm, xvs)

Prints information of the iteration.

Parameters
  • relative_residual_norm – Relative residual norms.

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

update_settings(rsp_dict, method_dict=None)

Updates response and method settings in linear response solver.

Parameters
  • rsp_dict – The dictionary of response dict.

  • method_dict – The dictionary of method settings.

veloxchem.mointsdriver module

class veloxchem.mointsdriver.MOIntegralsDriver(comm=None, ostream=None)

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=None, ostream=None)

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, method_dict=None)

Updates settings in MP2 driver.

Parameters
  • mp2_dict – The dictionary of MP2 settings.

  • method_dict – The dictionary of method.

veloxchem.mpitask module

class veloxchem.mpitask.MpiTask(fname_list, mpi_comm=None)

Bases: object

Implements the MPI task.

Parameters
  • fname_list – List of the input/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.optimizationdriver module

class veloxchem.optimizationdriver.OptimizationDriver(filename, grad_drv, flag)

Bases: object

Implements optimization driver.

Parameters
  • comm – The MPI communicator.

  • ostream – The output stream.

Instance variables
  • rank: The rank of MPI process.

  • coordsys: The coordinate system.

  • constraints: The constraints.

  • check_interval: The interval (number of steps) for checking coordinate system.

  • max_iter: The maximum number of optimization steps

  • filename: The filename that will be used by geomeTRIC.

  • grad_drv: The gradient driver.

  • flag: The type of the optimization driver.

clean_up_file(*path_list)

Cleans up existing geomeTRIC file.

Parameters

path_list – A list contains the path to the file.

compute(molecule, ao_basis, min_basis=None)

Performs geometry optimization.

Parameters
  • molecule – The molecule.

  • ao_basis – The AO basis set.

  • min_basis – The minimal AO basis set.

Returns

The molecule with final geometry.

print_header()

Prints header for optimization driver.

print_ic_rmsd(opt_mol, ref_mol)

Prints statistical deviation of bonds, angles and dihedral angles between the optimized geometry and reference geometry.

Parameters
  • opt_mol – The optimized molecule.

  • ref_mol – The reference molecule (or xyz filename).

print_opt_result(progress)

Prints summary of geometry optimization.

Parameters

progress – The geomeTRIC progress of geometry optimization.

print_scan_result(progress)

Prints summary of geometry scan.

Parameters

progress – The geomeTRIC progress of geometry scan.

print_vib_analysis(vdata_label)

Prints summary of vibrational analysis.

Parameters

vdata_label – The label of vdata filename.

update_settings(opt_dict)

Updates settings in optimization driver.

Parameters

opt_dict – The input dictionary of optimize group.

write_log_ini(fname)

veloxchem.optimizationengine module

veloxchem.optimizationengine.OptimizationEngine = <MagicMock spec='str' id='140500758125368'>

veloxchem.outputstream module

class veloxchem.outputstream.OutputStream(stream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>, 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.

close()

Closes the output 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, pe_dict, comm=None)

Bases: object

Implements interface to the CPPE library.

Parameters
  • molecule – The molecule.

  • basis – The AO basis set.

  • pe_dict – The dictionary with options for CPPE.

  • comm – The MPI communicator.

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 dictionary with options for CPPE.

  • cppe_state: The CPPE state object.

  • polarizable_coords: The coordinates of the polarizable sites.

check_cppe_version()

Checks the version of CPPE.

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_cppe_version()

Gets the version of CPPE.

Returns

The version of CPPE.

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.

update_options(pe_dict)

Updates PE options based on the input dictionary.

Parameters

pe_dict – The dictionary with options for CPPE.

veloxchem.profiler module

class veloxchem.profiler.Profiler(settings=None)

Bases: object

Impements multifunctional profiler.

Parameters

settings – The dictionary of profiler settings.

Instance variable
  • timing: The flag for printing timing information.

  • profiling: The flag for printing profiling information.

  • memory_profiling: The flag for printing memory usage.

  • memory_tracing: The flag for tracing memory allocation using

  • start_time: The starting time.

  • start_avail_mem: The starting available memory.

  • timing_list: The list containing information about timing.

  • memory_usage: The list containing information about memory usage.

  • pr: The Profile object.

begin(settings)

Starts the multifunctional profiler.

Parameters

settings – The dictionary containing profiler settings.

check_memory_usage(remark='')

Checks memory usage.

Parameters

remark – Descriptive text about the point of checking.

comp_memory_object(obj, counted_ids=None)

Computes the memory usage of an object recursively.

Parameters
  • obj – The object.

  • counted_ids – The list of id’s of counted objects.

Returns

The memory usage in bytes.

end(ostream, scf_flag=False)

Stops the profiler and print the output.

Parameters
  • ostream – The output stream.

  • scf_flag – The flag for SCF.

get_available_memory()

Gets available memory as text string.

Returns

The amount of available memory as text string.

get_memory_dictionary(d)

Gets memory usage of a dictionary.

Parameters

d – The dictionary.

Returns

Memory usage of the dictionary and the list of memory usage of each item.

get_memory_object(obj)

Gets memory usage of an object as text string.

Parameters

obj – The object.

Returns

The amount of memory usage of the object as text string.

memory_to_string(memsize)

Gets memory size as text string.

Parameters

memsize – The memory size.

Returns

The text string for memory size.

print_memory_subspace(d, ostream)

Prints memory usage in subspace solver.

Parameters
  • d – The dictionary containing the data used in subspace.

  • ostream – The output stream.

print_memory_tracing(ostream)

Prints memory tracing output.

Parameters

ostream – The output stream.

print_memory_usage(ostream, scf_flag=False)

Prints memory usage.

Parameters
  • ostream – The output stream.

  • scf_flag – The flag for SCF.

print_profiling_summary(ostream)

Prints profiling summary.

Parameters

ostream – The output stream.

print_timing(ostream, scf_flag=False)

Prints timing.

Parameters
  • ostream – The output stream.

  • scf – The flag for SCF.

start_timer(iteration, label)

Starts the timer for an iteration and a label.

Parameters
  • iteration – The iteration.

  • label – The label.

stop_timer(iteration, label)

Stops the timer for an iteration and a label.

Parameters
  • iteration – The iteration.

  • label – The label.

update_timer(iteration, timing_dict)

Updates the timer with a dictionary of timing information.

Parameters
  • iteration – The iteration.

  • timing_dict – The dictionary containing timing information.

veloxchem.pulsedrsp module

class veloxchem.pulsedrsp.PulsedResponse(comm=None, ostream=None)

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.

print_header()

Prints Pulsed Lionear Response calculation setup details to output stream.

update_settings(settings, cpp_settings, method_settings=None)

Updates settings in PulsedRespnse

Parameters
  • settings – The settings dictionary for the driver.

  • cpp_settings – The settings dictionary for complex response driver.

  • method_settings – The dictionary of method settings.

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. 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.

Parameters

fname – Name of the checkpoint file.

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=None)

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=None)

Bases: veloxchem.rspproperty.ResponseProperty

Implements the C6 dispersion coefficient 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.

static 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=None)

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.rspcustomproperty module

class veloxchem.rspcustomproperty.CustomProperty(rsp_dict, method_dict=None)

Bases: veloxchem.rspproperty.ResponseProperty

Implements a custom, user-defined 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 custom 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.

  • ostream: The output stream.

  • is_converged: The flag for convergence.

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=None)

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=None)

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=None)

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=None)

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)

Computes response property/spectroscopy.

Parameters
  • molecule – The molecule.

  • basis – The AO basis set.

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

converged()

Checks if the response calculation is converged.

Returns

True if the response calculation is converged, False otherwise.

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.rsptpa module

class veloxchem.rsptpa.TPA(rsp_dict, method_dict=None)

Bases: veloxchem.rspproperty.ResponseProperty

Implements the cubic Two-photon abs 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.

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.

  • 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.

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

  • restricted: The flag for restricted SCF.

  • dispersion: The flag for calculating D4 dispersion correction.

  • 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.

  • pe_options: The dictionary with options 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.

  • dispersion: The flag for calculating D4 dispersion correction.

  • d4_energy: The D4 dispersion correction to energy.

  • electric_field: The static electric field.

  • ef_nuc_energy: The electric potential energy of the nuclei in the static electric field.

  • dipole_origin: The origin of the dipole operator.

  • timing: The flag for printing timing information.

  • profiling: The flag for printing profiling information.

  • memory_profiling: The flag for printing memory usage.

  • memory_tracing: The flag for tracing memory allocation using

add_iter_data(d)

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

Parameters

d – The dictionary containing SCF iteration data.

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, profiler)

Performs SCF calculation with C2-DIIS acceleration.

Parameters
  • molecule – The molecule.

  • ao_basis – The AO basis set.

  • min_basis – The minimal AO basis set.

  • profiler – The profiler.

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

Computes the sum of 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 sum of electronic energy, kinetic energy and 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.

graceful_exit(molecule, basis)

Gracefully exits the program.

Parameters
  • molecule – The molecule.

  • basis – The basis set.

Returns

The return code.

need_graceful_exit(iter_in_hours)

Checks if a graceful exit is needed.

Parameters

iter_in_hours – The time spent in one iteration (in hours).

Returns

True if a graceful exit is needed, False otherwise.

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.

set_skip_iter_flag(e_grad)

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

Parameters

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=None)

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.scffirstorderprop module

class veloxchem.scffirstorderprop.ScfFirstOrderProperties(comm=None, ostream=None)

Bases: object

Implements SCF first-order properties.

Parameters
  • comm – The MPI communicator.

  • ostream – The output stream.

Instance variables:
  • properties: The dictionary of properties.

compute(molecule, basis, scf_tensors)

Computes SCF first-order properties.

Parameters
  • molecule – The molecule

  • basis – The AO basis set.

  • scf_tensors – The tensors from the converged SCF calculation.

get_property(key)

Gets SCF first-order property.

Parameters

key – The name of the property.

Returns

The property.

print_properties(molecule)

Prints SCF first-order properties.

Parameters

molecule – The molecule.

veloxchem.scfgradientdriver module

class veloxchem.scfgradientdriver.ScfGradientDriver(scf_drv, comm=None, ostream=None)

Bases: veloxchem.gradientdriver.GradientDriver

Implements SCF gradient driver.

Parameters
  • scf_drv – The SCF driver.

  • comm – The MPI communicator.

  • ostream – The output stream.

Instance variables
  • scf_drv: The SCF driver.

  • delta_h: The displacement for finite difference.

compute(molecule, ao_basis, min_basis=None)

Performs calculation of numerical gradient.

Parameters
  • molecule – The molecule.

  • ao_basis – The AO basis set.

  • min_basis – The minimal AO basis set.

veloxchem.scfrestdriver module

class veloxchem.scfrestdriver.ScfRestrictedDriver(comm=None, ostream=None)

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=None, ostream=None)

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.

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.signalhandler module

class veloxchem.signalhandler.SignalHandler

Bases: object

Impements signal handler.

Instance variable
  • func: The exit function.

  • args: The arguments for the exit function.

  • original_sigterm_handler: The original SIGTERM handler.

add_sigterm_function(func, *args)

Sets the handler for SIGTERM.

Parameters
  • func – The exit function.

  • args – The arguments for the exit function.

remove_sigterm_function()

Resets the handler for SIGTERM.

sigterm_handler(signum, frame)

Handles the SIGTERM signal.

Parameters
  • signum – The signum parameter as in the handler function.

  • frame – The frame parameter as in the handler function.

veloxchem.slurminfo module

veloxchem.slurminfo.executable_in_path(executable)

Checks if the executable is in PATH.

Parameters

executable – The executable.

Returns

True if the executable is in PATH, False otherwise.

veloxchem.slurminfo.get_command_output(command)

Gets the output of a command.

Parameters

command – The command as a list of strings.

Returns

The output as a string.

veloxchem.slurminfo.get_slurm_job_id()

Gets SLURM job ID as a string.

veloxchem.slurminfo.get_slurm_maximum_hours()

Gets SLURM timelimit in hours.

Returns

The SLURM timelimit in hours (None if not a SLURM job).

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=None, ostream=None)

Bases: veloxchem.linearsolver.LinearSolver

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.

  • solver: The eigenvalues solver.

  • nto: The flag for natural transition orbital analysis.

  • nto_pairs: The number of NTO pairs in NTO analysis.

  • detach_attach: The flag for detachment/attachment density analysis.

  • cube_origin: The origin of cubic grid points.

  • cube_stepsize: The step size of cubic grid points in X, Y and Z directions.

  • cube_points: The number of cubic grid points in X, Y and Z directions.

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_onee_integrals(molecule, basis)

Computes one-electron integrals.

Parameters
  • molecule – The molecule.

  • basis – The AO basis set.

Returns

The one-electron integrals.

comp_trans_dipoles(integrals, eigvals, eigvecs, mo_occ, mo_vir)

Computes transition dipole moments.

Parameters
  • integrals – The one-electron integrals.

  • eigvals – The eigenvalues.

  • eigvecs – The CI vectors.

  • mo_occ – The occupied MO coefficients.

  • mo_vir – The virtual MO coefficients.

Returns

The transition dipole moments.

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.

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_mat, tensors, molecule)

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

Parameters
  • trial_mat – The matrix containing the Z vectors as columns.

  • 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_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=None)

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.tpadriver module

class veloxchem.tpadriver.TpaDriver(comm, ostream)

Bases: object

Implements the isotropic cubic response driver for two-photon absorption (TPA)

Parameters
  • comm – The MPI communicator.

  • ostream – The output stream.

Instance variables
  • is_converged: The flag for convergence.

  • eri_thresh: The electron repulsion integrals screening threshold.

  • qq_type: The electron repulsion integrals screening scheme.

  • batch_size: The batch size for computation of Fock matrices.

  • frequencies: The frequencies.

  • comp: The list of all the gamma tensor components

  • damping: The damping parameter.

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

  • conv_thresh: The convergence threshold for the solver.

  • max_iter: The maximum number of solver 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: The name of checkpoint file.

  • program_start_time: The start time of the program.

  • maximum_hours: The timelimit in hours.

  • timing: The flag for printing timing information.

  • profiling: The flag for printing profiling information.

  • memory_profiling: The flag for printing memory usage.

  • memory_tracing: The flag for tracing memory allocation.

a2_contract(k, A, D, nocc, norb)

Contracts the generalized dipole gradient tensor of rank 2 with a second-order response matrix. A[2]N1 = -(1 / 2)[[k1,X],D.T]

# Note that the sign needs further investigation.

Param

k: Respose vector in matrix representation

Parameters
  • A – Property operator in matrix represatiation

  • D – Density matrix

  • nocc – Number of occupied orbitals

  • norb – Number of total orbtials

Returns

Returns a matrix

a3_contract(k1, k2, A, D, nocc, norb)

Contracts the generalized dipole gradient tensor of rank 3 with two first-order response matrices. A[3]N1N2 = -(1/6)[[k2,[k1,A]],D.T]

Param

k1: First-order response matrix

Param

k2: First-order response matrix

Parameters
  • A – A dipole intergral matrix

  • D – Density matrix

  • nocc – Number of occupied orbitals

  • norb – Number of total orbtials

Returns

Returns a matrix

anti_sym(vec)

Returns an antisymetrized vector

Parameters

vec – The vector to be anti-symetrized

Returns

An antisymetrized vector

ao2mo(mo, A)

Transform a matrix to molecular basis

Parameters
  • mo – molecular orbital coefficent matrix

  • A – The matrix in AO basis that is the converted to MO basis

Returns

The matrix in MO basis

collect_vectors_in_columns(sendbuf)

Collects vectors into 2d array (column-wise).

Parameters

sendbuf – The 2d array containing the vector segments in columns.

Returns

A 2d array containing the full vectors in columns.

commut(A, B)

Commutes two matricies A and B

Parameters
  • A – Matrix A.

  • B – Matrix B.

Returns

AB - BA

compute(molecule, ao_basis, scf_tensors)

Computes the isotropic cubic response function for two-photon absorption

Parameters
  • molecule – The molecule.

  • basis – The AO basis.

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

Returns

A dictonary containing the isotropic T[4], T[3], X[3], A[3], X[2], A[2] contractions and the isotropic cubic response functions for TPA

compute_tpa_components(Focks, w, X, d_a_mo, kX, track, scf_tensors, molecule, ao_basis, profiler)

Computes all the relevent terms to third-order isotropic gradient

Parameters
  • w – A list of all the frequencies

  • X – A dictonary of matricies containing all the dipole integrals

  • d_a_mo – The SCF density in MO basis

  • kX – A dictonary containing all the response matricies

  • track – A list that contains all the information about which γ components and at what freqs they are to be computed

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

  • molecule – The molecule.

  • basis – The AO basis.

  • profiler – The profiler.

Returns

A dictionary containing all the relevent terms to third-order isotropic gradient

flip_xy(X)

Swaps upper and lower parts of a response vector. This is used when rewriting the R^[4] tensor contraction in terms of S^[4] tensor contractions.

Parameters

X – A response vector v = (Z,-Y^*)

Returns

A response vector of the form v’ = (-Y^*,Z)

flip_yz(X)

This method takes a first-order response vector with a given sign of the frequency and returns the first-order response vector with reversed frequency argument.

Parameters

X – A response vector N(ω,x) = (Z,-Y^*)

Returns

A response vector with reversed optical frequency N(-ω,x) = (Y,-Z^*)

get_Nxy(w, d_a_mo, X, fock_dict, kX, nocc, norb, molecule, ao_basis, scf_tensors)

Computes all the second-order response vectors needed for the isotropic cubic response computation

Parameters
  • w – A list of all the frequencies

  • d_a_mo – The density matrix in MO basis

  • X – Dipole integrals

  • fock_dict – A dictonary containing all the Fock matricies

  • kX – A dictonary containg all the response matricies

  • nocc – The number of occupied orbitals

  • norb – The number of total orbitals

  • molecule – The molecule.

  • basis – The AO basis.

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

Returns

A dictonary of Fock matrices from the subspace,second-order response vectors and second-order response matrices

get_comp(freqs)

Makes a list of all the gamma tensor components that are to be computed for printing purposes and for the contraction of X[3],X[2],A[3],A[2]

Parameters

freqs – A list of all the frequencies for the TPA calculation

Returns

A list of gamma tensors components inlcuded in the isotropic cubic response with their corresponding frequencies

get_densities(wi, kX, S, D0, mo)

Computes the compounded densities needed for the compounded Fock matrics F^{σ},F^{λ+τ},F^{σλτ} used for the isotropic cubic response function

Parameters
  • wi – A list of the frequencies

  • kX – A dictonary with all the first-order response matrices

  • S – The overlap matrix

  • D0 – The SCF density matrix in AO basis

  • mo – A matrix containing the MO coefficents

Returns

A list of tranformed compounded densities

get_densities_II(wi, kX, kXY, S, D0, mo)

Computes the compounded densities needed for the compounded second-order Fock matrics used for the isotropic cubic response function

Parameters
  • wi – A list of the frequencies

  • kX – A dictonary with all the first-order response matrices

  • kXY – A dict of the two index response matrices

  • S – The overlap matrix

  • D0 – The SCF density matrix in AO basis

  • mo – A matrix containing the MO coefficents

Returns

A list of tranformed compounded densities

get_e3(wi, kX, kXY, fo, fo2, nocc, norb)

Contracts E[3]

Parameters
  • wi – A list of freqs

  • kX – A dict of the single index response matricies

  • kXY – A dict of the two index response matrices

  • fo – A dictonary of transformed Fock matricies from fock_dict

  • fo2 – A dictonarty of transfromed Fock matricies from fock_dict_two

  • nocc – The number of occupied orbitals

  • norb – The total number of orbitals

Returns

A dictonary of compounded E[3] tensors for the isotropic cubic response function for TPA

get_e4(wi, kX, fo, nocc, norb)

Contracts E[4]NxNyNz for the isotropic cubic response function. Takes the Fock matrices from fock_dict and contracts them with the response vectors.

Parameters
  • wi – A list of freqs

  • kX – A dict of the single index response matricies

  • fo – A dictonary of transformed Fock matricies from fock_dict

  • nocc – The number of occupied orbitals

  • norb – The total number of orbitals

Returns

A dictonary of compounded E[4] tensors for the isotropic cubic response function for TPA

get_fock_dict(wi, density_list, F0, mo, molecule, ao_basis)

Computes the compounded Fock matrics F^{σ},F^{λ+τ},F^{σλτ} used for the isotropic cubic response function

Parameters
  • wi – A list of the frequencies

  • density_list – A list of tranformed compounded densities

  • F0 – The Fock matrix in MO basis

  • mo – A matrix containing the MO coefficents

  • molecule – The molecule

  • ao_basis – The AO basis set

Returns

A dictonary of compounded first-order Fock-matrices

get_fock_dict_II(wi, density_list, mo, molecule, ao_basis)

Computes the compounded second-order Fock matrics used for the isotropic cubic response function

Parameters
  • wi – A list of the frequencies

  • density_list – A list of tranformed compounded densities

  • mo – A matrix containing the MO coefficents

  • molecule – The molecule

  • ao_basis – The AO basis set

Returns

A dictonary of compounded second-order Fock-matrices

get_fock_r(mo, D, molecule, ao_basis, fock_flag)

Computes and returns a list of Fock matrices

Parameters
  • mo – The MO coefficients

  • D – A list of densities

  • molecule – The molecule

  • ao_basis – The AO basis set

  • fock_flag – The type of Fock matrices

Returns

A list of Fock matrices

get_other_terms(wi, track, X, kX, kXY, da, nocc, norb)

Computes the terms involving X[3],A[3],X[2],A[2] in the isotropic cubic response function

Parameters
  • wi – A list containing all the frequencies

  • track – A list that contains information about what γ components that are to be computed and which freqs

  • X – A dictonray with all the property integral matricies

  • kX – A dictonary with all the respone matricies

  • kXY – A dictonary containing all the two-index response matricies

  • da – The SCF density matrix in MO basis

  • nocc – The number of occupied orbitals

  • norb – The total number of orbitals

Returns

A dictonary of final X[2],A[2] contraction values

get_t3(freqs, e3_dict, kX, track, nocc, norb)

Computes the T[3] contraction, for HF S[3] = 0, R[3] = 0 such that the T[3] contraction for the isotropic cubic response function in terms of compounded Fock matrices is given as:

[(ζ_{α}^{σσ} + ζ_{α}^{λλ+ττ} + f_{α}^{λσ,τ})_is]

t3term = Σ_{α} N_{α} [(ζ_{α}^{σσ} + ζ_{α}^{λλ+ττ} + f_{α}^{λσ,τ})_si]

For more details see article

Parameters
  • freqs – List of frequencies of the pertubations

  • e3_dict – A dictonary that contains the contractions of E[3]

  • kX – A dictonray containng all the response matricies

  • track – A list containing information about what tensor components that are being computed

  • nocc – The number of occupied orbitals

  • norb – The total number of orbitals

Returns

A dictonary of the final values for the NaT[3]NxNyz contractions

get_t4(wi, e4_dict, kX, track, da, nocc, norb)

Computes the contraction of the E[4] tensor with that of the S[4] and R[4] tensors to return the contraction of T[4] as a dictonary of vectors. T[4]NxNyNz = (E^[4]-ω_1S^[4]-ω_1S^[4]-ω_3S^[4]-γiR^[4])

Parameters
  • wi – A list of all the freqs

  • e4_dict – A dictonary of all the E[4] contraction

  • kX – A dictonray containng all the response matricies

  • track – A list containg information about all the γ components that are to be computed

  • da – The SCF density matrix in MO basis

  • nocc – The number of occupied orbitals

  • norb – The total number of orbitals

Returns

A dictonary of final T[4] contraction values

get_two_el_fock_mod_r(mo, molecule, ao_basis, dabs)

Returns the two-electron part of the Fock matix in MO basis

Parameters
  • mo – The MO coefficients

  • molecule – The molecule

  • ao_basis – The AO basis set

  • dabs – A list of densitiy matrices

Returns

A tuple containing the two-electron part of the Fock matix (in MO basis)

get_x2_a2(inp_dict, da, nocc, norb)

Computes X[2] and A[2] contributions.

Parameters
  • inp_dict – A dictionary containing input data for computing X[2] and A[2].

  • da – The SCF density matrix in MO basis

  • nocc – The number of occupied orbitals

  • norb – The total number of orbitals

Returns

A dictionary containing frequencies, X[2] and A[2].

get_x3_a3(inp_dict, da, nocc, norb)

Computes X[3] and A[3] contributions.

Parameters
  • inp_dict – A dictionary containing input data for computing X[3] and A[3].

  • da – The SCF density matrix in MO basis

  • nocc – The number of occupied orbitals

  • norb – The total number of orbitals

Returns

A dictionary containing frequencies, X[3] and A[3].

mo2ao(mo, A)

Transform a matrix to atomic basis

Parameters
  • mo – molecular orbital coefficent matrix

  • A – The matrix in MO basis that is the converted to AO basis

Returns

The matrix in AO basis

phi(kA, kB, Fb, F0)

Returns a matrix used for the E[3] contraction

Parameters
  • kA – First-order or Second-order response matrix

  • kB – First-order or Second-order response matrix

  • Fa – First-order or Second-order perturbed Fock matrix

  • Fb – First-order or Second-order perturbed Fock matrix

  • F0 – SCF Fock matrix

Returns

Returns a matrix

print_component(label, freq, value, width)

Prints TPA component.

Parameters
  • label – The label

  • freq – The frequency

  • value – The complex value

  • width – The width for the output

print_fock_header()

Prints header for Fock computation

print_fock_time(time)

Prints time for Fock computation

Parameters

time – Total time to compute Fock matrices

print_header()

Prints TPA setup header to output stream.

print_results(freqs, gamma, comp, t4_dict, t3_dict, tpa_dict)

Prints the results from the TPA calculation.

Parameters
  • freqs – List of frequencies

  • gamma – A dictonary containing the isotropic cubic response functions for TPA

  • comp – List of gamma tensors components

  • t4_dict – A dictonary containing the isotropic T[4] contractions

  • t3_dict – A dictonary containing the isotropic T[3] contractions

  • tpa_dict – A dictonary containing the isotropic X[3], A[3], X[2], A[2] contractions

transform_dens(k, D, S)

Creates the perturbed density

Parameters
  • k – Response vector in matrix form in AO basis

  • D – The density that is to be perturbed in AO basis

  • S – Overlap matrix

Returns

[k,D]

update_settings(rsp_dict, method_dict=None)

Updates response and method settings in TPA driver

Parameters
  • rsp_dict – The dictionary of response dict.

  • method_dict – The dictionary of method settings.

x2_contract(k, X, D, nocc, norb)

Contracts the generalized dipole gradient tensor of rank 2 with a second-order response matrix. X[2]N1 = [[k1,X],D.T]

Param

k: Respose vector in matrix representation

Parameters
  • X – Property operator in matrix represatiation

  • D – Density matrix

  • nocc – Number of occupied orbitals

  • norb – Number of total orbtials

Returns

Returns a matrix

x3_contract(k1, k2, X, D, nocc, norb)

Contracts the generalized dipole gradient tensor of rank 3 with two first-order response matrices. X[3]N1N2 = (1/2)[[k2,[k1,X]],D.T]

Param

k1: First-order response matrix

Param

k2: First-order response matrix

Parameters
  • X – Dipole intergral matrix

  • D – Density matrix

  • nocc – Number of occupied orbitals

  • norb – Number of total orbtials

Returns

Returns a matrix

xi(kA, kB, Fa, Fb, F0)

Returns a matrix used for the E[4] contraction

Parameters
  • kA – First-order response matrix

  • kB – First-order response matrix

  • Fa – First-order perturbed Fock matrix

  • Fb – First-order perturbed Fock matrix

  • F0 – SCF Fock matrix

Returns

Returns a matrix

veloxchem.tpafulldriver module

class veloxchem.tpafulldriver.TpaFullDriver(comm=None, ostream=None)

Bases: veloxchem.tpadriver.TpaDriver

Implements the full isotropic cubic response driver for two-photon absorption (TPA)

Parameters
  • comm – The MPI communicator.

  • ostream – The output stream.

get_Nxy(w, d_a_mo, X, fock_dict, kX, nocc, norb, molecule, ao_basis, scf_tensors)

Computes all the second-order response vectors needed for the isotropic cubic response computation

Parameters
  • w – A list of all the frequencies

  • d_a_mo – The density matrix in MO basis

  • X – Dipole integrals

  • fock_dict – A dictonary containing all the Fock matricies

  • kX – A dictonary containg all the response matricies

  • nocc – The number of occupied orbitals

  • norb – The number of total orbitals

  • molecule – The molecule.

  • basis – The AO basis.

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

Returns

A dictonary of Fock matrices from the subspace,second-order response vectors and second-order response matrices

get_densities(wi, kX, S, D0, mo)

Computes the compounded densities needed for the compounded Fock matrics F^{σ},F^{λ+τ},F^{σλτ} used for the isotropic cubic response function. Note: All densities are 1/3 of those in the paper, and all the Fock matrices are later scaled by 3.

Parameters
  • wi – A list of the frequencies

  • kX – A dictonary with all the first-order response matrices

  • S – The overlap matrix

  • D0 – The SCF density matrix in AO basis

  • mo – A matrix containing the MO coefficents

Returns

A list of tranformed compounded densities

get_densities_II(wi, kX, kXY, S, D0, mo)

Computes the compounded densities needed for the compounded second-order Fock matrics used for the isotropic cubic response function

Parameters
  • wi – A list of the frequencies

  • kX – A dictonary with all the first-order response matrices

  • kXY – A dict of the two index response matrices

  • S – The overlap matrix

  • D0 – The SCF density matrix in AO basis

  • mo – A matrix containing the MO coefficents

Returns

A list of tranformed compounded densities

get_e3(wi, kX, kXY, fo, fo2, nocc, norb)

Contracts E[3]

Parameters
  • wi – A list of freqs

  • kX – A dict of the single index response matricies

  • kXY – A dict of the two index response matrices

  • fo – A dictonary of transformed Fock matricies from fock_dict

  • fo2 – A dictonarty of transfromed Fock matricies from fock_dict_two

  • nocc – The number of occupied orbitals

  • norb – The total number of orbitals

Returns

A dictonary of compounded E[3] tensors for the isotropic cubic response function for TPA

get_e4(wi, kX, fo, nocc, norb)

Contracts E[4]NxNyNz for the isotropic cubic response function. Takes the Fock matrices from fock_dict and contracts them with the response vectors.

Parameters
  • wi – A list of freqs

  • kX – A dict of the single index response matricies

  • fo – A dictonary of transformed Fock matricies from fock_dict

  • nocc – The number of occupied orbitals

  • norb – The total number of orbitals

Returns

A dictonary of compounded E[4] tensors for the isotropic cubic response function for TPA

get_fock_dict(wi, density_list, F0_a, mo, molecule, ao_basis)

Computes the compounded Fock matrics F^{σ},F^{λ+τ},F^{σλτ} used for the isotropic cubic response function

Parameters
  • wi – A list of the frequencies

  • density_list – A list of tranformed compounded densities

  • F0_a – The Fock matrix in MO basis

  • mo – A matrix containing the MO coefficents

  • molecule – The molecule

  • ao_basis – The AO basis set

Returns

A dictonary of compounded first-order Fock-matrices

get_fock_dict_II(wi, density_list, mo, molecule, ao_basis)

Computes the compounded second-order Fock matrics used for the isotropic cubic response function

Parameters
  • wi – A list of the frequencies

  • density_list – A list of tranformed compounded densities

  • mo – A matrix containing the MO coefficents

  • molecule – The molecule

  • ao_basis – The AO basis set

Returns

A dictonary of compounded second-order Fock-matrices

get_other_terms(wi, track, X, kX, kXY, da, nocc, norb)

Computes the terms involving X[3],A[3],X[2],A[2] in the isotropic cubic response function

Parameters
  • wi – A list containing all the frequencies

  • track – A list that contains information about what γ components that are to be computed and which freqs

  • X – A dictonray with all the property integral matricies

  • kX – A dictonary with all the respone matricies

  • kXY – A dictonary containing all the two-index response matricies

  • da – The SCF density matrix in MO basis

  • nocc – The number of occupied orbitals

  • norb – The total number of orbitals

Returns

A dictonary of final X[2],A[2] contraction values

get_s4_and_r4(wi, kX, track, D0, nocc, norb)

Computes the S4 contractions

Parameters
  • wi – A list of all the freqs

  • kX – A dict with all the response matricies in MO basis

  • track – A list containing information about all the components that are to be computed

  • D0 – The SCF density in MO basis

  • nocc – The number of occupied obritals

  • norb – The number of total orbitals

Returns

A dictonary of final S[4] contraction values

get_s4_and_r4_terms(inp_dict, D0, nocc, norb)

Computes S[4] and R[4] contributions.

Parameters
  • inp_dict – A dictionary containing input data for computing S[4] and R[4].

  • D0 – The SCF density matrix in MO basis

  • nocc – The number of occupied orbitals

  • norb – The total number of orbitals

Returns

Dictionaries containing S[4] and R[4].

get_t4(wi, e4_dict, kX, track, da, nocc, norb)

Computes the contraction of the E[4] tensor with that of the S[4] and R[4] tensors to return the contraction of T[4] as a dictonary of vectors. T[4]NxNyNz = (E^[4]-ω_1S^[4]-ω_1S^[4]-ω_3S^[4]-γiR^[4])

Parameters
  • wi – A list of all the freqs

  • e4_dict – A dictonary of all the E[4] contraction

  • kX – A dictonray containng all the response matricies

  • track – A list containg information about all the γ components that are to be computed

  • da – The SCF density matrix in MO basis

  • nocc – The number of occupied orbitals

  • norb – The total number of orbitals

Returns

A dictonary of final T[4] contraction values

get_x3_a3(inp_dict, da, nocc, norb)

Computes X[3] and A[3] contributions.

Parameters
  • inp_dict – A dictionary containing input data for computing X[3] and A[3].

  • da – The SCF density matrix in MO basis

  • nocc – The number of occupied orbitals

  • norb – The total number of orbitals

Returns

A dictionary containing frequencies, X[3] and A[3].

get_xy(d_a_mo, X, wi, Fock, kX, nocc, norb)

Computes the compounded gradient vectors N^{σ},N^{λ+τ} used for the isotropic cubic response function

Parameters
  • d_a_mo – The SCF density matrix in MO basis

  • X – Dipole integrals

  • wi – A list of the frequencies

  • Fock – A dictonary containing all the Fock matricies

  • kX – A dictonary with all the first-order response matrices

  • nocc – The number of occupied orbitals

  • norb – The number of total orbitals

Returns

A dictonary of compounded gradient vectors

print_results(freqs, gamma, comp, t4_dict, t3_dict, tpa_dict)

Prints the results from the TPA calculation.

Parameters
  • freqs – List of frequencies

  • gamma – A dictonary containing the isotropic cubic response functions for TPA

  • comp – List of gamma tensors components

  • t4_dict – A dictonary containing the isotropic T[4] contractions

  • t3_dict – A dictonary containing the isotropic T[3] contractions

  • tpa_dict – A dictonary containing the isotropic X[3], A[3], X[2], A[2] contractions

s4(k1, k2, k3, D, nocc, norb)

Returns the contraction of S[4] for S[4] dict

Parameters
  • k1 – A response matrix

  • k2 – A response matrix

  • k3 – A response matrix

  • D – A density matrix

  • nocc – The number of occupied orbtials

  • norb – The number of total orbitals

Returns

The contraction of S[4] for S[4] dict

s4_contract(k1, k2, k3, D, nocc, norb)

Returns the contraction of S[4] for S[4] dict

Parameters
  • k1 – A response matrix

  • k2 – A response matrix

  • k3 – A response matrix

  • D – A density matrix

  • nocc – The number of occupied orbtials

  • norb – The number of total orbitals

Returns

The contraction of S[4] for S[4] dict

s4_for_r4(k1, k2, k3, D, nocc, norb)

Returns the contraction of S[4] for the contraction of R[4]

Parameters
  • k1 – A response matrix

  • k2 – A response matrix

  • k3 – A response matrix

  • D – A density matrix

  • nocc – The number of occupied orbtials

  • norb – The number of total orbitals

Returns

The contraction of S[4] for the contraction of R[4]

update_settings(rsp_dict, method_dict=None)

Updates response and method settings for TPA

Parameters
  • rsp_dict – The dictionary of response dict.

  • method_dict – The dictionary of method settings.

veloxchem.tpareddriver module

class veloxchem.tpareddriver.TpaReducedDriver(comm=None, ostream=None)

Bases: veloxchem.tpadriver.TpaDriver

Implements the reduced isotropic cubic response driver for two-photon absorption (TPA)

Parameters
  • comm – The MPI communicator.

  • ostream – The output stream.

get_Nxy(w, d_a_mo, X, fock_dict, kX, nocc, norb, molecule, ao_basis, scf_tensors)

Computes all the second-order response vectors needed for the reduced isotropic cubic response computation

Parameters
  • w – A list of all the frequencies

  • d_a_mo – The density matrix in MO basis

  • X – Dipole integrals

  • fock_dict – A dictonary containing all the Fock matricies

  • kX – A dictonary containg all the response matricies

  • nocc – The number of occupied orbitals

  • norb – The number of total orbitals

  • molecule – The molecule.

  • basis – The AO basis.

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

Returns

A dictonary of Fock matrices from the subspace,second-order response vectors and second-order response matrices

get_densities(wi, kX, S, D0, mo)

Computes the compounded densities needed for the compounded Fock matrics F^{σ} used for the reduced iostropic cubic response function

Parameters
  • wi – A list of the frequencies

  • kX – A dictonary with all the first-order response matrices

  • S – The overlap matrix

  • D0 – The SCF density matrix in AO basis

  • mo – A matrix containing the MO coefficents

Returns

A list of tranformed compounded densities

get_densities_II(wi, kX, kXY, S, D0, mo)

Computes the compounded densities needed for the compounded second-order Fock matrics used for the reduced isotropic cubic response function. Note: All densities are 1/3 of those in the paper, and all the Fock matrices are later scaled by 3.

Parameters
  • wi – A list of the frequencies

  • kX – A dictonary with all the first-order response matrices

  • kXY – A dict of the two index response matrices

  • S – The overlap matrix

  • D0 – The SCF density matrix in AO basis

  • mo – A matrix containing the MO coefficents

Returns

A list of tranformed compounded densities

get_e3(wi, kX, kXY, fo, fo2, nocc, norb)

Contracts E[3]NxNyz for the isotropic cubic response function. Takes the Fock matrices from fock_dict and fock_dict_II and contracts them with the first and second-order response vectors.

Parameters
  • wi – A list of freqs

  • kX – A dict of the single index response matricies

  • kXY – A dict of the two index response matrices

  • fo – A dictonary of transformed Fock matricies from fock_dict

  • fo2 – A dictonarty of transfromed Fock matricies from fock_dict_two

  • nocc – The number of occupied orbitals

  • norb – The total number of orbitals

Returns

A dictonary of compounded E[3] tensors for the isotropic reduced cubic response function for TPA

get_fock_dict(wi, density_list, F0_a, mo, molecule, ao_basis)

Computes the compounded Fock matrics F^{σ} used for the reduced isotropic cubic response function

Parameters
  • wi – A list of the frequencies

  • density_list – A list of tranformed compounded densities

  • F0_a – The Fock matrix in MO basis

  • mo – A matrix containing the MO coefficents

  • molecule – The molecule

  • ao_basis – The AO basis set

Returns

A dictonary of compounded first-order Fock-matrices

get_fock_dict_II(wi, density_list, mo, molecule, ao_basis)

Computes the compounded second-order Fock matrics used for the isotropic cubic response function

Parameters
  • wi – A list of the frequencies

  • density_list – A list of tranformed compounded densities

  • mo – A matrix containing the MO coefficents

  • molecule – The molecule

  • ao_basis – The AO basis set

Returns

A dictonary of compounded second-order Fock-matrices

get_other_terms(wi, track, X, kX, kXY, da, nocc, norb)

Computes the terms involving X[2],A[2] in the reduced isotropic cubic response function

Parameters
  • wi – A list containing all the frequencies

  • track – A list that contains information about what γ components that are to be computed and which freqs

  • X – A dictonray with all the property integral matricies

  • kX – A dictonary with all the respone matricies

  • kXY – A dictonary containing all the two-index response matricies

  • da – The SCF density matrix in MO basis

  • nocc – The number of occupied orbitals

  • norb – The total number of orbitals

Returns

A dictonary of final X[2],A[2] contraction values

get_xy(d_a_mo, X, wi, Fock, kX, nocc, norb)

Computes the compounded gradient vectors N^{σ} used for the reduced isotropic cubic response function

Parameters
  • d_a_mo – The SCF density matrix in MO basis

  • X – Dipole integrals

  • wi – A list of the frequencies

  • Fock – A dictonary containing all the Fock matricies

  • kX – A dictonary with all the first-order response matrices

  • nocc – The number of occupied orbitals

  • norb – The number of total orbitals

Returns

A dictonary of compounded gradient vectors

print_results(freqs, gamma, comp, t4_dict, t3_dict, other_dict)

Prints the results from the reduced TPA calculation.

Parameters
  • freqs – List of frequencies

  • gamma – A dictonary containing the reduced isotropic cubic response functions for TPA

  • comp – List of gamma tensors components

  • t4_dict – A dictonary containing the isotropic T[4] contractions (None for one-photon off-resonance TPA calculations)

  • t3_dict – A dictonary containing the isotropic T[3] contractions for one-photon off-resonance TPA calculations

  • other_dict – A dictonary containing the isotropic X[2] and A[2] contractions for one-photo off-resonance TPA calculations

update_settings(rsp_dict, method_dict=None)

Updates response and method settings for TPA

Parameters
  • rsp_dict – The dictionary of response dict.

  • method_dict – The dictionary of method settings.

veloxchem.veloxchem module

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

veloxchem.xtbgradientdriver module

class veloxchem.xtbgradientdriver.XTBGradientDriver(xtb_drv, comm=None, ostream=None)

Bases: veloxchem.gradientdriver.GradientDriver

Implements XTB gradient driver.

Parameters
  • xtb_drv – The XTB driver.

  • comm – The MPI communicator.

  • ostream – The output stream.

Instance variables
  • xtb_drv: The XTB driver.

compute(molecule)

Performs calculation of XTB analytical gradient.

Parameters

molecule – The molecule.

Module contents