WaveBlocksND
Hagedorn.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../types.hpp"
4 #include "../potentials/potentials.hpp"
5 #include "../potentials/bases.hpp"
6 #include "../innerproducts/homogeneous_inner_product.hpp"
7 #include "../innerproducts/vector_inner_product.hpp"
8 
9 #include "basic_steps.hpp"
10 
11 
12 namespace waveblocks {
13  namespace propagators {
14  using wavepackets::ScalarHaWp;
15  using wavepackets::HomogeneousHaWp;
16  using wavepackets::InhomogeneousHaWp;
17  using innerproducts::HomogeneousInnerProduct;
18  using innerproducts::VectorInnerProduct;
19  using steps::StepT;
20  using steps::StepU;
21  using steps::StepW;
22 
37  template <int N, int D, class MultiIndex, class MDQR>
38  struct Hagedorn {
39  // Inhomogeneous wavepackets
40  template<class Potential>
41  static void propagate(InhomogeneousHaWp<D, MultiIndex> &packet,
42  const real_t &delta_t,
43  const Potential &V) {
44  int i = 0;
45  for (auto& component : packet.components()) {
46  auto& params = component.parameters();
47  StepT<N,D>::apply(params, delta_t);
48  StepU<N,D>::inhomogeneous(i, V, params, delta_t);
49  i++;
50  }
51  StepW<InhomogeneousHaWp<D, MultiIndex>, Potential, N, D, VectorInnerProduct<D, MultiIndex, MDQR> >::apply(packet, V, delta_t);
52  for (auto& component : packet.components()) {
53  auto& params = component.parameters();
54  StepT<N,D>::apply(params, delta_t);
55  }
56  }
57 
58  // Homogeneous wavepackets
59  template<class Potential>
60  static void propagate(HomogeneousHaWp<D,MultiIndex> &packet,
61  const real_t &delta_t,
62  const Potential &V) {
63  auto& params = packet.parameters();
64  StepT<N,D>::apply(params, delta_t);
65  StepU<N,D>::homogeneous(V, params, delta_t);
66  StepW<HomogeneousHaWp<D, MultiIndex>, Potential, N, D, VectorInnerProduct<D, MultiIndex, MDQR> >::apply(packet, V, delta_t);
67  StepT<N,D>::apply(params, delta_t);
68  }
69  };
70 
83  template<int D, class MultiIndex, class MDQR>
84  struct Hagedorn<1, D, MultiIndex, MDQR> {
85  // Scalar wavepackets
86  template<class Potential>
87  static void propagate(ScalarHaWp<D, MultiIndex> &packet,
88  const real_t &delta_t,
89  const Potential &V) {
90  auto& params = packet.parameters();
91  StepT<1,D>::apply(params, delta_t);
92  StepU<1,D>::homogeneous(V, params, delta_t);
93  StepW<ScalarHaWp<D, MultiIndex>, Potential, 1, D, HomogeneousInnerProduct<D, MultiIndex, MDQR> >::apply(packet, V, delta_t);
94  StepT<1,D>::apply(params, delta_t);
95  }
96  };
97  }
98 }
static void propagate(InhomogeneousHaWp< D, MultiIndex > &packet, const real_t &delta_t, const Potential &V)
Definition: Hagedorn.hpp:41
Definition: coefficients_file_parser.cpp:10
Implements the Hagedorn propagator for vector valued wavepackets. Offers a method for time propagatio...
Definition: Hagedorn.hpp:38
double real_t
Definition: types.hpp:14
static void propagate(ScalarHaWp< D, MultiIndex > &packet, const real_t &delta_t, const Potential &V)
Definition: Hagedorn.hpp:87
static void propagate(HomogeneousHaWp< D, MultiIndex > &packet, const real_t &delta_t, const Potential &V)
Definition: Hagedorn.hpp:60