Skip to content

Commit

Permalink
Release 3.0.6
Browse files Browse the repository at this point in the history
Changelog:
- fix compilation bug with BUILD_PREBO=OFF
  • Loading branch information
AlbertoBaiardi committed Aug 6, 2021
1 parent 63ed092 commit 5ab0eef
Show file tree
Hide file tree
Showing 14 changed files with 112 additions and 27 deletions.
55 changes: 50 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,70 @@
image: gitlab.chab.ethz.ch:4567/reiher/docker/qcmaquis-gcc:latest

build:
build-electronic:
stage: build
tags:
- default_docker
script:
- mkdir build && cd build
- mkdir buildElectronic && cd buildElectronic
- cmake -DQCMAQUIS_TESTS=ON -DBUILD_SYMMETRIES="TwoU1;TwoU1PG;SU2U1;SU2U1PG" ../dmrg
- make -j4
artifacts:
paths:
- buildElectronic/
expire_in: 6h
when: always

build-relativistic:
stage: build
tags:
- default_docker
script:
- mkdir buildRelativistic && cd buildRelativistic
- cmake -DQCMAQUIS_TESTS=ON -DBUILD_SYMMETRIES="TwoU1;TwoU1PG;SU2U1;SU2U1PG;U1DG" ../dmrg
- make -j4
artifacts:
paths:
- buildRelativistic/
expire_in: 6h
when: always

build-with-nu1:
stage: build
tags:
- default_docker
script:
- mkdir buildNU1 && cd buildNU1
- cmake -DQCMAQUIS_TESTS=ON -DBUILD_SYMMETRIES="TwoU1;TwoU1PG;SU2U1;SU2U1PG;U1DG;NU1" -DBUILD_PREBO=ON -DDMRG_NUMSYMM=5 ../dmrg
- make -j4
artifacts:
paths:
- build/
- buildNU1/
expire_in: 6h
when: always

testElectronic:
stage: test
needs: ["build-electronic"]
tags:
- default_docker
script:
- cd buildElectronic
- make test

test:
testRelativistic:
stage: test
needs: ["build-relativistic"]
tags:
- default_docker
script:
- cd build
- cd buildRelativistic
- make test

testNU1:
stage: test
needs: ["build-with-nu1"]
tags:
- default_docker
script:
- cd buildNU1
- make test
23 changes: 15 additions & 8 deletions dmrg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,23 @@ endif()
######################################################################
# How to build
######################################################################

