Skip to content

Commit

Permalink
Merge pull request #355 from ahzeeshan/scdm_auto_example
Browse files Browse the repository at this point in the history
simplified projectability vs e table
  • Loading branch information
VVitale authored Feb 23, 2021
2 parents 6bcbd42 + 58085da commit 31a2e1c
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions examples/example32/generate_weights.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,11 @@ rm -f p_vs_e.dat
# Check proj.out exists
[[ -f "proj.out" ]] || { echo "proj.out not found!"; echo "Aborting!"; exit 1; }

# Start loop over bands
for i in {1..21}; do
echo $i
if [ $i -lt 10 ]; then
line=`echo "e( $i)"`;
else
line=`echo "e( $i)"`;
fi;
grep "$line" proj.out | awk '{print $5}' >> e.dat;
grep -A4 "$line" proj.out | grep "|psi|^2" | awk '{print $3}' >> p.dat;
paste e.dat p.dat >> tmp.dat;
done
# Get energies and projectability in the correct order
cat proj.out |grep '=='|awk '{print $5}' > e.dat
cat proj.out |grep '|psi|^2'|awk '{print $3}' > p.dat
paste e.dat p.dat > tmp.dat

sort -k1n tmp.dat > p_vs_e.dat

# Clean workspace
Expand Down

0 comments on commit 31a2e1c

Please sign in to comment.