Skip to content

Commit

Permalink
for testing Real Rashba Hubbard and Complex Square
Browse files Browse the repository at this point in the history
  • Loading branch information
PDoakORNL committed Jun 5, 2024
1 parent e10b1b9 commit 4f461de
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 20 deletions.
10 changes: 7 additions & 3 deletions cmake/dca_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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<PointGroup>)
Expand Down Expand Up @@ -158,6 +158,10 @@ elseif (DCA_LATTICE STREQUAL "Rashba_Hubbard")
set(DCA_LATTICE_TYPE dca::phys::models::RashbaHubbard<PointGroup>)
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<PointGroup>)
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<PointGroup>)
set(DCA_LATTICE_INCLUDE
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -59,8 +59,9 @@ class complex_square_lattice {
// Initializes the interaction part of the real space Hubbard Hamiltonian.
template <typename BandDmn, typename SpinDmn, typename RDmn, typename parameters_type>
static void initializeHInteraction(
func::function<typename parameters_type::Real, func::dmn_variadic<func::dmn_variadic<BandDmn, SpinDmn>,
func::dmn_variadic<BandDmn, SpinDmn>, RDmn>>& H_interaction,
func::function<typename parameters_type::Real,
func::dmn_variadic<func::dmn_variadic<BandDmn, SpinDmn>,
func::dmn_variadic<BandDmn, SpinDmn>, RDmn>>& H_interaction,
const parameters_type& parameters);

template <class domain>
Expand Down
1 change: 1 addition & 0 deletions include/dca/phys/parameters/model_parameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
112 changes: 112 additions & 0 deletions include/dca/phys/parameters/model_parameters_rashba_hubbard.inc
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,115 @@ void ModelParameters<models::TightBindingModel<models::RashbaHubbard<PointGroup>
<< std::endl;
}
}


