Psi4
adc.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This file is part of Psi4.
12  *
13  * Psi4 is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation, version 3.
16  *
17  * Psi4 is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License along
23  * with Psi4; if not, write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  *
26  * @END LICENSE
27  */
28 
29 #ifndef ADC_H
30 #define ADC_H
31 
32 #include "psi4/libmints/matrix.h"
33 #include "psi4/libmints/vector.h"
35 #include "psi4/libdpd/dpd.h"
36 #include "psi4/psifiles.h"
37 
38 #define ID(x) _ints->DPD_ID(x)
39 
40 #define DEBUG_ false
41 #define ANGL_TOL_ 50.0
42 #define CUTOFF_DENS_ 1e-6
43 
44 namespace psi{
45 
46 class Options;
47 class Matrix;
48 class Vector;
50 typedef std::shared_ptr<Matrix> SharedMatrix;
51 typedef std::shared_ptr<Vector> SharedVector;
52 
53 namespace adc{
54 
55 struct pole{
56  int iter; // Iterated time
57  double iter_value; // Converged value of the excitation energy
58  double ps_value; // Pseudo-pertirbative value of the excitation energy
59  double osc_strength; // Oscillator strength
60  double renorm_factor; // Residue of the propagator, which is identical to the squared norm of the singly excited vector
61  double rot_angle; // Rotation angle from corresponding CIS vector
62 };
63 
64 class ADCWfn: public Wavefunction
65 {
66 public:
68  ~ADCWfn();
69  double compute_energy();
70 
71 protected:
72  void init();
73  void release_mem();
74  void rhf_prepare_tensors();
75  void amps_write(dpdfile2 *B, int length, std::string out);
76  void onestack_insert(struct onestack *stack, double value, int i, int a, int level, int staclen);
77  double rhf_init_tensors();
78  double rhf_differentiate_omega(int irrep, int root);
79  void rhf_diagonalize(int irrep, int num_root, bool first, double omega_in, double *eps);
80  void rhf_construct_sigma(int irrep, int root);
81  void shift_denom2(int root, int irrep, double omega);
82  void shift_denom4(int irrep, double omega);
83 
84  // Number of the singly excited configurations
85  int nxs_;
86  // Number of singly occupied orbitals
87  int nopen_;
88  // Convergence criteria in Newton-Raphson procedure
89  double conv_;
90  // Maximum iteration number in Newton-Raphson procedure
91  int pole_max_;
92  // MAximum iteration number in simultaneous expansion method
93  int sem_max_;
94  // Norm tolerance for the residual vector
95  double norm_tol_;
96  // Number of components of transition amplitudes printed in outfile
97  int num_amps_;
98  // Number of alpha active occupied MOs per irrep
99  int *aoccpi_;
100  // Number of alpha active virtual MOs per irrep
101  int *avirpi_;
102  // Number of beta active occupied MOs per irrep
103  int *boccpi_;
104  // Number of beta active virtual MOs per irrep
105  int *bvirpi_;
106  // Number of doubly occupied MOs per irrep
107  int *clsdpi_;
108  // Roots sought per irrep
109  int *rpi_;
110  // Number of sngly excited configurations per irrep
111  int *nxspi_;
112  // Irreps for X, Y and Z
114  // Ground state energy
115  double gs_energy_;
116  // An array containing alpha occupied orbital energies in DPD order
117  double *aocce_;
118  // An array containing alpha virtual orbital energies in DPD order
119  double *avire_;
120  // An array containing beta occupied orbital energies in DPD order
121  double *bocce_;
122  // An array containing beta virtual orbital energies in DPD order
123  double *bvire_;
124  // Array of struct that contains all the information on the pole of the propagator
125  struct pole **poles_;
126  // Integral transformation object
128  // Guesses for the correlated excitation energies, which are given as CIS/ADC(1) energies
130 };
131 
132 }}
133 
134 #endif
int * nxspi_
Definition: adc.h:111
void onestack_insert(struct onestack *stack, double value, int i, int a, int level, int staclen)
Definition: amps_write.cc:89
int * aoccpi_
Definition: adc.h:99
Definition: amps_write.cc:39
Options & options() const
Definition: wavefunction.cc:412
SharedVector omega_guess_
Definition: adc.h:129
int num_amps_
Definition: adc.h:97
double * avire_
Definition: adc.h:119
double ps_value
Definition: adc.h:58
Definition: adc.h:64
int * avirpi_
Definition: adc.h:101
int iter
Definition: adc.h:56
double * bvire_
Definition: adc.h:123
void rhf_diagonalize(int irrep, int num_root, bool first, double omega_in, double *eps)
Definition: diagonalize.cc:51
SharedWavefunction adc(SharedWavefunction, Options &)
Definition: adc_main.cc:38
IntegralTransform * _ints
Definition: adc.h:127
Definition: pointgrp.h:106
void amps_write(dpdfile2 *B, int length, std::string out)
Definition: amps_write.cc:48
double conv_
Definition: adc.h:89
Enter brief description of file here.
double * aocce_
Definition: adc.h:117
double compute_energy()
Compute energy. Subclasses override this function to compute its energy.
Definition: compute_energy.cc:49
struct pole ** poles_
Definition: adc.h:125
void rhf_construct_sigma(int irrep, int root)
Definition: construct_sigma.cc:48
int * irrep_axis_
Definition: adc.h:113
double osc_strength
Definition: adc.h:59
int * rpi_
Definition: adc.h:109
double rot_angle
Definition: adc.h:61
int pole_max_
Definition: adc.h:91
void shift_denom4(int irrep, double omega)
Definition: adc/denominator.cc:70
double norm_tol_
Definition: adc.h:95
int sem_max_
Definition: adc.h:93
int * bvirpi_
Definition: adc.h:105
double iter_value
Definition: adc.h:57
void rhf_prepare_tensors()
Definition: prepare_tensors.cc:54
double * bocce_
Definition: adc.h:121
Definition: liboptions.h:355
Definition: adc.h:55
Definition: libdpd/dpd.h:140
~ADCWfn()
Definition: adc.cc:164
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:49
ADCWfn(SharedWavefunction ref_wfn, Options &options)
Definition: adc.cc:41
Simple wavefunction base class.
Definition: wavefunction.h:84
double gs_energy_
Definition: adc.h:115
void release_mem()
Definition: adc.cc:168
double renorm_factor
Definition: adc.h:60
int nxs_
Definition: adc.h:85
double rhf_differentiate_omega(int irrep, int root)
Definition: differentiation.cc:45
std::shared_ptr< Wavefunction > SharedWavefunction
Definition: typedefs.h:54
Definition: integraltransform.h:58
int * clsdpi_
Definition: adc.h:107
std::shared_ptr< Vector > SharedVector
Definition: adc.h:51
int nopen_
Definition: adc.h:87
void shift_denom2(int root, int irrep, double omega)
Definition: adc/denominator.cc:36
int * boccpi_
Definition: adc.h:103
double rhf_init_tensors()
Definition: init_tensors.cc:41