From 4d03fa6a29944cf71ae56dd9458e567a9fb68a15 Mon Sep 17 00:00:00 2001 From: Donjan Rodic <donjan@dyx.ch> Date: Tue, 22 Mar 2016 11:36:21 +0100 Subject: [PATCH] fix Makefile #2 --- exercises/ex04_solution/heised_cpp/Makefile | 4 +++- exercises/ex04_solution/heised_cpp/heised.cpp | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/exercises/ex04_solution/heised_cpp/Makefile b/exercises/ex04_solution/heised_cpp/Makefile index f4e1f56..1a0a8d3 100644 --- a/exercises/ex04_solution/heised_cpp/Makefile +++ b/exercises/ex04_solution/heised_cpp/Makefile @@ -1,4 +1,6 @@ -ALPSDIR = /opt/alps/include/ +# pick your directory +#ALPSDIR = /opt/alps/include/ +ALPSDIR = alps-2.2.b4-src-with-boost CXX = g++ CPPFLAGS = -std=c++14 -I${ALPSDIR} -I${ALPSDIR}/boost -I${ALPSDIR}/alps/src diff --git a/exercises/ex04_solution/heised_cpp/heised.cpp b/exercises/ex04_solution/heised_cpp/heised.cpp index deaf687..cdea1fe 100644 --- a/exercises/ex04_solution/heised_cpp/heised.cpp +++ b/exercises/ex04_solution/heised_cpp/heised.cpp @@ -36,12 +36,12 @@ private: }; SpinHalfBasis::SpinHalfBasis(unsigned l, unsigned nups) // l: chain length; nups: spins-ups (fixes the symmetry sector). -: index_(State(1<<l), NOT_FOUND) // initialize index_ to have 2^l entries each of which is the NOT_FOUND flag. +: index_(State(1<<l), NOT_FOUND) // initialize index_ to have 2^l entries each of which is the NOT_FOUND flag. { // find all states with [nups] up spins for( State s = 0; s < index_.size(); ++s ) { - if( alps::popcnt(s) == nups ) // if the state is in this sector keep it. + if( alps::popcnt(s) == nups ) // if the state is in this sector keep it. { index_[s] = states_.size(); states_.push_back(s); @@ -144,7 +144,7 @@ diagonalize( const HeisenbergHamiltonian& h, unsigned nvals=1, unsigned maxiter= Vectorspace vspace(h.dimension()); Lanczos solver(h,vspace); Iteration iter(maxiter,nvals); - + solver.calculate_eigenvalues(iter,Generator()); // call the solver for the eigenvalues. if( iter.iterations() == maxiter ) @@ -197,8 +197,8 @@ void write_dat_header(std::ostream& datfile,unsigned nstates) int main() { - int lmin = 2; - int lmax = 20; + int lmin = 5; + int lmax = 5; double j = 1.; unsigned nstates = 2; // How many of the lowest eigenvalues (energies) do you want to calculate? ( nstates = 1 ... just the ground state) -- GitLab