From 4da4062084684848879f83ee865df38ea54c362d Mon Sep 17 00:00:00 2001 From: Hannah Andersen Date: Wed, 5 Jun 2024 14:57:48 -0600 Subject: [PATCH 1/3] Updated project so it builds smoothly. Added README for build --- .gitmodules | 8 ++++---- CMakeLists.txt | 17 +++++++++++------ README.md | 11 +++++++++++ extern/pybind11 | 2 +- src/hamiltonian/hamiltonian.hpp | 1 + src/hamiltonian/runtime.cpp | 5 +++-- src/hamiltonian/setup.cpp | 2 +- src/pyket_config.hpp | 2 +- 8 files changed, 33 insertions(+), 15 deletions(-) create mode 100644 README.md diff --git a/.gitmodules b/.gitmodules index a99b87c..f0d26ac 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,3 @@ -[submodule "extern/pybind11"] - path = extern/pybind11 - url = https://github.com/pybind/pybind11.git - branch = stable [submodule "extern/boost-cmake"] path = extern/boost-cmake url = https://github.com/Orphis/boost-cmake.git @@ -26,3 +22,7 @@ [submodule "extern/boost"] path = extern/boost url = https://github.com/boostorg/boost.git +[submodule "extern/pybind11"] + path = extern/pybind11 + url = ../../pybind/pybind11 + branch = stable diff --git a/CMakeLists.txt b/CMakeLists.txt index c9ebe92..5b46685 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,10 +6,13 @@ set(CMAKE_BUILD_TYPE RelWithDebInfo) set(DEFAULT_NUM_MODES 2) set(DEFAULT_NUM_BITS 8) -set(rapidjson_DIR home/ethan/libraries/builds/rapidjson/include) -set(Eigen3_DIR /home/ethan/libraries/builds/eigen_3_install) -FIND_PACKAGE( Boost REQUIRED ) -find_package(Eigen3 3.3 NO_MODULE REQUIRED) +add_subdirectory(extern/boost) +add_subdirectory(extern/eigen) + +#set(rapidjson_DIR home/ethan/libraries/builds/rapidjson/include) +#set(Eigen3_DIR /home/ethan/libraries/builds/eigen_3_install) +#FIND_PACKAGE( Boost REQUIRED ) +#find_package(Eigen3 3.3 NO_MODULE REQUIRED) @@ -21,6 +24,7 @@ if(NOT DEFINED NUM_BITS) message(STATUS "Using Default Number of bits per mode") set(NUM_BITS ${DEFAULT_NUM_BITS}) endif() + #-------DEFINE MODULE NAME------------ set(pyket pyket${NUM_MODES}_${NUM_BITS}) @@ -42,8 +46,9 @@ pybind11_add_module(${pyket} SHARED ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/pyket_config.hpp.in ${CMAKE_CURRENT_SOURCE_DIR}/src/pyket_config.hpp @ONLY) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/src) -target_include_directories(HamiltonianFuncs SYSTEM PUBLIC ${rapidjson_DIR}/include) -target_link_libraries (HamiltonianFuncs Eigen3::Eigen) +target_include_directories(HamiltonianFuncs SYSTEM PUBLIC extern/rapidjson/include) +target_link_libraries(HamiltonianFuncs Eigen3::Eigen) +target_link_libraries(HamiltonianFuncs Boost::format) target_compile_options(HamiltonianFuncs PRIVATE -fPIC) target_link_libraries(${pyket} PRIVATE HamiltonianFuncs) find_package(OpenMP) diff --git a/README.md b/README.md new file mode 100644 index 0000000..9fa69d4 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# README + +To build, run the following commands in the project root directory. + +```bash +git submodule update --init --recursive +mkdir build +cmake .. +make +``` + diff --git a/extern/pybind11 b/extern/pybind11 index f1abf5d..01ab935 160000 --- a/extern/pybind11 +++ b/extern/pybind11 @@ -1 +1 @@ -Subproject commit f1abf5d9159b805674197f6bc443592e631c9130 +Subproject commit 01ab935612a6800c4ad42957808d6cbd30047902 diff --git a/src/hamiltonian/hamiltonian.hpp b/src/hamiltonian/hamiltonian.hpp index 3c30202..99befdb 100644 --- a/src/hamiltonian/hamiltonian.hpp +++ b/src/hamiltonian/hamiltonian.hpp @@ -137,6 +137,7 @@ class hamiltonian{ std::vector> get_spin_idxs()const; pair evolve_state(double time); pair evolve_step(complex factor); + //std::vector> get_decay_diags(int delta_e); TODO: Fix this //par_runtime.cpp void par_test_one(); void par_test_two(); diff --git a/src/hamiltonian/runtime.cpp b/src/hamiltonian/runtime.cpp index 7734909..0a73d6c 100644 --- a/src/hamiltonian/runtime.cpp +++ b/src/hamiltonian/runtime.cpp @@ -37,7 +37,8 @@ void hamiltonian::run_grow(){ } -void hamiltonian::get_decay_diags(int delta_e){ +/* TODO FIX THIS + * vector> hamiltonian::get_decay_diags(int delta_e){ vector> decay_diags(psi_lbl.size()); @@ -78,7 +79,7 @@ void hamiltonian::get_decay_diags(int delta_e){ return(decay_diags); } - +*/ void hamiltonian::set_zero_except_init(){ using namespace std; diff --git a/src/hamiltonian/setup.cpp b/src/hamiltonian/setup.cpp index b5eccde..ddbdded 100644 --- a/src/hamiltonian/setup.cpp +++ b/src/hamiltonian/setup.cpp @@ -1,6 +1,6 @@ #include "hamiltonian.hpp" #include "../io_tools/input_tools.hpp" -#include +//#include hamiltonian::hamiltonian(const std::string &json_str):hamiltonian(load_json_str(json_str)){} diff --git a/src/pyket_config.hpp b/src/pyket_config.hpp index fe810ff..cd59aee 100644 --- a/src/pyket_config.hpp +++ b/src/pyket_config.hpp @@ -1 +1 @@ -#define PYKET pyket1_8 +#define PYKET pyket2_8 From 62ce066bb0791c3665372e7a425a4f3ddc7843ad Mon Sep 17 00:00:00 2001 From: Hannah Andersen Date: Wed, 5 Jun 2024 15:01:43 -0600 Subject: [PATCH 2/3] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9fa69d4..2c15106 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ To build, run the following commands in the project root directory. ```bash git submodule update --init --recursive mkdir build +cd build cmake .. make ``` From 943aacfc50634deaaeb14f15327119bc50a0424c Mon Sep 17 00:00:00 2001 From: Hannah Andersen Date: Wed, 5 Jun 2024 15:11:26 -0600 Subject: [PATCH 3/3] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c15106..dd131d8 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,11 @@ # README -To build, run the following commands in the project root directory. +To build, run the following commands. ```bash +git clone https://github.com/Andersen98/adaptive_spin_evolution +cd adaptive_spin_evolution +git checkout demo git submodule update --init --recursive mkdir build cd build