MADNESS  0.10.1
fcwf.h
Go to the documentation of this file.
1 #ifndef MADNESS_APPS_MOLDFT_FCWF_H_INCLUDED
2 #define MADNESS_APPS_MOLDFT_FCWF_H_INCLUDED
3 
4 #include <madness/mra/mra.h>
5 #include <madness/mra/operator.h>
6 #include <vector>
7 #include <math.h>
8 #include <complex>
9 
10 using namespace madness;
11 
12 class Fcwf{
13  std::vector<complex_function_3d> m_psi;
15 
16 public:
17 
18  Fcwf();
19 
20  Fcwf(const complex_function_3d& wf1,
21  const complex_function_3d& wf2,
22  const complex_function_3d& wf3,
23  const complex_function_3d& wf4);
24 
25  Fcwf(World& world);
26 
27  complex_function_3d& operator[](const int i);
28 
29  const complex_function_3d& operator[](const int i) const ;
30 
31  explicit Fcwf(std::vector<complex_function_3d>& phi);
32 
33  bool getinitialize();
34 
35  bool getinitialize() const ;
36 
37  unsigned int size();
38 
39  unsigned int size() const ;
40 
41  Fcwf(const Fcwf& phi);
42 
43  Fcwf operator=(const Fcwf& phi);
44 
45  Fcwf operator-(const Fcwf& phi) const ;
46 
47  Fcwf operator+(const Fcwf& phi);
48 
49  Fcwf operator*(std::complex<double> a) const ;
50 
51  void scale(std::complex<double> a);
52 
53  Fcwf operator+=(const Fcwf& phi);
54 
55  Fcwf operator-=(const Fcwf& phi);
56 
57  double norm2();
58 
59  void normalize();
60 
62 
64 
65  void truncate();
66 
67  std::complex<double> inner(World& world, const Fcwf& phi) const;
68 
69  void apply(World& world, real_convolution_3d& op);
70 
71  void apply(World& world, complex_derivative_3d& D);
72 
73  void reconstruct();
74 
75  void compress();
76 
77  Fcwf KramersPair();
78 
79 };
80 
81 std::complex<double> inner(const Fcwf& psi, const Fcwf& phi);
82 
83 Fcwf apply(World& world, real_convolution_3d& op, const Fcwf& psi);
84 
85 Fcwf apply(World& world, complex_derivative_3d& op, const Fcwf& psi);
86 
88 
90 
92 
94 
95 Fcwf copy(Fcwf psi);
96 
97 std::complex<double> inner(std::vector<Fcwf>& a, std::vector<Fcwf>& b);
98 
99 std::vector<Fcwf> operator*(const std::vector<Fcwf>& psis, std::complex<double> a);
100 
101 std::vector<Fcwf> operator*(std::complex<double> a, const std::vector<Fcwf>& psis);
102 
103 void operator+=(std::vector<Fcwf>& phi, const std::vector<Fcwf>& psi);
104 
105 std::vector<Fcwf> operator-(const std::vector<Fcwf>& phi, const std::vector<Fcwf>& psi);
106 
107 Tensor<std::complex<double>> matrix_inner(World& world, std::vector<Fcwf>& a, std::vector<Fcwf>& b);
108 
109 std::vector<Fcwf> transform(World& world, std::vector<Fcwf>& a, Tensor<std::complex<double>> U);
110 
111 //allocator class needed for KAIN
114  unsigned int m_size;
115  public:
116  //Constructor
117  Fcwf_vector_allocator(World& world, unsigned int m_size);
118 
119  //Overloading () operator
120  std::vector<Fcwf> operator()();
121 
122  //Copy Constructor
123  Fcwf_vector_allocator operator=(const Fcwf_vector_allocator& other);
124 
125  void set_size(int size);
126 };
127 
128 #endif
129 
130 //kthxbye
Definition: fcwf.h:112
unsigned int m_size
Definition: fcwf.h:114
World & world
Definition: fcwf.h:113
Definition: fcwf.h:12
bool m_initialized
Definition: fcwf.h:14
std::vector< complex_function_3d > m_psi
Definition: fcwf.h:13
Implements derivatives operators with variety of boundary conditions on simulation domain.
Definition: derivative.h:266
A multiresolution adaptive numerical function.
Definition: mra.h:122
A tensor is a multidimension array.
Definition: tensor.h:317
A parallel world class.
Definition: world.h:132
real_function_3d squaremod(Fcwf &psi)
Definition: fcwf.cc:295
real_function_3d squaremod_large(Fcwf &psi)
Definition: fcwf.cc:311
real_function_3d squaremod_small(Fcwf &psi)
Definition: fcwf.cc:303
complex_function_3d inner_func(World &world, Fcwf &psi, Fcwf &phi)
Definition: fcwf.cc:318
double psi(const Vector< double, 3 > &r)
Definition: hatom_energy.cc:78
Tensor< double > op(const Tensor< double > &x)
Definition: kain.cc:508
Main include file for MADNESS and defines Function interface.
File holds all helper structures necessary for the CC_Operator and CC2 class.
Definition: DFParameters.h:10
std::vector< CCPairFunction< T, NDIM > > operator+(const std::vector< CCPairFunction< T, NDIM >> c1, const std::vector< CCPairFunction< T, NDIM > > &c2)
Definition: ccpairfunction.h:1047
response_space scale(response_space a, double b)
std::vector< CCPairFunction< T, NDIM > > operator-(const std::vector< CCPairFunction< T, NDIM >> c1, const std::vector< CCPairFunction< T, NDIM > > &c2)
Definition: ccpairfunction.h:1055
response_space apply(World &world, std::vector< std::vector< std::shared_ptr< real_convolution_3d >>> &op, response_space &f)
Definition: basic_operators.cc:39
void truncate(World &world, response_space &v, double tol, bool fence)
Definition: basic_operators.cc:30
Function< T, NDIM > copy(const Function< T, NDIM > &f, const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > &pmap, bool fence=true)
Create a new copy of the function with different distribution and optional fence.
Definition: mra.h:2002
void compress(World &world, const std::vector< Function< T, NDIM > > &v, bool fence=true)
Compress a vector of functions.
Definition: vmra.h:133
double norm2(World &world, const std::vector< Function< T, NDIM > > &v)
Computes the 2-norm of a vector of functions.
Definition: vmra.h:851
std::vector< CCPairFunction< T, NDIM > > & operator+=(std::vector< CCPairFunction< T, NDIM > > &lhs, const CCPairFunction< T, NDIM > &rhs)
Definition: ccpairfunction.h:1063
std::vector< CCPairFunction< T, NDIM > > & operator-=(std::vector< CCPairFunction< T, NDIM > > &rhs, const std::vector< CCPairFunction< T, NDIM > > &lhs)
Definition: ccpairfunction.h:1077
std::vector< CCPairFunction< T, NDIM > > operator*(const double fac, const std::vector< CCPairFunction< T, NDIM > > &arg)
Definition: ccpairfunction.h:1084
double inner(response_space &a, response_space &b)
Definition: response_functions.h:442
void normalize(World &world, std::vector< Function< T, NDIM > > &v, bool fence=true)
Normalizes a vector of functions — v[i] = v[i].scale(1.0/v[i].norm2())
Definition: vmra.h:1614
std::vector< Function< TENSOR_RESULT_TYPE(T, R), NDIM > > transform(World &world, const std::vector< Function< T, NDIM > > &v, const Tensor< R > &c, bool fence=true)
Transforms a vector of functions according to new[i] = sum[j] old[j]*c[j,i].
Definition: vmra.h:689
void matrix_inner(DistributedMatrix< T > &A, const std::vector< Function< T, NDIM > > &f, const std::vector< Function< T, NDIM > > &g, bool sym=false)
Definition: distpm.cc:46
const std::vector< Function< T, NDIM > > & reconstruct(const std::vector< Function< T, NDIM > > &v)
reconstruct a vector of functions
Definition: vmra.h:156
static const double b
Definition: nonlinschro.cc:119
static const double a
Definition: nonlinschro.cc:118
Implements most functionality of separated operators.
Definition: test_ar.cc:204