MPQC  3.0.0-alpha
twoparticlecontraction.h
1 //
2 // twoparticlecontraction.h
3 //
4 // Copyright (C) 2005 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 #include <util/state/state.h>
29 #include <util/state/statein.h>
30 #include <util/state/stateout.h>
31 
32 #ifndef _chemistry_qc_mbptr12_twoparticlecontraction_h
33 #define _chemistry_qc_mbptr12_twoparticlecontraction_h
34 
35 namespace sc {
36 
37  namespace mbptr12 {
38 
43  class TwoParticleContraction : virtual public SavableState {
44  public:
45  TwoParticleContraction(unsigned int nrow, unsigned int ncol);
47  virtual ~TwoParticleContraction() {}
48 
49  void save_data_state(StateOut& so);
50 
51  unsigned int nrow() const;
52  unsigned int ncol() const;
53 
55  virtual double contract(const double* A, const double* B) const =0;
56 
57  protected:
58  double dot_prod(const double* A, const double* B) const;
59 
60  private:
61  unsigned int nrow_;
62  unsigned int ncol_;
63  };
64 
69  public:
70  Direct_Contraction(unsigned int nrow, unsigned int ncol, double scale);
72  ~Direct_Contraction() {}
73  void save_data_state(StateOut& so);
74 
76  double contract(const double* A, const double* B) const;
77 
78  private:
79  double scale_;
80  };
81 
88  public:
90  ABS_OBS_Contraction(unsigned int nobs, unsigned int nocc1, unsigned int nocc2);
95  double contract(const double* A, const double* B) const;
96 
97  private:
98  unsigned int nocc1_;
99  unsigned int nocc2_;
100  };
101 
107  public:
109  CABS_OBS_Contraction(unsigned int nobs);
112  void save_data_state(StateOut&);
114  double contract(const double* A, const double* B) const;
115  };
116  }
117 }
118 
119 #endif
120 
sc::mbptr12::CABS_OBS_Contraction::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::mbptr12::ABS_OBS_Contraction::ABS_OBS_Contraction
ABS_OBS_Contraction(unsigned int nobs, unsigned int nocc1, unsigned int nocc2)
nobs = rank of OBS (number of all orbitals), nocc1 and nocc2 are number of occupied orbitals for spac...
sc::mbptr12::CABS_OBS_Contraction::CABS_OBS_Contraction
CABS_OBS_Contraction(unsigned int nobs)
CABS OBS contraction does not depend on the occupied spaces.
sc::mbptr12::TwoParticleContraction::contract
virtual double contract(const double *A, const double *B) const =0
Computes contraction of blocks A and B.
sc::mbptr12::Direct_Contraction
Direct_Contraction is a straight scalar (dot) product of 2 rectangular blocks, scaled by scale.
Definition: twoparticlecontraction.h:68
sc::mbptr12::CABS_OBS_Contraction::contract
double contract(const double *A, const double *B) const
Computes contraction of blocks A and B.
sc::mbptr12::CABS_OBS_Contraction
CABS_OBS_Contraction contracts 2 square nobs-by-nobs blocks for the CABS approach.
Definition: twoparticlecontraction.h:106
sc::StateIn
Definition: statein.h:79
sc::StateOut
Definition: stateout.h:71
sc::mbptr12::TwoParticleContraction
TwoParticleContraction contracts nrow-by-ncol bra- or ket-blocks of two 2-particle tensors i....
Definition: twoparticlecontraction.h:43
sc::mbptr12::Direct_Contraction::contract
double contract(const double *A, const double *B) const
Computes contraction of blocks A and B.
sc::SavableState
Base class for objects that can save/restore state.
Definition: state.h:45
sc::mbptr12::ABS_OBS_Contraction
ABS_OBS_Contraction contracts 2 square nobs-by-nobs blocks for the ABS approach.
Definition: twoparticlecontraction.h:87
sc::mbptr12::ABS_OBS_Contraction::contract
double contract(const double *A, const double *B) const
Computes contraction of blocks A and B.
sc::mbptr12::TwoParticleContraction::save_data_state
void save_data_state(StateOut &so)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::mbptr12::Direct_Contraction::save_data_state
void save_data_state(StateOut &so)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
sc::mbptr12::ABS_OBS_Contraction::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...

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