template <typename PointGroup>
class ModelParameters<models::TightBindingModel<models::RealRashbaHubbard<PointGroup>>> {
public:
ModelParameters() = default;

template <typename Concurrency>
int getBufferSize(const Concurrency& concurrency) const;
template <typename Concurrency>
void pack(const Concurrency& concurrency, char* buffer, int buffer_size, int& position) const;
template <typename Concurrency>
void unpack(const Concurrency& concurrency, char* buffer, int buffer_size, int& position);

template <typename ReaderOrWriter>
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 <typename PointGroup>
template <typename Concurrency>
int ModelParameters<models::TightBindingModel<models::RealRashbaHubbard<PointGroup>>>::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 <typename PointGroup>
template <typename Concurrency>
void ModelParameters<models::TightBindingModel<models::RealRashbaHubbard<PointGroup>>>::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 <typename PointGroup>
template <typename Concurrency>
void ModelParameters<models::TightBindingModel<models::RealRashbaHubbard<PointGroup>>>::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 <typename PointGroup>
template <typename ReaderOrWriter>
void ModelParameters<models::TightBindingModel<models::RealRashbaHubbard<PointGroup>>>::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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -983,77 +983,76 @@ template double updateG4<std::complex<double>, FourPointType::PARTICLE_PARTICLE_

// complex g0

template <>
double updateG4<std::complex<float>, FourPointType::PARTICLE_HOLE_TRANSVERSE, std::complex<float>>(
template double updateG4<std::complex<float>, FourPointType::PARTICLE_HOLE_TRANSVERSE, std::complex<float>>(
std::complex<float>* G4, const std::complex<float>* G_up, const int ldgu,
const std::complex<float>* G_down, const int ldgd, const std::complex<float> factor,
bool atomic, cudaStream_t stream, std::size_t start, std::size_t end);

template <>
template
double updateG4<std::complex<float>, FourPointType::PARTICLE_HOLE_MAGNETIC, std::complex<float>>(
std::complex<float>* G4, const std::complex<float>* G_up, const int ldgu,
const std::complex<float>* G_down, const int ldgd, const std::complex<float> factor,
bool atomic, cudaStream_t stream, std::size_t start, std::size_t end);

template <>
template
double updateG4<std::complex<float>, FourPointType::PARTICLE_HOLE_CHARGE, std::complex<float>>(
std::complex<float>* G4, const std::complex<float>* G_up, const int ldgu,
const std::complex<float>* G_down, const int ldgd, const std::complex<float> factor,
bool atomic, cudaStream_t stream, std::size_t start, std::size_t end);

template <>
template
double updateG4<std::complex<float>, FourPointType::PARTICLE_HOLE_LONGITUDINAL_UP_UP,
std::complex<float>>(std::complex<float>* G4, const std::complex<float>* G_up,
const int ldgu, const std::complex<float>* G_down,
const int ldgd, const std::complex<float> factor, bool atomic,
cudaStream_t stream, std::size_t start, std::size_t end);

template <>
template
double updateG4<std::complex<float>, FourPointType::PARTICLE_HOLE_LONGITUDINAL_UP_DOWN,
std::complex<float>>(std::complex<float>* G4, const std::complex<float>* G_up,
const int ldgu, const std::complex<float>* G_down,
const int ldgd, const std::complex<float> factor, bool atomic,
cudaStream_t stream, std::size_t start, std::size_t end);

template <>
template
double updateG4<std::complex<float>, FourPointType::PARTICLE_PARTICLE_UP_DOWN, std::complex<float>>(
std::complex<float>* G4, const std::complex<float>* G_up, const int ldgu,
const std::complex<float>* G_down, const int ldgd, const std::complex<float> factor,
bool atomic, cudaStream_t stream, std::size_t start, std::size_t end);

template <>
template
double updateG4<std::complex<double>, FourPointType::PARTICLE_HOLE_TRANSVERSE, std::complex<double>>(
std::complex<double>* G4, const std::complex<double>* G_up, const int ldgu,
const std::complex<double>* G_down, const int ldgd, const std::complex<double> factor,
bool atomic, cudaStream_t stream, std::size_t start, std::size_t end);

template <>
template
double updateG4<std::complex<double>, FourPointType::PARTICLE_HOLE_MAGNETIC, std::complex<double>>(
std::complex<double>* G4, const std::complex<double>* G_up, const int ldgu,
const std::complex<double>* G_down, const int ldgd, const std::complex<double> factor,
bool atomic, cudaStream_t stream, std::size_t start, std::size_t end);

template <>
template
double updateG4<std::complex<double>, FourPointType::PARTICLE_HOLE_CHARGE, std::complex<double>>(
std::complex<double>* G4, const std::complex<double>* G_up, const int ldgu,
const std::complex<double>* G_down, const int ldgd, const std::complex<double> factor,
bool atomic, cudaStream_t stream, std::size_t start, std::size_t end);

template <>
template
double updateG4<std::complex<double>, FourPointType::PARTICLE_HOLE_LONGITUDINAL_UP_UP,
std::complex<double>>(std::complex<double>* G4, const std::complex<double>* G_up,
const int ldgu, const std::complex<double>* G_down,
const int ldgd, const std::complex<double> factor, bool atomic,
cudaStream_t stream, std::size_t start, std::size_t end);

template <>
template
double updateG4<std::complex<double>, FourPointType::PARTICLE_HOLE_LONGITUDINAL_UP_DOWN,
std::complex<double>>(std::complex<double>* G4, const std::complex<double>* G_up,
const int ldgu, const std::complex<double>* G_down,
const int ldgd, const std::complex<double> factor, bool atomic,
cudaStream_t stream, std::size_t start, std::size_t end);

template <>
template
double updateG4<std::complex<double>, FourPointType::PARTICLE_PARTICLE_UP_DOWN, std::complex<double>>(
std::complex<double>* G4, const std::complex<double>* G_up, const int ldgu,
const std::complex<double>* G_down, const int ldgd, const std::complex<double> factor,
Expand All @@ -1070,6 +1069,11 @@ template double updateG4NoSpin<std::complex<double>, FourPointType::PARTICLE_PAR
const std::complex<double> factor, bool atomic,
cudaStream_t stream, std::size_t start, std::size_t end);

template double updateG4NoSpin<std::complex<double>, FourPointType::PARTICLE_PARTICLE_UP_DOWN, std::int8_t>(
std::complex<double>* G4, const std::complex<double>* 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>(
Expand Down

0 comments on commit 4f461de

Please sign in to comment.