Skip to content

Commit

Permalink
Add Hubbard-Sz-unconserved test to check sz-OpenMP feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuaki1987 committed Dec 7, 2021
1 parent bb15953 commit 159b59e
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ add_test(
NAME lobcg_hubbard_square
COMMAND ${CMAKE_SOURCE_DIR}/test/lobcg_hubbard_square.sh
)
add_test(
NAME lobcg_hubbard_szunconserv
COMMAND ${CMAKE_SOURCE_DIR}/test/lobcg_hubbard_szunconserv.sh
)
add_test(
NAME lobcg_kondo_chain
COMMAND ${CMAKE_SOURCE_DIR}/test/lobcg_kondo_chain.sh
Expand Down
44 changes: 44 additions & 0 deletions test/lobcg_hubbard_szunconserv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/sh -e

mkdir -p lobcg_hubbard_szconserv/
cd lobcg_hubbard_szconserv

cat > stan.in <<EOF
W = 4
L = 2
model = "FermionHubbard"
method = "CG"
lattice = "Tetragonal"
t = 1.0
U = 4.0
nelec = 8
exct = 3
h = 2.0
Gamma = 1.0
EOF

${MPIRUN} ../../src/HPhi -s stan.in

# Check value

cat > reference.dat <<EOF
0
-12.0689666528263331
1.1830984216584166
0.8944271910345338
1
-12.0188079575967599
0.8548755838399427
1.7888543820161609
2
-11.7934541620331608
0.9348617586588275
1.7888543739897627
EOF
paste output/zvo_energy.dat reference.dat > paste.dat
diff=`awk 'BEGIN{diff=0.0} {diff+=sqrt(($2-$3)*($2-$3))} END{printf "%8.6f", diff}' paste.dat`
test "${diff}" = "0.000000"

exit $?

0 comments on commit 159b59e

Please sign in to comment.