QMCPACK
BareKineticHelper.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2021 QMCPACK developers.
6 //
7 // File developed by: Ken Esler, kpesler@gmail.com, University of Illinois at Urbana-Champaign
8 // Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
9 // Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
10 // Jaron T. Krogel, krogeljt@ornl.gov, Oak Ridge National Laboratory
11 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
12 //
13 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
14 //////////////////////////////////////////////////////////////////////////////////////
15 
16 
17 #ifndef QMCPLUSPLUS_BAREKINETICHELPER_H
18 #define QMCPLUSPLUS_BAREKINETICHELPER_H
19 
21 
22 namespace qmcplusplus
23 {
24 /** compute real(laplacian)
25  */
26 template<typename T, unsigned D>
27 inline T laplacian(const TinyVector<T, D>& g, T l)
28 {
29  return dot(g, g) + l;
30 }
31 
32 /** specialization of laplacian with complex g & l
33  */
34 template<typename T, unsigned D>
35 inline T laplacian(const TinyVector<std::complex<T>, D>& g, const std::complex<T>& l)
36 {
37  return l.real() + OTCDot<T, T, D>::apply(g, g);
38 }
39 
40 /** Convenience function to compute \f$\Re( \nabla^2_i \partial \Psi_T/\Psi_T)\f$
41  * @param g OHMMS_DIM dimensional vector for \f$\nabla_i \ln \Psi_T\f$ .
42  * @param l A number, representing \f$\nabla^2_i \ln \Psi_T\f$ .
43  * @param gg OHMMS_DIM dimensional vector containing \f$\nabla_i \partial \ln \Psi_T\f$ .
44  * @param gl A number, representing \f$\nabla^2_i \partial \ln \Psi_T\f$
45  * @param ideriv A number, representing \f$\partial \ln \Psi_T\f$
46  *
47  * @return A number corresponding to \f$\Re( \nabla^2_i \partial \Psi_T/\Psi_T)\f$
48  */
49 
50 template<typename T, unsigned D>
51 inline T dlaplacian(const TinyVector<T, D>& g, const T l, const TinyVector<T, D>& gg, const T gl, const T ideriv)
52 {
53  return gl + l * ideriv + 2.0 * dot(g, gg) + dot(g, g) * ideriv;
54 }
55 
56 template<typename T, unsigned D>
57 inline T dlaplacian(const TinyVector<std::complex<T>, D>& g,
58  const std::complex<T> l,
59  const TinyVector<std::complex<T>, D>& gg,
60  const std::complex<T> gl,
61  const std::complex<T> ideriv)
62 {
63  std::complex<T> l_times_ideriv = l * ideriv;
64  TinyVector<std::complex<T>, D> g_times_ideriv = g * ideriv;
65 
66  return gl.real() + l_times_ideriv.real() + 2.0 * OTCDot<T, T, D>::apply(g, gg) +
67  OTCDot<T, T, D>::apply(g, g_times_ideriv);
68 }
69 
70 } // namespace qmcplusplus
71 #endif
Fixed-size array.
Definition: OhmmsTinyMeta.h:30
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
T dlaplacian(const TinyVector< T, D > &g, const T l, const TinyVector< T, D > &gg, const T gl, const T ideriv)
Convenience function to compute .
static Type_t apply(const TinyVector< std::complex< T1 >, D > &lhs, const TinyVector< std::complex< T2 >, D > &rhs)
T laplacian(const TinyVector< T, D > &g, T l)
compute real(laplacian)
Declaraton of ParticleAttrib<T>
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)