diff --git a/cmake/dca_config.cmake b/cmake/dca_config.cmake index 731e3e1d2..1ef357a91 100644 --- a/cmake/dca_config.cmake +++ b/cmake/dca_config.cmake @@ -121,9 +121,9 @@ endif() # Lattice type set(DCA_LATTICE "square" CACHE STRING "Lattice type, options are: bilayer | complex_square | square | triangular | - Kagome | hund | twoband_Cu | threeband | Rashba_Hubbard | Moire_Hubbard | FeAs | material_NiO | material_FeSn ") + Kagome | hund | twoband_Cu | threeband | Rashba_Hubbard | RealRashba_Hubbard | Moire_Hubbard | FeAs | material_NiO | material_FeSn ") set_property(CACHE DCA_LATTICE PROPERTY STRINGS bilayer complex_square square triangular Kagome hund twoband_Cu threeband - Rashba_Hubbard Moire_Hubbard FeAs material_NiO material_FeSn) + Rashba_Hubbard RealRashba_Hubbard Moire_Hubbard FeAs material_NiO material_FeSn) if (DCA_LATTICE STREQUAL "bilayer") set(DCA_LATTICE_TYPE dca::phys::models::bilayer_lattice) @@ -158,6 +158,10 @@ elseif (DCA_LATTICE STREQUAL "Rashba_Hubbard") set(DCA_LATTICE_TYPE dca::phys::models::RashbaHubbard) set(DCA_LATTICE_INCLUDE "dca/phys/models/analytic_hamiltonians/rashba_hubbard.hpp") +elseif (DCA_LATTICE STREQUAL "RealRashba_Hubbard") + set(DCA_LATTICE_TYPE dca::phys::models::RealRashbaHubbard) + set(DCA_LATTICE_INCLUDE + "dca/phys/models/analytic_hamiltonians/real_rashba_hubbard.hpp") elseif (DCA_LATTICE STREQUAL "Moire_Hubbard") set(DCA_LATTICE_TYPE dca::phys::models::moire_hubbard) set(DCA_LATTICE_INCLUDE @@ -185,7 +189,7 @@ elseif (DCA_LATTICE STREQUAL "material_FeSn") "dca/phys/models/material_hamiltonians/material_lattice.hpp") set(DCA_MODEL_IS_MATERIAL_LATTICE ON CACHE BOOL "is the model a material lattice") else() - message(FATAL_ERROR "Please set DCA_LATTICE to a valid option: bilayer | complex_square | square | triangular | Kagome | hund | twoband_Cu | threeband | Rashba_Hubbard | Moire_Hubbard | FeAs | material_NiO | material_FeSn.") + message(FATAL_ERROR "Please set DCA_LATTICE to a valid option: bilayer | complex_square | square | triangular | Kagome | hund | twoband_Cu | threeband | Rashba_Hubbard | RealRashba_Hubbard | Moire_Hubbard | FeAs | material_NiO | material_FeSn.") endif() # Model type diff --git a/include/dca/phys/models/analytic_hamiltonians/complex_square_lattice.hpp b/include/dca/phys/models/analytic_hamiltonians/complex_square_lattice.hpp index 119086ff7..416a1f6d0 100644 --- a/include/dca/phys/models/analytic_hamiltonians/complex_square_lattice.hpp +++ b/include/dca/phys/models/analytic_hamiltonians/complex_square_lattice.hpp @@ -35,8 +35,8 @@ class complex_square_lattice { static constexpr bool complex_g0 = true; static constexpr bool spin_symmetric = true; - typedef domains::no_symmetry<2> LDA_point_group; - typedef point_group_type DCA_point_group; + using LDA_point_group = domains::no_symmetry<2>; + using DCA_point_group = PointGroup; const static int DIMENSION = 2; const static int BANDS = 1; @@ -59,8 +59,9 @@ class complex_square_lattice { // Initializes the interaction part of the real space Hubbard Hamiltonian. template static void initializeHInteraction( - func::function, - func::dmn_variadic, RDmn>>& H_interaction, + func::function, + func::dmn_variadic, RDmn>>& H_interaction, const parameters_type& parameters); template diff --git a/include/dca/phys/parameters/model_parameters.hpp b/include/dca/phys/parameters/model_parameters.hpp index 590dd4993..c92170f1f 100644 --- a/include/dca/phys/parameters/model_parameters.hpp +++ b/include/dca/phys/parameters/model_parameters.hpp @@ -31,6 +31,7 @@ #include "dca/phys/models/material_hamiltonians/material_lattice.hpp" #include "dca/phys/models/analytic_hamiltonians/hund_lattice.hpp" #include "dca/phys/models/analytic_hamiltonians/rashba_hubbard.hpp" +#include "dca/phys/models/analytic_hamiltonians/real_rashba_hubbard.hpp" #include "dca/phys/models/analytic_hamiltonians/Moire_Hubbard.hpp" #include "dca/phys/models/analytic_hamiltonians/twoband_Cu.hpp" #include "dca/phys/models/analytic_hamiltonians/Kagome_hubbard.hpp" diff --git a/include/dca/phys/parameters/model_parameters_rashba_hubbard.inc b/include/dca/phys/parameters/model_parameters_rashba_hubbard.inc index 3d13890b3..6cd8c513b 100644 --- a/include/dca/phys/parameters/model_parameters_rashba_hubbard.inc +++ b/include/dca/phys/parameters/model_parameters_rashba_hubbard.inc @@ -119,3 +119,115 @@ void ModelParameters << std::endl; } } + + +template +class ModelParameters>> { +public: + ModelParameters() = default; + + template + int getBufferSize(const Concurrency& concurrency) const; + template + void pack(const Concurrency& concurrency, char* buffer, int buffer_size, int& position) const; + template + void unpack(const Concurrency& concurrency, char* buffer, int buffer_size, int& position); + + template + void readWrite(ReaderOrWriter& reader_or_writer); + + double get_t() const { + return t_; + } + + double get_h() const { + return h_; + } + + double get_lambda() const { + return lambda_; + } + + double get_U() const { + return U_; + } + +private: + double t_ = 1; + double h_ = 0.; + double lambda_ = 0.; + double U_ = 0.; +}; + +template +template +int ModelParameters>>::getBufferSize( + const Concurrency& concurrency) const { + int buffer_size = 0; + + buffer_size += concurrency.get_buffer_size(t_); + buffer_size += concurrency.get_buffer_size(h_); + buffer_size += concurrency.get_buffer_size(lambda_); + buffer_size += concurrency.get_buffer_size(U_); + + return buffer_size; +} + +template +template +void ModelParameters>>::pack( + const Concurrency& concurrency, char* buffer, int buffer_size, int& position) const { + concurrency.pack(buffer, buffer_size, position, t_); + concurrency.pack(buffer, buffer_size, position, h_); + concurrency.pack(buffer, buffer_size, position, lambda_); + concurrency.pack(buffer, buffer_size, position, U_); +} + +template +template +void ModelParameters>>::unpack( + const Concurrency& concurrency, char* buffer, int buffer_size, int& position) { + concurrency.unpack(buffer, buffer_size, position, t_); + concurrency.unpack(buffer, buffer_size, position, h_); + concurrency.unpack(buffer, buffer_size, position, lambda_); + concurrency.unpack(buffer, buffer_size, position, U_); +} + +template +template +void ModelParameters>>::readWrite( + ReaderOrWriter& reader_or_writer) { + auto tryToRead = [&](const std::string& name, auto& obj) { + try { + reader_or_writer.execute(name, obj); + } + catch (const std::exception& /*err*/) { + std::cerr << "Warning: Rashba-Hubbard-model has no " << name << " value specified.\n"; + } + }; + + try { + reader_or_writer.open_group("Rashba-Hubbard-model"); + tryToRead("t", t_); + tryToRead("h", h_); + tryToRead("lambda", lambda_); + tryToRead("U", U_); + reader_or_writer.close_group(); + } + catch (const std::exception& r_e) { + std::cout << "\n Rashba-Hubbard-model parameter group is not defined!\n" << std::endl; + throw std::logic_error(__PRETTY_FUNCTION__); + } + + if (ReaderOrWriter::is_reader) { + std::cout << "\n\n" + << "\tRasha-Hubbard-model : \n" + << "\t--------------- \n\n" + << "\t\t t : " << t_ << "\n" + << "\t\t h : " << h_ << "\n" + << "\t\t lambda : " << lambda_ << "\n" + << "\t\t U : " << U_ << "\n" + << "\n" + << std::endl; + } +} diff --git a/src/phys/dca_step/cluster_solver/shared_tools/accumulation/tp/tp_accumulator_kernels.cu b/src/phys/dca_step/cluster_solver/shared_tools/accumulation/tp/tp_accumulator_kernels.cu index 39259bc02..412cff348 100644 --- a/src/phys/dca_step/cluster_solver/shared_tools/accumulation/tp/tp_accumulator_kernels.cu +++ b/src/phys/dca_step/cluster_solver/shared_tools/accumulation/tp/tp_accumulator_kernels.cu @@ -983,77 +983,76 @@ template double updateG4, FourPointType::PARTICLE_PARTICLE_ // complex g0 -template <> -double updateG4, FourPointType::PARTICLE_HOLE_TRANSVERSE, std::complex>( +template double updateG4, FourPointType::PARTICLE_HOLE_TRANSVERSE, std::complex>( std::complex* G4, const std::complex* G_up, const int ldgu, const std::complex* G_down, const int ldgd, const std::complex factor, bool atomic, cudaStream_t stream, std::size_t start, std::size_t end); -template <> +template double updateG4, FourPointType::PARTICLE_HOLE_MAGNETIC, std::complex>( std::complex* G4, const std::complex* G_up, const int ldgu, const std::complex* G_down, const int ldgd, const std::complex factor, bool atomic, cudaStream_t stream, std::size_t start, std::size_t end); -template <> +template double updateG4, FourPointType::PARTICLE_HOLE_CHARGE, std::complex>( std::complex* G4, const std::complex* G_up, const int ldgu, const std::complex* G_down, const int ldgd, const std::complex factor, bool atomic, cudaStream_t stream, std::size_t start, std::size_t end); -template <> +template double updateG4, FourPointType::PARTICLE_HOLE_LONGITUDINAL_UP_UP, std::complex>(std::complex* G4, const std::complex* G_up, const int ldgu, const std::complex* G_down, const int ldgd, const std::complex factor, bool atomic, cudaStream_t stream, std::size_t start, std::size_t end); -template <> +template double updateG4, FourPointType::PARTICLE_HOLE_LONGITUDINAL_UP_DOWN, std::complex>(std::complex* G4, const std::complex* G_up, const int ldgu, const std::complex* G_down, const int ldgd, const std::complex factor, bool atomic, cudaStream_t stream, std::size_t start, std::size_t end); -template <> +template double updateG4, FourPointType::PARTICLE_PARTICLE_UP_DOWN, std::complex>( std::complex* G4, const std::complex* G_up, const int ldgu, const std::complex* G_down, const int ldgd, const std::complex factor, bool atomic, cudaStream_t stream, std::size_t start, std::size_t end); -template <> +template double updateG4, FourPointType::PARTICLE_HOLE_TRANSVERSE, std::complex>( std::complex* G4, const std::complex* G_up, const int ldgu, const std::complex* G_down, const int ldgd, const std::complex factor, bool atomic, cudaStream_t stream, std::size_t start, std::size_t end); -template <> +template double updateG4, FourPointType::PARTICLE_HOLE_MAGNETIC, std::complex>( std::complex* G4, const std::complex* G_up, const int ldgu, const std::complex* G_down, const int ldgd, const std::complex factor, bool atomic, cudaStream_t stream, std::size_t start, std::size_t end); -template <> +template double updateG4, FourPointType::PARTICLE_HOLE_CHARGE, std::complex>( std::complex* G4, const std::complex* G_up, const int ldgu, const std::complex* G_down, const int ldgd, const std::complex factor, bool atomic, cudaStream_t stream, std::size_t start, std::size_t end); -template <> +template double updateG4, FourPointType::PARTICLE_HOLE_LONGITUDINAL_UP_UP, std::complex>(std::complex* G4, const std::complex* G_up, const int ldgu, const std::complex* G_down, const int ldgd, const std::complex factor, bool atomic, cudaStream_t stream, std::size_t start, std::size_t end); -template <> +template double updateG4, FourPointType::PARTICLE_HOLE_LONGITUDINAL_UP_DOWN, std::complex>(std::complex* G4, const std::complex* G_up, const int ldgu, const std::complex* G_down, const int ldgd, const std::complex factor, bool atomic, cudaStream_t stream, std::size_t start, std::size_t end); -template <> +template double updateG4, FourPointType::PARTICLE_PARTICLE_UP_DOWN, std::complex>( std::complex* G4, const std::complex* G_up, const int ldgu, const std::complex* G_down, const int ldgd, const std::complex factor, @@ -1070,6 +1069,11 @@ template double updateG4NoSpin, FourPointType::PARTICLE_PAR const std::complex factor, bool atomic, cudaStream_t stream, std::size_t start, std::size_t end); +template double updateG4NoSpin, FourPointType::PARTICLE_PARTICLE_UP_DOWN, std::int8_t>( + std::complex* G4, const std::complex* G_up, const int ldgu, + const std::int8_t factor, bool atomic, + cudaStream_t stream, std::size_t start, std::size_t end); + // template<> double updateG4< FourPointType::PARTICLE_HOLE_TRANSVERSE>(