Unverified Commit 44b74f66 authored by Peter Doak's avatar Peter Doak Committed by GitHub
Browse files

Merge pull request #186 from CompFUSE/DCA_post_interpolation

DCA with post interpolation
parents ef03b63b 917e0ddc
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
@@ -143,7 +143,8 @@ private:
  DcaDataType& MOMS;

  func::function<std::complex<ScalarType>, HOST_matrix_dmn_t> Gamma_lattice;
  func::function<std::complex<ScalarType>, func::dmn_variadic<b_b, b_b, k_HOST_VERTEX, WVertexDmn>> chi_0_lattice;
  func::function<std::complex<ScalarType>, func::dmn_variadic<b_b, b_b, k_HOST_VERTEX, WVertexDmn>>
      chi_0_lattice;
  // Matrix in \vec{k} and \omega_n with the diagonal = chi_0_lattice.
  func::function<std::complex<ScalarType>, HOST_matrix_dmn_t> chi_0_lattice_matrix;

@@ -309,8 +310,8 @@ void BseLatticeSolver<ParametersType, DcaDataType, ScalarType>::computeChi0Latti

  clustermapping::coarsegraining_tp<ParametersType, k_HOST_VERTEX> coarsegraining_tp(parameters);

  // DCA+: Compute \chi_0 from continuous lattice self-energy.
  if (parameters.do_dca_plus()) {
  // DCA+/DCA with post-interpolation: Compute \chi_0 from continuous lattice self-energy.
  if (parameters.do_dca_plus() || parameters.doPostInterpolation()) {
    latticemapping::lattice_mapping_sp<ParametersType, k_DCA, k_HOST> lattice_map_sp(parameters);

    MOMS.Sigma_lattice_interpolated = 0.;
@@ -335,7 +336,12 @@ void BseLatticeSolver<ParametersType, DcaDataType, ScalarType>::computeChi0Latti
      lattice_map_sp.execute(MOMS.Sigma, MOMS.Sigma_lattice_interpolated,
                             MOMS.Sigma_lattice_coarsegrained, MOMS.Sigma_lattice);
    }

    if (parameters.do_dca_plus())
      coarsegraining_tp.execute(MOMS.H_HOST, MOMS.Sigma_lattice, chi_0_lattice);

    else  // do_post_interpolation
      coarsegraining_tp.execute(MOMS.H_HOST, MOMS.Sigma_lattice_interpolated, chi_0_lattice);
  }

  // (Standard) DCA: Compute \chi_0 from cluster self-energy.