if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
include("config/clang_fixes.cmake")
include("config/clang_fixes.cmake")
endif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Type of build" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "-Wno-unknown-pragmas ${CMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "CMAKE_CXX_FLAGS_RELEASE: Flags used by the compiler during release builds" FORCE)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Wno-unknown-pragmas ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" CACHE STRING "CMAKE_CXX_FLAGS_RELWITHDEBINFO: Flags used by the compiler during Release with Debug Info builds." FORCE)
set(CMAKE_C_FLAGS_RELEASE " ${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "CMAKE_C_FLAGS_RELEASE: Flags used by the compiler during release builds" FORCE)
endif(NOT CMAKE_BUILD_TYPE)
message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
# Set a default build type if none was specified
set(default_build_type "Release")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "RelWithDebugInfo")
endif()
set(CMAKE_CXX_FLAGS_RELEASE "-Wno-unknown-pragmas ${CMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "CMAKE_CXX_FLAGS_RELEASE: Flags used by the compiler during release builds" FORCE)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Wno-unknown-pragmas ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" CACHE STRING "CMAKE_CXX_FLAGS_RELWITHDEBINFO: Flags used by the compiler during Release with Debug Info builds." FORCE)
set(CMAKE_C_FLAGS_RELEASE " ${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "CMAKE_C_FLAGS_RELEASE: Flags used by the compiler during release builds" FORCE)


######################################################################
Expand Down
6 changes: 3 additions & 3 deletions dmrg/applications/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ create_tools_symm_target("mps_overlap_none" "NONE" "mps_overlap.cpp" "${DMRG_
endif (BUILD_MPS_OVERLAP)
#create_tools_symm_target("mps_reflect_u1" "U1" "mps_reflect.cpp" "${DMRG_APP_LIBRARIES}")
#create_tools_symm_target("mps_reflect_2u1" "TWOU1" "mps_reflect.cpp" "${DMRG_APP_LIBRARIES}")
# create_tools_symm_target("mps_reflect_none" "NONE" "mps_reflect.cpp" "${DMRG_APP_LIBRARIES}")
# create_tools_symm_target("mps_reflect_none" "None" "mps_reflect.cpp" "${DMRG_APP_LIBRARIES}")

#create_tools_symm_target("mps_join_u1" "U1" "mps_join.cpp" "${DMRG_APP_LIBRARIES}")
# create_tools_symm_target("mps_join_2u1" "TWOU1" "mps_join.cpp" "${DMRG_APP_LIBRARIES}")
# create_tools_symm_target("mps_join_none" "NONE" "mps_join.cpp" "${DMRG_APP_LIBRARIES}")
# create_tools_symm_target("mps_join_none" "None" "mps_join.cpp" "${DMRG_APP_LIBRARIES}")


#create_tools_symm_target("mps_stats_u1" "U1" "mps_stats.cpp" "dmrg_models;${DMRG_APP_LIBRARIES}")
Expand All @@ -54,7 +54,7 @@ endif (BUILD_MPS_OVERLAP)

#create_tools_symm_target("mps_upgrade_u1" "U1" "mps_upgrade.cpp" "${DMRG_APP_LIBRARIES}")
#create_tools_symm_target("mps_upgrade_2u1" "TWOU1" "mps_upgrade.cpp" "${DMRG_APP_LIBRARIES}")
#create_tools_symm_target("mps_upgrade_none" "NONE" "mps_upgrade.cpp" "${DMRG_APP_LIBRARIES}")
#create_tools_symm_target("mps_upgrade_none" "None" "mps_upgrade.cpp" "${DMRG_APP_LIBRARIES}")
if (BUILD_ONETDM_DIAG)
create_tools_symm_target("onetdm_diag_2u1" "TWOU1" "onetdm_diag.cpp" "dmrg_models;${DMRG_APP_LIBRARIES}")
create_tools_symm_target("onetdm_diag_2u1pg" "TWOU1PG" "onetdm_diag.cpp" "dmrg_models;${DMRG_APP_LIBRARIES}")
Expand Down
1 change: 0 additions & 1 deletion dmrg/framework/dmrg/models/coded/lattice.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* Copyright (C) 2014 Institute for Theoretical Physics, ETH Zurich
* 2012-2013 by Michele Dolfi <[email protected]>
* Sebastian Keller <[email protected]>
*
* 2020- by Robin Feldmann <[email protected]>
*
* This software is part of the ALPS Applications, published under the ALPS
Expand Down
3 changes: 3 additions & 0 deletions dmrg/framework/dmrg/models/factories/factory_2u1.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*
* Copyright (C) 2014 Institute for Theoretical Physics, ETH Zurich
* 2011-2011 by Michele Dolfi <[email protected]>
* 2021 by Alberto Baiardi <[email protected]>
*
* This software is part of the ALPS Applications, published under the ALPS
* Application License; you can use, redistribute it and/or modify it under
Expand Down Expand Up @@ -39,8 +40,10 @@ struct coded_model_factory<Matrix, TwoU1> {
return impl_ptr( new FermiHubbardTwoU1<Matrix>(lattice, parms) );
else if (parms["MODEL"] == std::string("quantum_chemistry"))
return impl_ptr( new qc_model<Matrix, TwoU1>(lattice, parms) );
#ifdef HAVE_NU1
else if (parms["MODEL"] == std::string("PreBO"))
return impl_ptr( new PreBO<Matrix, 2>(lattice, parms) );
#endif
else {
throw std::runtime_error("Don't know this model!");
return impl_ptr();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#ifndef MAQUIS_DMRG_PREBO_MUTUAL_INFORMATION_H
#define MAQUIS_DMRG_PREBO_MUTUAL_INFORMATION_H


/* internal */
#include "dmrg/models/measurement.h"
#include "dmrg/utils/checks.h"
Expand All @@ -38,6 +37,8 @@
/* external */
#include <alps/numeric/matrix/algorithms.hpp>

#ifdef HAVE_NU1

namespace measurements {

/**
Expand Down Expand Up @@ -652,4 +653,6 @@ namespace measurements {
};
}

#endif //MAQUIS_DMRG_PREBO_MUTUAL_INFORMATION_H
#endif // HAVE_NU1

#endif // MAQUIS_DMRG_PREBO_MUTUAL_INFORMATION_H
7 changes: 5 additions & 2 deletions dmrg/framework/dmrg/models/measurements/prebo_particle_rdm.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#ifndef MAQUIS_DMRG_PREBO_PARTICLE_RDM_H
#define MAQUIS_DMRG_PREBO_PARTICLE_RDM_H


/* internal */
#include "dmrg/models/measurement.h"
#include "dmrg/utils/checks.h"
Expand All @@ -38,6 +37,8 @@
/* external */
#include <alps/numeric/matrix/algorithms.hpp>

#ifdef HAVE_NU1

namespace measurements {

/**
Expand Down Expand Up @@ -160,4 +161,6 @@ namespace measurements {
};
}

#endif //MAQUIS_DMRG_PREBO_PARTICLE_RDM_H
#endif // HAVE_NU1

#endif // MAQUIS_DMRG_PREBO_PARTICLE_RDM_H
4 changes: 4 additions & 0 deletions dmrg/framework/dmrg/models/prebo/nu1/model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#include <unordered_map>
#include <chrono>

#ifdef HAVE_NU1

/**
* @brief Pre-Born Oppenheimer model class
* @class preBO models_nu1.hpp
Expand Down Expand Up @@ -221,4 +223,6 @@ class PreBO : public model_impl<Matrix, NU1_template<N>> {
}
};

#endif // HAVE_NU1

#endif
5 changes: 3 additions & 2 deletions dmrg/framework/dmrg/models/prebo/nu1/nu1_nBodyTerm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@
#ifndef MAQUIS_DMRG_NU1_NBODYTERM_HPP
#define MAQUIS_DMRG_NU1_NBODYTERM_HPP

#ifdef HAVE_NU1

#include "nu1_SymbolicJordanWigner.hpp"

#include <map>


/**
* @class NBodyTerm nu1_nBodyTerm.hpp
* @brief Takes an n-body 2nd quantization string that can contain operators of different particle types and creates
Expand Down Expand Up @@ -306,4 +305,6 @@ class NBodyTerm {

};

#endif // HAVE_NU1

#endif // MAQUIS_DMRG_NU1_NBODYTERM_HPP
6 changes: 5 additions & 1 deletion dmrg/framework/dmrg/models/prebo/prebo_TagGenerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#include <alps/numeric/matrix/matrix.hpp>
#include <map>

#ifdef HAVE_NU1

namespace prebo {

/**
Expand Down Expand Up @@ -443,4 +445,6 @@ namespace prebo {

} // namespace prebo

#endif //MAQUIS_DMRG_PREBO_TAGGENERATOR_HPP
#endif // HAVE_NU1

#endif // MAQUIS_DMRG_PREBO_TAGGENERATOR_HPP
7 changes: 6 additions & 1 deletion dmrg/framework/dmrg/models/prebo/prebo_TermGenerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
#include "prebo_TagGenerator.hpp"
#include "integral_interface.h"

#ifdef HAVE_NU1

namespace prebo {

/**
* @class TermGenerator prebo_TermGenerator.hpp
* General info: the ordering of the lattice for Hamiltonian and particle RDM is handled by the nu1_nBodyTerm class.
Expand Down Expand Up @@ -802,4 +805,6 @@ namespace prebo {

} // namespace prebo

#endif //MAQUIS_DMRG_PREBO_TERMGENERATOR_HPP
#endif // HAVE_NU1

#endif // MAQUIS_DMRG_PREBO_TERMGENERATOR_HPP
8 changes: 8 additions & 0 deletions dmrg/framework/dmrg/sim/symmetry_factory.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,20 @@ namespace dmrg {
#ifdef HAVE_NU1
else if (symm_name == "nu1") {
std::vector<bool> isFermion;
std::vector<int> vec_ini_state;
std::string isFermion_str = parms["PreBO_FermionOrBosonVector"].as<std::string>();
std::istringstream is( isFermion_str );
isFermion.assign(std::istream_iterator<int>( is ), std::istream_iterator<int>() );
std::string vec_ini_state_str = parms["PreBO_InitialStateVector"].as<std::string>();
is.clear();
is.str(vec_ini_state_str);
vec_ini_state.assign(std::istream_iterator<int>( is ), std::istream_iterator<int>() );
int numberOfSymmetries = 0;
for (const auto iElement: isFermion)
numberOfSymmetries += (iElement) ? 2 : 1;
if (vec_ini_state.size() != numberOfSymmetries) {
throw std::runtime_error("PreBO_InitialStateVector input Error.");
}
switch (numberOfSymmetries) {
BOOST_PP_REPEAT_FROM_TO(1, @DMRG_NUMSYMM@, DECLCASE, ~)
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ SUBROUTINE pretty_print_util(AMATRX,ROWLOW,ROWHI,COLLOW,COLHI,ROWDIM,COLDIM,NCTL
! hjaaj: negative for 132 col width
!
! THE PARAMETERS THAT FOLLOW MATRIX ARE ALL OF TYPE INTEGER. THE
! PROGRAM IS SET UP TO HANDLE 5 COLUMNS/PAGE WITH A 1P,5D24.15 FORMAT
! PROGRAM IS SET Up TO HANDLE 5 COLUMNS/PAGE WITH A 1P,5D24.15 FORMAT
! FOR THE COLUMNS. IF A DIFFERENT NUMBER OF COLUMNS IS REQUIRED,
! CHANGE FORMATS 1000 AND 2000, AND INITIALIZE KCOL WITH THE NEW NUMBER
! OF COLUMNS.
Expand Down
5 changes: 4 additions & 1 deletion dmrg/lib/maquis_dmrg/integral_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@
#ifndef INTEGRAL_INTERFACE_H
#define INTEGRAL_INTERFACE_H

#include <unordered_map>
/* internal include */
#include "dmrg/utils/align.h"

/* external include */
#include <unordered_map>
#include <boost/serialization/serialization.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
Expand Down

0 comments on commit 5ab0eef

Please sign in to comment.