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