MPQC  3.0.0-alpha
mp2r12_energy_util.h
1 //
2 // mp2r12_energy_util.h
3 //
4 // Copyright (C) 2006 Edward Valeev
5 //
6 // Author: Edward Valeev <evaleev@vt.edu>
7 // Maintainer: EV
8 //
9 // This file is part of the SC Toolkit.
10 //
11 // The SC Toolkit is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU Library General Public License as published by
13 // the Free Software Foundation; either version 2, or (at your option)
14 // any later version.
15 //
16 // The SC Toolkit 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 Library General Public License for more details.
20 //
21 // You should have received a copy of the GNU Library General Public License
22 // along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 //
25 // The U.S. Government is granted a limited license as per AL 91-7.
26 //
27 
28 #ifndef _chemistry_qc_mbptr12_mp2r12energyutil_h
29 #define _chemistry_qc_mbptr12_mp2r12energyutil_h
30 
31 #include <util/ref/ref.h>
32 #include <math/scmat/matrix.h>
33 #include <util/misc/scexception.h>
34 #include <chemistry/qc/wfn/spin.h>
35 #include <math/scmat/svd.h>
36 #include <chemistry/qc/wfn/orbitalspace.h>
37 #include <chemistry/qc/mbptr12/r12technology.h>
38 
39 namespace sc {
40 
43  class MP2R12EnergyUtil_base : virtual public RefCount {
44  protected:
46  unsigned int nocc_act_;
56  unsigned int nf12_;
57 
58  public:
61  const RefSCDimension& xydim,
62  const RefSCDimension& f12dim,
63  const unsigned int nocc_act);
64  virtual ~MP2R12EnergyUtil_base();
65 
67  void check_dims(const RefSCMatrix& A) const;
69  void check_dims(const RefSymmSCMatrix& A) const;
70 
72  virtual void print(const char* label, const RefSCMatrix& A, std::ostream& os = ExEnv::out0()) const = 0;
74  virtual void print(const char* label, const RefSymmSCMatrix& A, std::ostream& os = ExEnv::out0()) const = 0;
76  virtual void print(const char* label, const RefDiagSCMatrix& A, std::ostream& os = ExEnv::out0()) const = 0;
78  virtual void invert(RefSymmSCMatrix& A) const = 0;
80  virtual RefDiagSCMatrix eigenvalues(const RefSymmSCMatrix& A) const = 0;
82  virtual void diagonalize(const RefSymmSCMatrix& A, RefDiagSCMatrix& evals, RefSCMatrix& evecs) const = 0;
84  virtual void transform(const RefSymmSCMatrix& B, const RefDiagSCMatrix& A, const RefSCMatrix& U) const = 0;
86  virtual void solve_linear_system(const RefSymmSCMatrix& A,
87  RefSCMatrix& X,
88  const RefSCMatrix& B) const = 0;
89  virtual void solve_linear_system(unsigned int ij,
90  const RefSymmSCMatrix& A,
91  RefSCMatrix& X,
92  const RefSCMatrix& B) const = 0;
94  virtual void times(const RefSymmSCMatrix& A,
95  const RefSCMatrix& x,
96  RefSCMatrix& y) const = 0;
98  virtual void times(unsigned int ij,
99  const RefSymmSCMatrix& A,
100  const RefSCMatrix& x,
101  RefSCMatrix& y) const = 0;
103  virtual RefSCVector dot_product(const RefSCMatrix& A,
104  const RefSCMatrix& B) const = 0;
105  };
106 
107  class MP2R12EnergyUtil_Diag : virtual public RefCount {
108  protected:
110  unsigned int nocc_act_;
120  unsigned int nf12_;
121 
122  public:
125  const RefSCDimension& xydim,
126  const RefSCDimension& f12dim,
127  const unsigned int nocc_act);
128  virtual ~MP2R12EnergyUtil_Diag();
129 
131  void check_dims(const RefSCMatrix& A) const;
133  void check_dims(const RefSymmSCMatrix& A) const;
134 
136  virtual void print(const char* label, const RefSCMatrix& A, std::ostream& os = ExEnv::out0()) const = 0;
138  virtual void print(const char* label, const RefSymmSCMatrix& A, std::ostream& os = ExEnv::out0()) const = 0;
140  virtual void print(const char* label, const RefDiagSCMatrix& A, std::ostream& os = ExEnv::out0()) const = 0;
141 
143  virtual void get(unsigned int ij, const RefSCMatrix& A, const RefSCVector& Aij) const = 0;
145  virtual void get(unsigned int ij, const RefSCMatrix& A, const RefSCMatrix& Aij) const =0;
147  virtual void get(unsigned int ij, const RefSymmSCMatrix& A, const RefSymmSCMatrix& Aij) const = 0;
149  virtual void get(unsigned int ij, const RefDiagSCMatrix& A, const RefDiagSCMatrix& Aij) const =0;
150 
152  virtual void put(unsigned int ij, const RefSCMatrix& A, const RefSCVector& Aij) const =0;
154  virtual void put(unsigned int ij, const RefSCMatrix& A, const RefSCMatrix& Aij) const =0;
156  virtual void put(unsigned int ij, const RefSymmSCMatrix& A, const RefSymmSCMatrix& Aij) const = 0;
158  virtual void put(unsigned int ij, const RefDiagSCMatrix& A, const RefDiagSCMatrix& Aij) const = 0;
159 
161  virtual void invert(RefSymmSCMatrix& A) const = 0;
163  virtual RefDiagSCMatrix eigenvalues(const RefSymmSCMatrix& A) const = 0;
165  virtual void diagonalize(const RefSymmSCMatrix& A, RefDiagSCMatrix& evals, RefSCMatrix& evecs) const = 0;
167  virtual void transform(const RefSymmSCMatrix& B, const RefDiagSCMatrix& A, const RefSCMatrix& U) const = 0;
169  virtual void solve_linear_system(const RefSymmSCMatrix& A,
170  RefSCMatrix& X,
171  const RefSCMatrix& B) const = 0;
172  virtual void solve_linear_system(unsigned int ij,
173  const RefSymmSCMatrix& A,
174  RefSCMatrix& X,
175  const RefSCMatrix& B) const = 0;
177  virtual void times(const RefSymmSCMatrix& A,
178  const RefSCMatrix& x,
179  RefSCMatrix& y) const = 0;
181  virtual void times(unsigned int ij,
182  const RefSymmSCMatrix& A,
183  const RefSCMatrix& x,
184  RefSCMatrix& y) const = 0;
186  virtual RefSCVector dot_product(const RefSCMatrix& A,
187  const RefSCMatrix& B) const = 0;
188  };
189 
196  private:
197  SpinCase2 spincase2_;
198  public:
204  const RefSCDimension& xydim,
205  const RefSCDimension& f12dim,
206  const unsigned int nocc_act);
208 
210  unsigned int nrowblks(const RefSCMatrix& A) const;
212  unsigned int ncolblks(const RefSCMatrix& A) const;
214  unsigned int nblks(const RefSymmSCMatrix& A) const;
215 
217  void get(unsigned int ij, const RefSCMatrix& A, const RefSCVector& Aij) const;
219  void get(unsigned int ij, const RefSCMatrix& A, const RefSCMatrix& Aij) const;
221  void get(unsigned int ij, const RefSymmSCMatrix& A, const RefSymmSCMatrix& Aij) const;
223  void get(unsigned int ij, const RefDiagSCMatrix& A, const RefDiagSCMatrix& Aij) const;
224 
226  void put(unsigned int ij, const RefSCMatrix& A, const RefSCVector& Aij) const;
228  void put(unsigned int ij, const RefSCMatrix& A, const RefSCMatrix& Aij) const;
230  void put(unsigned int ij, const RefSymmSCMatrix& A, const RefSymmSCMatrix& Aij) const;
232  void put(unsigned int ij, const RefDiagSCMatrix& A, const RefDiagSCMatrix& Aij) const;
233 
235  void invert(RefSymmSCMatrix& A) const;
239  void diagonalize(const RefSymmSCMatrix& A, RefDiagSCMatrix& evals, RefSCMatrix& evecs) const;
241  void transform(const RefSymmSCMatrix& B, const RefDiagSCMatrix& A, const RefSCMatrix& U) const;
243  void solve_linear_system(const RefSymmSCMatrix& A,
244  RefSCMatrix& X,
245  const RefSCMatrix& B) const;
246  void solve_linear_system(unsigned int ij,
247  const RefSymmSCMatrix& A,
248  RefSCMatrix& X,
249  const RefSCMatrix& B) const;
251  void times(const RefSymmSCMatrix& A,
252  const RefSCMatrix& x,
253  RefSCMatrix& y) const;
255  void times(unsigned int ij,
256  const RefSymmSCMatrix& A,
257  const RefSCMatrix& x,
258  RefSCMatrix& y) const;
261  const RefSCMatrix& B) const;
262 
264  void print(const char* label, const RefSCMatrix& A, std::ostream& os = ExEnv::out0()) const;
266  void print(const char* label, const RefSymmSCMatrix& A, std::ostream& os = ExEnv::out0()) const;
268  void print(const char* label, const RefDiagSCMatrix& A, std::ostream& os = ExEnv::out0()) const;
269  };
270 
272  private:
273  SpinCase2 spincase2_;
274  public:
280  const RefSCDimension& xydim,
281  const RefSCDimension& f12dim,
282  const unsigned int nocc_act);
284 
286  unsigned int nrowblks(const RefSCMatrix& A) const;
288  unsigned int ncolblks(const RefSCMatrix& A) const;
290  unsigned int nblks(const RefSymmSCMatrix& A) const;
291 
293  void get(unsigned int ij, const RefSCMatrix& A, const RefSCVector& Aij) const;
295  void get(unsigned int ij, const RefSCMatrix& A, const RefSCMatrix& Aij) const;
297  void get(unsigned int ij, const RefSymmSCMatrix& A, const RefSymmSCMatrix& Aij) const;
299  void get(unsigned int ij, const RefDiagSCMatrix& A, const RefDiagSCMatrix& Aij) const;
300 
302  void put(unsigned int ij, const RefSCMatrix& A, const RefSCVector& Aij) const;
304  void put(unsigned int ij, const RefSCMatrix& A, const RefSCMatrix& Aij) const;
306  void put(unsigned int ij, const RefSymmSCMatrix& A, const RefSymmSCMatrix& Aij) const;
308  void put(unsigned int ij, const RefDiagSCMatrix& A, const RefDiagSCMatrix& Aij) const;
309 
311  void invert(RefSymmSCMatrix& A) const;
315  void diagonalize(const RefSymmSCMatrix& A, RefDiagSCMatrix& evals, RefSCMatrix& evecs) const;
317  void transform(const RefSymmSCMatrix& B, const RefDiagSCMatrix& A, const RefSCMatrix& U) const;
319  void solve_linear_system(const RefSymmSCMatrix& A,
320  RefSCMatrix& X,
321  const RefSCMatrix& B) const;
322  void solve_linear_system(unsigned int ij,
323  const RefSymmSCMatrix& A,
324  RefSCMatrix& X,
325  const RefSCMatrix& B) const;
327  void times(const RefSymmSCMatrix& A,
328  const RefSCMatrix& x,
329  RefSCMatrix& y) const;
330  void times(unsigned int ij,
331  const RefSymmSCMatrix& A,
332  const RefSCMatrix& x,
333  RefSCMatrix& y) const;
336  const RefSCMatrix& B) const;
337 
339  void print(const char* label, const RefSCMatrix& A, std::ostream& os = ExEnv::out0()) const;
341  void print(const char* label, const RefSymmSCMatrix& A, std::ostream& os = ExEnv::out0()) const;
343  void print(const char* label, const RefDiagSCMatrix& A, std::ostream& os = ExEnv::out0()) const;
344  };
345 
347  public:
352  const RefSCDimension& xydim,
353  const RefSCDimension& f12dim,
354  const unsigned int nocc_act);
356 
358  void print(const char* label, const RefSCMatrix& A, std::ostream& os = ExEnv::out0()) const;
360  void print(const char* label, const RefSymmSCMatrix& A, std::ostream& os = ExEnv::out0()) const;
362  void print(const char* label, const RefDiagSCMatrix& A, std::ostream& os = ExEnv::out0()) const;
364  void invert(RefSymmSCMatrix& A) const;
368  void diagonalize(const RefSymmSCMatrix& A, RefDiagSCMatrix& evals, RefSCMatrix& evecs) const;
370  void transform(const RefSymmSCMatrix& B, const RefDiagSCMatrix& A, const RefSCMatrix& U) const;
372  void solve_linear_system(const RefSymmSCMatrix& A,
373  RefSCMatrix& X,
374  const RefSCMatrix& B) const;
375  void solve_linear_system(unsigned int ij,
376  const RefSymmSCMatrix& A,
377  RefSCMatrix& X,
378  const RefSCMatrix& B) const;
380  void times(const RefSymmSCMatrix& A,
381  const RefSCMatrix& x,
382  RefSCMatrix& y) const;
383  void times(unsigned int ij,
384  const RefSymmSCMatrix& A,
385  const RefSCMatrix& x,
386  RefSCMatrix& y) const;
389  const RefSCMatrix& B) const;
390 
392  unsigned int nrowblks(const RefSCMatrix& A) const;
394  unsigned int ncolblks(const RefSCMatrix& A) const;
396  unsigned int nblks(const RefSymmSCMatrix& A) const;
397 
398  };
399 
400  Ref<MP2R12EnergyUtil_Diag> generate_MP2R12EnergyUtil_Diag(SpinCase2 spincase2,
401  const RefSCDimension& oodim,
402  const RefSCDimension& xydim,
403  const RefSCDimension& f12dim,
404  const unsigned int nocc_act);
405 
407  void firstorder_cusp_coefficients(const SpinCase2 &spincase2,
408  RefSCMatrix& C,
409  const Ref<OrbitalSpace>& i1,
410  const Ref<OrbitalSpace>& i2,
411  const Ref<R12Technology::CorrelationFactor>& corrfactor);
412 }
413 
414 #endif // include guard
sc::MP2R12EnergyUtil_Diag_DifferentSpin
Class MP2R12EnergyUtil provides some misc functions to operate on (blocked) ijxy and xyxy matrices.
Definition: mp2r12_energy_util.h:195
sc::MP2R12EnergyUtil_Diag_DifferentSpin::diagonalize
void diagonalize(const RefSymmSCMatrix &A, RefDiagSCMatrix &evals, RefSCMatrix &evecs) const
Computes eigenvalues and eigenvectors of A. evals and evecs don't have to be allocated.
sc::MP2R12EnergyUtil_Diag_DifferentSpin::dot_product
RefSCVector dot_product(const RefSCMatrix &A, const RefSCMatrix &B) const
Computes "dot" product of A and B: tr[i] = sum_j A[j][i] B[j][i].
sc::MP2R12EnergyUtil_Nondiag::nrowblks
unsigned int nrowblks(const RefSCMatrix &A) const
Number of oo blocks in row dimension of A.
sc::MP2R12EnergyUtil_Diag::print
virtual void print(const char *label, const RefSCMatrix &A, std::ostream &os=ExEnv::out0()) const =0
Prints A.
sc::MP2R12EnergyUtil_Diag_DifferentSpin::eigenvalues
RefDiagSCMatrix eigenvalues(const RefSymmSCMatrix &A) const
Computes eigenvalues of A.
sc::MP2R12EnergyUtil_Diag_SameSpin::nrowblks
unsigned int nrowblks(const RefSCMatrix &A) const
Number of oo blocks in row dimension of A.
sc::MP2R12EnergyUtil_Diag_SameSpin
Definition: mp2r12_energy_util.h:271
sc::MP2R12EnergyUtil_Diag::eigenvalues
virtual RefDiagSCMatrix eigenvalues(const RefSymmSCMatrix &A) const =0
Computes eigenvalues of A.
sc::MP2R12EnergyUtil_Diag_DifferentSpin::transform
void transform(const RefSymmSCMatrix &B, const RefDiagSCMatrix &A, const RefSCMatrix &U) const
B = U * A * U.t()
sc::MP2R12EnergyUtil_Diag
Definition: mp2r12_energy_util.h:107
sc::RefSymmSCMatrix
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization.
Definition: matrix.h:265
sc::MP2R12EnergyUtil_Diag_DifferentSpin::nblks
unsigned int nblks(const RefSymmSCMatrix &A) const
Number of oo blocks in dimension of A.
sc::MP2R12EnergyUtil_base::xydim_
RefSCDimension xydim_
number of xy pairs
Definition: mp2r12_energy_util.h:50
sc::MP2R12EnergyUtil_Diag_DifferentSpin::solve_linear_system
void solve_linear_system(const RefSymmSCMatrix &A, RefSCMatrix &X, const RefSCMatrix &B) const
Solves A*X = B.
sc::MP2R12EnergyUtil_Nondiag::print
void print(const char *label, const RefSCMatrix &A, std::ostream &os=ExEnv::out0()) const
Prints A.
sc::RefSCMatrix
The RefSCMatrix class is a smart pointer to an SCMatrix specialization.
Definition: matrix.h:135
sc::MP2R12EnergyUtil_Diag::diagonalize
virtual void diagonalize(const RefSymmSCMatrix &A, RefDiagSCMatrix &evals, RefSCMatrix &evecs) const =0
Computes eigenvalues and eigenvectors of A. evals and evecs don't have to be allocated.
sc::Ref
A template class that maintains references counts.
Definition: ref.h:361
sc::MP2R12EnergyUtil_Diag::nf12_
unsigned int nf12_
number of geminals
Definition: mp2r12_energy_util.h:120
sc::MP2R12EnergyUtil_Diag::put
virtual void put(unsigned int ij, const RefSCMatrix &A, const RefSCVector &Aij) const =0
puts ij block into A
sc::X
Definition: reftestx.h:32
sc::MP2R12EnergyUtil_Diag::nocc_act_
unsigned int nocc_act_
number of active occupied orbitals
Definition: mp2r12_energy_util.h:110
sc::MP2R12EnergyUtil_base::nf12_
unsigned int nf12_
number of geminals
Definition: mp2r12_energy_util.h:56
sc::MP2R12EnergyUtil_base::eigenvalues
virtual RefDiagSCMatrix eigenvalues(const RefSymmSCMatrix &A) const =0
Computes eigenvalues of A.
sc::MP2R12EnergyUtil_Diag_DifferentSpin::put
void put(unsigned int ij, const RefSCMatrix &A, const RefSCVector &Aij) const
puts ij block into A
sc::MP2R12EnergyUtil_Diag_SameSpin::get
void get(unsigned int ij, const RefSCMatrix &A, const RefSCVector &Aij) const
gets ij block of A
sc::MP2R12EnergyUtil_Diag::check_dims
void check_dims(const RefSCMatrix &A) const
Checks if matrix A has proper dimensions. Throw, if not.
sc::MP2R12EnergyUtil_Diag_DifferentSpin::MP2R12EnergyUtil_Diag_DifferentSpin
MP2R12EnergyUtil_Diag_DifferentSpin(const RefSCDimension &oodim, const RefSCDimension &xydim, const RefSCDimension &f12dim, const unsigned int nocc_act)
oodim is a dimension of ij (active occupied pairs) xydim is a dimension of xy (orbital products used ...
sc::MP2R12EnergyUtil_Nondiag::invert
void invert(RefSymmSCMatrix &A) const
Inverts A in-place.
sc::MP2R12EnergyUtil_Diag_SameSpin::times
void times(const RefSymmSCMatrix &A, const RefSCMatrix &x, RefSCMatrix &y) const
computes y = A x
sc::MP2R12EnergyUtil_Diag_SameSpin::nblks
unsigned int nblks(const RefSymmSCMatrix &A) const
Number of oo blocks in dimension of A.
sc::RefDiagSCMatrix
The RefDiagSCMatrix class is a smart pointer to an DiagSCMatrix specialization.
Definition: matrix.h:389
sc::MP2R12EnergyUtil_Diag::oodim_
RefSCDimension oodim_
number of ij pairs
Definition: mp2r12_energy_util.h:112
sc::MP2R12EnergyUtil_base::times
virtual void times(const RefSymmSCMatrix &A, const RefSCMatrix &x, RefSCMatrix &y) const =0
computes y = A x
sc::MP2R12EnergyUtil_base::print
virtual void print(const char *label, const RefSCMatrix &A, std::ostream &os=ExEnv::out0()) const =0
Prints A.
sc::MP2R12EnergyUtil_Diag_SameSpin::MP2R12EnergyUtil_Diag_SameSpin
MP2R12EnergyUtil_Diag_SameSpin(const RefSCDimension &oodim, const RefSCDimension &xydim, const RefSCDimension &f12dim, const unsigned int nocc_act)
oodim is a dimension of ij (active occupied pairs) xydim is a dimension of xy (orbital products used ...
sc::MP2R12EnergyUtil_base::dot_product
virtual RefSCVector dot_product(const RefSCMatrix &A, const RefSCMatrix &B) const =0
Computes "dot" product of A and B: tr[i] = sum_j A[j][i] B[j][i].
sc::MP2R12EnergyUtil_Diag::dot_product
virtual RefSCVector dot_product(const RefSCMatrix &A, const RefSCMatrix &B) const =0
Computes "dot" product of A and B: tr[i] = sum_j A[j][i] B[j][i].
sc::RefSCDimension
The RefSCDimension class is a smart pointer to an SCDimension specialization.
Definition: dim.h:152
sc::MP2R12EnergyUtil_base::f12dim_
RefSCDimension f12dim_
number of geminals per pair times number of xy pairs
Definition: mp2r12_energy_util.h:52
sc::MP2R12EnergyUtil_Nondiag::dot_product
RefSCVector dot_product(const RefSCMatrix &A, const RefSCMatrix &B) const
Computes "dot" product of A and B: tr[i] = sum_j A[j][i] B[j][i].
sc::MP2R12EnergyUtil_Diag_SameSpin::eigenvalues
RefDiagSCMatrix eigenvalues(const RefSymmSCMatrix &A) const
Computes eigenvalues of A.
sc::MP2R12EnergyUtil_Diag::times
virtual void times(const RefSymmSCMatrix &A, const RefSCMatrix &x, RefSCMatrix &y) const =0
computes y = A x
sc::MP2R12EnergyUtil_base::diagonalize
virtual void diagonalize(const RefSymmSCMatrix &A, RefDiagSCMatrix &evals, RefSCMatrix &evecs) const =0
Computes eigenvalues and eigenvectors of A. evals and evecs don't have to be allocated.
sc::MP2R12EnergyUtil_Diag::f12dim_
RefSCDimension f12dim_
number of geminals per pair times number of xy pairs
Definition: mp2r12_energy_util.h:116
sc::MP2R12EnergyUtil_Diag_SameSpin::transform
void transform(const RefSymmSCMatrix &B, const RefDiagSCMatrix &A, const RefSCMatrix &U) const
B = U * A * U.t()
sc::MP2R12EnergyUtil_Diag_SameSpin::solve_linear_system
void solve_linear_system(const RefSymmSCMatrix &A, RefSCMatrix &X, const RefSCMatrix &B) const
Solves A*X = B.
sc::MP2R12EnergyUtil_Nondiag::ncolblks
unsigned int ncolblks(const RefSCMatrix &A) const
Number of oo blocks in column dimension of A.
sc::firstorder_cusp_coefficients
void firstorder_cusp_coefficients(const SpinCase2 &spincase2, RefSCMatrix &C, const Ref< OrbitalSpace > &i1, const Ref< OrbitalSpace > &i2, const Ref< R12Technology::CorrelationFactor > &corrfactor)
fills C with coefficients determined by first-order cusp conditions
sc::MP2R12EnergyUtil_Nondiag
Definition: mp2r12_energy_util.h:346
sc::MP2R12EnergyUtil_Diag_SameSpin::print
void print(const char *label, const RefSCMatrix &A, std::ostream &os=ExEnv::out0()) const
Prints A.
sc::MP2R12EnergyUtil_Diag_DifferentSpin::get
void get(unsigned int ij, const RefSCMatrix &A, const RefSCVector &Aij) const
gets ij block of A
sc::MP2R12EnergyUtil_Diag_SameSpin::put
void put(unsigned int ij, const RefSCMatrix &A, const RefSCVector &Aij) const
puts ij block into A
sc::MP2R12EnergyUtil_Diag::get
virtual void get(unsigned int ij, const RefSCMatrix &A, const RefSCVector &Aij) const =0
gets ij block of A
sc::MP2R12EnergyUtil_base::solve_linear_system
virtual void solve_linear_system(const RefSymmSCMatrix &A, RefSCMatrix &X, const RefSCMatrix &B) const =0
Solves A*X = B.
sc::MP2R12EnergyUtil_Diag_SameSpin::invert
void invert(RefSymmSCMatrix &A) const
Inverts A in-place.
sc::MP2R12EnergyUtil_Diag_DifferentSpin::invert
void invert(RefSymmSCMatrix &A) const
Inverts A in-place.
sc::RefSCVector
The RefSCVector class is a smart pointer to an SCVector specialization.
Definition: matrix.h:55
sc::MP2R12EnergyUtil_base::nocc_act_
unsigned int nocc_act_
number of active occupied orbitals
Definition: mp2r12_energy_util.h:46
sc::MP2R12EnergyUtil_base::oodim_
RefSCDimension oodim_
number of ij pairs
Definition: mp2r12_energy_util.h:48
sc::MP2R12EnergyUtil_Diag_SameSpin::dot_product
RefSCVector dot_product(const RefSCMatrix &A, const RefSCMatrix &B) const
Computes "dot" product of A and B: tr[i] = sum_j A[j][i] B[j][i].
sc::MP2R12EnergyUtil_Diag_DifferentSpin::ncolblks
unsigned int ncolblks(const RefSCMatrix &A) const
Number of oo blocks in column dimension of A.
sc::MP2R12EnergyUtil_Diag::xydim_
RefSCDimension xydim_
number of xy pairs
Definition: mp2r12_energy_util.h:114
sc::MP2R12EnergyUtil_base::transform
virtual void transform(const RefSymmSCMatrix &B, const RefDiagSCMatrix &A, const RefSCMatrix &U) const =0
B = U * A * U.t()
sc::MP2R12EnergyUtil_Diag::solve_linear_system
virtual void solve_linear_system(const RefSymmSCMatrix &A, RefSCMatrix &X, const RefSCMatrix &B) const =0
Solves A*X = B.
sc::MP2R12EnergyUtil_base::gdim_
RefSCDimension gdim_
number of geminals
Definition: mp2r12_energy_util.h:54
sc::ExEnv::out0
static std::ostream & out0()
Return an ostream that writes from node 0.
sc::MP2R12EnergyUtil_Nondiag::times
void times(const RefSymmSCMatrix &A, const RefSCMatrix &x, RefSCMatrix &y) const
computes y = A x
sc::MP2R12EnergyUtil_Nondiag::diagonalize
void diagonalize(const RefSymmSCMatrix &A, RefDiagSCMatrix &evals, RefSCMatrix &evecs) const
Computes eigenvalues and eigenvectors of A. evals and evecs don't have to be allocated.
sc::MP2R12EnergyUtil_base::check_dims
void check_dims(const RefSCMatrix &A) const
Checks if matrix A has proper dimensions. Throw, if not.
sc::MP2R12EnergyUtil_Diag_DifferentSpin::nrowblks
unsigned int nrowblks(const RefSCMatrix &A) const
Number of oo blocks in row dimension of A.
sc::MP2R12EnergyUtil_Diag_DifferentSpin::print
void print(const char *label, const RefSCMatrix &A, std::ostream &os=ExEnv::out0()) const
Prints A.
sc::MP2R12EnergyUtil_Diag_SameSpin::diagonalize
void diagonalize(const RefSymmSCMatrix &A, RefDiagSCMatrix &evals, RefSCMatrix &evecs) const
Computes eigenvalues and eigenvectors of A. evals and evecs don't have to be allocated.
sc::MP2R12EnergyUtil_Nondiag::solve_linear_system
void solve_linear_system(const RefSymmSCMatrix &A, RefSCMatrix &X, const RefSCMatrix &B) const
Solves A*X = B.
sc::RefCount
The base class for all reference counted objects.
Definition: ref.h:192
sc::MP2R12EnergyUtil_Nondiag::eigenvalues
RefDiagSCMatrix eigenvalues(const RefSymmSCMatrix &A) const
Computes eigenvalues of A.
sc::MP2R12EnergyUtil_Nondiag::MP2R12EnergyUtil_Nondiag
MP2R12EnergyUtil_Nondiag(const RefSCDimension &oodim, const RefSCDimension &xydim, const RefSCDimension &f12dim, const unsigned int nocc_act)
oodim is a dimension of ij (active occupied pairs) xydim is a dimension of xy (orbital products used ...
sc::MP2R12EnergyUtil_Diag_SameSpin::ncolblks
unsigned int ncolblks(const RefSCMatrix &A) const
Number of oo blocks in column dimension of A.
sc::MP2R12EnergyUtil_base
Class MP2R12EnergyUtil_base is the abstract interface to utility functions used by MP2R12Energy deriv...
Definition: mp2r12_energy_util.h:43
sc::MP2R12EnergyUtil_Diag::invert
virtual void invert(RefSymmSCMatrix &A) const =0
Inverts A in-place.
sc::MP2R12EnergyUtil_Diag_DifferentSpin::times
void times(const RefSymmSCMatrix &A, const RefSCMatrix &x, RefSCMatrix &y) const
computes y = A x
sc::MP2R12EnergyUtil_Diag::gdim_
RefSCDimension gdim_
number of geminals
Definition: mp2r12_energy_util.h:118
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
sc::MP2R12EnergyUtil_Nondiag::transform
void transform(const RefSymmSCMatrix &B, const RefDiagSCMatrix &A, const RefSCMatrix &U) const
B = U * A * U.t()
sc::MP2R12EnergyUtil_Nondiag::nblks
unsigned int nblks(const RefSymmSCMatrix &A) const
Number of oo blocks in dimension of A.
sc::MP2R12EnergyUtil_base::invert
virtual void invert(RefSymmSCMatrix &A) const =0
Inverts A in-place.
sc::MP2R12EnergyUtil_Diag::transform
virtual void transform(const RefSymmSCMatrix &B, const RefDiagSCMatrix &A, const RefSCMatrix &U) const =0
B = U * A * U.t()

Generated at Sun Jan 26 2020 23:23:59 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.