diff --git a/CMakeLists.txt b/CMakeLists.txt
index 75aa918..c373eb5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,4 +28,11 @@ set(THREADS_PREFER_PTHREAD_FLAG ON) # This is just for us, we do prefer pthreads
# Create Documentation
add_subdirectory("nrgcore")
add_subdirectory("docs")
-
+#add_subdirectory("examples/entropySIAM")
+# add all sub directories ..
+# file(GLOB V_GLOB LIST_DIRECTORIES true "examples/*")
+# foreach(item ${V_GLOB})
+# if(IS_DIRECTORY ${item})
+# add_subdirectory(${item})
+# endif()
+# endforeach()
diff --git a/README.md b/README.md
index e78c4e7..145a9c5 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,9 @@
+
+
+
+![Documentation](https://github.com/github/docs/actions/workflows/cmake.yml/badge.svg)
+
## ⚠ This is a work in progress repository
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
index 7220899..838c409 100644
--- a/docs/CMakeLists.txt
+++ b/docs/CMakeLists.txt
@@ -3,7 +3,7 @@ find_package(Sphinx REQUIRED)
# Find all the public headers
# get_target_property(NRGCore_PUBLIC_HEADER_DIR NRGCore INTERFACE_INCLUDE_DIRECTORIES)
-file(GLOB_RECURSE NRGCore_PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../include/*/*.hpp)
+file(GLOB_RECURSE rst_dependent_files ${CMAKE_CURRENT_SOURCE_DIR}/*rst )
set(DOXYGEN_INPUT_DIR ${PROJECT_SOURCE_DIR}/nrgcore)
set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/doxygen)
@@ -19,12 +19,11 @@ file(MAKE_DIRECTORY ${DOXYGEN_OUTPUT_DIR})
# Only regenerate Doxygen when the Doxyfile or public headers change
add_custom_command(OUTPUT ${DOXYGEN_INDEX_FILE}
- DEPENDS ${NRGCore_PUBLIC_HEADERS}
+ DEPENDS ${rst_dependent_files}
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT}
MAIN_DEPENDENCY ${DOXYFILE_OUT} ${DOXYFILE_IN}
COMMENT "Generating docs"
VERBATIM)
-
# Nice named target so we can run the job easily
add_custom_target(Doxygen ALL DEPENDS ${DOXYGEN_INDEX_FILE})
diff --git a/examples/entropyKondo/CMakeLists.txt b/examples/entropyKondo/CMakeLists.txt
index 18224d4..9960c96 100644
--- a/examples/entropyKondo/CMakeLists.txt
+++ b/examples/entropyKondo/CMakeLists.txt
@@ -1,11 +1,16 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
-project(entropyKondo LANGUAGES CXX)
+# project(entropySIAM LANGUAGES CXX)
+# use folder name for the project name
+get_filename_component(ProjectId ${CMAKE_CURRENT_LIST_DIR} NAME)
+string(REPLACE " " "_" ProjectId ${ProjectId})
+project(${ProjectId} C CXX)
##########Dependencies########
find_package(HDF5 COMPONENTS CXX HL)
include_directories(${HDF5_INCLUDE_DIR})
set(LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES})
+
########################################################################
################
@@ -23,11 +28,10 @@ target_link_libraries(
#openblas
#cblas
#lapack
- hdf5
- hdf5_cpp
+ HDF5::HDF5
# MKL::MKL
# mkl_intel_lp64 mkl_intel_thread mkl_core
- mkl_intel_lp64 mkl_core mkl_intel_thread iomp5
+ mkl_intel_lp64 mkl_core mkl_intel_thread mkl_core iomp5
)
diff --git a/examples/entropySIAM/CMakeLists.txt b/examples/entropySIAM/CMakeLists.txt
index ae4d960..9960c96 100644
--- a/examples/entropySIAM/CMakeLists.txt
+++ b/examples/entropySIAM/CMakeLists.txt
@@ -1,12 +1,16 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
-project(entropySIAM LANGUAGES CXX)
-
+# project(entropySIAM LANGUAGES CXX)
+# use folder name for the project name
+get_filename_component(ProjectId ${CMAKE_CURRENT_LIST_DIR} NAME)
+string(REPLACE " " "_" ProjectId ${ProjectId})
+project(${ProjectId} C CXX)
##########Dependencies########
find_package(HDF5 COMPONENTS CXX HL)
include_directories(${HDF5_INCLUDE_DIR})
set(LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES})
+
########################################################################
################
@@ -24,8 +28,7 @@ target_link_libraries(
#openblas
#cblas
#lapack
- hdf5
- hdf5_cpp
+ HDF5::HDF5
# MKL::MKL
# mkl_intel_lp64 mkl_intel_thread mkl_core
mkl_intel_lp64 mkl_core mkl_intel_thread mkl_core iomp5
diff --git a/examples/fdmSpectrumSiam/CMakeLists.txt b/examples/fdmSpectrumSiam/CMakeLists.txt
index a0a78b9..9960c96 100644
--- a/examples/fdmSpectrumSiam/CMakeLists.txt
+++ b/examples/fdmSpectrumSiam/CMakeLists.txt
@@ -1,28 +1,37 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
-project(fdmSpectrum LANGUAGES CXX)
-
+# project(entropySIAM LANGUAGES CXX)
+# use folder name for the project name
+get_filename_component(ProjectId ${CMAKE_CURRENT_LIST_DIR} NAME)
+string(REPLACE " " "_" ProjectId ${ProjectId})
+project(${ProjectId} C CXX)
##########Dependencies########
find_package(HDF5 COMPONENTS CXX HL)
include_directories(${HDF5_INCLUDE_DIR})
set(LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES})
-#lapack
-
+########################################################################
################
file(GLOB sources CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
file(GLOB headers CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
+######################################################
+
add_executable(${PROJECT_NAME}.out ${sources} ${headers})
+
+
+
target_link_libraries(
${PROJECT_NAME}.out NRG
- #MKL::MKL
- mkl_intel_lp64 mkl_intel_thread mkl_core
#openblas
#cblas
#lapack
- hdf5
- hdf5_cpp
+ HDF5::HDF5
+ # MKL::MKL
+ # mkl_intel_lp64 mkl_intel_thread mkl_core
+ mkl_intel_lp64 mkl_core mkl_intel_thread mkl_core iomp5
)
+
+
diff --git a/examples/fdmSpectrumSiam/main.cpp b/examples/fdmSpectrumSiam/main.cpp
index 3c53cd3..74e199a 100644
--- a/examples/fdmSpectrumSiam/main.cpp
+++ b/examples/fdmSpectrumSiam/main.cpp
@@ -6,11 +6,11 @@
#include "nrgcore/nrgcore.hpp"
#include "nrgcore/sysOperator.hpp"
#include
-double LAMBDA = 3.00; // Dont do this
-double hopping(int site) {
+const double LAMBDA = 3.00; // Dont do this
+double hopping(int site) {
return 0.5 * (1.0 + 1.0 / LAMBDA) * (1. - std::pow(LAMBDA, -site - 1)) /
std::sqrt((1.0 - std::pow(LAMBDA, -2. * site - 1)) *
- (1.0 - std::pow(LAMBDA, -2. * site - 3)));
+ (1.0 - std::pow(LAMBDA, -2. * site - 3)));
}
int main() {
h5stream::h5stream rfile("resultsTc.h5");
@@ -39,8 +39,9 @@ int main() {
// Bulla's RMP
std::vector dUpDownDagger; // Up and Down particle number
{
- fermionBasis spinhalfBasis(2); // Number of fermion channels/spins
- auto f_dag_raw = spinhalfBasis.get_raw_f_dag_operator();
+ fermionBasis spinhalfBasis(
+ 2, fermionBasis::chargeAndSpin); // Number of fermion channels/spins
+ auto f_dag_raw = spinhalfBasis.get_raw_f_dag_operator();
// set f_operator
// Total Number of particle
auto ntotal = f_dag_raw[0].dot(f_dag_raw[0].cTranspose());
@@ -70,8 +71,9 @@ int main() {
// dUpDownDagger[0].display();
for (auto &aa : dUpDownDagger) {
for (const auto &[key, value] : *aa.getMap()) {
- for (size_t i = 0; i < value.size(); i++)
- sum += std::pow(value.at(i), 2);
+ for (double i : value) {
+ sum += std::pow(i, 2);
+ }
}
}
std::cout << "dUpDownDagger Sum :" << sum << std::endl;
@@ -122,8 +124,9 @@ int main() {
// dUpDownDagger[0].display();
for (auto &aa : dUpDownDagger) {
for (const auto &[key, value] : *aa.getMap()) {
- for (size_t i = 0; i < value.size(); i++)
- sum += std::pow(value.at(i), 2);
+ for (double i : value) {
+ sum += std::pow(i, 2);
+ }
}
}
std::cout << "dUpDownDagger Sum :" << sum << std::endl;
diff --git a/examples/fdmSpectrumTwoChannel/CMakeLists.txt b/examples/fdmSpectrumTwoChannel/CMakeLists.txt
index 897a976..9960c96 100644
--- a/examples/fdmSpectrumTwoChannel/CMakeLists.txt
+++ b/examples/fdmSpectrumTwoChannel/CMakeLists.txt
@@ -1,20 +1,24 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
-project(fdmSpectrum LANGUAGES CXX)
-
+# project(entropySIAM LANGUAGES CXX)
+# use folder name for the project name
+get_filename_component(ProjectId ${CMAKE_CURRENT_LIST_DIR} NAME)
+string(REPLACE " " "_" ProjectId ${ProjectId})
+project(${ProjectId} C CXX)
##########Dependencies########
find_package(HDF5 COMPONENTS CXX HL)
include_directories(${HDF5_INCLUDE_DIR})
set(LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES})
-#lapack
-find_package(LAPACK)
-find_package(BLAS)
-set(BLA_VENDOR Intel10_64lp)
+
+########################################################################
+
################
file(GLOB sources CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
file(GLOB headers CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
+######################################################
+
add_executable(${PROJECT_NAME}.out ${sources} ${headers})
@@ -24,8 +28,7 @@ target_link_libraries(
#openblas
#cblas
#lapack
- hdf5
- hdf5_cpp
+ HDF5::HDF5
# MKL::MKL
# mkl_intel_lp64 mkl_intel_thread mkl_core
mkl_intel_lp64 mkl_core mkl_intel_thread mkl_core iomp5
diff --git a/examples/fdmSpectrumTwoChannel/main.cpp b/examples/fdmSpectrumTwoChannel/main.cpp
index e9683e2..27b4d76 100644
--- a/examples/fdmSpectrumTwoChannel/main.cpp
+++ b/examples/fdmSpectrumTwoChannel/main.cpp
@@ -7,11 +7,11 @@
#include "nrgcore/sysOperator.hpp"
#include
#include
-double LAMBDA = 3.00; // Dont do this
-double hopping(int site) {
+const double LAMBDA = 3.00; // Dont do this
+double hopping(int site) {
return 0.5 * (1.0 + 1.0 / LAMBDA) * (1. - std::pow(LAMBDA, -site - 1)) /
std::sqrt((1.0 - std::pow(LAMBDA, -2. * site - 1)) *
- (1.0 - std::pow(LAMBDA, -2. * site - 3)));
+ (1.0 - std::pow(LAMBDA, -2. * site - 3)));
}
int main() {
timer mtime("Total time : ");
@@ -47,8 +47,9 @@ int main() {
// Bulla's RMP
std::vector dUpDownDagger; // Up and Down particle number
{
- fermionBasis spinhalfBasis(2); // Number of fermion channels/spins
- auto f_dag_raw = spinhalfBasis.get_raw_f_dag_operator();
+ fermionBasis spinhalfBasis(
+ 2, fermionBasis::chargeAndSpin); // Number of fermion channels/spins
+ auto f_dag_raw = spinhalfBasis.get_raw_f_dag_operator();
// set f_operator
// Total Number of particle
auto ntotal = f_dag_raw[0].dot(f_dag_raw[0].cTranspose());
diff --git a/examples/freeModel/CMakeLists.txt b/examples/freeModel/CMakeLists.txt
index 93225da..9960c96 100644
--- a/examples/freeModel/CMakeLists.txt
+++ b/examples/freeModel/CMakeLists.txt
@@ -1,12 +1,16 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
-project(rgflowKondo LANGUAGES CXX)
+# project(entropySIAM LANGUAGES CXX)
+# use folder name for the project name
+get_filename_component(ProjectId ${CMAKE_CURRENT_LIST_DIR} NAME)
+string(REPLACE " " "_" ProjectId ${ProjectId})
+project(${ProjectId} C CXX)
##########Dependencies########
find_package(HDF5 COMPONENTS CXX HL)
include_directories(${HDF5_INCLUDE_DIR})
set(LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES})
-#lapack
+
########################################################################
################
@@ -24,10 +28,10 @@ target_link_libraries(
#openblas
#cblas
#lapack
- hdf5
- hdf5_cpp
- MKL::MKL
- mkl_intel_lp64 mkl_intel_thread mkl_core
+ HDF5::HDF5
+ # MKL::MKL
+ # mkl_intel_lp64 mkl_intel_thread mkl_core
+ mkl_intel_lp64 mkl_core mkl_intel_thread mkl_core iomp5
)
diff --git a/examples/freeModel/main.cpp b/examples/freeModel/main.cpp
index b30ee53..fa8fb77 100644
--- a/examples/freeModel/main.cpp
+++ b/examples/freeModel/main.cpp
@@ -1,103 +1,98 @@
-#include "fdmThermodynamics.hpp"
-#include "freeModel.hpp"
#include "models/spinhalf.hpp"
#include "models/spinhalfKondo.hpp"
#include "nrgcore/nrgData.hpp"
#include "nrgcore/nrgcore.hpp"
-#include "rabiSpinless.hpp"
+#include "static/fdmThermodynamics.hpp"
#include "utils/h5stream.hpp"
#include
-double LAMBDA = 2.0; // Dont do this
-double hopping(int site) {
- return 0.5 * (1.0 + 1.0 / LAMBDA) * (1. - std::pow(LAMBDA, -site - 1)) /
- std::sqrt((1.0 - std::pow(LAMBDA, -2. * site - 1)) *
- (1.0 - std::pow(LAMBDA, -2. * site - 3)));
+const double LAMBDA = 2.0; // Dont do this
+double hopping(int site) {
+ return 0.5 * (1.0 + 1.0 / LAMBDA) * (1. - std::pow(LAMBDA, -site - 1)) /
+ std::sqrt((1.0 - std::pow(LAMBDA, -2. * site - 1)) *
+ (1.0 - std::pow(LAMBDA, -2. * site - 3)));
}
int main() {
- timer mtime("Total time : ");
- size_t minIterations = 1;
- // double GAMMA = 0.0100;
- // double fc = 0.5 * std::log(LAMBDA) * (1. + LAMBDA) / (LAMBDA - 1.);
- // double V = std::sqrt(2.0 * fc * GAMMA / std::acos(-1.));
- double Jkondo = 0.250;
- double Tk = std::exp(-1. / Jkondo);
- double Omega = 0.00 * Tk;
+ timer mtime("Total time : ");
+ size_t minIterations = 1;
+ // double GAMMA = 0.0100;
+ // double fc = 0.5 * std::log(LAMBDA) * (1. + LAMBDA) / (LAMBDA - 1.);
+ // double V = std::sqrt(2.0 * fc * GAMMA / std::acos(-1.));
+ //
+ spinhalf impurity(0, 0);
+ size_t nMax{41}; // Number of NRG iteration
+ h5stream::h5stream rfile("resultsZero.h5");
+ // size_t nMax{42}; // Number of NRG iteration
+ // spinhalfKondo impurity(Jkondo, 0.5);
+ // h5stream::h5stream rfile("results.h5");
+ spinhalf bathModel(0, 0); // set parameters
+ // std::cout << "Done !" << std::endl;
+ nrgcore kondoModel(impurity, bathModel);
+ // Start calc
+ std::cout << "f_dag_operators: " << impurity.f_dag_operator.size()
+ << std::endl;
+ kondoModel.set_parameters(1024); // set max number of states to be kept
+ // siam.add_bath_site({V, V}, 1.0); // first site. This is consistentent with
+ // siam.update_internal_state();
+ //
+ // Bulla's RMP
+ // h5stream::h5stream rfile("resultsOmega" + std::to_string(Omega / Tk) +
+ // ".h5");
+ NrgData rawData(&kondoModel);
+ for (size_t in = 0; in < nMax; in++) {
+ // Rescaling Factor is different for the Kondo Model
+ double rescale = std::sqrt(LAMBDA);
+ kondoModel.add_bath_site({hopping(in), hopping(in)}, rescale);
//
- freeModel impurity;
- size_t nMax{41}; // Number of NRG iteration
- h5stream::h5stream rfile("resultsZero.h5");
- // size_t nMax{42}; // Number of NRG iteration
- // spinhalfKondo impurity(Jkondo, 0.5);
- // h5stream::h5stream rfile("results.h5");
- spinhalf bathModel(0, 0); // set parameters
- // std::cout << "Done !" << std::endl;
- nrgcore kondoModel(impurity, bathModel);
- // Start calc
- std::cout << "f_dag_operators: " << impurity.f_dag_operator.size()
- << std::endl;
- kondoModel.set_parameters(1024); // set max number of states to be kept
- // siam.add_bath_site({V, V}, 1.0); // first site. This is consistentent with
- // siam.update_internal_state();
- //
- // Bulla's RMP
- // h5stream::h5stream rfile("resultsOmega" + std::to_string(Omega / Tk) +
- // ".h5");
- NrgData rawData(&kondoModel);
- for (size_t in = 0; in < nMax; in++) {
- // Rescaling Factor is different for the Kondo Model
- double rescale = std::sqrt(LAMBDA);
- kondoModel.add_bath_site({hopping(in), hopping(in)}, rescale);
- //
- if (kondoModel.checkHigherEnergyDiscarded()) {
- rawData.saveCurrentData();
- } else {
- minIterations++;
- }
- // Update operators if needed here. then ->
- kondoModel.update_internal_state();
- // std::cout << "Eigenvalues: " << kondoModel.all_eigenvalue <<
- // std::endl;
- rfile.write(
- kondoModel.all_eigenvalue,
- "Eigenvalues" +
- std::to_string(in)); // Save the eigenvalue of the current iteration
- }
- // Start of the Backward Iteration
- //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- // Backword iteration starts now.
- // BOOM:: BOOM
- //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- std::cout << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << std::endl;
- std::cout << "%%% Backward Iteration %%%%%%" << std::endl;
- std::cout << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << std::endl;
- // set temperatureArray
- double vMax = 2; // Max Voltage can be 2* bandwidth
- double vMin = 1e-10;
- int tPoints = 200;
- double delTime = (tPoints - 1.0) / (std::log(vMax / vMin));
- std::vector temperatureArray(tPoints);
- // Log scale
- for (int i = 0; i < tPoints; i++) {
- temperatureArray[i] = vMin * std::exp(std::fabs(i) * 1. / delTime);
+ if (kondoModel.checkHigherEnergyDiscarded()) {
+ rawData.saveCurrentData();
+ } else {
+ minIterations++;
}
- // Load data
- // Start ofd the fdmSpectrum
- fdmThermodynamics fdmTc(&kondoModel, temperatureArray);
- for (size_t in = nMax; in > minIterations; in--) {
- // We dont need load the nrg data for the
- // last iteration
- double enScale = std::pow(LAMBDA, -(1. * in - 1.0) / 2.0);
- std::cout << "--Started Backward iteration: " << in
- << " Mtr: " << minIterations << " enScale:" << enScale
- << std::endl;
- kondoModel.nrg_iterations_cnt--;
- rawData.loadCurrentData();
- fdmTc.calcThermodynamics(enScale);
- // fdmTc.calcThermodynamics(std::pow(LAMBDA, -(in - 1.0) / 2.0));
- }
- fdmTc.saveFinalData(&rfile);
- // Dont do this
- rfile.close();
- // create operators that connect to the environment
- return 0;
+ // Update operators if needed here. then ->
+ kondoModel.update_internal_state();
+ // std::cout << "Eigenvalues: " << kondoModel.all_eigenvalue <<
+ // std::endl;
+ rfile.write(
+ kondoModel.all_eigenvalue,
+ "Eigenvalues" +
+ std::to_string(in)); // Save the eigenvalue of the current iteration
+ }
+ // Start of the Backward Iteration
+ //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ // Backword iteration starts now.
+ // BOOM:: BOOM
+ //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ std::cout << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << std::endl;
+ std::cout << "%%% Backward Iteration %%%%%%" << std::endl;
+ std::cout << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << std::endl;
+ // set temperatureArray
+ double vMax = 2; // Max Voltage can be 2* bandwidth
+ double vMin = 1e-10;
+ int tPoints = 200;
+ double delTime = (tPoints - 1.0) / (std::log(vMax / vMin));
+ std::vector temperatureArray(tPoints);
+ // Log scale
+ for (int i = 0; i < tPoints; i++) {
+ temperatureArray[i] = vMin * std::exp(std::fabs(i) * 1. / delTime);
+ }
+ // Load data
+ // Start ofd the fdmSpectrum
+ fdmThermodynamics fdmTc(&kondoModel, temperatureArray);
+ for (size_t in = nMax; in > minIterations; in--) {
+ // We dont need load the nrg data for the
+ // last iteration
+ double enScale = std::pow(LAMBDA, -(1. * in - 1.0) / 2.0);
+ std::cout << "--Started Backward iteration: " << in
+ << " Mtr: " << minIterations << " enScale:" << enScale
+ << std::endl;
+ kondoModel.nrg_iterations_cnt--;
+ rawData.loadCurrentData();
+ fdmTc.calcThermodynamics(enScale);
+ // fdmTc.calcThermodynamics(std::pow(LAMBDA, -(in - 1.0) / 2.0));
+ }
+ fdmTc.saveFinalData(&rfile);
+ // Dont do this
+ rfile.close();
+ // create operators that connect to the environment
+ return 0;
}
diff --git a/examples/rabiAnderson/CMakeLists.txt b/examples/rabiAnderson/CMakeLists.txt
index 93225da..9960c96 100644
--- a/examples/rabiAnderson/CMakeLists.txt
+++ b/examples/rabiAnderson/CMakeLists.txt
@@ -1,12 +1,16 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
-project(rgflowKondo LANGUAGES CXX)
+# project(entropySIAM LANGUAGES CXX)
+# use folder name for the project name
+get_filename_component(ProjectId ${CMAKE_CURRENT_LIST_DIR} NAME)
+string(REPLACE " " "_" ProjectId ${ProjectId})
+project(${ProjectId} C CXX)
##########Dependencies########
find_package(HDF5 COMPONENTS CXX HL)
include_directories(${HDF5_INCLUDE_DIR})
set(LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES})
-#lapack
+
########################################################################
################
@@ -24,10 +28,10 @@ target_link_libraries(
#openblas
#cblas
#lapack
- hdf5
- hdf5_cpp
- MKL::MKL
- mkl_intel_lp64 mkl_intel_thread mkl_core
+ HDF5::HDF5
+ # MKL::MKL
+ # mkl_intel_lp64 mkl_intel_thread mkl_core
+ mkl_intel_lp64 mkl_core mkl_intel_thread mkl_core iomp5
)
diff --git a/examples/rabiAnderson/rabiAnderson.hpp b/examples/rabiAnderson/rabiAnderson.hpp
index 0ffe5f4..f6a9e6a 100644
--- a/examples/rabiAnderson/rabiAnderson.hpp
+++ b/examples/rabiAnderson/rabiAnderson.hpp
@@ -14,127 +14,125 @@
#include
#include
class rabiAnderson : public fermionBasis {
- // See PHYSICAL REVIEW B 101, 085110 (2020)
- /** This class is for a single orbital with spin up and down
- * f operator. SIAM can be made entirely from this class.
- *
- *
- */
+ // See PHYSICAL REVIEW B 101, 085110 (2020)
+ /** This class is for a single orbital with spin up and down
+ * f operator. SIAM can be made entirely from this class.
+ *
+ *
+ */
public:
- /**
- * @brief [TODO:description]
- *
- * @param UCoulumb [TODO:description]
- * @param gamma [TODO:description]
- * @param omega [TODO:description]
- */
- rabiAnderson(const std::map ¶ms) {
- dof = 1 + // for the trion State (up)
+ /**
+ * @brief [TODO:description]
+ *
+ * @param UCoulumb [TODO:description]
+ * @param gamma [TODO:description]
+ * @param omega [TODO:description]
+ */
+ explicit rabiAnderson(const std::map ¶ms)
+ : fermionBasis(5, fermionBasis::chargeAndSpin) // call the base class
+ {
+ int dof = 1 + // for the trion State (up)
2 + // for the electron state
2; // for the wilson site
- // Dimension of the system
- nstates = std::pow(2, dof);
- // Dimension of the system
- std::cout << "nstates: " << nstates << "\n"
- << "dof: " << dof << "\n";
- createBasis(params); // create the basis in nstates x nstates
- }
- std::vector> get_basis() {
- return n_Q;
- }
- std::vector> get_eigenvaluesQ() {
- return eigenvalues_Q;
- }
- std::vector get_chi_Q() {
- return chi_Q;
- }
- //
- std::vector> eigenvalues_Q;
- std::vector chi_Q;
- std::vector> n_Q;
- // ########################################
+ fermionBasis frBasis(dof, fermionBasis::chargeAndSpin);
+ // Dimension of the system
+ double nstates = std::pow(2, dof);
+ // Dimension of the system
+ std::cout << "nstates: " << nstates << "\n"
+ << "dof: " << dof << "\n";
+ createBasis(params); // create the basis in nstates x nstates
+ }
+ [[nodiscard]] std::vector> get_basis() const { return n_Q; }
+ [[nodiscard]] std::vector> get_eigenvaluesQ() const {
+ return eigenvalues_Q;
+ }
+ [[nodiscard]] std::vector get_chi_Q() const { return chi_Q; }
+ //
+ std::vector> eigenvalues_Q;
+ std::vector chi_Q;
+ std::vector> n_Q;
+ // ########################################
private:
- void createBasis(const std::map ¶ms) {
- double gammaZero = params.at("gammaZero");
- double epsilonTrion = params.at("epsilonTrion");
- double omega = params.at("Omega");
- double epsilonD = params.at("epsilonImpurity");
- double UCoulumb = params.at("UColoumbImpurity");
- double UTrion = params.at("UColoumbTrion");
- // if (std::fabs(omega) < 1e-20) {
- // UTrion = 0;
- // }
- //
- createFermionBasis();
- std::cout << "FermionBasis Size" << fermionOprMat.size() << "\n";
- // trion particle
- auto trParticle = fermionOprMat[4].dot(fermionOprMat[4].cTranspose());
- auto nDown = fermionOprMat[3].dot(fermionOprMat[3].cTranspose());
- auto nUp = fermionOprMat[2].dot(fermionOprMat[2].cTranspose());
- // ########################################################
- auto Hamiltonian =
- // Impurity Onsite Energy
- (nDown + nUp) * epsilonD +
- nDown.dot(nUp) * UCoulumb
- // Trion Onsite Energy
- + (trParticle)*epsilonTrion + // Trion onsite
- (nDown + nUp).dot(trParticle) * (-UTrion) + //
- // Wilson Site coupling
- (fermionOprMat[0].dot(fermionOprMat[2].cTranspose()) +
- fermionOprMat[2].dot(fermionOprMat[0].cTranspose()) +
- fermionOprMat[1].dot(fermionOprMat[3].cTranspose()) +
- fermionOprMat[3].dot(fermionOprMat[1].cTranspose())) *
+ void createBasis(const std::map ¶ms) {
+ double gammaZero = params.at("gammaZero");
+ double epsilonTrion = params.at("epsilonTrion");
+ double omega = params.at("Omega");
+ double epsilonD = params.at("epsilonImpurity");
+ double UCoulumb = params.at("UColoumbImpurity");
+ double UTrion = params.at("UColoumbTrion");
+ // if (std::fabs(omega) < 1e-20) {
+ // UTrion = 0;
+ // }
+ //
+ std::cout << "FermionBasis Size" << fermionOprMat.size() << "\n";
+ // trion particle
+ auto trParticle = fermionOprMat[4].dot(fermionOprMat[4].cTranspose());
+ auto nDown = fermionOprMat[3].dot(fermionOprMat[3].cTranspose());
+ auto nUp = fermionOprMat[2].dot(fermionOprMat[2].cTranspose());
+ // ########################################################
+ auto Hamiltonian =
+ // Impurity Onsite Energy
+ (nDown + nUp) * epsilonD +
+ nDown.dot(nUp) * UCoulumb
+ // Trion Onsite Energy
+ + (trParticle)*epsilonTrion + // Trion onsite
+ (nDown + nUp).dot(trParticle) * (-UTrion) + //
+ // Wilson Site coupling
+ (fermionOprMat[0].dot(fermionOprMat[2].cTranspose()) +
+ fermionOprMat[2].dot(fermionOprMat[0].cTranspose()) +
+ fermionOprMat[1].dot(fermionOprMat[3].cTranspose()) +
+ fermionOprMat[3].dot(fermionOprMat[1].cTranspose())) *
gammaZero
- // Trion coupling
- + ((fermionOprMat[3].cTranspose().dot(fermionOprMat[4].cTranspose()) +
- fermionOprMat[4].dot(fermionOprMat[3])) *
- omega);
- // End
- //
- //
- create_QuantumNspinCharge();
- create_Block_structure();
- //####################################################################
- n_Q = get_unique_Qnumbers();
- // set chi_Q
- chi_Q.clear();
- for (auto ai : n_Q) {
- double t_charge = std::accumulate(ai.begin(), ai.end(), 0);
- chi_Q.push_back(std::pow(-1., t_charge));
- }
- //
- // set foperator
- auto h_blocked = get_block_Hamiltonian(Hamiltonian);
- // std::cout << "h_blocked: " << h_blocked << std::endl;
- // std::cout << "Hamiltonian: " << Hamiltonian << std::endl;
- // Diagonalize the hamilton
- eigenvalues_Q.clear();
- eigenvalues_Q.resize(n_Q.size(), {});
- for (size_t i = 0; i < n_Q.size(); i++) {
- eigenvalues_Q[i] = (h_blocked.get(i, i)).value()->diag();
- }
- // std::cout << "Eigenvalues: " << eigenvalues_Q << std::endl;
- // TODO: rotate the f operator
- //####################################################################
- f_dag_operator = get_block_operators({fermionOprMat[0], fermionOprMat[1]});
- std::cout << "f_dag_operators: " << f_dag_operator.size() << std::endl;
- std::vector topr(f_dag_operator.size(), qOperator());
- for (size_t ip = 0; ip < f_dag_operator.size(); ip++) {
- for (size_t i = 0; i < n_Q.size(); i++) {
- for (size_t j = 0; j < n_Q.size(); j++) {
- auto tfopr = f_dag_operator[ip].get(i, j);
- if (tfopr) {
- topr[ip].set((h_blocked.get(i, i))
- .value()
- ->cTranspose()
- .dot(*tfopr.value())
- .dot(*(h_blocked.get(j, j)).value()),
- i, j);
- }
- }
- }
+ // Trion coupling
+ + ((fermionOprMat[3].cTranspose().dot(fermionOprMat[4].cTranspose()) +
+ fermionOprMat[4].dot(fermionOprMat[3])) *
+ omega);
+ // End
+ //
+ //
+ create_QuantumNspinCharge();
+ create_Block_structure();
+ // ####################################################################
+ n_Q = get_unique_Qnumbers();
+ // set chi_Q
+ chi_Q.clear();
+ for (auto ai : n_Q) {
+ double t_charge = std::accumulate(ai.begin(), ai.end(), 0);
+ chi_Q.push_back(std::pow(-1., t_charge));
+ }
+ //
+ // set foperator
+ auto h_blocked = get_block_Hamiltonian(Hamiltonian);
+ // std::cout << "h_blocked: " << h_blocked << std::endl;
+ // std::cout << "Hamiltonian: " << Hamiltonian << std::endl;
+ // Diagonalize the hamilton
+ eigenvalues_Q.clear();
+ eigenvalues_Q.resize(n_Q.size(), {});
+ for (size_t i = 0; i < n_Q.size(); i++) {
+ eigenvalues_Q[i] = (h_blocked.get(i, i)).value()->diag();
+ }
+ // std::cout << "Eigenvalues: " << eigenvalues_Q << std::endl;
+ // TODO(saurabh): rotate the f operator
+ // ####################################################################
+ f_dag_operator = get_block_operators({fermionOprMat[0], fermionOprMat[1]});
+ std::cout << "f_dag_operators: " << f_dag_operator.size() << std::endl;
+ std::vector topr(f_dag_operator.size(), qOperator());
+ for (size_t ip = 0; ip < f_dag_operator.size(); ip++) {
+ for (size_t i = 0; i < n_Q.size(); i++) {
+ for (size_t j = 0; j < n_Q.size(); j++) {
+ auto tfopr = f_dag_operator[ip].get(i, j);
+ if (tfopr) {
+ topr[ip].set((h_blocked.get(i, i))
+ .value()
+ ->cTranspose()
+ .dot(*tfopr.value())
+ .dot(*(h_blocked.get(j, j)).value()),
+ i, j);
+ }
}
- f_dag_operator = topr;
+ }
}
- // ######################################
+ f_dag_operator = topr;
+ }
+ // ######################################
};
diff --git a/examples/rabiAnderson/rabiSingleParticle.hpp b/examples/rabiAnderson/rabiSingleParticle.hpp
index 02ed0de..d72a8cb 100644
--- a/examples/rabiAnderson/rabiSingleParticle.hpp
+++ b/examples/rabiAnderson/rabiSingleParticle.hpp
@@ -13,163 +13,161 @@
#include
#include
class rabiSingleParticle : public fermionBasis {
- /** This class is for a single orbital with spin up and down
- * f operator. SIAM can be made entirely from this class.
- *
- *
- */
+ /** This class is for a single orbital with spin up and down
+ * f operator. SIAM can be made entirely from this class.
+ *
+ *
+ */
public:
- rabiSingleParticle(double JKondo, double omega) {
- // One additional state for the trion state
- nstates = 3 * 4; // std::pow(2, dof); // Dimension of the system
- dof = 3 // for spin + trion
- + 2; // std::pow(2, dof); // Dimension of the system
- std::cout << "nstates: " << nstates << "\n"
- << "dof: " << dof << "\n";
- createBasis(JKondo, omega); // create the basis in nstates x nstates
- }
- std::vector> get_basis() {
- return n_Q;
- }
- std::vector> get_eigenvaluesQ() {
- return eigenvalues_Q;
- }
- std::vector get_chi_Q() {
- return chi_Q;
- }
- //
- std::vector> eigenvalues_Q;
- std::vector chi_Q;
- std::vector> n_Q;
- // ########################################
+ rabiSingleParticle(double JKondo, double omega)
+ : fermionBasis(5, fermionBasis::chargeOnly) //
+ {
+ // One additional state for the trion state
+ int nstates = 3 * 4; // std::pow(2, dof); // Dimension of the system
+ int dof = 3 // for spin + trion
+ + 2; // std::pow(2, dof); // Dimension of the system
+ std::cout << "nstates: " << nstates << "\n"
+ << "dof: " << dof << "\n";
+ createBasis(JKondo, omega); // create the basis in nstates x nstates
+ }
+ [[nodiscard]] std::vector> get_basis() const { return n_Q; }
+ [[nodiscard]] std::vector> get_eigenvaluesQ() const {
+ return eigenvalues_Q;
+ }
+ [[nodiscard]] std::vector get_chi_Q() const { return chi_Q; }
+ //
+ std::vector> eigenvalues_Q;
+ std::vector chi_Q;
+ std::vector> n_Q;
+ // ########################################
private:
- void createBasis(double JKondo, double omega) {
- // TODO: check spinS is multiple of 2.
- size_t spinDim = 3;
- std::cout << "spinDim: " << spinDim << std::endl;
- qmatrix spinSz(spinDim, spinDim, 0);
- qmatrix spinSx(spinDim, spinDim, 0);
- qmatrix spinSy(spinDim, spinDim, 0);
- qmatrix hOmega(spinDim, spinDim, 0);
- qmatrix trParticle(spinDim, spinDim, 0); // trion particle Number
- qmatrix sParticle(spinDim, spinDim, 0); // trion particle Number
- // Set Matrices
- spinSz(1, 1) = -0.5;
- spinSz(2, 2) = 0.5;
- //
- spinSx(1, 2) = 0.5;
- spinSx(2, 1) = 0.5;
- //
- spinSy(1, 2) = 0.5;
- spinSy(2, 1) = -0.5;
- //
- hOmega(0, 1) = omega;
- hOmega(1, 0) = omega;
- //
- trParticle(0, 0) = 1.0;
- //
- sParticle(1, 1) = 1.0;
- sParticle(2, 2) = 1.0;
- // ########################################
- std::cout << "spinSx: " << spinSx << std::endl;
- std::cout << "spinSy: " << spinSy << std::endl;
- std::cout << "spinSz: " << spinSz << std::endl;
- // ########################################
- // create basis
- qmatrix<> fdag = {0, 0, 1, 0};
- qmatrix<> sigz = {1, 0, 0, -1};
- qmatrix<> id2 = {1, 0, 0, 1};
- // Create c_up and c_Down operator
- // Addting and additional operators should be done in the same way.
- auto c_up_dag = fdag.krDot(id2);
- auto c_Down_dag = sigz.krDot(fdag);
- // Create Wilson Site spin operators
- auto wSpinx = (c_up_dag.dot(c_Down_dag.cTranspose()) +
- c_Down_dag.dot(c_up_dag.cTranspose())) *
- 0.5;
- auto wSpiny = (c_Down_dag.dot(c_up_dag.cTranspose()) -
- c_up_dag.dot(c_Down_dag.cTranspose())) *
- 0.5; // -i is omitted here.
- auto wSpinz = (c_up_dag.dot(c_up_dag.cTranspose()) -
- c_Down_dag.dot(c_Down_dag.cTranspose())) *
- 0.5;
- auto wNtotal =
- (c_up_dag.dot(c_up_dag.cTranspose()) +
- c_Down_dag.dot(
- c_Down_dag.cTranspose())); // Create Hamiltonian spin operator
- // ########################################################
- std::cout << "wSpinx: " << wSpinx << std::endl;
- std::cout << "wSpiny: " << wSpiny << std::endl;
- std::cout << "wSpinz: " << wSpinz << std::endl;
- // ############################################
- auto Hamiltonian =
- (spinSz.krDot(wSpinz) + spinSx.krDot(wSpinx) //
- - spinSy.krDot(wSpiny)) * // Imaginary part is taken care here
+ void createBasis(double JKondo, double omega) {
+ // TODO(saurabh): check spinS is multiple of 2.
+ size_t spinDim = 3;
+ std::cout << "spinDim: " << spinDim << std::endl;
+ qmatrix spinSz(spinDim, spinDim, 0);
+ qmatrix spinSx(spinDim, spinDim, 0);
+ qmatrix spinSy(spinDim, spinDim, 0);
+ qmatrix hOmega(spinDim, spinDim, 0);
+ qmatrix trParticle(spinDim, spinDim, 0); // trion particle Number
+ qmatrix sParticle(spinDim, spinDim, 0); // trion particle Number
+ // Set Matrices
+ spinSz(1, 1) = -0.5;
+ spinSz(2, 2) = 0.5;
+ //
+ spinSx(1, 2) = 0.5;
+ spinSx(2, 1) = 0.5;
+ //
+ spinSy(1, 2) = 0.5;
+ spinSy(2, 1) = -0.5;
+ //
+ hOmega(0, 1) = omega;
+ hOmega(1, 0) = omega;
+ //
+ trParticle(0, 0) = 1.0;
+ //
+ sParticle(1, 1) = 1.0;
+ sParticle(2, 2) = 1.0;
+ // ########################################
+ std::cout << "spinSx: " << spinSx << std::endl;
+ std::cout << "spinSy: " << spinSy << std::endl;
+ std::cout << "spinSz: " << spinSz << std::endl;
+ // ########################################
+ // create basis
+ qmatrix<> fdag = {0, 0, 1, 0};
+ qmatrix<> sigz = {1, 0, 0, -1};
+ qmatrix<> id2 = {1, 0, 0, 1};
+ // Create c_up and c_Down operator
+ // Addting and additional operators should be done in the same way.
+ auto c_up_dag = fdag.krDot(id2);
+ auto c_Down_dag = sigz.krDot(fdag);
+ // Create Wilson Site spin operators
+ auto wSpinx = (c_up_dag.dot(c_Down_dag.cTranspose()) +
+ c_Down_dag.dot(c_up_dag.cTranspose())) *
+ 0.5;
+ auto wSpiny = (c_Down_dag.dot(c_up_dag.cTranspose()) -
+ c_up_dag.dot(c_Down_dag.cTranspose())) *
+ 0.5; // -i is omitted here.
+ auto wSpinz = (c_up_dag.dot(c_up_dag.cTranspose()) -
+ c_Down_dag.dot(c_Down_dag.cTranspose())) *
+ 0.5;
+ auto wNtotal =
+ (c_up_dag.dot(c_up_dag.cTranspose()) +
+ c_Down_dag.dot(
+ c_Down_dag.cTranspose())); // Create Hamiltonian spin operator
+ // ########################################################
+ std::cout << "wSpinx: " << wSpinx << std::endl;
+ std::cout << "wSpiny: " << wSpiny << std::endl;
+ std::cout << "wSpinz: " << wSpinz << std::endl;
+ // ############################################
+ auto Hamiltonian =
+ (spinSz.krDot(wSpinz) + spinSx.krDot(wSpinx) //
+ - spinSy.krDot(wSpiny)) * // Imaginary part is taken care here
JKondo +
- hOmega.krDot(wSpinz.id()); // Hamiltonian
- // End
- fnParticle.clear();
- // std::cout << "spinSz: " << spinSz << std::endl;
- spinSz = qmatrix(spinSz.krDot(wSpinx.id()));
- trParticle = qmatrix(trParticle.krDot(wSpinx.id()));
- sParticle = qmatrix(sParticle.krDot(wSpinx.id()));
- // std::cout << "spinSz: " << spinSz << std::endl;
- wSpinz = spinSx.id().krDot(wSpinz);
- wNtotal = spinSx.id().krDot(wNtotal);
- std::cout << "wSpinz: " << wSpinz * 2 << std::endl;
- c_up_dag = spinSx.id().krDot(c_up_dag);
- c_Down_dag = spinSx.id().krDot(c_Down_dag);
- // Number of particles
- fnParticle.push_back(trParticle.getdiagonal());
- fnParticle.push_back(((sParticle + spinSz * 2.) * 0.5).getdiagonal());
- fnParticle.push_back(((sParticle - spinSz * 2.) * 0.5).getdiagonal());
- fnParticle.push_back(((wNtotal + wSpinz * 2.) * 0.5).getdiagonal());
- fnParticle.push_back(((wNtotal - wSpinz * 2.) * 0.5).getdiagonal());
- //
- std::cout << "fnParticle: " << fnParticle << std::endl;
- //
- createQNumbers({{1, 3}, {0, 2, 4}});
- create_Block_structure();
- //####################################################################
- n_Q = get_unique_Qnumbers();
- // set chi_Q
- chi_Q.clear();
- for (auto ai : n_Q) {
- double t_charge = std::accumulate(ai.begin(), ai.end(), 0);
- chi_Q.push_back(std::pow(-1., t_charge));
- }
- //
- // set foperator
- auto h_blocked = get_block_Hamiltonian(Hamiltonian);
- std::cout << "h_blocked: " << h_blocked << std::endl;
- std::cout << "Hamiltonian: " << Hamiltonian << std::endl;
- // Diagonalize the hamilton
- eigenvalues_Q.clear();
- eigenvalues_Q.resize(n_Q.size(), {});
- for (size_t i = 0; i < n_Q.size(); i++) {
- eigenvalues_Q[i] = (h_blocked.get(i, i)).value()->diag();
- }
- // TODO: rotate the f operator
- //####################################################################
- f_dag_operator = get_block_operators({c_up_dag, c_Down_dag});
- std::cout << "f_dag_operators: " << f_dag_operator.size() << std::endl;
- std::vector topr(f_dag_operator.size(), qOperator());
- for (size_t ip = 0; ip < f_dag_operator.size(); ip++) {
- for (size_t i = 0; i < n_Q.size(); i++) {
- for (size_t j = 0; j < n_Q.size(); j++) {
- auto tfopr = f_dag_operator[ip].get(i, j);
- if (tfopr) {
- topr[ip].set((h_blocked.get(i, i))
- .value()
- ->cTranspose()
- .dot(*tfopr.value())
- .dot(*(h_blocked.get(j, j)).value()),
- i, j);
- }
- }
- }
+ hOmega.krDot(wSpinz.id()); // Hamiltonian
+ // End
+ fnParticle.clear();
+ // std::cout << "spinSz: " << spinSz << std::endl;
+ spinSz = qmatrix(spinSz.krDot(wSpinx.id()));
+ trParticle = qmatrix(trParticle.krDot(wSpinx.id()));
+ sParticle = qmatrix(sParticle.krDot(wSpinx.id()));
+ // std::cout << "spinSz: " << spinSz << std::endl;
+ wSpinz = spinSx.id().krDot(wSpinz);
+ wNtotal = spinSx.id().krDot(wNtotal);
+ std::cout << "wSpinz: " << wSpinz * 2 << std::endl;
+ c_up_dag = spinSx.id().krDot(c_up_dag);
+ c_Down_dag = spinSx.id().krDot(c_Down_dag);
+ // Number of particles
+ fnParticle.push_back(trParticle.getdiagonal());
+ fnParticle.push_back(((sParticle + spinSz * 2.) * 0.5).getdiagonal());
+ fnParticle.push_back(((sParticle - spinSz * 2.) * 0.5).getdiagonal());
+ fnParticle.push_back(((wNtotal + wSpinz * 2.) * 0.5).getdiagonal());
+ fnParticle.push_back(((wNtotal - wSpinz * 2.) * 0.5).getdiagonal());
+ //
+ std::cout << "fnParticle: " << fnParticle << std::endl;
+ //
+ createQNumbers({{1, 3}, {0, 2, 4}});
+ create_Block_structure();
+ // ####################################################################
+ n_Q = get_unique_Qnumbers();
+ // set chi_Q
+ chi_Q.clear();
+ for (auto ai : n_Q) {
+ double t_charge = std::accumulate(ai.begin(), ai.end(), 0);
+ chi_Q.push_back(std::pow(-1., t_charge));
+ }
+ //
+ // set foperator
+ auto h_blocked = get_block_Hamiltonian(Hamiltonian);
+ std::cout << "h_blocked: " << h_blocked << std::endl;
+ std::cout << "Hamiltonian: " << Hamiltonian << std::endl;
+ // Diagonalize the hamilton
+ eigenvalues_Q.clear();
+ eigenvalues_Q.resize(n_Q.size(), {});
+ for (size_t i = 0; i < n_Q.size(); i++) {
+ eigenvalues_Q[i] = (h_blocked.get(i, i)).value()->diag();
+ }
+ // TODO(saurabh): rotate the f operator
+ // ####################################################################
+ f_dag_operator = get_block_operators({c_up_dag, c_Down_dag});
+ std::cout << "f_dag_operators: " << f_dag_operator.size() << std::endl;
+ std::vector topr(f_dag_operator.size(), qOperator());
+ for (size_t ip = 0; ip < f_dag_operator.size(); ip++) {
+ for (size_t i = 0; i < n_Q.size(); i++) {
+ for (size_t j = 0; j < n_Q.size(); j++) {
+ auto tfopr = f_dag_operator[ip].get(i, j);
+ if (tfopr) {
+ topr[ip].set((h_blocked.get(i, i))
+ .value()
+ ->cTranspose()
+ .dot(*tfopr.value())
+ .dot(*(h_blocked.get(j, j)).value()),
+ i, j);
+ }
}
- f_dag_operator = topr;
+ }
}
- // ######################################
+ f_dag_operator = topr;
+ }
+ // ######################################
};
diff --git a/examples/rabiAnderson/rabiSpinless.hpp b/examples/rabiAnderson/rabiSpinless.hpp
index 71551ab..6d54af3 100644
--- a/examples/rabiAnderson/rabiSpinless.hpp
+++ b/examples/rabiAnderson/rabiSpinless.hpp
@@ -13,132 +13,129 @@
#include
#include
class rabiSpinless : public fermionBasis {
- // See PHYSICAL REVIEW B 101, 085110 (2020)
- /** This class is for a single orbital with spin up and down
- * f operator. SIAM can be made entirely from this class.
- *
- *
- */
+ // See PHYSICAL REVIEW B 101, 085110 (2020)
+ /** This class is for a single orbital with spin up and down
+ * f operator. SIAM can be made entirely from this class.
+ *
+ *
+ */
public:
- /**
- * @brief Construct a new rabiSpinless object
- *
- * @param JKondo: J value for the Kondo interaction
- * @param spinS: Spin value i.e,. 1/2 or 3/2. Integer Spin may not work
- */
- rabiSpinless(double JKondo, double omega) {
- dof = 1 + // for the trion State (up)
+ /**
+ * @brief Construct a new rabiSpinless object
+ *
+ * @param JKondo: J value for the Kondo interaction
+ * @param spinS: Spin value i.e,. 1/2 or 3/2. Integer Spin may not work
+ */
+ rabiSpinless(double JKondo, double omega)
+ : fermionBasis(5, fermionBasis::chargeOnly) {
+ int dof = 1 + // for the trion State (up)
2 + // for the electron state
2; // for the wilson site
- // Dimension of the system
- nstates = std::pow(2, dof);
- // Dimension of the system
- std::cout << "nstates: " << nstates << "\n"
- << "dof: " << dof << "\n";
- createBasis(JKondo, omega); // create the basis in nstates x nstates
- }
- std::vector> get_basis() {
- return n_Q;
- }
- std::vector> get_eigenvaluesQ() {
- return eigenvalues_Q;
- }
- std::vector get_chi_Q() {
- return chi_Q;
+ // Dimension of the system
+ double nstates = std::pow(2, dof);
+ // Dimension of the system
+ std::cout << "nstates: " << nstates << "\n"
+ << "dof: " << dof << "\n";
+ createBasis(JKondo, omega); // create the basis in nstates x nstates
+ }
+ [[nodiscard]] std::vector> get_basis() const { return n_Q; }
+ [[nodiscard]] std::vector> get_eigenvaluesQ() const {
+ return eigenvalues_Q;
+ }
+ [[nodiscard]] std::vector get_chi_Q() const { return chi_Q; }
+ //
+ std::vector> eigenvalues_Q;
+ std::vector chi_Q;
+ std::vector> n_Q;
+ // ########################################
+private:
+ void createBasis(double JKondo, double Omega) {
+ //
+ // createFermionBasis();
+ std::cout << "FermionBasis Size" << fermionOprMat.size() << "\n";
+ // Create the spinOperator electron[Impurity]
+ auto iSpinx = (fermionOprMat[3].dot(fermionOprMat[2].cTranspose()) +
+ fermionOprMat[2].dot(fermionOprMat[3].cTranspose())) *
+ 0.5;
+ auto iSpiny = (fermionOprMat[3].dot(fermionOprMat[2].cTranspose()) -
+ fermionOprMat[2].dot(fermionOprMat[3].cTranspose())) *
+ 0.5;
+ auto iSpinz = (fermionOprMat[2].dot(fermionOprMat[2].cTranspose()) -
+ fermionOprMat[3].dot(fermionOprMat[3].cTranspose())) *
+ 0.5;
+ // Create the spinOperator electron[Wilson Site ]
+ auto wSpinx = (fermionOprMat[1].dot(fermionOprMat[0].cTranspose()) +
+ fermionOprMat[0].dot(fermionOprMat[1].cTranspose())) *
+ 0.5;
+ auto wSpiny = (fermionOprMat[1].dot(fermionOprMat[0].cTranspose()) -
+ fermionOprMat[0].dot(fermionOprMat[1].cTranspose())) *
+ 0.5;
+ auto wSpinz = (fermionOprMat[0].dot(fermionOprMat[0].cTranspose()) -
+ fermionOprMat[1].dot(fermionOprMat[1].cTranspose())) *
+ 0.5;
+ // ########################################################
+ // std::cout << "iSpinx" << iSpinx << std::endl;
+ // std::cout << "iSpiny: " << iSpiny << std::endl;
+ // std::cout << "iSpinz" << iSpinz << std::endl;
+ // //
+ // std::cout << "wSpinx: " << wSpinx << std::endl;
+ // std::cout << "wSpiny: " << wSpiny << std::endl;
+ // std::cout << "wSpinz: " << wSpinz << std::endl;
+ // ############################################
+ auto Hamiltonian =
+ ((iSpinz.dot(wSpinz) + iSpinx.dot(wSpinx) //
+ - iSpiny.dot(wSpiny)) * // Imaginary part is taken care here
+ JKondo)
+ // Trion coupling
+ + ((fermionOprMat[4].dot(fermionOprMat[3].cTranspose()) +
+ fermionOprMat[3].dot(fermionOprMat[4].cTranspose())) *
+ Omega);
+ // End
+ //
+ //
+ create_QuantumNspinCharge();
+ create_Block_structure();
+ // ####################################################################
+ n_Q = get_unique_Qnumbers();
+ // set chi_Q
+ chi_Q.clear();
+ for (auto ai : n_Q) {
+ double t_charge = std::accumulate(ai.begin(), ai.end(), 0);
+ chi_Q.push_back(std::pow(-1., t_charge));
}
//
- std::vector> eigenvalues_Q;
- std::vector chi_Q;
- std::vector> n_Q;
- // ########################################
-private:
- void createBasis(double JKondo, double Omega) {
- //
- createFermionBasis();
- std::cout << "FermionBasis Size" << fermionOprMat.size() << "\n";
- // Create the spinOperator electron[Impurity]
- auto iSpinx = (fermionOprMat[3].dot(fermionOprMat[2].cTranspose()) +
- fermionOprMat[2].dot(fermionOprMat[3].cTranspose())) *
- 0.5;
- auto iSpiny = (fermionOprMat[3].dot(fermionOprMat[2].cTranspose()) -
- fermionOprMat[2].dot(fermionOprMat[3].cTranspose())) *
- 0.5;
- auto iSpinz = (fermionOprMat[2].dot(fermionOprMat[2].cTranspose()) -
- fermionOprMat[3].dot(fermionOprMat[3].cTranspose())) *
- 0.5;
- // Create the spinOperator electron[Wilson Site ]
- auto wSpinx = (fermionOprMat[1].dot(fermionOprMat[0].cTranspose()) +
- fermionOprMat[0].dot(fermionOprMat[1].cTranspose())) *
- 0.5;
- auto wSpiny = (fermionOprMat[1].dot(fermionOprMat[0].cTranspose()) -
- fermionOprMat[0].dot(fermionOprMat[1].cTranspose())) *
- 0.5;
- auto wSpinz = (fermionOprMat[0].dot(fermionOprMat[0].cTranspose()) -
- fermionOprMat[1].dot(fermionOprMat[1].cTranspose())) *
- 0.5;
- // ########################################################
- // std::cout << "iSpinx" << iSpinx << std::endl;
- // std::cout << "iSpiny: " << iSpiny << std::endl;
- // std::cout << "iSpinz" << iSpinz << std::endl;
- // //
- // std::cout << "wSpinx: " << wSpinx << std::endl;
- // std::cout << "wSpiny: " << wSpiny << std::endl;
- // std::cout << "wSpinz: " << wSpinz << std::endl;
- // ############################################
- auto Hamiltonian =
- ((iSpinz.dot(wSpinz) + iSpinx.dot(wSpinx) //
- - iSpiny.dot(wSpiny)) * // Imaginary part is taken care here
- JKondo)
- // Trion coupling
- + ((fermionOprMat[4].dot(fermionOprMat[3].cTranspose()) +
- fermionOprMat[3].dot(fermionOprMat[4].cTranspose())) *
- Omega);
- // End
- //
- //
- create_QuantumNspinCharge();
- create_Block_structure();
- //####################################################################
- n_Q = get_unique_Qnumbers();
- // set chi_Q
- chi_Q.clear();
- for (auto ai : n_Q) {
- double t_charge = std::accumulate(ai.begin(), ai.end(), 0);
- chi_Q.push_back(std::pow(-1., t_charge));
- }
- //
- // set foperator
- auto h_blocked = get_block_Hamiltonian(Hamiltonian);
- // std::cout << "h_blocked: " << h_blocked << std::endl;
- // std::cout << "Hamiltonian: " << Hamiltonian << std::endl;
- // Diagonalize the hamilton
- eigenvalues_Q.clear();
- eigenvalues_Q.resize(n_Q.size(), {});
- for (size_t i = 0; i < n_Q.size(); i++) {
- eigenvalues_Q[i] = (h_blocked.get(i, i)).value()->diag();
- }
- // std::cout << "Eigenvalues: " << eigenvalues_Q << std::endl;
- // TODO: rotate the f operator
- //####################################################################
- f_dag_operator = get_block_operators({fermionOprMat[0], fermionOprMat[1]});
- std::cout << "f_dag_operators: " << f_dag_operator.size() << std::endl;
- std::vector topr(f_dag_operator.size(), qOperator());
- for (size_t ip = 0; ip < f_dag_operator.size(); ip++) {
- for (size_t i = 0; i < n_Q.size(); i++) {
- for (size_t j = 0; j < n_Q.size(); j++) {
- auto tfopr = f_dag_operator[ip].get(i, j);
- if (tfopr) {
- topr[ip].set((h_blocked.get(i, i))
- .value()
- ->cTranspose()
- .dot(*tfopr.value())
- .dot(*(h_blocked.get(j, j)).value()),
- i, j);
- }
- }
- }
+ // set foperator
+ auto h_blocked = get_block_Hamiltonian(Hamiltonian);
+ // std::cout << "h_blocked: " << h_blocked << std::endl;
+ // std::cout << "Hamiltonian: " << Hamiltonian << std::endl;
+ // Diagonalize the hamilton
+ eigenvalues_Q.clear();
+ eigenvalues_Q.resize(n_Q.size(), {});
+ for (size_t i = 0; i < n_Q.size(); i++) {
+ eigenvalues_Q[i] = (h_blocked.get(i, i)).value()->diag();
+ }
+ // std::cout << "Eigenvalues: " << eigenvalues_Q << std::endl;
+ // TODO: rotate the f operator
+ // ####################################################################
+ f_dag_operator = get_block_operators({fermionOprMat[0], fermionOprMat[1]});
+ std::cout << "f_dag_operators: " << f_dag_operator.size() << std::endl;
+ std::vector topr(f_dag_operator.size(), qOperator());
+ for (size_t ip = 0; ip < f_dag_operator.size(); ip++) {
+ for (size_t i = 0; i < n_Q.size(); i++) {
+ for (size_t j = 0; j < n_Q.size(); j++) {
+ auto tfopr = f_dag_operator[ip].get(i, j);
+ if (tfopr) {
+ topr[ip].set((h_blocked.get(i, i))
+ .value()
+ ->cTranspose()
+ .dot(*tfopr.value())
+ .dot(*(h_blocked.get(j, j)).value()),
+ i, j);
+ }
}
- f_dag_operator = topr;
+ }
}
- // ######################################
+ f_dag_operator = topr;
+ }
+ // ######################################
};
diff --git a/examples/resonantLevel/CMakeLists.txt b/examples/resonantLevel/CMakeLists.txt
index f5ad440..9960c96 100644
--- a/examples/resonantLevel/CMakeLists.txt
+++ b/examples/resonantLevel/CMakeLists.txt
@@ -1,12 +1,18 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
-project(resonantLevel LANGUAGES CXX)
-
+# project(entropySIAM LANGUAGES CXX)
+# use folder name for the project name
+get_filename_component(ProjectId ${CMAKE_CURRENT_LIST_DIR} NAME)
+string(REPLACE " " "_" ProjectId ${ProjectId})
+project(${ProjectId} C CXX)
##########Dependencies########
find_package(HDF5 COMPONENTS CXX HL)
include_directories(${HDF5_INCLUDE_DIR})
set(LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES})
+
+########################################################################
+
################
file(GLOB sources CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
file(GLOB headers CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)
@@ -22,8 +28,10 @@ target_link_libraries(
#openblas
#cblas
#lapack
- hdf5
- hdf5_cpp
+ HDF5::HDF5
# MKL::MKL
- mkl_intel_lp64 mkl_intel_thread mkl_core iomp5
+ # mkl_intel_lp64 mkl_intel_thread mkl_core
+ mkl_intel_lp64 mkl_core mkl_intel_thread mkl_core iomp5
)
+
+
diff --git a/examples/resonantLevel/main.cpp b/examples/resonantLevel/main.cpp
index 94d909d..4f61dd9 100644
--- a/examples/resonantLevel/main.cpp
+++ b/examples/resonantLevel/main.cpp
@@ -9,19 +9,17 @@
#include "nrgcore/nrgData.hpp"
#include "nrgcore/nrgcore.hpp"
#include "nrgcore/sysOperator.hpp"
-#include "openChain/currentShellCouplingOpenChain.hpp"
-#include "openChain/staticExpectationOpenChain.hpp"
#include
#include
-double LAMBDA = 3.00; // Dont do this
-double hopping(int site) {
+const double LAMBDA = 3.00; // Dont do this
+double hopping(int site) {
return 0.5 * (1.0 + 1.0 / LAMBDA) * (1. - std::pow(LAMBDA, -site - 1)) /
std::sqrt((1.0 - std::pow(LAMBDA, -2. * site - 1)) *
- (1.0 - std::pow(LAMBDA, -2. * site - 3)));
+ (1.0 - std::pow(LAMBDA, -2. * site - 3)));
}
// int main(int argc, char *argv[]) {
int main() {
- std::srand(std::time(0));
+ std::srand(std::time(nullptr));
timer mtime("Total time : ");
// Parameter ############################################
size_t nMax = 6; // Number of NRG iteration
@@ -61,10 +59,10 @@ int main() {
// This is consistentent with
// Bulla's RMP
std::vector nUpDownOperator{impurity.impurityNparticle};
- currentOpenChain fullOpenCalc(&siamTc, // NRG objeect
- &nUpDownOperator, // NRG local operator
- LAMBDA);
- // Hopping element for each operator
+ // currentOpenChain fullOpenCalc(&siamTc, // NRG objeect
+ // &nUpDownOperator, // NRG local operator
+ // LAMBDA);
+ // // Hopping element for each operator
std::vector thop;
for (size_t in = 0; in < nMax; in++) {
double rescale = 1.0;
@@ -78,7 +76,7 @@ int main() {
minIterations++;
}
// bath operators are always saved
- fullOpenCalc.saveFullNRGState();
+ // fullOpenCalc.saveFullNRGState();
// Update all the previous bath operator
// Every site has bath operators
// openChainTC.saveBathOperators();
@@ -118,8 +116,8 @@ int main() {
// }
// }
// #####################################################
- fullOpenCalc.setVolltageArray(voltageArray);
- fullOpenCalc.openChainFullCalculation();
+ // fullOpenCalc.setVolltageArray(voltageArray);
+ // fullOpenCalc.openChainFullCalculation();
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
std::cout << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << std::endl;
std::cout << "%Second Backward Iteration %%" << std::endl;
@@ -134,7 +132,7 @@ int main() {
// fullOpenCalc.openChainFullCalculation(std::pow(LAMBDA, -(in - 1.0)
// / 2.0)); std::cout << "##########################" << std::endl;
// }
- fullOpenCalc.saveOpenChainFinalData(&rfile);
+ // fullOpenCalc.saveOpenChainFinalData(&rfile);
//
// Dont do this
rfile.close();
diff --git a/examples/rgflowKondo/CMakeLists.txt b/examples/rgflowKondo/CMakeLists.txt
index 724cec5..9960c96 100644
--- a/examples/rgflowKondo/CMakeLists.txt
+++ b/examples/rgflowKondo/CMakeLists.txt
@@ -1,12 +1,16 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
-project(rgflowKondo LANGUAGES CXX)
-
+# project(entropySIAM LANGUAGES CXX)
+# use folder name for the project name
+get_filename_component(ProjectId ${CMAKE_CURRENT_LIST_DIR} NAME)
+string(REPLACE " " "_" ProjectId ${ProjectId})
+project(${ProjectId} C CXX)
##########Dependencies########
find_package(HDF5 COMPONENTS CXX HL)
include_directories(${HDF5_INCLUDE_DIR})
set(LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES})
+
########################################################################
################
@@ -24,8 +28,7 @@ target_link_libraries(
#openblas
#cblas
#lapack
- hdf5
- hdf5_cpp
+ HDF5::HDF5
# MKL::MKL
# mkl_intel_lp64 mkl_intel_thread mkl_core
mkl_intel_lp64 mkl_core mkl_intel_thread mkl_core iomp5
diff --git a/examples/rgflowSIAM/CMakeLists.txt b/examples/rgflowSIAM/CMakeLists.txt
index 7b66c7f..9960c96 100644
--- a/examples/rgflowSIAM/CMakeLists.txt
+++ b/examples/rgflowSIAM/CMakeLists.txt
@@ -1,12 +1,16 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
-project(rgflowSIAM LANGUAGES CXX)
-
+# project(entropySIAM LANGUAGES CXX)
+# use folder name for the project name
+get_filename_component(ProjectId ${CMAKE_CURRENT_LIST_DIR} NAME)
+string(REPLACE " " "_" ProjectId ${ProjectId})
+project(${ProjectId} C CXX)
##########Dependencies########
find_package(HDF5 COMPONENTS CXX HL)
include_directories(${HDF5_INCLUDE_DIR})
set(LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES})
+
########################################################################
################
@@ -24,8 +28,7 @@ target_link_libraries(
#openblas
#cblas
#lapack
- hdf5
- hdf5_cpp
+ HDF5::HDF5
# MKL::MKL
# mkl_intel_lp64 mkl_intel_thread mkl_core
mkl_intel_lp64 mkl_core mkl_intel_thread mkl_core iomp5
diff --git a/examples/twoChannelSiam/CMakeLists.txt b/examples/twoChannelSiam/CMakeLists.txt
index 271b9d6..9960c96 100644
--- a/examples/twoChannelSiam/CMakeLists.txt
+++ b/examples/twoChannelSiam/CMakeLists.txt
@@ -1,25 +1,37 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
-project(twoChannelSiam LANGUAGES CXX)
-
+# project(entropySIAM LANGUAGES CXX)
+# use folder name for the project name
+get_filename_component(ProjectId ${CMAKE_CURRENT_LIST_DIR} NAME)
+string(REPLACE " " "_" ProjectId ${ProjectId})
+project(${ProjectId} C CXX)
##########Dependencies########
find_package(HDF5 COMPONENTS CXX HL)
include_directories(${HDF5_INCLUDE_DIR})
set(LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES})
-#lapack
-find_package(LAPACK)
-find_package(BLAS)
-set(BLA_VENDOR Intel10_64lp)
+
+########################################################################
+
################
file(GLOB sources CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
file(GLOB headers CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
-add_executable(${PROJECT_NAME}.output ${sources} ${headers})
+######################################################
+
+add_executable(${PROJECT_NAME}.out ${sources} ${headers})
+
+
+
target_link_libraries(
- ${PROJECT_NAME}.output NRG
- hdf5
- hdf5_cpp
- mkl_intel_lp64 mkl_core mkl_intel_thread iomp5
+ ${PROJECT_NAME}.out NRG
+ #openblas
+ #cblas
+ #lapack
+ HDF5::HDF5
+ # MKL::MKL
+ # mkl_intel_lp64 mkl_intel_thread mkl_core
+ mkl_intel_lp64 mkl_core mkl_intel_thread mkl_core iomp5
+)
+
- )
diff --git a/examples/twoChannelSiam/main.cpp b/examples/twoChannelSiam/main.cpp
index 08ec8a0..2f50de3 100644
--- a/examples/twoChannelSiam/main.cpp
+++ b/examples/twoChannelSiam/main.cpp
@@ -1,28 +1,27 @@
+#include "models/spinhalf.hpp"
+#include "models/twoChannel.hpp"
#include "nrgcore/nrgcore.hpp"
-#include "nrgcore/spinhalf.hpp"
-#include "nrgcore/twoChannel.hpp"
#include "utils/h5stream.hpp"
#include
#include
-double LAMBDA = 2.50; // Dont do this
-double hopping(int site) {
+const double LAMBDA = 2.50; // Dont do this
+double hopping(int site) {
return 0.5 * (1.0 + 1.0 / LAMBDA) * (1. - std::pow(LAMBDA, -site - 1)) /
std::sqrt((1.0 - std::pow(LAMBDA, -2. * site - 1)) *
- (1.0 - std::pow(LAMBDA, -2. * site - 3)));
+ (1.0 - std::pow(LAMBDA, -2. * site - 3)));
}
int main() {
h5stream::h5stream rfile("resultsTc.h5");
- timer mtime("Total time : ");
- size_t nMax{40}; // Number of NRG iteration
- double U_int = 0.20;
- double GAMMA = 0.0100;
+ timer mtime("Total time : ");
+ size_t nMax{40}; // Number of NRG iteration
+ double U_int = 0.20;
+ double GAMMA = 0.0100;
double fc = 0.5 * std::log(LAMBDA) * (1. + LAMBDA) / (LAMBDA - 1.);
- double V = std::sqrt(2.0 * fc * GAMMA / std::acos(-1.));
+ double V = std::sqrt(2.0 * fc * GAMMA / std::acos(-1.));
std::sqrt(2.0 * GAMMA / std::acos(-1.));
- double eps = -U_int * 0.50;
+ double eps = -U_int * 0.50;
spinhalf impurity(eps, U_int);
// Enlarge the no of fermion on the impurity
-
impurity.f_dag_operator.push_back(impurity.f_dag_operator[0]);
impurity.f_dag_operator.push_back(impurity.f_dag_operator[1]);
twoChannel bath_model;
@@ -44,9 +43,7 @@ int main() {
// Bulla's RMP
auto thop =
std::vector{V, V, V, V}; // Hopping element for each operator
-
siam.add_bath_site(thop, 1.0);
-
siam.update_internal_state();
std::cout << "Eigenvalues: " << siam.all_eigenvalue.size() << " |"
<< siam.all_eigenvalue << std::endl;
@@ -61,7 +58,8 @@ int main() {
// Bulla's RMP
// std::cout << "Eigenvalues: " << siam.all_eigenvalue << std::endl;
// Save the eigenvalue of the current iteration
- rfile.write("Eigenvalues" + std::to_string(in), siam.all_eigenvalue);
+ rfile.write(siam.all_eigenvalue,
+ std::string("Eigenvalues") + std::to_string(in));
}
rfile.close();
// create operators that connect to the environment
diff --git a/makefile b/makefile
index e4f0465..1019c18 100644
--- a/makefile
+++ b/makefile
@@ -6,13 +6,13 @@ build:
rm -rf build
mkdir build
# Clang for debug
- #cmake -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE -Bbuild -DCMAKE_CXX_FLAGS=" -D_GLIBCXX_USE_TBB_PAR_BACKEND=0 -fsanitize=address,leak,undefined -Wno-narrowing -fsanitize-recover=all -g -O0" -DCMAKE_CXX_COMPILER=clang++ .
+ cmake -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE -Bbuild -DCMAKE_CXX_FLAGS=" -D_GLIBCXX_USE_TBB_PAR_BACKEND=0 -fsanitize=address,leak,undefined -Wno-narrowing -fsanitize-recover=all -g -O0" -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang .
# GCC
#cmake -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE -Bbuild -DCMAKE_CXX_FLAGS=" -D_GLIBCXX_USE_TBB_PAR_BACKEND=0 -fsanitize=address,leak,undefined -Wno-narrowing -fsanitize-recover=all -g -O0" -DCMAKE_CXX_COMPILER=g++ .
# Intel Compiler
- cmake -Bbuild -DCMAKE_CXX_FLAGS=" -D_GLIBCXX_USE_TBB_PAR_BACKEND=0 -std=c++20 -qopenmp -qmkl -fp-model precise " -DCMAKE_CXX_COMPILER=icpx -DCMAKE_C_COMPILER=icx .
- # ninja -C build -j12
- make -C build -j12 all
+ # cmake -Bbuild -DCMAKE_CXX_FLAGS=" -D_GLIBCXX_USE_TBB_PAR_BACKEND=0 -std=c++20 -qopenmp -qmkl -fp-model precise " -DCMAKE_CXX_COMPILER=icpx -DCMAKE_C_COMPILER=icx .
+ ninja -C build -j12
+ #make -C build -j12 all
# ninja -C build
#make -C build/${projectName} -j12 all
plot:
diff --git a/nrgcore/CMakeLists.txt b/nrgcore/CMakeLists.txt
index be1508a..3244c44 100644
--- a/nrgcore/CMakeLists.txt
+++ b/nrgcore/CMakeLists.txt
@@ -18,6 +18,10 @@ set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
# add sources and headers
file(GLOB_RECURSE headers CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/include/*/*.hpp")
file(GLOB_RECURSE sources CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/*/*.cpp")
+#
+
+
+
include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/include")
#Add dependencies
find_package(Threads REQUIRED) # Threads may or may not be required. For the profiler, the target that you link against
@@ -33,8 +37,19 @@ find_package(HDF5 COMPONENTS CXX HL)
include_directories(${HDF5_INCLUDE_DIR})
set(LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES})
+# add_dependencies(NRG ${headers} ${sources})
+
#----------------------------------------------------------------
-add_library(NRG ${headers} ${sources})
-target_include_directories(NRG PUBLIC .)
+add_library(NRG "${headers};${sources}" )
+# add_library(NRG ${headers} ${sources})
+# target_include_directories(NRG PUBLIC .)
+# fix rebuild if header or src file changes
+target_include_directories(NRG PRIVATE
+ $
+ $
+)
+#
+
+target_include_directories(NRG INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include" )
target_include_directories(NRG PRIVATE /opt/intel/oneapi/vtune/latest/sdk/include)
target_link_directories(NRG PRIVATE /opt/intel/oneapi/vtune/latest/sdk/lib64)
diff --git a/nrgcore/include/nrgcore/sysOperator.hpp b/nrgcore/include/nrgcore/sysOperator.hpp
index b36b420..291463f 100644
--- a/nrgcore/include/nrgcore/sysOperator.hpp
+++ b/nrgcore/include/nrgcore/sysOperator.hpp
@@ -15,8 +15,8 @@
* the function `add_bath_site` has been called and before
* the `update_internal_state`.
*
- * @tparam nrgcore_type nrgcore object type
- * @param systemo_oparator_nQ `qOperator` of the impurity class
+ * @tparam nrgcore_type nrgcore object type.
+ * @param systemo_oparator_nQ `qOperator` of the impurity class.
*/
template // nrgcore_type is a type of
void update_system_operator(nrgcore_type *nrg_object, // NOLINT