28#ifndef _chemistry_qc_wfn_density_h
29#define _chemistry_qc_wfn_density_h
35#include <math/isosurf/volume.h>
36#include <chemistry/qc/wfn/wfn.h>
37#include <chemistry/qc/basis/extent.h>
38#include <chemistry/molecule/molrender.h>
52 virtual void boundingbox(
double valuemin,
91 bool need_hessian_, need_gradient_;
92 bool need_basis_hessian_, need_basis_gradient_;
94 bool using_shared_data_;
97 virtual void init_common_data(
bool initialize_density_matrices);
100 virtual void init_scratch_data();
101 void compute_basis_values(
const SCVector3&r);
102 void compute_spin_density(
const double *dmat,
103 double *rho,
double *grad,
double *hess);
109 enum {
X=0,
Y=1, Z=2};
111 enum {XX=0, YX=1, YY=2, ZX=3, ZY=4, ZZ=5};
113 BatchElectronDensity(
const Ref<KeyVal>&);
114 BatchElectronDensity(
const Ref<Wavefunction>&,
double accuracy=DBL_EPSILON);
126 bool reference_parent_data=
false);
139 double *alpha_density,
140 double *alpha_density_grad,
141 double *alpha_density_hessian,
142 double *beta_density,
143 double *beta_density_grad,
144 double *beta_density_hessian);
155 virtual void init(
bool initialize_density_matrices =
true);
183 {
return (spin_polarized_?beta_dmat_:alpha_dmat_); }
184 int ncontrib() {
return ncontrib_; }
185 int *contrib() {
return contrib_; }
186 int ncontrib_bf() {
return ncontrib_bf_; }
187 int *contrib_bf() {
return contrib_bf_; }
188 double *bs_values() {
return bs_values_; }
189 double *bsg_values() {
return bsg_values_; }
190 double *bsh_values() {
return bsh_values_; }
194 void set_need_basis_hessian(
bool b) { need_basis_hessian_ = b; }
This a more highly optimized than ElectronDensity since everything is precomputed.
Definition density.h:62
void set_linear_scaling(bool b)
Turn linear scaling algorithm on/off.
Definition density.h:166
BatchElectronDensity(const Ref< BatchElectronDensity > &d, bool reference_parent_data=false)
This will construct copies of this.
double * alpha_density_matrix()
Return the alpha density matrix.
Definition density.h:180
virtual void compute()
Recompute at least the results that have compute true and are not already computed.
void set_accuracy(double a)
Sets the accuracy.
Definition density.h:169
double * beta_density_matrix()
Return the beta density matrix.
Definition density.h:182
void set_need_basis_gradient(bool b)
To ensure that that the basis functions gradients are computed, use this.
Definition density.h:193
void compute_density(const SCVector3 &r, double *alpha_density, double *alpha_density_grad, double *alpha_density_hessian, double *beta_density, double *beta_density_grad, double *beta_density_hessian)
This is a alternate to the Volume interface that avoids some of the overhead of that interface.
virtual void set_densities(const RefSymmSCMatrix &aden, const RefSymmSCMatrix &bden)
This will fill in the internel copies of the density matrices with new values.
void clear()
This will cause all stratch storage to be released.
virtual void init(bool initialize_density_matrices=true)
This is called to finish initialization of the object.
virtual void boundingbox(double valuemin, double valuemax, SCVector3 &p1, SCVector3 &p2)
Returns the bounding box.
void set_use_dmat_bound(bool b)
Turn use of density matrix bounds on/off.
Definition density.h:172
This is a Volume that computer the electron density.
Definition density.h:44
virtual void compute()
Recompute at least the results that have compute true and are not already computed.
This holds scratch data needed to compute basis function values.
Definition gaussbas.h:211
Definition molrender.h:81
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization.
Definition matrix.h:261
A template class that maintains references counts.
Definition ref.h:332
A Volume is a Function of three variables.
Definition volume.h:42