@@ -367,8 +373,8 @@ void BseLatticeSolver<ParametersType, DcaDataType, ScalarType>::computeGammaLatt
  if (concurrency.id() == concurrency.first())
    std::cout << "\n" << __FUNCTION__ << std::endl;

  // DCA+: Compute Gamma_lattice from an interpolation of Gamma_cluster followed by a deconvolution.
  if (parameters.do_dca_plus()) {
  // DCA+/DCA with post-interpolation: Compute Gamma_lattice with continuous momentum dependence.
  if (parameters.do_dca_plus() || parameters.doPostInterpolation()) {
    latticemapping::lattice_mapping_tp<ParametersType, k_DCA, k_HOST_VERTEX> lattice_map_tp(
        parameters);
    lattice_map_tp.execute(Gamma_cluster, Gamma_lattice);
@@ -809,7 +815,8 @@ void BseLatticeSolver<ParametersType, DcaDataType, ScalarType>::printOnShell() {
        std::complex<ScalarType> norm = 0;

        for (int j = 0; j < k_HOST_VERTEX::dmn_size(); j++) {
          scal_prod += conj(psi_k(j, l)) * leading_eigenvectors(i, 0, 0, j, WVertexDmn::dmn_size() / 2);
          scal_prod +=
              conj(psi_k(j, l)) * leading_eigenvectors(i, 0, 0, j, WVertexDmn::dmn_size() / 2);
          norm += conj(leading_eigenvectors(i, 0, 0, j, WVertexDmn::dmn_size() / 2)) *
                  leading_eigenvectors(i, 0, 0, j, WVertexDmn::dmn_size() / 2);
        }
+4 −1
Original line number Diff line number Diff line
@@ -450,7 +450,10 @@ void DcaData<Parameters>::write(Writer& writer) {
  writer.execute(Sigma_err_);

  if (parameters_.dump_lattice_self_energy()) {
    if (parameters_.do_dca_plus())
      writer.execute(Sigma_lattice);
    else if (parameters_.doPostInterpolation())
      writer.execute(Sigma_lattice_interpolated);
  }

  if (parameters_.dump_cluster_Greens_functions()) {
+1 −1
Original line number Diff line number Diff line
@@ -314,7 +314,7 @@ void DcaLoop<ParametersType, DcaDataType, MCIntegratorType>::perform_lattice_map
  if (concurrency.id() == concurrency.first())
    std::cout << "\n\t\t lattice-mapping " << dca::util::print_time();

  if (parameters.do_dca_plus()) {
  if (parameters.do_dca_plus() || parameters.doPostInterpolation()) {
    if (parameters.hts_approximation()) {
      DcaDataType MOMS_HTS(parameters);

+4 −4
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ void lattice_mapping_tp<parameters_type, source_k_dmn_t, target_k_dmn_t>::execut
    interpolation_obj.execute(f_source, f_target);
  }

  {
  if (parameters.do_dca_plus()) {
    if (concurrency.id() == concurrency.first())
      std::cout << "\n\n start tp-deconvolution of Gamma \n\n";

@@ -139,8 +139,8 @@ void lattice_mapping_tp<parameters_type, source_k_dmn_t, target_k_dmn_t>::plot_f
  util::Plot::heatMap(x, y, z_im);
}

}  // latticemapping
}  // phys
}  // dca
}  // namespace latticemapping
}  // namespace phys
}  // namespace dca

#endif  // DCA_PHYS_DCA_STEP_LATTICE_MAPPING_LATTICE_MAPPING_TP_HPP
+13 −0
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@ public:
        self_energy_mixing_factor_(1.),
        interacting_orbitals_(n_bands),

        do_post_interpolation_(false),

        do_finite_size_qmc_(false),

        k_mesh_recursion_(0),
@@ -82,6 +84,10 @@ public:
    return interacting_orbitals_;
  }

  bool doPostInterpolation() const {
    return do_post_interpolation_;
  }

  bool do_finite_size_qmc() const {
    return do_finite_size_qmc_;
  }
@@ -123,6 +129,8 @@ private:
  double self_energy_mixing_factor_;
  std::vector<int> interacting_orbitals_;

  bool do_post_interpolation_;

  bool do_finite_size_qmc_;

  // coarse-graining
@@ -149,6 +157,7 @@ int DcaParameters::getBufferSize(const Concurrency& concurrency) const {
  buffer_size += concurrency.get_buffer_size(dca_accuracy_);
  buffer_size += concurrency.get_buffer_size(self_energy_mixing_factor_);
  buffer_size += concurrency.get_buffer_size(interacting_orbitals_);
  buffer_size += concurrency.get_buffer_size(do_post_interpolation_);
  buffer_size += concurrency.get_buffer_size(do_finite_size_qmc_);
  buffer_size += concurrency.get_buffer_size(k_mesh_recursion_);
  buffer_size += concurrency.get_buffer_size(coarsegraining_periods_);
@@ -172,6 +181,7 @@ void DcaParameters::pack(const Concurrency& concurrency, char* buffer, int buffe
  concurrency.pack(buffer, buffer_size, position, dca_accuracy_);
  concurrency.pack(buffer, buffer_size, position, self_energy_mixing_factor_);
  concurrency.pack(buffer, buffer_size, position, interacting_orbitals_);
  concurrency.pack(buffer, buffer_size, position, do_post_interpolation_);
  concurrency.pack(buffer, buffer_size, position, do_finite_size_qmc_);
  concurrency.pack(buffer, buffer_size, position, k_mesh_recursion_);
  concurrency.pack(buffer, buffer_size, position, coarsegraining_periods_);
@@ -193,6 +203,7 @@ void DcaParameters::unpack(const Concurrency& concurrency, char* buffer, int buf
  concurrency.unpack(buffer, buffer_size, position, dca_accuracy_);
  concurrency.unpack(buffer, buffer_size, position, self_energy_mixing_factor_);
  concurrency.unpack(buffer, buffer_size, position, interacting_orbitals_);
  concurrency.unpack(buffer, buffer_size, position, do_post_interpolation_);
  concurrency.unpack(buffer, buffer_size, position, do_finite_size_qmc_);
  concurrency.unpack(buffer, buffer_size, position, k_mesh_recursion_);
  concurrency.unpack(buffer, buffer_size, position, coarsegraining_periods_);
@@ -225,6 +236,8 @@ void DcaParameters::readWrite(ReaderOrWriter& reader_or_writer) {
    try_to_read("self-energy-mixing-factor", self_energy_mixing_factor_);
    try_to_read("interacting-orbitals", interacting_orbitals_);

    try_to_read("do-post-interpolation", do_post_interpolation_);

    try_to_read("do-finite-size-QMC", do_finite_size_qmc_);

    try {
Loading