PAVPC运行脚本
作者:互联网
最近做的代码改名字了,以前叫PVPC,现在干脆叫 PAVPC,即 projection after variation of pair condensate,这样可以区分开"projection after variation"和"variation after projection"。
现在给这个代码写一个脚本 run.sh,可以用来计算 \(sd\) 壳和 \(pf\) 壳的任意偶偶核的投影能谱和B(E2)值,只需给脚本传递 4 个参数即可:
#!/bin/bash
# ./run.sh x y sd nmini
# variation + LAP + B(E2) for x proton pairs and y neutron pairs in sd shell
pN=$1
nN=$2
shell=$3
nucleus=p${pN}n${nN}
jsp="example/$shell/$shell.jsp"
int="example/$shell/$shell.pn"
pjpair="output/best-proton.pair"
njpair="output/best-neutron.pair"
echo "======================================================================="
echo " variation starts "
echo "-----------------------------------------------------------------------"
./pvpc.x << input
v # mode: optimize
$nucleus # nucleus
$pN # number of proton pairs
$nN # number of neutron pairs
$jsp # file for j-scheme single particle orbits
xpn # format of interactions: J-scheme P+Q interactions
$int # file for interactions
y # scaling
y # start from random pairs
$4 # number of optimized pair condensates
input
echo "-----------------------------------------------------------------------"
echo " variation ends "
echo "======================================================================="
echo "======================================================================="
echo " LAP starts "
echo "-----------------------------------------------------------------------"
./pvpc.x << Input
LAP // mode
$nucleus // nucleus
$pN // # of proton pairs
$nN // # of neutron pairs
$jsp // file for j-scheme single particle space
xpn // format of interactions
$int // file for interactions
y // scale or not
1 // number of pair condensates
$pjpair $njpair
16 // Jmax to be projected, not doubled
Input
echo "-----------------------------------------------------------------------"
echo " LAP ends "
echo "======================================================================="
echo "copy the lowest pairs into sdpairs/ or pfpairs/"
cp $pjpair ${shell}pairs/$nucleus-best-proton.pair
cp $njpair ${shell}pairs/$nucleus-best-neutron.pair
pjpair=${shell}pairs/$nucleus-best-proton.pair
njpair=${shell}pairs/$nucleus-best-neutron.pair
unitchoice=1 # 1/2 for e2fm4 / W.u., 3 for e2fm4 with BAB's hbar omega
echo " ----------------------------------------------- "
echo " Calculate B(E2) values "
echo " ----------------------------------------------- "
./pvpc.x << Input
EMtrans # mode: E&M transition
$nucleus # nucleus name
$pN # number of proton pairs
$nN # number of neutron pairs
$jsp # j-scheme single particle info
xpn # interaction format
$int # interaction file name
y # scale or not
1 # number of pair condensates
$pjpair $njpair
output/${shell}e2.jQt # filejQt for transition operator
e # electric
2 # quadrapole
1.5 0.5 # ep, en
$unitchoice # choice of unit, 1/2 for e2fm4/W.u.
output/$nucleus.eig # file for wavefunctions
Input
echo cp output/$nucleus.trans sdpairs/
cp output/$nucleus.trans sdpairs/
赋予脚本可执行权限,然后:
./run.sh 1 1 sd 5
即对 Ne20 求 5 个低能的 pair condensate,然后取能量最低的,进行 LAP 投影,最后把最优的对命名为 pxnx-best-proton.pair, pxnx-best-neutron.pair,拷贝到 sdpairs/ 中,跃迁值命名为 pxnx.trans 也拷贝到 sdpairs/ 中。
如果需要一次算好几个核,可以使用下面的代码:
#!/bin/bash
sleep 30
date
for(( pN = 3; pN <= 3; pN ++ ))
do
for(( nN = 1; nN <=5; nN ++ ))
do
time ./run.sh $pN $nN sd 5
done
done
date
其中,sleep
后面的参数是等待的秒数,设置适当的秒数,可以让办公室电脑等到晚上十点再启动,就不会打扰加班的同事。
标签:脚本,shell,variation,best,pair,PAVPC,pN,运行,sd 来源: https://www.cnblogs.com/luyi07/p/15404123.html