diff --git a/docs/1.0.x/.doctrees/environment.pickle b/docs/1.0.x/.doctrees/environment.pickle index b7947a9..e55f5fe 100644 Binary files a/docs/1.0.x/.doctrees/environment.pickle and b/docs/1.0.x/.doctrees/environment.pickle differ diff --git a/docs/1.0.x/doxygen/html/dlr__dyson_8hpp_source.html b/docs/1.0.x/doxygen/html/dlr__dyson_8hpp_source.html index 217a61a..b4f6bed 100644 --- a/docs/1.0.x/doxygen/html/dlr__dyson_8hpp_source.html +++ b/docs/1.0.x/doxygen/html/dlr__dyson_8hpp_source.html @@ -222,8 +222,8 @@
228 
229 } // namespace cppdlr
cppdlr::imtime_ops
Class responsible for all DLR imaginary time operations, including building imaginary time grid and t...
Definition: dlr_imtime.hpp:46
-
cppdlr::imtime_ops::rank
int rank() const
Get DLR rank.
Definition: dlr_imtime.hpp:575
-
cppdlr::imtime_ops::get_itnodes
nda::vector_const_view< double > get_itnodes() const
Get DLR imaginary time nodes.
Definition: dlr_imtime.hpp:537
+
cppdlr::imtime_ops::rank
int rank() const
Get DLR rank.
Definition: dlr_imtime.hpp:572
+
cppdlr::imtime_ops::get_itnodes
nda::vector_const_view< double > get_itnodes() const
Get DLR imaginary time nodes.
Definition: dlr_imtime.hpp:534
dyson_it
Class for solving Dyson equation in imaginary time.
dlr_imtime.hpp
dlr_kernels.hpp
diff --git a/docs/1.0.x/doxygen/html/dlr__imfreq_8hpp_source.html b/docs/1.0.x/doxygen/html/dlr__imfreq_8hpp_source.html index 890e656..4b48caa 100644 --- a/docs/1.0.x/doxygen/html/dlr__imfreq_8hpp_source.html +++ b/docs/1.0.x/doxygen/html/dlr__imfreq_8hpp_source.html @@ -123,175 +123,173 @@
75 
76  if (r != g.shape(0)) throw std::runtime_error("First dim of g != DLR rank r.");
77 
-
78  // Reshape g to matrix w/ first dimension r
-
79  auto g_rs = nda::reshape(g, r, g.size() / r);
-
80  auto gct = nda::matrix<nda::dcomplex>(transpose(g_rs));
-
81 
-
82  // Solve linear system (multiple right hand sides) to convert vals ->
-
83  // coeffs (we transpose because LAPACK requires index into RHS # to be
-
84  // slowest)
-
85  nda::lapack::getrs(if2cf.lu, gct, if2cf.piv);
+
78  // Make a copy of the data in Fortran Layout as required by getrs
+
79  auto gf = nda::array<get_value_t<T>, get_rank<T>, F_layout>(g);
+
80 
+
81  // Reshape as matrix_view with r rows
+
82  auto gfv = nda::reshape(gf, r, g.size() / r);
+
83 
+
84  // Solve linear system (multiple right hand sides) to convert vals -> coeffs
+
85  nda::lapack::getrs(if2cf.lu, gfv, if2cf.piv);
86 
-
87  // Reshape to original dimensions and return
-
88  auto gc = nda::matrix<nda::dcomplex>(transpose(gct));
-
89  return nda::reshape(gc, g.shape());
-
90  }
-
91 
-
101  template <nda::MemoryArray T, nda::Scalar S = nda::get_value_t<T>> make_cplx_t<T> coefs2vals(double beta, T const &gc) const {
-
102  return coefs2vals(make_regular(beta * gc));
-
103  }
+
87  return gf;
+
88  }
+
89 
+
99  template <nda::MemoryArray T, nda::Scalar S = nda::get_value_t<T>> make_cplx_t<T> coefs2vals(double beta, T const &gc) const {
+
100  return coefs2vals(make_regular(beta * gc));
+
101  }
+
102 
+
103  template <nda::MemoryArray T, nda::Scalar S = nda::get_value_t<T>> make_cplx_t<T> coefs2vals(T const &gc) const {
104 
-
105  template <nda::MemoryArray T, nda::Scalar S = nda::get_value_t<T>> make_cplx_t<T> coefs2vals(T const &gc) const {
+
105  if (r != gc.shape(0)) throw std::runtime_error("First dim of g != DLR rank r.");
106 
-
107  if (r != gc.shape(0)) throw std::runtime_error("First dim of g != DLR rank r.");
-
108 
-
109  // Reshape gc to a matrix w/ first dimension r
-
110  auto gc_rs = nda::reshape(gc, r, gc.size() / r);
-
111 
-
112  // Apply coeffs -> vals matrix
-
113  auto g = cf2if * nda::matrix_const_view<S>(gc_rs);
-
114 
-
115  // Reshape to original dimensions and return
-
116  return nda::reshape(g, gc.shape());
-
117  }
-
118 
-
129  template <nda::MemoryArray T, nda::Scalar S = nda::get_value_t<T>> auto coefs2eval(double beta, T const &gc, int n) const {
-
130  return beta * coefs2eval(gc, n);
-
131  }
+
107  // Reshape gc to a matrix w/ first dimension r
+
108  auto gc_rs = nda::reshape(gc, r, gc.size() / r);
+
109 
+
110  // Apply coeffs -> vals matrix
+
111  auto g = cf2if * nda::matrix_const_view<S>(gc_rs);
+
112 
+
113  // Reshape to original dimensions and return
+
114  return nda::reshape(g, gc.shape());
+
115  }
+
116 
+
127  template <nda::MemoryArray T, nda::Scalar S = nda::get_value_t<T>> auto coefs2eval(double beta, T const &gc, int n) const {
+
128  return beta * coefs2eval(gc, n);
+
129  }
+
130 
+
131  template <nda::MemoryArray T, nda::Scalar S = nda::get_value_t<T>> auto coefs2eval(T const &gc, int n) const {
132 
-
133  template <nda::MemoryArray T, nda::Scalar S = nda::get_value_t<T>> auto coefs2eval(T const &gc, int n) const {
+
133  if (r != gc.shape(0)) throw std::runtime_error("First dim of g != DLR rank r.");
134 
-
135  if (r != gc.shape(0)) throw std::runtime_error("First dim of g != DLR rank r.");
+
135  // Scalar-valued Green's functions are handled differently than matrix-valued Green's functions
136 
-
137  // Scalar-valued Green's functions are handled differently than matrix-valued Green's functions
+
137  if constexpr (T::rank == 1) {
138 
-
139  if constexpr (T::rank == 1) {
-
140 
-
141  // Evaluate DLR expansion
-
142  std::complex<double> g = 0;
-
143  for (int l = 0; l < r; ++l) { g += k_if(n, dlr_rf(l), statistic) * gc(l); }
-
144 
-
145  return g;
-
146  } else {
-
147 
-
148  // Reshape gc to matrix w/ first dimension r
-
149  auto gc_rs = nda::reshape(gc, r, gc.size() / r);
-
150 
-
151  // Get output shape
-
152  std::array<long, T::rank - 1> shape_out;
-
153  for (int i = 0; i < T::rank - 1; ++i) { shape_out[i] = gc.shape(i + 1); }
-
154 
-
155  // Get vector of evaluation of DLR expansion at a point
-
156  auto kvec = build_evalvec(n);
-
157 
-
158  // Evaluate DLR expansion, reshape to original dimensions (with first
-
159  // dimension summed out), and return
-
160  return nda::reshape(transpose(nda::matrix_const_view<S>(gc_rs)) * kvec, shape_out);
-
161  }
-
162  }
-
163 
-
172  nda::vector<nda::dcomplex> build_evalvec(double beta, int n) const;
-
173  nda::vector<nda::dcomplex> build_evalvec(int n) const;
-
174 
-
180  nda::vector_const_view<int> get_ifnodes() const { return dlr_if; };
-
181  int get_ifnodes(int i) const { return dlr_if(i); };
-
182 
-
188  nda::vector_const_view<double> get_rfnodes() const { return dlr_rf; };
-
189  double get_rfnodes(int i) const { return dlr_rf(i); };
-
190 
-
196  nda::matrix_const_view<nda::dcomplex> get_cf2if() const { return cf2if; };
-
197 
-
203  nda::matrix_const_view<nda::dcomplex> get_if2cf_lu() const { return if2cf.lu; };
-
204 
-
210  nda::vector_const_view<int> get_if2cf_piv() const { return if2cf.piv; };
-
211 
-
217  int rank() const { return r; }
-
218  double lambda() const { return lambda_; }
-
219  statistic_t get_statistic() const { return statistic; }
-
220 
-
221  private:
-
222  double lambda_;
-
223  statistic_t statistic;
-
224  int r;
-
225  nda::vector<double> dlr_rf;
-
226  nda::vector<int> dlr_if;
-
227  nda::matrix<nda::dcomplex> cf2if;
-
228 
-
232  struct {
-
233  nda::matrix<nda::dcomplex> lu;
-
234  nda::vector<int> piv;
-
235  } if2cf;
+
139  // Evaluate DLR expansion
+
140  std::complex<double> g = 0;
+
141  for (int l = 0; l < r; ++l) { g += k_if(n, dlr_rf(l), statistic) * gc(l); }
+
142 
+
143  return g;
+
144  } else {
+
145 
+
146  // Reshape gc to matrix w/ first dimension r
+
147  auto gc_rs = nda::reshape(gc, r, gc.size() / r);
+
148 
+
149  // Get output shape
+
150  std::array<long, T::rank - 1> shape_out;
+
151  for (int i = 0; i < T::rank - 1; ++i) { shape_out[i] = gc.shape(i + 1); }
+
152 
+
153  // Get vector of evaluation of DLR expansion at a point
+
154  auto kvec = build_evalvec(n);
+
155 
+
156  // Evaluate DLR expansion, reshape to original dimensions (with first
+
157  // dimension summed out), and return
+
158  return nda::reshape(transpose(nda::matrix_const_view<S>(gc_rs)) * kvec, shape_out);
+
159  }
+
160  }
+
161 
+
170  nda::vector<nda::dcomplex> build_evalvec(double beta, int n) const;
+
171  nda::vector<nda::dcomplex> build_evalvec(int n) const;
+
172 
+
178  nda::vector_const_view<int> get_ifnodes() const { return dlr_if; };
+
179  int get_ifnodes(int i) const { return dlr_if(i); };
+
180 
+
186  nda::vector_const_view<double> get_rfnodes() const { return dlr_rf; };
+
187  double get_rfnodes(int i) const { return dlr_rf(i); };
+
188 
+
194  nda::matrix_const_view<nda::dcomplex> get_cf2if() const { return cf2if; };
+
195 
+
201  nda::matrix_const_view<nda::dcomplex> get_if2cf_lu() const { return if2cf.lu; };
+
202 
+
208  nda::vector_const_view<int> get_if2cf_piv() const { return if2cf.piv; };
+
209 
+
215  int rank() const { return r; }
+
216  double lambda() const { return lambda_; }
+
217  statistic_t get_statistic() const { return statistic; }
+
218 
+
219  private:
+
220  double lambda_;
+
221  statistic_t statistic;
+
222  int r;
+
223  nda::vector<double> dlr_rf;
+
224  nda::vector<int> dlr_if;
+
225  nda::matrix<nda::dcomplex> cf2if;
+
226 
+
230  struct {
+
231  nda::matrix<nda::dcomplex> lu;
+
232  nda::vector<int> piv;
+
233  } if2cf;
+
234 
+
235  // -------------------- hdf5 -------------------
236 
-
237  // -------------------- hdf5 -------------------
-
238 
-
239  public:
-
240  static std::string hdf5_format() { return "cppdlr::imfreq_ops"; }
+
237  public:
+
238  static std::string hdf5_format() { return "cppdlr::imfreq_ops"; }
+
239 
+
240  friend void h5_write(h5::group fg, std::string const &subgroup_name, imfreq_ops const &m) {
241 
-
242  friend void h5_write(h5::group fg, std::string const &subgroup_name, imfreq_ops const &m) {
-
243 
-
244  h5::group gr = fg.create_group(subgroup_name);
-
245  write_hdf5_format_as_string(gr, "cppdlr::imfreq_ops");
-
246 
-
247  h5::write(gr, "lambda", m.lambda());
-
248  h5::write<int>(gr, "statistic", m.get_statistic());
-
249  h5::write(gr, "rf", m.get_rfnodes());
-
250  h5::write(gr, "if", m.get_ifnodes());
-
251  h5::write(gr, "cf2if", m.get_cf2if());
-
252  h5::write(gr, "if2cf_lu", m.get_if2cf_lu());
-
253  h5::write(gr, "if2cf_piv", m.get_if2cf_piv());
-
254  }
+
242  h5::group gr = fg.create_group(subgroup_name);
+
243  write_hdf5_format_as_string(gr, "cppdlr::imfreq_ops");
+
244 
+
245  h5::write(gr, "lambda", m.lambda());
+
246  h5::write<int>(gr, "statistic", m.get_statistic());
+
247  h5::write(gr, "rf", m.get_rfnodes());
+
248  h5::write(gr, "if", m.get_ifnodes());
+
249  h5::write(gr, "cf2if", m.get_cf2if());
+
250  h5::write(gr, "if2cf_lu", m.get_if2cf_lu());
+
251  h5::write(gr, "if2cf_piv", m.get_if2cf_piv());
+
252  }
+
253 
+
254  friend void h5_read(h5::group fg, std::string const &subgroup_name, imfreq_ops &m) {
255 
-
256  friend void h5_read(h5::group fg, std::string const &subgroup_name, imfreq_ops &m) {
-
257 
-
258  h5::group gr = fg.open_group(subgroup_name);
-
259  assert_hdf5_format_as_string(gr, "cppdlr::imfreq_ops", true);
-
260 
-
261  double lambda;
-
262  statistic_t statistic_;
-
263  nda::vector<double> rf;
-
264  nda::vector<int> if_;
-
265  nda::matrix<nda::dcomplex> cf2if_;
-
266  nda::matrix<nda::dcomplex> if2cf_lu;
-
267  nda::vector<int> if2cf_piv;
-
268 
-
269  h5::read(gr, "lambda", lambda);
-
270  statistic_ = statistic_t(h5::read<int>(gr, "statistic"));
-
271  h5::read(gr, "rf", rf);
-
272  h5::read(gr, "if", if_);
-
273  h5::read(gr, "cf2if", cf2if_);
-
274  h5::read(gr, "if2cf_lu", if2cf_lu);
-
275  h5::read(gr, "if2cf_piv", if2cf_piv);
-
276 
-
277  m = imfreq_ops(lambda, rf, statistic_, if_, cf2if_, if2cf_lu, if2cf_piv);
-
278  }
-
279  };
-
280 
-
281 } // namespace cppdlr
+
256  h5::group gr = fg.open_group(subgroup_name);
+
257  assert_hdf5_format_as_string(gr, "cppdlr::imfreq_ops", true);
+
258 
+
259  double lambda;
+
260  statistic_t statistic_;
+
261  nda::vector<double> rf;
+
262  nda::vector<int> if_;
+
263  nda::matrix<nda::dcomplex> cf2if_;
+
264  nda::matrix<nda::dcomplex> if2cf_lu;
+
265  nda::vector<int> if2cf_piv;
+
266 
+
267  h5::read(gr, "lambda", lambda);
+
268  statistic_ = statistic_t(h5::read<int>(gr, "statistic"));
+
269  h5::read(gr, "rf", rf);
+
270  h5::read(gr, "if", if_);
+
271  h5::read(gr, "cf2if", cf2if_);
+
272  h5::read(gr, "if2cf_lu", if2cf_lu);
+
273  h5::read(gr, "if2cf_piv", if2cf_piv);
+
274 
+
275  m = imfreq_ops(lambda, rf, statistic_, if_, cf2if_, if2cf_lu, if2cf_piv);
+
276  }
+
277  };
+
278 
+
279 } // namespace cppdlr
cppdlr::imfreq_ops
Class responsible for all DLR imaginary frequency operations, including building imaginary frequency ...
Definition: dlr_imfreq.hpp:38
-
cppdlr::imfreq_ops::get_if2cf_piv
nda::vector_const_view< int > get_if2cf_piv() const
Get LU pivots of transformation matrix from DLR imaginary frequency values to coefficients.
Definition: dlr_imfreq.hpp:210
-
cppdlr::imfreq_ops::rank
int rank() const
Get DLR rank.
Definition: dlr_imfreq.hpp:217
-
cppdlr::imfreq_ops::lambda
double lambda() const
Definition: dlr_imfreq.hpp:218
-
cppdlr::imfreq_ops::h5_write
friend void h5_write(h5::group fg, std::string const &subgroup_name, imfreq_ops const &m)
Definition: dlr_imfreq.hpp:242
+
cppdlr::imfreq_ops::get_if2cf_piv
nda::vector_const_view< int > get_if2cf_piv() const
Get LU pivots of transformation matrix from DLR imaginary frequency values to coefficients.
Definition: dlr_imfreq.hpp:208
+
cppdlr::imfreq_ops::rank
int rank() const
Get DLR rank.
Definition: dlr_imfreq.hpp:215
+
cppdlr::imfreq_ops::lambda
double lambda() const
Definition: dlr_imfreq.hpp:216
+
cppdlr::imfreq_ops::h5_write
friend void h5_write(h5::group fg, std::string const &subgroup_name, imfreq_ops const &m)
Definition: dlr_imfreq.hpp:240
cppdlr::imfreq_ops::build_evalvec
nda::vector< nda::dcomplex > build_evalvec(double beta, int n) const
Get vector of evaluation of DLR expansion at an imaginary frequency point.
Definition: dlr_imfreq.cpp:52
-
cppdlr::imfreq_ops::get_statistic
statistic_t get_statistic() const
Definition: dlr_imfreq.hpp:219
-
cppdlr::imfreq_ops::coefs2vals
make_cplx_t< T > coefs2vals(double beta, T const &gc) const
Transform DLR coefficients of Green's function G to values on DLR imaginary frequency grid.
Definition: dlr_imfreq.hpp:101
-
cppdlr::imfreq_ops::coefs2eval
auto coefs2eval(double beta, T const &gc, int n) const
Evaluate DLR expansion of G, given by its DLR coefficients, at imaginary frequency point.
Definition: dlr_imfreq.hpp:129
-
cppdlr::imfreq_ops::get_ifnodes
int get_ifnodes(int i) const
Definition: dlr_imfreq.hpp:181
-
cppdlr::imfreq_ops::get_cf2if
nda::matrix_const_view< nda::dcomplex > get_cf2if() const
Get transformation matrix from DLR coefficients to values at DLR imaginary frequency nodes.
Definition: dlr_imfreq.hpp:196
-
cppdlr::imfreq_ops::get_rfnodes
nda::vector_const_view< double > get_rfnodes() const
Get DLR real frequency nodes.
Definition: dlr_imfreq.hpp:188
-
cppdlr::imfreq_ops::piv
nda::vector< int > piv
LU pivots (LAPACK format) of imaginary frequency vals -> coefs matrix.
Definition: dlr_imfreq.hpp:234
-
cppdlr::imfreq_ops::h5_read
friend void h5_read(h5::group fg, std::string const &subgroup_name, imfreq_ops &m)
Definition: dlr_imfreq.hpp:256
-
cppdlr::imfreq_ops::get_if2cf_lu
nda::matrix_const_view< nda::dcomplex > get_if2cf_lu() const
Get LU factors of transformation matrix from DLR imaginary frequency values to coefficients.
Definition: dlr_imfreq.hpp:203
+
cppdlr::imfreq_ops::get_statistic
statistic_t get_statistic() const
Definition: dlr_imfreq.hpp:217
+
cppdlr::imfreq_ops::coefs2vals
make_cplx_t< T > coefs2vals(double beta, T const &gc) const
Transform DLR coefficients of Green's function G to values on DLR imaginary frequency grid.
Definition: dlr_imfreq.hpp:99
+
cppdlr::imfreq_ops::coefs2eval
auto coefs2eval(double beta, T const &gc, int n) const
Evaluate DLR expansion of G, given by its DLR coefficients, at imaginary frequency point.
Definition: dlr_imfreq.hpp:127
+
cppdlr::imfreq_ops::get_ifnodes
int get_ifnodes(int i) const
Definition: dlr_imfreq.hpp:179
+
cppdlr::imfreq_ops::get_cf2if
nda::matrix_const_view< nda::dcomplex > get_cf2if() const
Get transformation matrix from DLR coefficients to values at DLR imaginary frequency nodes.
Definition: dlr_imfreq.hpp:194
+
cppdlr::imfreq_ops::get_rfnodes
nda::vector_const_view< double > get_rfnodes() const
Get DLR real frequency nodes.
Definition: dlr_imfreq.hpp:186
+
cppdlr::imfreq_ops::piv
nda::vector< int > piv
LU pivots (LAPACK format) of imaginary frequency vals -> coefs matrix.
Definition: dlr_imfreq.hpp:232
+
cppdlr::imfreq_ops::h5_read
friend void h5_read(h5::group fg, std::string const &subgroup_name, imfreq_ops &m)
Definition: dlr_imfreq.hpp:254
+
cppdlr::imfreq_ops::get_if2cf_lu
nda::matrix_const_view< nda::dcomplex > get_if2cf_lu() const
Get LU factors of transformation matrix from DLR imaginary frequency values to coefficients.
Definition: dlr_imfreq.hpp:201
cppdlr::imfreq_ops::vals2coefs
T::regular_type vals2coefs(double beta, T const &g) const
Transform values of Green's function G on DLR imaginary frequency grid to DLR coefficients.
Definition: dlr_imfreq.hpp:68
-
cppdlr::imfreq_ops::get_rfnodes
double get_rfnodes(int i) const
Definition: dlr_imfreq.hpp:189
+
cppdlr::imfreq_ops::get_rfnodes
double get_rfnodes(int i) const
Definition: dlr_imfreq.hpp:187
cppdlr::imfreq_ops::vals2coefs
T::regular_type vals2coefs(T const &g) const
Definition: dlr_imfreq.hpp:70
-
cppdlr::imfreq_ops::lu
nda::matrix< nda::dcomplex > lu
LU factors (LAPACK format) of imaginary frequency vals -> coefs matrix.
Definition: dlr_imfreq.hpp:233
-
cppdlr::imfreq_ops::get_ifnodes
nda::vector_const_view< int > get_ifnodes() const
Get DLR imaginary frequency nodes.
Definition: dlr_imfreq.hpp:180
-
cppdlr::imfreq_ops::coefs2vals
make_cplx_t< T > coefs2vals(T const &gc) const
Definition: dlr_imfreq.hpp:105
-
cppdlr::imfreq_ops::coefs2eval
auto coefs2eval(T const &gc, int n) const
Definition: dlr_imfreq.hpp:133
+
cppdlr::imfreq_ops::lu
nda::matrix< nda::dcomplex > lu
LU factors (LAPACK format) of imaginary frequency vals -> coefs matrix.
Definition: dlr_imfreq.hpp:231
+
cppdlr::imfreq_ops::get_ifnodes
nda::vector_const_view< int > get_ifnodes() const
Get DLR imaginary frequency nodes.
Definition: dlr_imfreq.hpp:178
+
cppdlr::imfreq_ops::coefs2vals
make_cplx_t< T > coefs2vals(T const &gc) const
Definition: dlr_imfreq.hpp:103
+
cppdlr::imfreq_ops::coefs2eval
auto coefs2eval(T const &gc, int n) const
Definition: dlr_imfreq.hpp:131
cppdlr::imfreq_ops::imfreq_ops
imfreq_ops()=default
cppdlr::imfreq_ops::imfreq_ops
imfreq_ops(double lambda, nda::vector_const_view< double > dlr_rf, statistic_t statistic, nda::vector_const_view< int > dlr_if, nda::matrix_const_view< nda::dcomplex > cf2if, nda::matrix_const_view< nda::dcomplex > if2cf_lu, nda::vector_const_view< int > if2cf_piv)
Definition: dlr_imfreq.hpp:50
-
cppdlr::imfreq_ops::hdf5_format
static std::string hdf5_format()
Definition: dlr_imfreq.hpp:240
+
cppdlr::imfreq_ops::hdf5_format
static std::string hdf5_format()
Definition: dlr_imfreq.hpp:238
dlr_build.hpp
dlr_kernels.hpp
cppdlr
Definition: dlr_build.cpp:27
diff --git a/docs/1.0.x/doxygen/html/dlr__imtime_8hpp_source.html b/docs/1.0.x/doxygen/html/dlr__imtime_8hpp_source.html index a4b54ab..a4d7dbf 100644 --- a/docs/1.0.x/doxygen/html/dlr__imtime_8hpp_source.html +++ b/docs/1.0.x/doxygen/html/dlr__imtime_8hpp_source.html @@ -123,490 +123,487 @@
76 
77  if (r != g.shape(0)) throw std::runtime_error("First dim of g != DLR rank r.");
78 
-
79  // Reshape g to matrix w/ first dimension r
-
80  auto g_rs = nda::reshape(g, r, g.size() / r);
-
81  auto gct = nda::matrix<S>(transpose(g_rs));
-
82 
-
83  // Solve linear system (multiple right hand sides) to convert vals ->
-
84  // coeffs (we transpose because LAPACK requires index into RHS # to be
-
85  // slowest)
-
86 
-
87  if constexpr (nda::have_same_value_type_v<T, decltype(it2cf.lu)>) {
-
88  nda::lapack::getrs(it2cf.lu, gct, it2cf.piv);
-
89  } else {
-
90  // getrs requires matrix and rhs to have same value type
-
91  nda::lapack::getrs(nda::matrix<S>(it2cf.lu), gct, it2cf.piv);
-
92  }
-
93 
-
94  // Reshape to original dimensions and return
-
95  auto gc = nda::matrix<S>(transpose(gct));
-
96  return nda::reshape(gc, g.shape());
-
97  }
-
98 
-
107  template <nda::MemoryArray T, nda::Scalar S = nda::get_value_t<T>> typename T::regular_type coefs2vals(T const &gc) const {
-
108 
-
109  if (r != gc.shape(0)) throw std::runtime_error("First dim of g != DLR rank r.");
+
79  // Make a copy of the data in Fortran Layout as required by getrs
+
80  auto gf = nda::array<get_value_t<T>, get_rank<T>, F_layout>(g);
+
81 
+
82  // Reshape as matrix_view with r rows
+
83  auto gfv = nda::reshape(gf, r, g.size() / r);
+
84 
+
85  // Solve linear system (multiple right hand sides) to convert vals -> coeffs
+
86  if constexpr (nda::have_same_value_type_v<T, decltype(it2cf.lu)>) {
+
87  nda::lapack::getrs(it2cf.lu, gfv, it2cf.piv);
+
88  } else {
+
89  // getrs requires matrix and rhs to have same value type
+
90  nda::lapack::getrs(nda::matrix<S>(it2cf.lu), gfv, it2cf.piv);
+
91  }
+
92 
+
93  return gf;
+
94  }
+
95 
+
104  template <nda::MemoryArray T, nda::Scalar S = nda::get_value_t<T>> typename T::regular_type coefs2vals(T const &gc) const {
+
105 
+
106  if (r != gc.shape(0)) throw std::runtime_error("First dim of g != DLR rank r.");
+
107 
+
108  // Reshape gc to a matrix w/ first dimension r
+
109  auto gc_rs = nda::reshape(gc, r, gc.size() / r);
110 
-
111  // Reshape gc to a matrix w/ first dimension r
-
112  auto gc_rs = nda::reshape(gc, r, gc.size() / r);
+
111  // Apply coeffs -> vals matrix
+
112  auto g = cf2it * nda::matrix_const_view<S>(gc_rs);
113 
-
114  // Apply coeffs -> vals matrix
-
115  auto g = cf2it * nda::matrix_const_view<S>(gc_rs);
-
116 
-
117  // Reshape to original dimensions and return
-
118  return nda::reshape(g, gc.shape());
-
119  }
-
120 
-
135  template <nda::MemoryArray T, nda::Scalar S = nda::get_value_t<T>> auto coefs2eval(T const &gc, double t) const {
-
136 
-
137  if (r != gc.shape(0)) throw std::runtime_error("First dim of g != DLR rank r.");
-
138 
-
139  // Scalar-valued Green's functions are handled differently than matrix-valued Green's functions
-
140 
-
141  if constexpr (T::rank == 1) {
-
142 
-
143  // TODO: can be further optimized to reduce # exponential evals.
-
144  // Evaluate DLR expansion
-
145  S g = 0;
-
146  if (t >= 0) {
-
147  for (int l = 0; l < r; ++l) { g += k_it_abs(t, dlr_rf(l)) * gc(l); }
-
148  } else {
-
149  for (int l = 0; l < r; ++l) { g += k_it_abs(-t, -dlr_rf(l)) * gc(l); }
-
150  }
+
114  // Reshape to original dimensions and return
+
115  return nda::reshape(g, gc.shape());
+
116  }
+
117 
+
132  template <nda::MemoryArray T, nda::Scalar S = nda::get_value_t<T>> auto coefs2eval(T const &gc, double t) const {
+
133 
+
134  if (r != gc.shape(0)) throw std::runtime_error("First dim of g != DLR rank r.");
+
135 
+
136  // Scalar-valued Green's functions are handled differently than matrix-valued Green's functions
+
137 
+
138  if constexpr (T::rank == 1) {
+
139 
+
140  // TODO: can be further optimized to reduce # exponential evals.
+
141  // Evaluate DLR expansion
+
142  S g = 0;
+
143  if (t >= 0) {
+
144  for (int l = 0; l < r; ++l) { g += k_it_abs(t, dlr_rf(l)) * gc(l); }
+
145  } else {
+
146  for (int l = 0; l < r; ++l) { g += k_it_abs(-t, -dlr_rf(l)) * gc(l); }
+
147  }
+
148 
+
149  return g;
+
150  } else {
151 
-
152  return g;
-
153  } else {
+
152  // Reshape gc to matrix w/ first dimension r
+
153  auto gc_rs = nda::reshape(gc, r, gc.size() / r);
154 
-
155  // Reshape gc to matrix w/ first dimension r
-
156  auto gc_rs = nda::reshape(gc, r, gc.size() / r);
-
157 
-
158  // Get output shape
-
159  std::array<long, T::rank - 1> shape_out;
-
160  for (int i = 0; i < T::rank - 1; ++i) { shape_out[i] = gc.shape(i + 1); }
+
155  // Get output shape
+
156  std::array<long, T::rank - 1> shape_out;
+
157  for (int i = 0; i < T::rank - 1; ++i) { shape_out[i] = gc.shape(i + 1); }
+
158 
+
159  // Get vector of evaluation of DLR expansion at a point
+
160  auto kvec = build_evalvec(t);
161 
-
162  // Get vector of evaluation of DLR expansion at a point
-
163  auto kvec = build_evalvec(t);
-
164 
-
165  // Evaluate DLR expansion, reshape to original dimensions (with first
-
166  // dimension summed out), and return
-
167  return nda::reshape(transpose(nda::matrix_const_view<S>(gc_rs)) * kvec, shape_out);
-
168  }
-
169  }
-
170 
-
183  nda::vector<double> build_evalvec(double t) const;
-
184 
-
194  template <nda::MemoryArray T, nda::Scalar S = nda::get_value_t<T>>
-
195  typename T::regular_type fitvals2coefs(nda::vector_const_view<double> t, T const &g) const {
-
196 
-
197  // Check first dimension of g equal to length of t
-
198  int n = t.size();
-
199  if (n != g.shape(0)) throw std::runtime_error("First dim of g must be equal to length of t.");
-
200 
-
201  // Get matrix for least squares fitting: columns are DLR basis functions
-
202  // evaluating at data points t. Must built in Fortran layout for
-
203  // compatibility with LAPACK.
-
204  auto kmat = nda::matrix<S, F_layout>(n, r); // Make sure matrix has same scalar type as g
-
205  for (int j = 0; j < r; ++j) {
-
206  for (int i = 0; i < n; ++i) { kmat(i, j) = k_it(t(i), dlr_rf(j)); }
-
207  }
-
208 
-
209  // Reshape g to matrix w/ first dimension n, and put in Fortran layout for
-
210  // compatibility w/ LAPACK
-
211  auto g_rs = nda::matrix<S, F_layout>(nda::reshape(g, n, g.size() / n));
-
212 
-
213  // Solve least squares problem to obtain DLR coefficients
-
214  auto s = nda::vector<double>(r); // Singular values (not needed)
-
215  int rank = 0; // Rank of system matrix (not needed)
-
216  nda::lapack::gelss(kmat, g_rs, s, 0.0, rank);
-
217 
-
218  auto gc_shape = g.shape(); // Output shape is same as g...
-
219  gc_shape[0] = r; // ...with first dimension n replaced by r
-
220  auto gc = typename T::regular_type(gc_shape); // Output array: output type is same as g
-
221  reshape(gc, r, g.size() / n) = g_rs(nda::range(r), _); // Place result in output array
+
162  // Evaluate DLR expansion, reshape to original dimensions (with first
+
163  // dimension summed out), and return
+
164  return nda::reshape(transpose(nda::matrix_const_view<S>(gc_rs)) * kvec, shape_out);
+
165  }
+
166  }
+
167 
+
180  nda::vector<double> build_evalvec(double t) const;
+
181 
+
191  template <nda::MemoryArray T, nda::Scalar S = nda::get_value_t<T>>
+
192  typename T::regular_type fitvals2coefs(nda::vector_const_view<double> t, T const &g) const {
+
193 
+
194  // Check first dimension of g equal to length of t
+
195  int n = t.size();
+
196  if (n != g.shape(0)) throw std::runtime_error("First dim of g must be equal to length of t.");
+
197 
+
198  // Get matrix for least squares fitting: columns are DLR basis functions
+
199  // evaluating at data points t. Must built in Fortran layout for
+
200  // compatibility with LAPACK.
+
201  auto kmat = nda::matrix<S, F_layout>(n, r); // Make sure matrix has same scalar type as g
+
202  for (int j = 0; j < r; ++j) {
+
203  for (int i = 0; i < n; ++i) { kmat(i, j) = k_it(t(i), dlr_rf(j)); }
+
204  }
+
205 
+
206  // Reshape g to matrix w/ first dimension n, and put in Fortran layout for
+
207  // compatibility w/ LAPACK
+
208  auto g_rs = nda::matrix<S, F_layout>(nda::reshape(g, n, g.size() / n));
+
209 
+
210  // Solve least squares problem to obtain DLR coefficients
+
211  auto s = nda::vector<double>(r); // Singular values (not needed)
+
212  int rank = 0; // Rank of system matrix (not needed)
+
213  nda::lapack::gelss(kmat, g_rs, s, 0.0, rank);
+
214 
+
215  auto gc_shape = g.shape(); // Output shape is same as g...
+
216  gc_shape[0] = r; // ...with first dimension n replaced by r
+
217  auto gc = typename T::regular_type(gc_shape); // Output array: output type is same as g
+
218  reshape(gc, r, g.size() / n) = g_rs(nda::range(r), _); // Place result in output array
+
219 
+
220  return gc;
+
221  }
222 
-
223  return gc;
-
224  }
-
225 
-
237  template <nda::MemoryArray T> typename T::regular_type reflect(T const &g) const {
-
238 
-
239  if (r != g.shape(0)) throw std::runtime_error("First dim of g != DLR rank r.");
+
234  template <nda::MemoryArray T> typename T::regular_type reflect(T const &g) const {
+
235 
+
236  if (r != g.shape(0)) throw std::runtime_error("First dim of g != DLR rank r.");
+
237 
+
238  // Initialize reflection matrix, if it hasn't been done already
+
239  if (refl.empty()) { reflect_init(); }
240 
-
241  // Initialize reflection matrix, if it hasn't been done already
-
242  if (refl.empty()) { reflect_init(); }
-
243 
-
244  if constexpr (T::rank == 1) { // Scalar-valued Green's function
-
245  return matmul(refl, g);
-
246  } else {
-
247  auto gr = typename T::regular_type(g.shape()); // Output has same type/shape as g
-
248  reshape(gr, r, g.size() / r) = matmul(refl, reshape(g, r, g.size() / r)); // Reshape, matrix multiply, reshape back
-
249  return gr;
-
250  }
-
251  }
-
252 
-
253 
-
283  template <nda::MemoryArray T, nda::Scalar S = nda::get_value_t<T>>
-
284  typename T::regular_type convolve(double beta, statistic_t statistic, T const &fc, T const &gc, bool time_order = false) const {
+
241  if constexpr (T::rank == 1) { // Scalar-valued Green's function
+
242  return matmul(refl, g);
+
243  } else {
+
244  auto gr = typename T::regular_type(g.shape()); // Output has same type/shape as g
+
245  reshape(gr, r, g.size() / r) = matmul(refl, reshape(g, r, g.size() / r)); // Reshape, matrix multiply, reshape back
+
246  return gr;
+
247  }
+
248  }
+
249 
+
250 
+
280  template <nda::MemoryArray T, nda::Scalar S = nda::get_value_t<T>>
+
281  typename T::regular_type convolve(double beta, statistic_t statistic, T const &fc, T const &gc, bool time_order = false) const {
+
282 
+
283  if (r != fc.shape(0) || r != gc.shape(0)) throw std::runtime_error("First dim of input arrays must be equal to DLR rank r.");
+
284  if (fc.shape() != gc.shape()) throw std::runtime_error("Input arrays must have the same shape.");
285 
-
286  if (r != fc.shape(0) || r != gc.shape(0)) throw std::runtime_error("First dim of input arrays must be equal to DLR rank r.");
-
287  if (fc.shape() != gc.shape()) throw std::runtime_error("Input arrays must have the same shape.");
+
286  // TODO: implement bosonic case and remove
+
287  if (statistic == 0) throw std::runtime_error("imtime_ops::convolve not yet implemented for bosonic Green's functions.");
288 
-
289  // TODO: implement bosonic case and remove
-
290  if (statistic == 0) throw std::runtime_error("imtime_ops::convolve not yet implemented for bosonic Green's functions.");
-
291 
-
292  // Initialize convolution, if it hasn't been done already
-
293  if (!time_order & hilb.empty()) { convolve_init(); }
-
294  if (time_order & thilb.empty()) { tconvolve_init(); }
-
295 
-
296  // Get view of helper matrices based on time_order flag
-
297  auto hilb_v = (time_order ? nda::matrix_const_view<double>(thilb) : nda::matrix_const_view<double>(hilb));
-
298  auto tcf2it_v = (time_order ? nda::matrix_const_view<double>(ttcf2it) : nda::matrix_const_view<double>(tcf2it));
-
299 
-
300  if constexpr (T::rank == 1) { // Scalar-valued Green's function
-
301 
-
302  // Take array view of fc and gc
-
303  auto fca = nda::array_const_view<S, 1>(fc);
-
304  auto gca = nda::array_const_view<S, 1>(gc);
+
289  // Initialize convolution, if it hasn't been done already
+
290  if (!time_order & hilb.empty()) { convolve_init(); }
+
291  if (time_order & thilb.empty()) { tconvolve_init(); }
+
292 
+
293  // Get view of helper matrices based on time_order flag
+
294  auto hilb_v = (time_order ? nda::matrix_const_view<double>(thilb) : nda::matrix_const_view<double>(hilb));
+
295  auto tcf2it_v = (time_order ? nda::matrix_const_view<double>(ttcf2it) : nda::matrix_const_view<double>(tcf2it));
+
296 
+
297  if constexpr (T::rank == 1) { // Scalar-valued Green's function
+
298 
+
299  // Take array view of fc and gc
+
300  auto fca = nda::array_const_view<S, 1>(fc);
+
301  auto gca = nda::array_const_view<S, 1>(gc);
+
302 
+
303  // Diagonal contribution
+
304  auto h = arraymult(tcf2it_v, make_regular(fca * gca));
305 
-
306  // Diagonal contribution
-
307  auto h = arraymult(tcf2it_v, make_regular(fca * gca));
-
308 
-
309  // Off-diagonal contribution
-
310  auto tmp = fca * arraymult(hilb_v, gca) + gca * arraymult(hilb_v, fca);
-
311  return beta * (h + arraymult(cf2it, make_regular(tmp)));
-
312 
-
313  } else if (T::rank == 3) { // Matrix-valued Green's function
-
314 
-
315  // Diagonal contribution
-
316  auto fcgc = nda::array<S, 3>(fc.shape()); // Product of coefficients of f and g
-
317  for (int i = 0; i < r; ++i) { fcgc(i, _, _) = arraymult(fc(i, _, _), gc(i, _, _)); }
-
318  auto h = arraymult(tcf2it_v, fcgc);
-
319 
-
320  // Off-diagonal contribution
-
321  auto tmp1 = arraymult(hilb_v, fc);
-
322  auto tmp2 = arraymult(hilb_v, gc);
-
323  for (int i = 0; i < r; ++i) { tmp1(i, _, _) = arraymult(tmp1(i, _, _), gc(i, _, _)) + arraymult(fc(i, _, _), tmp2(i, _, _)); }
-
324 
-
325  return beta * (h + arraymult(cf2it, tmp1));
-
326 
-
327  } else {
-
328  throw std::runtime_error("Input arrays must be rank 1 (scalar-valued Green's function) or 3 (matrix-valued Green's function).");
-
329  }
-
330  }
-
331 
-
353  template <nda::MemoryMatrix Tf, nda::MemoryArray Tg, nda::Scalar Sf = nda::get_value_t<Tf>, nda::Scalar Sg = nda::get_value_t<Tg>,
-
354  nda::Scalar S = typename std::common_type<Sf, Sg>::type>
-
355  typename Tg::regular_type convolve(Tf const &fconv, Tg const &g) const {
-
356 
-
357  if (r != g.shape(0)) throw std::runtime_error("First dim of input g must be equal to DLR rank r.");
-
358 
-
359  if constexpr (Tg::rank == 1) { // Scalar-valued Green's function
-
360 
-
361  if (fconv.shape(1) != g.shape(0)) throw std::runtime_error("Input array dimensions incompatible.");
-
362 
-
363  return arraymult(fconv, g);
-
364 
-
365  } else if (Tg::rank == 3) { // Matrix-valued Green's function
-
366 
-
367  if (fconv.shape(1) != g.shape(0) * g.shape(1)) throw std::runtime_error("Input array dimensions incompatible.");
+
306  // Off-diagonal contribution
+
307  auto tmp = fca * arraymult(hilb_v, gca) + gca * arraymult(hilb_v, fca);
+
308  return beta * (h + arraymult(cf2it, make_regular(tmp)));
+
309 
+
310  } else if (T::rank == 3) { // Matrix-valued Green's function
+
311 
+
312  // Diagonal contribution
+
313  auto fcgc = nda::array<S, 3>(fc.shape()); // Product of coefficients of f and g
+
314  for (int i = 0; i < r; ++i) { fcgc(i, _, _) = arraymult(fc(i, _, _), gc(i, _, _)); }
+
315  auto h = arraymult(tcf2it_v, fcgc);
+
316 
+
317  // Off-diagonal contribution
+
318  auto tmp1 = arraymult(hilb_v, fc);
+
319  auto tmp2 = arraymult(hilb_v, gc);
+
320  for (int i = 0; i < r; ++i) { tmp1(i, _, _) = arraymult(tmp1(i, _, _), gc(i, _, _)) + arraymult(fc(i, _, _), tmp2(i, _, _)); }
+
321 
+
322  return beta * (h + arraymult(cf2it, tmp1));
+
323 
+
324  } else {
+
325  throw std::runtime_error("Input arrays must be rank 1 (scalar-valued Green's function) or 3 (matrix-valued Green's function).");
+
326  }
+
327  }
+
328 
+
350  template <nda::MemoryMatrix Tf, nda::MemoryArray Tg, nda::Scalar Sf = nda::get_value_t<Tf>, nda::Scalar Sg = nda::get_value_t<Tg>,
+
351  nda::Scalar S = typename std::common_type<Sf, Sg>::type>
+
352  typename Tg::regular_type convolve(Tf const &fconv, Tg const &g) const {
+
353 
+
354  if (r != g.shape(0)) throw std::runtime_error("First dim of input g must be equal to DLR rank r.");
+
355 
+
356  if constexpr (Tg::rank == 1) { // Scalar-valued Green's function
+
357 
+
358  if (fconv.shape(1) != g.shape(0)) throw std::runtime_error("Input array dimensions incompatible.");
+
359 
+
360  return arraymult(fconv, g);
+
361 
+
362  } else if (Tg::rank == 3) { // Matrix-valued Green's function
+
363 
+
364  if (fconv.shape(1) != g.shape(0) * g.shape(1)) throw std::runtime_error("Input array dimensions incompatible.");
+
365 
+
366  int norb1 = g.shape(1);
+
367  int norb2 = g.shape(2);
368 
-
369  int norb1 = g.shape(1);
-
370  int norb2 = g.shape(2);
+
369  auto h = nda::array<S, 3>(r, norb1, norb2);
+
370  reshape(h, r * norb1, norb2) = arraymult(fconv, reshape(g, r * norb1, norb2));
371 
-
372  auto h = nda::array<S, 3>(r, norb1, norb2);
-
373  reshape(h, r * norb1, norb2) = arraymult(fconv, reshape(g, r * norb1, norb2));
-
374 
-
375  return h;
-
376 
-
377  } else {
-
378  throw std::runtime_error("Input arrays must be rank 1 (scalar-valued Green's function) or 3 (matrix-valued Green's function).");
-
379  }
-
380  }
-
381 
-
426  template <nda::MemoryArray T, nda::Scalar S = nda::get_value_t<T>>
-
427  nda::matrix<S> convmat(double beta, statistic_t statistic, T const &fc, bool time_order = false) const {
-
428 
-
429  if (r != fc.shape(0)) throw std::runtime_error("First dim of input array must be equal to DLR rank r.");
+
372  return h;
+
373 
+
374  } else {
+
375  throw std::runtime_error("Input arrays must be rank 1 (scalar-valued Green's function) or 3 (matrix-valued Green's function).");
+
376  }
+
377  }
+
378 
+
423  template <nda::MemoryArray T, nda::Scalar S = nda::get_value_t<T>>
+
424  nda::matrix<S> convmat(double beta, statistic_t statistic, T const &fc, bool time_order = false) const {
+
425 
+
426  if (r != fc.shape(0)) throw std::runtime_error("First dim of input array must be equal to DLR rank r.");
+
427 
+
428  // TODO: implement bosonic case and remove
+
429  if (statistic == 0) throw std::runtime_error("imtime_ops::convmat not yet implemented for bosonic Green's functions.");
430 
-
431  // TODO: implement bosonic case and remove
-
432  if (statistic == 0) throw std::runtime_error("imtime_ops::convmat not yet implemented for bosonic Green's functions.");
-
433 
-
434  // Initialize convolution, if it hasn't been done already
-
435  if (!time_order & hilb.empty()) { convolve_init(); }
-
436  if (time_order & thilb.empty()) { tconvolve_init(); }
-
437 
-
438  // Get view of helper matrices based on time_order flag
-
439  auto hilb_v = (time_order ? nda::matrix_const_view<double>(thilb) : nda::matrix_const_view<double>(hilb));
-
440  auto tcf2it_v = (time_order ? nda::matrix_const_view<double>(ttcf2it) : nda::matrix_const_view<double>(tcf2it));
-
441 
-
442  if constexpr (T::rank == 1) { // Scalar-valued Green's function
-
443 
-
444  // First construct convolution matrix from DLR coefficients to DLR grid
-
445  // values
-
446  auto fconv = nda::matrix<S>(r, r); // Matrix of convolution by f
-
447 
-
448  // Diagonal contribution (given by diag(tau_k) * K(tau_k, om_l) * diag(fc_l))
-
449  for (int k = 0; k < r; ++k) {
-
450  for (int l = 0; l < r; ++l) { fconv(k, l) = tcf2it_v(k, l) * fc(l); }
-
451  }
-
452 
-
453  // Off-diagonal contribution (given by K * (diag(hilb*fc) +
-
454  // (diag(fc)*hilb)), where K is the matrix K(dlr_it(k), dlr_rf(l))
-
455  auto tmp1 = arraymult(hilb_v, fc); // hilb * fc
-
456  auto tmp2 = nda::matrix<S>(r, r);
-
457  for (int k = 0; k < r; ++k) {
-
458  for (int l = 0; l < r; ++l) {
-
459  tmp2(k, l) = fc(k) * hilb_v(k, l); // diag(fc) * hilb
-
460  }
-
461  tmp2(k, k) += tmp1(k); // diag(fc)*hilb + diag(hilb*fc)
-
462  }
-
463  fconv += arraymult(cf2it, tmp2);
-
464 
-
465  // Then precompose with DLR grid values to DLR coefficients matrix
-
466  if constexpr (nda::have_same_value_type_v<T, decltype(it2cf.lu)>) {
-
467  nda::lapack::getrs(transpose(it2cf.lu), fconv, it2cf.piv); // Note: lapack effectively tranposes fconv by fortran reordering here
-
468  } else {
-
469  // getrs requires matrix and rhs to have same value type
-
470  nda::lapack::getrs(transpose(nda::matrix<S>(it2cf.lu)), fconv, it2cf.piv);
-
471  }
-
472 
-
473  return beta * fconv;
-
474 
-
475  } else if (T::rank == 3) { // Matrix-valued Green's function
+
431  // Initialize convolution, if it hasn't been done already
+
432  if (!time_order & hilb.empty()) { convolve_init(); }
+
433  if (time_order & thilb.empty()) { tconvolve_init(); }
+
434 
+
435  // Get view of helper matrices based on time_order flag
+
436  auto hilb_v = (time_order ? nda::matrix_const_view<double>(thilb) : nda::matrix_const_view<double>(hilb));
+
437  auto tcf2it_v = (time_order ? nda::matrix_const_view<double>(ttcf2it) : nda::matrix_const_view<double>(tcf2it));
+
438 
+
439  if constexpr (T::rank == 1) { // Scalar-valued Green's function
+
440 
+
441  // First construct convolution matrix from DLR coefficients to DLR grid
+
442  // values
+
443  auto fconv = nda::matrix<S>(r, r); // Matrix of convolution by f
+
444 
+
445  // Diagonal contribution (given by diag(tau_k) * K(tau_k, om_l) * diag(fc_l))
+
446  for (int k = 0; k < r; ++k) {
+
447  for (int l = 0; l < r; ++l) { fconv(k, l) = tcf2it_v(k, l) * fc(l); }
+
448  }
+
449 
+
450  // Off-diagonal contribution (given by K * (diag(hilb*fc) +
+
451  // (diag(fc)*hilb)), where K is the matrix K(dlr_it(k), dlr_rf(l))
+
452  auto tmp1 = arraymult(hilb_v, fc); // hilb * fc
+
453  auto tmp2 = nda::matrix<S>(r, r);
+
454  for (int k = 0; k < r; ++k) {
+
455  for (int l = 0; l < r; ++l) {
+
456  tmp2(k, l) = fc(k) * hilb_v(k, l); // diag(fc) * hilb
+
457  }
+
458  tmp2(k, k) += tmp1(k); // diag(fc)*hilb + diag(hilb*fc)
+
459  }
+
460  fconv += arraymult(cf2it, tmp2);
+
461 
+
462  // Then precompose with DLR grid values to DLR coefficients matrix
+
463  if constexpr (nda::have_same_value_type_v<T, decltype(it2cf.lu)>) {
+
464  nda::lapack::getrs(transpose(it2cf.lu), fconv, it2cf.piv); // Note: lapack effectively tranposes fconv by fortran reordering here
+
465  } else {
+
466  // getrs requires matrix and rhs to have same value type
+
467  nda::lapack::getrs(transpose(nda::matrix<S>(it2cf.lu)), fconv, it2cf.piv);
+
468  }
+
469 
+
470  return beta * fconv;
+
471 
+
472  } else if (T::rank == 3) { // Matrix-valued Green's function
+
473 
+
474  int norb1 = fc.shape(1);
+
475  int norb2 = fc.shape(2);
476 
-
477  int norb1 = fc.shape(1);
-
478  int norb2 = fc.shape(2);
-
479 
-
480  // First construct convolution matrix from DLR coefficients to DLR grid
-
481  // values
-
482  auto fconv = nda::matrix<S>(r * norb1, r * norb2); // Matrix of convolution by f
-
483  auto fconv_rs = nda::reshape(fconv, r, norb1, r, norb2); // Array view to index into fconv for conevenience
-
484 
-
485  // Diagonal contribution (given by diag(tau_k) * K(tau_k, om_l) * diag(fc_l))
-
486  for (int k = 0; k < r; ++k) {
-
487  for (int l = 0; l < r; ++l) { fconv_rs(k, _, l, _) = tcf2it_v(k, l) * fc(l, _, _); }
-
488  }
-
489 
-
490  // Off-diagonal contribution (given by K * (diag(hilb*fc) +
-
491  // (diag(fc)*hilb)), where K is the matrix K(dlr_it(k), dlr_rf(l))
-
492  auto tmp1 = arraymult(hilb_v, fc); // hilb * fc
-
493  auto tmp2 = nda::array<S, 4>(r, norb1, r, norb2);
-
494  for (int k = 0; k < r; ++k) {
-
495  for (int l = 0; l < r; ++l) {
-
496  tmp2(k, _, l, _) = fc(k, _, _) * hilb_v(k, l); // diag(fc) * hilb
-
497  }
-
498  tmp2(k, _, k, _) += tmp1(k, _, _); // diag(fc)*hilb + diag(hilb*fc)
-
499  }
-
500  fconv_rs += arraymult(cf2it, tmp2);
-
501 
-
502  // Then precompose with DLR grid values to DLR coefficients matrix
-
503 
-
504  // Transpose last two indices to put make column DLR index the last
-
505  // index
-
506  auto fconvtmp = nda::matrix<S>(r * norb1 * norb2, r);
-
507  auto fconvtmp_rs = nda::reshape(fconvtmp, r, norb1, norb2, r);
-
508  for (int i = 0; i < norb2; ++i) {
-
509  for (int k = 0; k < r; ++k) { fconvtmp_rs(_, _, i, k) = fconv_rs(_, _, k, i); }
-
510  }
-
511 
-
512  // Do the solve
-
513  if constexpr (nda::have_same_value_type_v<T, decltype(it2cf.lu)>) {
-
514  nda::lapack::getrs(transpose(it2cf.lu), fconvtmp, it2cf.piv); // Note: lapack effectively tranposes fconv by fortran reordering here
-
515  } else {
-
516  // getrs requires matrix and rhs to have same value type
-
517  nda::lapack::getrs(transpose(nda::matrix<S>(it2cf.lu)), fconvtmp, it2cf.piv);
-
518  }
-
519 
-
520  // Transpose back
-
521  for (int i = 0; i < norb2; ++i) {
-
522  for (int k = 0; k < r; ++k) { fconv_rs(_, _, k, i) = fconvtmp_rs(_, _, i, k); }
-
523  }
-
524 
-
525  return beta * fconv;
-
526 
-
527  } else {
-
528  throw std::runtime_error("Input arrays must be rank 1 (scalar-valued Green's function) or 3 (matrix-valued Green's function).");
-
529  }
-
530  }
-
531 
-
537  nda::vector_const_view<double> get_itnodes() const { return dlr_it; };
-
538  double get_itnodes(int i) const { return dlr_it(i); };
-
539 
-
546  nda::vector_const_view<double> get_rfnodes() const { return dlr_rf; };
-
547  double get_rfnodes(int i) const { return dlr_rf(i); };
-
548 
-
554  nda::matrix_const_view<double> get_cf2it() const { return cf2it; };
-
555 
-
561  nda::matrix_const_view<double> get_it2cf_lu() const { return it2cf.lu; };
-
562 
-
568  nda::vector_const_view<int> get_it2cf_piv() const { return it2cf.piv; };
-
569 
-
575  int rank() const { return r; }
-
576  double lambda() const { return lambda_; }
-
577 
-
586  void convolve_init() const {
+
477  // First construct convolution matrix from DLR coefficients to DLR grid
+
478  // values
+
479  auto fconv = nda::matrix<S>(r * norb1, r * norb2); // Matrix of convolution by f
+
480  auto fconv_rs = nda::reshape(fconv, r, norb1, r, norb2); // Array view to index into fconv for conevenience
+
481 
+
482  // Diagonal contribution (given by diag(tau_k) * K(tau_k, om_l) * diag(fc_l))
+
483  for (int k = 0; k < r; ++k) {
+
484  for (int l = 0; l < r; ++l) { fconv_rs(k, _, l, _) = tcf2it_v(k, l) * fc(l, _, _); }
+
485  }
+
486 
+
487  // Off-diagonal contribution (given by K * (diag(hilb*fc) +
+
488  // (diag(fc)*hilb)), where K is the matrix K(dlr_it(k), dlr_rf(l))
+
489  auto tmp1 = arraymult(hilb_v, fc); // hilb * fc
+
490  auto tmp2 = nda::array<S, 4>(r, norb1, r, norb2);
+
491  for (int k = 0; k < r; ++k) {
+
492  for (int l = 0; l < r; ++l) {
+
493  tmp2(k, _, l, _) = fc(k, _, _) * hilb_v(k, l); // diag(fc) * hilb
+
494  }
+
495  tmp2(k, _, k, _) += tmp1(k, _, _); // diag(fc)*hilb + diag(hilb*fc)
+
496  }
+
497  fconv_rs += arraymult(cf2it, tmp2);
+
498 
+
499  // Then precompose with DLR grid values to DLR coefficients matrix
+
500 
+
501  // Transpose last two indices to put make column DLR index the last
+
502  // index
+
503  auto fconvtmp = nda::matrix<S>(r * norb1 * norb2, r);
+
504  auto fconvtmp_rs = nda::reshape(fconvtmp, r, norb1, norb2, r);
+
505  for (int i = 0; i < norb2; ++i) {
+
506  for (int k = 0; k < r; ++k) { fconvtmp_rs(_, _, i, k) = fconv_rs(_, _, k, i); }
+
507  }
+
508 
+
509  // Do the solve
+
510  if constexpr (nda::have_same_value_type_v<T, decltype(it2cf.lu)>) {
+
511  nda::lapack::getrs(transpose(it2cf.lu), fconvtmp, it2cf.piv); // Note: lapack effectively tranposes fconv by fortran reordering here
+
512  } else {
+
513  // getrs requires matrix and rhs to have same value type
+
514  nda::lapack::getrs(transpose(nda::matrix<S>(it2cf.lu)), fconvtmp, it2cf.piv);
+
515  }
+
516 
+
517  // Transpose back
+
518  for (int i = 0; i < norb2; ++i) {
+
519  for (int k = 0; k < r; ++k) { fconv_rs(_, _, k, i) = fconvtmp_rs(_, _, i, k); }
+
520  }
+
521 
+
522  return beta * fconv;
+
523 
+
524  } else {
+
525  throw std::runtime_error("Input arrays must be rank 1 (scalar-valued Green's function) or 3 (matrix-valued Green's function).");
+
526  }
+
527  }
+
528 
+
534  nda::vector_const_view<double> get_itnodes() const { return dlr_it; };
+
535  double get_itnodes(int i) const { return dlr_it(i); };
+
536 
+
543  nda::vector_const_view<double> get_rfnodes() const { return dlr_rf; };
+
544  double get_rfnodes(int i) const { return dlr_rf(i); };
+
545 
+
551  nda::matrix_const_view<double> get_cf2it() const { return cf2it; };
+
552 
+
558  nda::matrix_const_view<double> get_it2cf_lu() const { return it2cf.lu; };
+
559 
+
565  nda::vector_const_view<int> get_it2cf_piv() const { return it2cf.piv; };
+
566 
+
572  int rank() const { return r; }
+
573  double lambda() const { return lambda_; }
+
574 
+
583  void convolve_init() const {
+
584 
+
585  hilb = nda::matrix<double>(r, r);
+
586  tcf2it = nda::matrix<double>(r, r);
587 
-
588  hilb = nda::matrix<double>(r, r);
-
589  tcf2it = nda::matrix<double>(r, r);
-
590 
-
591  // "Discrete Hilbert transform" matrix -(1-delta_jk)/(dlr_rf(j) -
-
592  // dlr_rf(k)), scaled by beta
-
593  for (int j = 0; j < r; ++j) {
-
594  for (int k = 0; k < r; ++k) {
-
595  if (j == k) {
-
596  hilb(j, k) = 0;
-
597  } else {
-
598  hilb(j, k) = 1.0 / (dlr_rf(j) - dlr_rf(k));
-
599  }
-
600  }
-
601  }
-
602 
-
603  // Matrix which applies DLR coefficients to imaginary time grid values
-
604  // transformation matrix, and then multiplies the result by tau, the
-
605  // imaginary time variable
-
606  for (int j = 0; j < r; ++j) {
-
607  for (int k = 0; k < r; ++k) {
-
608  if (dlr_it(j) > 0) {
-
609  tcf2it(j, k) = -(dlr_it(j) + k_it(1.0, dlr_rf(k))) * cf2it(j, k);
-
610  } else {
-
611  tcf2it(j, k) = -(dlr_it(j) - k_it(0.0, dlr_rf(k))) * cf2it(j, k);
-
612  }
-
613  }
-
614  }
-
615  }
-
616 
-
626  void tconvolve_init() const {
+
588  // "Discrete Hilbert transform" matrix -(1-delta_jk)/(dlr_rf(j) -
+
589  // dlr_rf(k)), scaled by beta
+
590  for (int j = 0; j < r; ++j) {
+
591  for (int k = 0; k < r; ++k) {
+
592  if (j == k) {
+
593  hilb(j, k) = 0;
+
594  } else {
+
595  hilb(j, k) = 1.0 / (dlr_rf(j) - dlr_rf(k));
+
596  }
+
597  }
+
598  }
+
599 
+
600  // Matrix which applies DLR coefficients to imaginary time grid values
+
601  // transformation matrix, and then multiplies the result by tau, the
+
602  // imaginary time variable
+
603  for (int j = 0; j < r; ++j) {
+
604  for (int k = 0; k < r; ++k) {
+
605  if (dlr_it(j) > 0) {
+
606  tcf2it(j, k) = -(dlr_it(j) + k_it(1.0, dlr_rf(k))) * cf2it(j, k);
+
607  } else {
+
608  tcf2it(j, k) = -(dlr_it(j) - k_it(0.0, dlr_rf(k))) * cf2it(j, k);
+
609  }
+
610  }
+
611  }
+
612  }
+
613 
+
623  void tconvolve_init() const {
+
624 
+
625  thilb = nda::matrix<double>(r, r);
+
626  ttcf2it = nda::matrix<double>(r, r);
627 
-
628  thilb = nda::matrix<double>(r, r);
-
629  ttcf2it = nda::matrix<double>(r, r);
-
630 
-
631  // "Discrete Hilbert transform" matrix
-
632  // -(1-delta_jk)*K(0,dlr_rf(k))/(dlr_rf(j) - dlr_rf(k)) for time-ordered
-
633  // convolution, scaled by beta
-
634  for (int j = 0; j < r; ++j) {
-
635  for (int k = 0; k < r; ++k) {
-
636  if (j == k) {
-
637  thilb(j, k) = 0;
-
638  } else {
-
639  thilb(j, k) = k_it(0.0, dlr_rf(k)) / (dlr_rf(k) - dlr_rf(j));
-
640  }
-
641  }
-
642  }
-
643 
-
644  // Matrix which applies K(0,dlr_rf(j)) multiplication, then DLR
-
645  // coefficients to imaginary time grid values transformation matrix, and
-
646  // then multiplies the result by tau, the imaginary time variable
-
647  for (int j = 0; j < r; ++j) {
-
648  for (int k = 0; k < r; ++k) {
-
649  if (dlr_it(j) > 0) {
-
650  ttcf2it(j, k) = dlr_it(j) * cf2it(j, k) * k_it(0.0, dlr_rf(k));
-
651  } else {
-
652  ttcf2it(j, k) = (1 + dlr_it(j)) * cf2it(j, k) * k_it(0.0, dlr_rf(k));
-
653  }
-
654  }
-
655  }
-
656  }
-
657 
-
667  void reflect_init() const {
-
668 
-
669  refl = nda::matrix<double>(r, r);
-
670 
-
671  // Matrix of reflection acting on DLR coefficients and returning values at
-
672  // DLR nodes
-
673  for (int i = 0; i < r; ++i) {
-
674  for (int j = 0; j < r; ++j) { refl(i, j) = k_it(-dlr_it(i), dlr_rf(j)); }
-
675  }
-
676 
-
677  // Precompose with DLR values to coefficients matrix
-
678  nda::lapack::getrs(transpose(it2cf.lu), refl, it2cf.piv); // Lapack effectively transposes refl by fortran reordering here
-
679  }
-
680 
-
681  private:
-
682  double lambda_;
-
683  int r;
-
684  nda::vector<double> dlr_rf;
-
685  nda::vector<double> dlr_it;
-
686  nda::matrix<double> cf2it;
-
687 
-
691  struct {
-
692  nda::matrix<double> lu;
-
693  nda::vector<int> piv;
-
694  } it2cf;
-
695 
-
696  // Arrays used for dlr_imtime::convolve
-
697  mutable nda::matrix<double> hilb;
-
698  mutable nda::matrix<double> tcf2it;
-
699 
-
700  // Arrays used for dlr_imtime::tconvolve
-
701  mutable nda::matrix<double> thilb;
-
702  mutable nda::matrix<double> ttcf2it;
+
628  // "Discrete Hilbert transform" matrix
+
629  // -(1-delta_jk)*K(0,dlr_rf(k))/(dlr_rf(j) - dlr_rf(k)) for time-ordered
+
630  // convolution, scaled by beta
+
631  for (int j = 0; j < r; ++j) {
+
632  for (int k = 0; k < r; ++k) {
+
633  if (j == k) {
+
634  thilb(j, k) = 0;
+
635  } else {
+
636  thilb(j, k) = k_it(0.0, dlr_rf(k)) / (dlr_rf(k) - dlr_rf(j));
+
637  }
+
638  }
+
639  }
+
640 
+
641  // Matrix which applies K(0,dlr_rf(j)) multiplication, then DLR
+
642  // coefficients to imaginary time grid values transformation matrix, and
+
643  // then multiplies the result by tau, the imaginary time variable
+
644  for (int j = 0; j < r; ++j) {
+
645  for (int k = 0; k < r; ++k) {
+
646  if (dlr_it(j) > 0) {
+
647  ttcf2it(j, k) = dlr_it(j) * cf2it(j, k) * k_it(0.0, dlr_rf(k));
+
648  } else {
+
649  ttcf2it(j, k) = (1 + dlr_it(j)) * cf2it(j, k) * k_it(0.0, dlr_rf(k));
+
650  }
+
651  }
+
652  }
+
653  }
+
654 
+
664  void reflect_init() const {
+
665 
+
666  refl = nda::matrix<double>(r, r);
+
667 
+
668  // Matrix of reflection acting on DLR coefficients and returning values at
+
669  // DLR nodes
+
670  for (int i = 0; i < r; ++i) {
+
671  for (int j = 0; j < r; ++j) { refl(i, j) = k_it(-dlr_it(i), dlr_rf(j)); }
+
672  }
+
673 
+
674  // Precompose with DLR values to coefficients matrix
+
675  nda::lapack::getrs(transpose(it2cf.lu), refl, it2cf.piv); // Lapack effectively transposes refl by fortran reordering here
+
676  }
+
677 
+
678  private:
+
679  double lambda_;
+
680  int r;
+
681  nda::vector<double> dlr_rf;
+
682  nda::vector<double> dlr_it;
+
683  nda::matrix<double> cf2it;
+
684 
+
688  struct {
+
689  nda::matrix<double> lu;
+
690  nda::vector<int> piv;
+
691  } it2cf;
+
692 
+
693  // Arrays used for dlr_imtime::convolve
+
694  mutable nda::matrix<double> hilb;
+
695  mutable nda::matrix<double> tcf2it;
+
696 
+
697  // Arrays used for dlr_imtime::tconvolve
+
698  mutable nda::matrix<double> thilb;
+
699  mutable nda::matrix<double> ttcf2it;
+
700 
+
701  // Arrays used for dlr_imtime::reflect
+
702  mutable nda::matrix<double> refl;
703 
-
704  // Arrays used for dlr_imtime::reflect
-
705  mutable nda::matrix<double> refl;
-
706 
-
707  // -------------------- hdf5 -------------------
+
704  // -------------------- hdf5 -------------------
+
705 
+
706  public:
+
707  static std::string hdf5_format() { return "cppdlr::imtime_ops"; }
708 
-
709  public:
-
710  static std::string hdf5_format() { return "cppdlr::imtime_ops"; }
-
711 
-
712  friend void h5_write(h5::group fg, std::string const &subgroup_name, imtime_ops const &m) {
+
709  friend void h5_write(h5::group fg, std::string const &subgroup_name, imtime_ops const &m) {
+
710 
+
711  h5::group gr = fg.create_group(subgroup_name);
+
712  write_hdf5_format(gr, m);
713 
-
714  h5::group gr = fg.create_group(subgroup_name);
-
715  write_hdf5_format(gr, m);
-
716 
-
717  h5::write(gr, "lambda", m.lambda());
-
718  h5::write(gr, "rf", m.get_rfnodes());
-
719  h5::write(gr, "it", m.get_itnodes());
-
720  h5::write(gr, "cf2it", m.get_cf2it());
-
721  h5::write(gr, "it2cf_lu", m.get_it2cf_lu());
-
722  h5::write(gr, "it2cf_piv", m.get_it2cf_piv());
-
723  }
-
724 
-
725  friend void h5_read(h5::group fg, std::string const &subgroup_name, imtime_ops &m) {
+
714  h5::write(gr, "lambda", m.lambda());
+
715  h5::write(gr, "rf", m.get_rfnodes());
+
716  h5::write(gr, "it", m.get_itnodes());
+
717  h5::write(gr, "cf2it", m.get_cf2it());
+
718  h5::write(gr, "it2cf_lu", m.get_it2cf_lu());
+
719  h5::write(gr, "it2cf_piv", m.get_it2cf_piv());
+
720  }
+
721 
+
722  friend void h5_read(h5::group fg, std::string const &subgroup_name, imtime_ops &m) {
+
723 
+
724  h5::group gr = fg.open_group(subgroup_name);
+
725  assert_hdf5_format(gr, m);
726 
-
727  h5::group gr = fg.open_group(subgroup_name);
-
728  assert_hdf5_format(gr, m);
-
729 
-
730  auto lambda = h5::read<double>(gr, "lambda");
-
731  auto rf = h5::read<nda::vector<double>>(gr, "rf");
-
732  auto it = h5::read<nda::vector<double>>(gr, "it");
-
733  auto cf2it_ = h5::read<nda::matrix<double>>(gr, "cf2it");
-
734  auto it2cf_lu = h5::read<nda::matrix<double>>(gr, "it2cf_lu");
-
735  auto it2cf_piv = h5::read<nda::vector<int>>(gr, "it2cf_piv");
-
736 
-
737  m = imtime_ops(lambda, rf, it, cf2it_, it2cf_lu, it2cf_piv);
-
738  }
-
739  };
-
740 
-
741 } // namespace cppdlr
+
727  auto lambda = h5::read<double>(gr, "lambda");
+
728  auto rf = h5::read<nda::vector<double>>(gr, "rf");
+
729  auto it = h5::read<nda::vector<double>>(gr, "it");
+
730  auto cf2it_ = h5::read<nda::matrix<double>>(gr, "cf2it");
+
731  auto it2cf_lu = h5::read<nda::matrix<double>>(gr, "it2cf_lu");
+
732  auto it2cf_piv = h5::read<nda::vector<int>>(gr, "it2cf_piv");
+
733 
+
734  m = imtime_ops(lambda, rf, it, cf2it_, it2cf_lu, it2cf_piv);
+
735  }
+
736  };
+
737 
+
738 } // namespace cppdlr
cppdlr::imtime_ops
Class responsible for all DLR imaginary time operations, including building imaginary time grid and t...
Definition: dlr_imtime.hpp:46
-
cppdlr::imtime_ops::h5_read
friend void h5_read(h5::group fg, std::string const &subgroup_name, imtime_ops &m)
Definition: dlr_imtime.hpp:725
-
cppdlr::imtime_ops::reflect
T::regular_type reflect(T const &g) const
Compute reflection of imaginary time Green's function.
Definition: dlr_imtime.hpp:237
-
cppdlr::imtime_ops::h5_write
friend void h5_write(h5::group fg, std::string const &subgroup_name, imtime_ops const &m)
Definition: dlr_imtime.hpp:712
-
cppdlr::imtime_ops::coefs2eval
auto coefs2eval(T const &gc, double t) const
Evaluate DLR expansion of G, given by its DLR coefficients, at imaginary time point.
Definition: dlr_imtime.hpp:135
-
cppdlr::imtime_ops::get_cf2it
nda::matrix_const_view< double > get_cf2it() const
Get transformation matrix from DLR coefficients to values at DLR imaginary time nodes.
Definition: dlr_imtime.hpp:554
+
cppdlr::imtime_ops::h5_read
friend void h5_read(h5::group fg, std::string const &subgroup_name, imtime_ops &m)
Definition: dlr_imtime.hpp:722
+
cppdlr::imtime_ops::reflect
T::regular_type reflect(T const &g) const
Compute reflection of imaginary time Green's function.
Definition: dlr_imtime.hpp:234
+
cppdlr::imtime_ops::h5_write
friend void h5_write(h5::group fg, std::string const &subgroup_name, imtime_ops const &m)
Definition: dlr_imtime.hpp:709
+
cppdlr::imtime_ops::coefs2eval
auto coefs2eval(T const &gc, double t) const
Evaluate DLR expansion of G, given by its DLR coefficients, at imaginary time point.
Definition: dlr_imtime.hpp:132
+
cppdlr::imtime_ops::get_cf2it
nda::matrix_const_view< double > get_cf2it() const
Get transformation matrix from DLR coefficients to values at DLR imaginary time nodes.
Definition: dlr_imtime.hpp:551
cppdlr::imtime_ops::build_evalvec
nda::vector< double > build_evalvec(double t) const
Build vector of evaluation of DLR expansion at an imaginary time point.
Definition: dlr_imtime.cpp:56
-
cppdlr::imtime_ops::get_rfnodes
nda::vector_const_view< double > get_rfnodes() const
Get DLR real frequency nodes.
Definition: dlr_imtime.hpp:546
-
cppdlr::imtime_ops::reflect_init
void reflect_init() const
Initialization for reflection method.
Definition: dlr_imtime.hpp:667
-
cppdlr::imtime_ops::lambda
double lambda() const
Definition: dlr_imtime.hpp:576
+
cppdlr::imtime_ops::get_rfnodes
nda::vector_const_view< double > get_rfnodes() const
Get DLR real frequency nodes.
Definition: dlr_imtime.hpp:543
+
cppdlr::imtime_ops::reflect_init
void reflect_init() const
Initialization for reflection method.
Definition: dlr_imtime.hpp:664
+
cppdlr::imtime_ops::lambda
double lambda() const
Definition: dlr_imtime.hpp:573
cppdlr::imtime_ops::imtime_ops
imtime_ops(double lambda, nda::vector_const_view< double > dlr_rf, nda::vector_const_view< double > dlr_it, nda::matrix_const_view< double > cf2it, nda::matrix_const_view< double > it2cf_lu, nda::vector_const_view< int > it2cf_piv)
Definition: dlr_imtime.hpp:57
-
cppdlr::imtime_ops::convmat
nda::matrix< S > convmat(double beta, statistic_t statistic, T const &fc, bool time_order=false) const
Compute matrix of convolution by an imaginary time Green's function.
Definition: dlr_imtime.hpp:427
-
cppdlr::imtime_ops::convolve
T::regular_type convolve(double beta, statistic_t statistic, T const &fc, T const &gc, bool time_order=false) const
Compute convolution of two imaginary time Green's functions.
Definition: dlr_imtime.hpp:284
-
cppdlr::imtime_ops::convolve_init
void convolve_init() const
Initialization for convolution methods.
Definition: dlr_imtime.hpp:586
-
cppdlr::imtime_ops::hdf5_format
static std::string hdf5_format()
Definition: dlr_imtime.hpp:710
-
cppdlr::imtime_ops::fitvals2coefs
T::regular_type fitvals2coefs(nda::vector_const_view< double > t, T const &g) const
Obtain DLR coefficients of a Green's function G from scattered imaginary time grid by least squares f...
Definition: dlr_imtime.hpp:195
-
cppdlr::imtime_ops::coefs2vals
T::regular_type coefs2vals(T const &gc) const
Transform DLR coefficients of Green's function G to values on DLR imaginary time grid.
Definition: dlr_imtime.hpp:107
-
cppdlr::imtime_ops::piv
nda::vector< int > piv
LU pivots (LAPACK format) of imaginary time vals -> coefs matrix.
Definition: dlr_imtime.hpp:693
-
cppdlr::imtime_ops::lu
nda::matrix< double > lu
LU factors (LAPACK format) of imaginary time vals -> coefs matrix.
Definition: dlr_imtime.hpp:692
-
cppdlr::imtime_ops::convolve
Tg::regular_type convolve(Tf const &fconv, Tg const &g) const
Compute convolution of two imaginary time Green's functions, given matrix of convolution by one of th...
Definition: dlr_imtime.hpp:355
-
cppdlr::imtime_ops::rank
int rank() const
Get DLR rank.
Definition: dlr_imtime.hpp:575
-
cppdlr::imtime_ops::get_itnodes
nda::vector_const_view< double > get_itnodes() const
Get DLR imaginary time nodes.
Definition: dlr_imtime.hpp:537
+
cppdlr::imtime_ops::convmat
nda::matrix< S > convmat(double beta, statistic_t statistic, T const &fc, bool time_order=false) const
Compute matrix of convolution by an imaginary time Green's function.
Definition: dlr_imtime.hpp:424
+
cppdlr::imtime_ops::convolve
T::regular_type convolve(double beta, statistic_t statistic, T const &fc, T const &gc, bool time_order=false) const
Compute convolution of two imaginary time Green's functions.
Definition: dlr_imtime.hpp:281
+
cppdlr::imtime_ops::convolve_init
void convolve_init() const
Initialization for convolution methods.
Definition: dlr_imtime.hpp:583
+
cppdlr::imtime_ops::hdf5_format
static std::string hdf5_format()
Definition: dlr_imtime.hpp:707
+
cppdlr::imtime_ops::fitvals2coefs
T::regular_type fitvals2coefs(nda::vector_const_view< double > t, T const &g) const
Obtain DLR coefficients of a Green's function G from scattered imaginary time grid by least squares f...
Definition: dlr_imtime.hpp:192
+
cppdlr::imtime_ops::coefs2vals
T::regular_type coefs2vals(T const &gc) const
Transform DLR coefficients of Green's function G to values on DLR imaginary time grid.
Definition: dlr_imtime.hpp:104
+
cppdlr::imtime_ops::piv
nda::vector< int > piv
LU pivots (LAPACK format) of imaginary time vals -> coefs matrix.
Definition: dlr_imtime.hpp:690
+
cppdlr::imtime_ops::lu
nda::matrix< double > lu
LU factors (LAPACK format) of imaginary time vals -> coefs matrix.
Definition: dlr_imtime.hpp:689
+
cppdlr::imtime_ops::convolve
Tg::regular_type convolve(Tf const &fconv, Tg const &g) const
Compute convolution of two imaginary time Green's functions, given matrix of convolution by one of th...
Definition: dlr_imtime.hpp:352
+
cppdlr::imtime_ops::rank
int rank() const
Get DLR rank.
Definition: dlr_imtime.hpp:572
+
cppdlr::imtime_ops::get_itnodes
nda::vector_const_view< double > get_itnodes() const
Get DLR imaginary time nodes.
Definition: dlr_imtime.hpp:534
cppdlr::imtime_ops::vals2coefs
T::regular_type vals2coefs(T const &g) const
Transform values of Green's function G on DLR imaginary time grid to DLR coefficients.
Definition: dlr_imtime.hpp:71
cppdlr::imtime_ops::imtime_ops
imtime_ops()=default
-
cppdlr::imtime_ops::get_rfnodes
double get_rfnodes(int i) const
Definition: dlr_imtime.hpp:547
-
cppdlr::imtime_ops::get_it2cf_piv
nda::vector_const_view< int > get_it2cf_piv() const
Get LU pivots of transformation matrix from DLR imaginary time values to coefficients.
Definition: dlr_imtime.hpp:568
-
cppdlr::imtime_ops::tconvolve_init
void tconvolve_init() const
Initialization for time-ordered convolution methods.
Definition: dlr_imtime.hpp:626
-
cppdlr::imtime_ops::get_itnodes
double get_itnodes(int i) const
Definition: dlr_imtime.hpp:538
-
cppdlr::imtime_ops::get_it2cf_lu
nda::matrix_const_view< double > get_it2cf_lu() const
Get LU factors of transformation matrix from DLR imaginary time values to coefficients.
Definition: dlr_imtime.hpp:561
+
cppdlr::imtime_ops::get_rfnodes
double get_rfnodes(int i) const
Definition: dlr_imtime.hpp:544
+
cppdlr::imtime_ops::get_it2cf_piv
nda::vector_const_view< int > get_it2cf_piv() const
Get LU pivots of transformation matrix from DLR imaginary time values to coefficients.
Definition: dlr_imtime.hpp:565
+
cppdlr::imtime_ops::tconvolve_init
void tconvolve_init() const
Initialization for time-ordered convolution methods.
Definition: dlr_imtime.hpp:623
+
cppdlr::imtime_ops::get_itnodes
double get_itnodes(int i) const
Definition: dlr_imtime.hpp:535
+
cppdlr::imtime_ops::get_it2cf_lu
nda::matrix_const_view< double > get_it2cf_lu() const
Get LU factors of transformation matrix from DLR imaginary time values to coefficients.
Definition: dlr_imtime.hpp:558
dlr_build.hpp
dlr_kernels.hpp
cppdlr
Definition: dlr_build.cpp:27
diff --git a/docs/1.0.x/searchindex.js b/docs/1.0.x/searchindex.js index feb4337..dbeb5ef 100644 --- a/docs/1.0.x/searchindex.js +++ b/docs/1.0.x/searchindex.js @@ -1 +1 @@ -Search.setIndex({"docnames": ["ChangeLog", "background", "documentation", "examples", "index", "install", "issues"], "filenames": ["ChangeLog.md", "background.rst", "documentation.rst", "examples.rst", "index.rst", "install.rst", "issues.rst"], "titles": ["Changelog", "Background", "Reference documentation", "Examples", "cppdlr: Imaginary time calculations using the discrete Lehmann representation", "Installation", "Reporting issues"], "terms": {"thi": [0, 1, 3, 5], "i": [0, 1, 3, 4, 5], "initi": 0, "releas": [0, 5], "cppdlr": [0, 1, 5, 6], "c": [0, 1, 4], "librari": [0, 5], "implement": [0, 1, 4], "discret": [0, 3], "lehmann": [0, 3], "represent": [0, 3], "imaginari": 0, "time": 0, "green": [0, 3, 4], "": [0, 3, 4], "function": [0, 3, 4], "we": [0, 1, 3, 5], "thank": 0, "all": [0, 1, 3, 5, 6], "contributor": 0, "thoma": 0, "hahn": 0, "jason": [0, 4], "kay": [0, 4], "hugo": [0, 4], "u": [0, 1, 4, 5], "r": [0, 1, 3, 4], "strand": [0, 4], "nil": 0, "wentzel": 0, "page": [1, 3, 4, 6], "give": [1, 3], "brief": [1, 3, 4], "review": 1, "establish": 1, "definit": [1, 3], "convent": [1, 3], "us": [1, 3, 5], "which": [1, 3, 4, 5], "can": [1, 3, 4, 5], "vari": 1, "from": [1, 3, 4, 5], "one": [1, 3, 4], "refer": 1, "anoth": 1, "If": [1, 3, 4, 5], "you": [1, 3, 4, 5], "ar": [1, 3, 4, 5], "alreadi": 1, "familiar": [1, 4], "should": [1, 3, 4], "probabl": 1, "still": [1, 4], "read": [1, 3, 4], "section": [1, 3, 5], "rel": [1, 3], "below": [1, 3, 4, 5], "For": [1, 3], "more": [1, 3, 4], "detail": [1, 3, 4], "descript": [1, 3], "pleas": [1, 3, 4, 5, 6], "see": [1, 3, 5], "list": [1, 4], "main": [1, 3], "exampl": [1, 4], "concept": 1, "The": [1, 3, 4, 5], "singl": [1, 4], "particl": [1, 4], "defin": [1, 3], "term": [1, 3], "order": 1, "expect": 1, "valu": [1, 3], "g_": 1, "ab": 1, "tau": [1, 3], "langl": 1, "mathcal": 1, "t": 1, "c_a": 1, "c_b": 1, "dagger": 1, "0": [1, 3, 5], "rangl": 1, "where": [1, 5], "dagger_b": 1, "creation": 1, "state": 1, "b": [1, 4], "annihil": 1, "interv": 1, "beta": [1, 3], "invers": [1, 3], "temperatur": [1, 3], "extend": 1, "period": 1, "anti": 1, "properti": 1, "xi": 1, "boson": 1, "1": [1, 3, 5], "fermion": [1, 3], "respect": [1, 3], "spectral": [1, 3], "given": [1, 3], "g": [1, 3], "int_": 1, "infti": 1, "k": [1, 3], "omega": [1, 3], "rho": [1, 3], "d": 1, "correspond": [1, 3], "analyt": [1, 3], "continu": 1, "kernel": 1, "frac": [1, 3], "e": [1, 3], "take": [1, 3, 4], "fourier": [1, 3], "transform": [1, 3], "nu_n": [1, 3], "tanh": 1, "2": [1, 3, 5], "here": [1, 3], "n": [1, 3], "pi": 1, "2n": 1, "make": [1, 5], "low": 1, "rank": 1, "approxim": 1, "interpol": [1, 4], "decomposit": 1, "let": [1, 5], "dimensionless": 1, "cutoff": [1, 3], "paramt": 1, "lambda": [1, 3], "equiv": [1, 3], "omega_": [1, 3], "max": [1, 3], "outsid": 1, "In": [1, 3, 5], "practic": [1, 3], "typic": 1, "known": [1, 3], "estim": 1, "user": [1, 3, 4], "specifi": [1, 3, 5], "paramet": [1, 3], "case": [1, 3], "exactli": 1, "result": [1, 3], "converg": [1, 3], "error": [1, 3], "toler": [1, 3], "epsilon": [1, 3], "an": [1, 3, 5], "begin": [1, 3, 4], "equat": [1, 3], "approx": [1, 3], "sum_": [1, 3], "l": [1, 3], "omega_l": [1, 3], "widehat": [1, 3], "_l": [1, 3], "label": 1, "dlrexp": 1, "tag": [1, 5], "end": 1, "equal": 1, "accuraci": [1, 3], "determin": [1, 3], "carefulli": 1, "chosen": 1, "pivot": 1, "gram": 1, "schmidt": 1, "procedur": 1, "depend": [1, 4], "onli": [1, 3], "itself": [1, 5], "As": 1, "close": 1, "relat": 1, "intermedi": 1, "spars": 1, "ir": 1, "orthogon": 1, "non": [1, 3], "explicit": 1, "have": [1, 3, 5], "o": 1, "log": 1, "thu": 1, "enabl": 1, "highli": 1, "effici": [1, 4], "high": 1, "accur": 1, "number": [1, 3], "degre": 1, "freedom": 1, "independ": 1, "specif": [1, 4], "structur": 1, "beyond": 1, "its": [1, 3], "coeffici": [1, 3], "must": 1, "some": [1, 3], "sampl": 1, "done": [1, 3], "fit": [1, 3], "data": [1, 3], "via": [1, 4, 5], "ordinari": 1, "least": 1, "squar": 1, "node": [1, 3], "tau_k": [1, 3], "These": [1, 3], "also": [1, 3, 4, 5], "particular": [1, 3, 5], "solv": [1, 3], "linear": [1, 3], "system": [1, 3, 4], "problem": [1, 3, 6], "obtain": [1, 3], "evalu": [1, 4], "eqref": 1, "yield": [1, 3], "dlrexp_imfreq": 1, "so": [1, 3], "directli": [1, 3], "perform": [1, 3], "nu_": 1, "n_k": 1, "whereupon": 1, "sinc": [1, 3], "common": 1, "straightforwardli": 1, "repres": 1, "them": 1, "includ": [1, 3, 5], "explain": 1, "abov": [1, 3, 5], "switch": 1, "between": 1, "addit": [1, 5], "product": 1, "simpli": [1, 3], "multipli": 1, "grid": [1, 3], "h": 1, "f": 1, "recov": 1, "convolut": [1, 3], "full": 1, "int_0": 1, "requir": [1, 5], "condit": 1, "inner": 1, "etc": 1, "form": [1, 4], "vector": [1, 3], "matric": 1, "tensor": 1, "act": 1, "either": 1, "friendli": [1, 3], "manner": 1, "new": [1, 5], "request": 1, "github": [1, 4, 5, 6], "issu": [1, 4, 5], "first": [1, 3], "scale": 1, "becaus": [1, 3], "work": [1, 3, 4, 5], "variabl": [1, 3], "whenev": 1, "possibl": 1, "mani": 1, "unnecessari": 1, "explicitli": 1, "second": 1, "store": 1, "peculiar": 1, "call": [1, 3, 5], "subtl": 1, "awar": 1, "want": [1, 5], "suppli": [1, 3], "tldr": 1, "skip": 1, "guidelin": 1, "even": 1, "discuss": [1, 3], "than": [1, 3, 5], "appendix": 1, "paper": [1, 4], "follow": [1, 3, 4, 5], "5": 1, "normal": 1, "howev": [1, 3], "instead": [1, 5], "other": [1, 4, 5], "word": [1, 3], "neg": 1, "distanc": 1, "rather": [1, 3], "standard": 1, "absolut": 1, "straightforward": 1, "rel2ab": 1, "reason": 1, "ha": [1, 3], "do": [1, 3], "maintain": [1, 4], "float": 1, "arithmet": 1, "To": [1, 3, 4, 5], "sometim": [1, 3], "need": [1, 3, 4], "comput": [1, 3, 4], "veri": 1, "loss": 1, "due": 1, "catastroph": 1, "cancel": 1, "appear": 1, "extrem": 1, "physic": [1, 3], "regim": 1, "exploit": 1, "symmetri": 1, "avoid": 1, "ever": 1, "annoy": 1, "price": 1, "arithm": 1, "But": 1, "larg": [1, 3], "ignor": 1, "notic": 1, "your": [1, 3, 4, 5], "applic": [1, 4, 5], "provid": [1, 4], "carri": 1, "out": 1, "usual": 1, "hide": 1, "technic": 1, "complic": [1, 3], "situat": 1, "two": [1, 3], "option": [1, 4], "power": 1, "accord": 1, "instruct": [1, 4], "relev": [1, 3], "therebi": 1, "calcul": 1, "don": 1, "care": 1, "about": [1, 3, 4], "minor": 1, "digit": 1, "come": 1, "subtleti": 1, "convert": [1, 3], "abs2rel": 1, "start": [1, 3], "life": 1, "cannot": 1, "compat": 1, "subroutin": 1, "happen": 1, "equispac": [1, 3], "eqpts_rel": 1, "gener": [1, 3], "integ": 1, "whether": 1, "statistic_t": 1, "step": [3, 4], "most": 3, "basic": 3, "usag": 3, "within": 3, "overview": [3, 4], "background": [3, 4], "further": 3, "contain": [3, 4], "thorough": 3, "document": [3, 4, 5], "found": 3, "directori": [3, 5], "repositori": [3, 4, 5], "serv": 3, "good": [3, 4], "point": [3, 4], "write": 3, "own": 3, "code": [3, 5], "being": 3, "cover": 3, "test": [3, 5], "compon": 3, "though": 3, "thei": 3, "might": 3, "therefor": 3, "current": [3, 5], "temporari": 3, "measur": 3, "until": 3, "comprehens": 3, "set": 3, "program": 3, "file": 3, "dlr_interpol": 3, "cpp": 3, "know": [3, 5], "look": [3, 4, 5], "up": 3, "find": 3, "inform": [3, 4], "header": 3, "hpp": 3, "necessari": 3, "namespac": 3, "gfun": 3, "simpl": 3, "sum": 3, "delta": 3, "a_i": 3, "taken": 3, "each": 3, "symmetr": 3, "matrix": 3, "There": 3, "noth": 3, "special": 3, "except": 3, "conveni": 3, "matsubara": [3, 4], "space": 3, "direct": 3, "next": 3, "move": [3, 5], "orbit": 3, "indic": 3, "desir": 3, "our": [3, 4], "note": [3, 4], "took": 3, "less": 3, "width": 3, "safe": 3, "unknown": 3, "recommend": [3, 5], "after": 3, "both": [3, 4], "now": 3, "build_dlr_rf": 3, "input": 3, "31": 3, "shown": 3, "although": 3, "dimension": 3, "consid": 3, "back": 3, "origin": [3, 4], "figur": 3, "object": 3, "type": 3, "imtime_op": 3, "class": [3, 4], "respons": 3, "oper": [3, 4], "extract": 3, "get_itnod": 3, "method": 3, "would": 3, "could": 3, "involv": 3, "plot": 3, "vals2coef": 3, "basi": [3, 4], "constitut": 3, "character": 3, "ani": [3, 5], "coefs2ev": 3, "eqptsrel": 3, "format": [3, 4], "true": 3, "compar": 3, "pointwis": 3, "top": 3, "left": 3, "entri": 3, "g_00": 3, "correct": 3, "10": 3, "construct": [3, 4], "imfreq_op": 3, "analog": 3, "index": 3, "again": 3, "agreement": 3, "themselv": 3, "describ": 3, "unit": 3, "sever": 3, "fit_scalar": 3, "fit_matrix": 3, "fit_matrix_cmplx": 3, "convolve_scalar_r": 3, "convolve_scalar_cmplx": 3, "convolve_matrix_r": 3, "convolve_matrix_cmplx": 3, "reflect": 3, "mapsto": 3, "refl_matrix": 3, "interp_scalar": 3, "interp_matrix": 3, "fix": 3, "self": 3, "energi": 3, "dyson": 3, "dyson_it": 3, "dyson_vs_ed_r": 3, "dyson_vs_ed_cmplx": 3, "dyson_beth": 3, "consist": 3, "express": 3, "dyson_bethe_fpi": 3, "dlr": 4, "quantiti": 4, "It": 4, "download": [4, 5], "instal": 4, "unfamiliar": 4, "introduct": 4, "import": 4, "softwar": 4, "publish": 4, "research": 4, "cite": 4, "citat": 4, "help": 4, "encourag": 4, "develop": 4, "open": 4, "sourc": [4, 5], "scientif": 4, "kun": 4, "chen": 4, "olivi": 4, "parcollet": 4, "phy": 4, "rev": 4, "105": 4, "235115": 4, "2022": 4, "arxiv": 4, "2107": 4, "13094": 4, "companion": 4, "libdlr": 4, "briefer": 4, "commun": 4, "280": 4, "108458": 4, "2110": 4, "06765": 4, "avail": [4, 5], "languag": 4, "python": [4, 5], "pydlr": 4, "fortran": 4, "julia": 4, "jl": 4, "toolbox": 4, "interact": 4, "quantum": 4, "triq": 4, "version": 4, "custom": 4, "cmake": 4, "compil": 4, "clang": 4, "maco": 4, "expans": 4, "frequenc": 4, "domain": 4, "capabl": 4, "report": 4, "stabl": 5, "troubl": 5, "gcc": 5, "12": 5, "later": 5, "OR": 5, "15": 5, "bla": 5, "lapack": 5, "hdf5": 5, "openmp": 5, "mpi": 5, "nda": 5, "built": 5, "automat": 5, "wish": 5, "build": 5, "libclang": 5, "packag": 5, "sphinx": 5, "nbsphinx": 5, "myst_pars": 5, "sphinx_rtd_them": 5, "linkifi": 5, "py": 5, "latest": 5, "clone": 5, "git": 5, "http": [5, 6], "com": [5, 6], "flatironinstitut": [5, 6], "src": 5, "creat": 5, "mkdir": 5, "cd": 5, "dcmake_install_prefix": 5, "path_to_install_dir": 5, "run": 5, "go": 5, "checkout": 5, "4": 5, "configur": 5, "doption1": 5, "value1": 5, "doption2": 5, "value2": 5, "syntax": 5, "path": 5, "path_to_triq": 5, "path_to_cppdlr": 5, "debug": 5, "mode": 5, "dcmake_build_typ": 5, "disabl": 5, "dbuild_test": 5, "off": 5, "dbuild_document": 5, "ON": 5, "flag": 5, "command": 5, "3": 5, "dcmake_c_compil": 5, "dcmake_cxx_compil": 5, "dcmake_cxx_flag": 5, "stdlib": 5, "libc": 5, "doe": 5, "support": 5, "appleclang": 5, "homebrew": 5, "brew": 5, "llvm": 5, "prefix": 5, "opt": 5, "bin": 5, "bug": 6}, "objects": {}, "objtypes": {}, "objnames": {}, "titleterms": {"changelog": 0, "version": [0, 5], "1": 0, "0": 0, "background": 1, "imaginari": [1, 3, 4], "time": [1, 3, 4], "green": 1, "": 1, "function": 1, "lehmann": [1, 4], "represent": [1, 4], "discret": [1, 4], "construct": 1, "dlr": [1, 3], "expans": [1, 3], "matsubara": 1, "frequenc": [1, 3], "domain": 1, "oper": 1, "basi": 1, "point": 1, "format": 1, "refer": [2, 4], "document": 2, "exampl": 3, "form": 3, "via": 3, "interpol": 3, "evalu": 3, "list": 3, "other": 3, "cppdlr": [3, 4], "capabl": 3, "calcul": 4, "us": 4, "get": 4, "start": 4, "relat": 4, "librari": 4, "content": 4, "instal": 5, "depend": 5, "step": 5, "custom": 5, "cmake": 5, "option": 5, "compil": 5, "clang": 5, "note": 5, "maco": 5, "user": 5, "report": 6, "issu": 6}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 8, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1, "sphinx.ext.todo": 2, "sphinx.ext.viewcode": 1, "sphinx": 57}, "alltitles": {"cppdlr: Imaginary time calculations using the discrete Lehmann representation": [[4, "cppdlr-imaginary-time-calculations-using-the-discrete-lehmann-representation"]], "Getting started": [[4, "getting-started"]], "References": [[4, "references"]], "Related libraries": [[4, "related-libraries"]], "Contents:": [[4, null]], "Examples": [[3, "examples"]], "Example: form a DLR expansion via interpolation, and evaluate it in imaginary time and frequency": [[3, "example-form-a-dlr-expansion-via-interpolation-and-evaluate-it-in-imaginary-time-and-frequency"]], "List of examples": [[3, "list-of-examples"]], "List of other cppdlr capabilities": [[3, "list-of-other-cppdlr-capabilities"]], "Installation": [[5, "installation"]], "Dependencies": [[5, "dependencies"]], "Installation steps": [[5, "installation-steps"]], "Versions": [[5, "versions"]], "Custom CMake options": [[5, "custom-cmake-options"]], "Compiling with clang": [[5, "compiling-with-clang"]], "Note for MacOS users": [[5, "note-for-macos-users"]], "Reference documentation": [[2, "reference-documentation"]], "Changelog": [[0, "changelog"]], "Version 1.0.0": [[0, "version-1-0-0"]], "Background": [[1, "background"]], "Imaginary time Green\u2019s functions and the Lehmann representation": [[1, "imaginary-time-green-s-functions-and-the-lehmann-representation"]], "Discrete Lehmann representation": [[1, "discrete-lehmann-representation"]], "Constructing a DLR expansion": [[1, "constructing-a-dlr-expansion"]], "DLR in the Matsubara frequency domain": [[1, "dlr-in-the-matsubara-frequency-domain"]], "Operations in the DLR basis": [[1, "operations-in-the-dlr-basis"]], "Imaginary time point format": [[1, "imaginary-time-point-format"]], "Matsubara frequency point format": [[1, "matsubara-frequency-point-format"]], "Reporting issues": [[6, "reporting-issues"]]}, "indexentries": {}}) \ No newline at end of file +Search.setIndex({"docnames": ["ChangeLog", "background", "documentation", "examples", "index", "install", "issues"], "filenames": ["ChangeLog.md", "background.rst", "documentation.rst", "examples.rst", "index.rst", "install.rst", "issues.rst"], "titles": ["Changelog", "Background", "Reference documentation", "Examples", "cppdlr: Imaginary time calculations using the discrete Lehmann representation", "Installation", "Reporting issues"], "terms": {"thi": [0, 1, 3, 5], "i": [0, 1, 3, 4, 5], "initi": 0, "releas": [0, 5], "cppdlr": [0, 1, 5, 6], "c": [0, 1, 4], "librari": [0, 5], "implement": [0, 1, 4], "discret": [0, 3], "lehmann": [0, 3], "represent": [0, 3], "imaginari": 0, "time": 0, "green": [0, 3, 4], "": [0, 3, 4], "function": [0, 3, 4], "we": [0, 1, 3, 5], "thank": 0, "all": [0, 1, 3, 5, 6], "contributor": 0, "thoma": 0, "hahn": 0, "jason": [0, 4], "kay": [0, 4], "hugo": [0, 4], "u": [0, 1, 4, 5], "r": [0, 1, 3, 4], "strand": [0, 4], "nil": 0, "wentzel": 0, "page": [1, 3, 4, 6], "give": [1, 3], "brief": [1, 3, 4], "review": 1, "establish": 1, "definit": [1, 3], "convent": [1, 3], "us": [1, 3, 5], "which": [1, 3, 4, 5], "can": [1, 3, 4, 5], "vari": 1, "from": [1, 3, 4, 5], "one": [1, 3, 4], "refer": 1, "anoth": 1, "If": [1, 3, 4, 5], "you": [1, 3, 4, 5], "ar": [1, 3, 4, 5], "alreadi": 1, "familiar": [1, 4], "should": [1, 3, 4], "probabl": 1, "still": [1, 4], "read": [1, 3, 4], "section": [1, 3, 5], "rel": [1, 3], "below": [1, 3, 4, 5], "For": [1, 3], "more": [1, 3, 4], "detail": [1, 3, 4], "descript": [1, 3], "pleas": [1, 3, 4, 5, 6], "see": [1, 3, 5], "list": [1, 4], "main": [1, 3], "exampl": [1, 4], "concept": 1, "The": [1, 3, 4, 5], "singl": [1, 4], "particl": [1, 4], "defin": [1, 3], "term": [1, 3], "order": 1, "expect": 1, "valu": [1, 3], "g_": 1, "ab": 1, "tau": [1, 3], "langl": 1, "mathcal": 1, "t": 1, "c_a": 1, "c_b": 1, "dagger": 1, "0": [1, 3, 5], "rangl": 1, "where": [1, 5], "dagger_b": 1, "creation": 1, "state": 1, "b": [1, 4], "annihil": 1, "interv": 1, "beta": [1, 3], "invers": [1, 3], "temperatur": [1, 3], "extend": 1, "period": 1, "anti": 1, "properti": 1, "xi": 1, "boson": 1, "1": [1, 3, 5], "fermion": [1, 3], "respect": [1, 3], "spectral": [1, 3], "given": [1, 3], "g": [1, 3], "int_": 1, "infti": 1, "k": [1, 3], "omega": [1, 3], "rho": [1, 3], "d": 1, "correspond": [1, 3], "analyt": [1, 3], "continu": 1, "kernel": 1, "frac": [1, 3], "e": [1, 3], "take": [1, 3, 4], "fourier": [1, 3], "transform": [1, 3], "nu_n": [1, 3], "tanh": 1, "2": [1, 3, 5], "here": [1, 3], "n": [1, 3], "pi": 1, "2n": 1, "make": [1, 5], "low": 1, "rank": 1, "approxim": 1, "interpol": [1, 4], "decomposit": 1, "let": [1, 5], "dimensionless": 1, "cutoff": [1, 3], "paramt": 1, "lambda": [1, 3], "equiv": [1, 3], "omega_": [1, 3], "max": [1, 3], "outsid": 1, "In": [1, 3, 5], "practic": [1, 3], "typic": 1, "known": [1, 3], "estim": 1, "user": [1, 3, 4], "specifi": [1, 3, 5], "paramet": [1, 3], "case": [1, 3], "exactli": 1, "result": [1, 3], "converg": [1, 3], "error": [1, 3], "toler": [1, 3], "epsilon": [1, 3], "an": [1, 3, 5], "begin": [1, 3, 4], "equat": [1, 3], "approx": [1, 3], "sum_": [1, 3], "l": [1, 3], "omega_l": [1, 3], "widehat": [1, 3], "_l": [1, 3], "label": 1, "dlrexp": 1, "tag": [1, 5], "end": 1, "equal": 1, "accuraci": [1, 3], "determin": [1, 3], "carefulli": 1, "chosen": 1, "pivot": 1, "gram": 1, "schmidt": 1, "procedur": 1, "depend": [1, 4], "onli": [1, 3], "itself": [1, 5], "As": 1, "close": 1, "relat": 1, "intermedi": 1, "spars": 1, "ir": 1, "orthogon": 1, "non": [1, 3], "explicit": 1, "have": [1, 3, 5], "o": 1, "log": 1, "thu": 1, "enabl": 1, "highli": 1, "effici": [1, 4], "high": 1, "accur": 1, "number": [1, 3], "degre": 1, "freedom": 1, "independ": 1, "specif": [1, 4], "structur": 1, "beyond": 1, "its": [1, 3], "coeffici": [1, 3], "must": 1, "some": [1, 3], "sampl": 1, "done": [1, 3], "fit": [1, 3], "data": [1, 3], "via": [1, 4, 5], "ordinari": 1, "least": 1, "squar": 1, "node": [1, 3], "tau_k": [1, 3], "These": [1, 3], "also": [1, 3, 4, 5], "particular": [1, 3, 5], "solv": [1, 3], "linear": [1, 3], "system": [1, 3, 4], "problem": [1, 3, 6], "obtain": [1, 3], "evalu": [1, 4], "eqref": 1, "yield": [1, 3], "dlrexp_imfreq": 1, "so": [1, 3], "directli": [1, 3], "perform": [1, 3], "nu_": 1, "n_k": 1, "whereupon": 1, "sinc": [1, 3], "common": 1, "straightforwardli": 1, "repres": 1, "them": 1, "includ": [1, 3, 5], "explain": 1, "abov": [1, 3, 5], "switch": 1, "between": 1, "addit": [1, 5], "product": 1, "simpli": [1, 3], "multipli": 1, "grid": [1, 3], "h": 1, "f": 1, "recov": 1, "convolut": [1, 3], "full": 1, "int_0": 1, "requir": [1, 5], "condit": 1, "inner": 1, "etc": 1, "form": [1, 4], "vector": [1, 3], "matric": 1, "tensor": 1, "act": 1, "either": 1, "friendli": [1, 3], "manner": 1, "new": [1, 5], "request": 1, "github": [1, 4, 5, 6], "issu": [1, 4, 5], "first": [1, 3], "scale": 1, "becaus": [1, 3], "work": [1, 3, 4, 5], "variabl": [1, 3], "whenev": 1, "possibl": 1, "mani": 1, "unnecessari": 1, "explicitli": 1, "second": 1, "store": 1, "peculiar": 1, "call": [1, 3, 5], "subtl": 1, "awar": 1, "want": [1, 5], "suppli": [1, 3], "tldr": 1, "skip": 1, "guidelin": 1, "even": 1, "discuss": [1, 3], "than": [1, 3, 5], "appendix": 1, "paper": [1, 4], "follow": [1, 3, 4, 5], "5": 1, "normal": 1, "howev": [1, 3], "instead": [1, 5], "other": [1, 4, 5], "word": [1, 3], "neg": 1, "distanc": 1, "rather": [1, 3], "standard": 1, "absolut": 1, "straightforward": 1, "rel2ab": 1, "reason": 1, "ha": [1, 3], "do": [1, 3], "maintain": [1, 4], "float": 1, "arithmet": 1, "To": [1, 3, 4, 5], "sometim": [1, 3], "need": [1, 3, 4], "comput": [1, 3, 4], "veri": 1, "loss": 1, "due": 1, "catastroph": 1, "cancel": 1, "appear": 1, "extrem": 1, "physic": [1, 3], "regim": 1, "exploit": 1, "symmetri": 1, "avoid": 1, "ever": 1, "annoy": 1, "price": 1, "arithm": 1, "But": 1, "larg": [1, 3], "ignor": 1, "notic": 1, "your": [1, 3, 4, 5], "applic": [1, 4, 5], "provid": [1, 4], "carri": 1, "out": 1, "usual": 1, "hide": 1, "technic": 1, "complic": [1, 3], "situat": 1, "two": [1, 3], "option": [1, 4], "power": 1, "accord": 1, "instruct": [1, 4], "relev": [1, 3], "therebi": 1, "calcul": 1, "don": 1, "care": 1, "about": [1, 3, 4], "minor": 1, "digit": 1, "come": 1, "subtleti": 1, "convert": [1, 3], "abs2rel": 1, "start": [1, 3], "life": 1, "cannot": 1, "compat": 1, "subroutin": 1, "happen": 1, "equispac": [1, 3], "eqpts_rel": 1, "gener": [1, 3], "integ": 1, "whether": 1, "statistic_t": 1, "step": [3, 4], "most": 3, "basic": 3, "usag": 3, "within": 3, "overview": [3, 4], "background": [3, 4], "further": 3, "contain": [3, 4], "thorough": 3, "document": [3, 4, 5], "found": 3, "directori": [3, 5], "repositori": [3, 4, 5], "serv": 3, "good": [3, 4], "point": [3, 4], "write": 3, "own": 3, "code": [3, 5], "being": 3, "cover": 3, "test": [3, 5], "compon": 3, "though": 3, "thei": 3, "might": 3, "therefor": 3, "current": [3, 5], "temporari": 3, "measur": 3, "until": 3, "comprehens": 3, "set": 3, "program": 3, "file": 3, "dlr_interpol": 3, "cpp": 3, "know": [3, 5], "look": [3, 4, 5], "up": 3, "find": 3, "inform": [3, 4], "header": 3, "hpp": 3, "necessari": 3, "namespac": 3, "gfun": 3, "simpl": 3, "sum": 3, "delta": 3, "a_i": 3, "taken": 3, "each": 3, "symmetr": 3, "matrix": 3, "There": 3, "noth": 3, "special": 3, "except": 3, "conveni": 3, "matsubara": [3, 4], "space": 3, "direct": 3, "next": 3, "move": [3, 5], "orbit": 3, "indic": 3, "desir": 3, "our": [3, 4], "note": [3, 4], "took": 3, "less": 3, "width": 3, "safe": 3, "unknown": 3, "recommend": [3, 5], "after": 3, "both": [3, 4], "now": 3, "build_dlr_rf": 3, "input": 3, "31": 3, "shown": 3, "although": 3, "dimension": 3, "consid": 3, "back": 3, "origin": [3, 4], "figur": 3, "object": 3, "type": 3, "imtime_op": 3, "class": [3, 4], "respons": 3, "oper": [3, 4], "extract": 3, "get_itnod": 3, "method": 3, "would": 3, "could": 3, "involv": 3, "plot": 3, "vals2coef": 3, "basi": [3, 4], "constitut": 3, "character": 3, "ani": [3, 5], "coefs2ev": 3, "eqptsrel": 3, "format": [3, 4], "true": 3, "compar": 3, "pointwis": 3, "top": 3, "left": 3, "entri": 3, "g_00": 3, "correct": 3, "10": 3, "construct": [3, 4], "imfreq_op": 3, "analog": 3, "index": 3, "again": 3, "agreement": 3, "themselv": 3, "describ": 3, "unit": 3, "sever": 3, "fit_scalar": 3, "fit_matrix": 3, "fit_matrix_cmplx": 3, "convolve_scalar_r": 3, "convolve_scalar_cmplx": 3, "convolve_matrix_r": 3, "convolve_matrix_cmplx": 3, "reflect": 3, "mapsto": 3, "refl_matrix": 3, "interp_scalar": 3, "interp_matrix": 3, "fix": 3, "self": 3, "energi": 3, "dyson": 3, "dyson_it": 3, "dyson_vs_ed_r": 3, "dyson_vs_ed_cmplx": 3, "dyson_beth": 3, "consist": 3, "express": 3, "dyson_bethe_fpi": 3, "dlr": 4, "quantiti": 4, "It": 4, "download": [4, 5], "instal": 4, "unfamiliar": 4, "introduct": 4, "import": 4, "softwar": 4, "publish": 4, "research": 4, "cite": 4, "citat": 4, "help": 4, "encourag": 4, "develop": 4, "open": 4, "sourc": [4, 5], "scientif": 4, "kun": 4, "chen": 4, "olivi": 4, "parcollet": 4, "phy": 4, "rev": 4, "105": 4, "235115": 4, "2022": 4, "arxiv": 4, "2107": 4, "13094": 4, "companion": 4, "libdlr": 4, "briefer": 4, "commun": 4, "280": 4, "108458": 4, "2110": 4, "06765": 4, "avail": [4, 5], "languag": 4, "python": [4, 5], "pydlr": 4, "fortran": 4, "julia": 4, "jl": 4, "toolbox": 4, "interact": 4, "quantum": 4, "triq": 4, "version": 4, "custom": 4, "cmake": 4, "compil": 4, "clang": 4, "maco": 4, "expans": 4, "frequenc": 4, "domain": 4, "capabl": 4, "report": 4, "stabl": 5, "troubl": 5, "gcc": 5, "12": 5, "later": 5, "OR": 5, "15": 5, "bla": 5, "lapack": 5, "hdf5": 5, "openmp": 5, "mpi": 5, "nda": 5, "built": 5, "automat": 5, "wish": 5, "build": 5, "libclang": 5, "packag": 5, "sphinx": 5, "nbsphinx": 5, "myst_pars": 5, "sphinx_rtd_them": 5, "linkifi": 5, "py": 5, "latest": 5, "clone": 5, "git": 5, "http": [5, 6], "com": [5, 6], "flatironinstitut": [5, 6], "src": 5, "creat": 5, "mkdir": 5, "cd": 5, "dcmake_install_prefix": 5, "path_to_install_dir": 5, "run": 5, "go": 5, "checkout": 5, "4": 5, "configur": 5, "doption1": 5, "value1": 5, "doption2": 5, "value2": 5, "syntax": 5, "path": 5, "path_to_triq": 5, "path_to_cppdlr": 5, "debug": 5, "mode": 5, "dcmake_build_typ": 5, "disabl": 5, "dbuild_test": 5, "off": 5, "dbuild_document": 5, "ON": 5, "flag": 5, "command": 5, "3": 5, "dcmake_c_compil": 5, "dcmake_cxx_compil": 5, "dcmake_cxx_flag": 5, "stdlib": 5, "libc": 5, "doe": 5, "support": 5, "appleclang": 5, "homebrew": 5, "brew": 5, "llvm": 5, "prefix": 5, "opt": 5, "bin": 5, "bug": 6}, "objects": {}, "objtypes": {}, "objnames": {}, "titleterms": {"changelog": 0, "version": [0, 5], "1": 0, "0": 0, "background": 1, "imaginari": [1, 3, 4], "time": [1, 3, 4], "green": 1, "": 1, "function": 1, "lehmann": [1, 4], "represent": [1, 4], "discret": [1, 4], "construct": 1, "dlr": [1, 3], "expans": [1, 3], "matsubara": 1, "frequenc": [1, 3], "domain": 1, "oper": 1, "basi": 1, "point": 1, "format": 1, "refer": [2, 4], "document": 2, "exampl": 3, "form": 3, "via": 3, "interpol": 3, "evalu": 3, "list": 3, "other": 3, "cppdlr": [3, 4], "capabl": 3, "calcul": 4, "us": 4, "get": 4, "start": 4, "relat": 4, "librari": 4, "content": 4, "instal": 5, "depend": 5, "step": 5, "custom": 5, "cmake": 5, "option": 5, "compil": 5, "clang": 5, "note": 5, "maco": 5, "user": 5, "report": 6, "issu": 6}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 8, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1, "sphinx.ext.todo": 2, "sphinx.ext.viewcode": 1, "sphinx": 57}, "alltitles": {"Examples": [[3, "examples"]], "Example: form a DLR expansion via interpolation, and evaluate it in imaginary time and frequency": [[3, "example-form-a-dlr-expansion-via-interpolation-and-evaluate-it-in-imaginary-time-and-frequency"]], "List of examples": [[3, "list-of-examples"]], "List of other cppdlr capabilities": [[3, "list-of-other-cppdlr-capabilities"]], "Installation": [[5, "installation"]], "Dependencies": [[5, "dependencies"]], "Installation steps": [[5, "installation-steps"]], "Versions": [[5, "versions"]], "Custom CMake options": [[5, "custom-cmake-options"]], "Compiling with clang": [[5, "compiling-with-clang"]], "Note for MacOS users": [[5, "note-for-macos-users"]], "cppdlr: Imaginary time calculations using the discrete Lehmann representation": [[4, "cppdlr-imaginary-time-calculations-using-the-discrete-lehmann-representation"]], "Getting started": [[4, "getting-started"]], "References": [[4, "references"]], "Related libraries": [[4, "related-libraries"]], "Contents:": [[4, null]], "Background": [[1, "background"]], "Imaginary time Green\u2019s functions and the Lehmann representation": [[1, "imaginary-time-green-s-functions-and-the-lehmann-representation"]], "Discrete Lehmann representation": [[1, "discrete-lehmann-representation"]], "Constructing a DLR expansion": [[1, "constructing-a-dlr-expansion"]], "DLR in the Matsubara frequency domain": [[1, "dlr-in-the-matsubara-frequency-domain"]], "Operations in the DLR basis": [[1, "operations-in-the-dlr-basis"]], "Imaginary time point format": [[1, "imaginary-time-point-format"]], "Matsubara frequency point format": [[1, "matsubara-frequency-point-format"]], "Changelog": [[0, "changelog"]], "Version 1.0.0": [[0, "version-1-0-0"]], "Reference documentation": [[2, "reference-documentation"]], "Reporting issues": [[6, "reporting-issues"]]}, "indexentries": {}}) \ No newline at end of file