WIP examples

Former-commit-id: 23a04ed4d9edb5dd20ce85015edd158cc9bd75b1
This commit is contained in:
Marek Nečada 2020-06-07 22:28:21 +03:00
parent ecf599bb15
commit 582f33bb00
21 changed files with 389 additions and 2 deletions

View File

@ -27,6 +27,11 @@ export B2Y_nmi=$(bc <<< '4*pi/3/'${SEPARATION_nm})
export KPOINTX_nmi=$(bc <<< '4*pi/3/sqrt(3)'/${SEPARATION_nm}) export KPOINTX_nmi=$(bc <<< '4*pi/3/sqrt(3)'/${SEPARATION_nm})
export KPOINTY_nmi=0.0 #$(bc <<< '4*pi/3/sqrt(3)'/${SEPARATION_nm}) export KPOINTY_nmi=0.0 #$(bc <<< '4*pi/3/sqrt(3)'/${SEPARATION_nm})
# a M-point coordinates
export MPOINTX_nmi=0.0
export MPOINTY_nmi=$(bc <<< '2*pi/3'/${SEPARATION_nm})
export RADIUS_nm=50 export RADIUS_nm=50
export HEIGHT_nm=50 export HEIGHT_nm=50
export METAL=Au export METAL=Au

View File

@ -13,4 +13,6 @@ ${MISCDIR}/lat2d_modes.py \
-L 3 -m $METAL -r ${RADIUS_nm}e-9 -H ${HEIGHT_nm}e-9 \ -L 3 -m $METAL -r ${RADIUS_nm}e-9 -H ${HEIGHT_nm}e-9 \
-k s${KPOINTX_nmi}e9 s${KPOINTY_nmi}e9 \ -k s${KPOINTX_nmi}e9 s${KPOINTY_nmi}e9 \
-d -3 \ -d -3 \
-t 0.01 \
-c 250 \
-P -P

View File

@ -0,0 +1,22 @@
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
MISCDIR=../../../misc
source ${SCRIPTDIR}/00_params.sh
for bbb in 1 -2 -3 -4 ; do
for coeff in $(seq 0.80 0.01 1.50 | sed -e s/,/./g) ; do
${MISCDIR}/lat2d_modes.py \
-n $BG_REFINDEX \
-b s${A1X_nm}e-9 s${A1Y_nm}e-9 \
-b s${A2X_nm}e-9 s${A2Y_nm}e-9 \
-p s${P1X_nm}e-9 s${P1Y_nm}e-9 \
-p s${P2X_nm}e-9 s${P2Y_nm}e-9 \
-L 3 -m $METAL -r ${RADIUS_nm}e-9 -H ${HEIGHT_nm}e-9 \
-k s$(bc <<< ${KPOINTX_nmi}*${coeff})e9 s$(bc <<< ${KPOINTY_nmi}*${coeff})e9 \
-d $bbb \
-t 1e13 \
-T 0.2 \
-c 250
done
done

View File

@ -0,0 +1,24 @@
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
MISCDIR=../../../misc
source ${SCRIPTDIR}/00_params.sh
for bbb in 1 -2 -3 -4 ; do
for coeff in $(seq 0.00 0.01 1.00 | sed -e s/,/./g) ; do
${MISCDIR}/lat2d_modes.py \
-n $BG_REFINDEX \
-b s${A1X_nm}e-9 s${A1Y_nm}e-9 \
-b s${A2X_nm}e-9 s${A2Y_nm}e-9 \
-p s${P1X_nm}e-9 s${P1Y_nm}e-9 \
-p s${P2X_nm}e-9 s${P2Y_nm}e-9 \
-L 3 -m $METAL -r ${RADIUS_nm}e-9 -H ${HEIGHT_nm}e-9 \
-k s$(bc <<< ${MPOINTX_nmi}*${coeff})e9 s$(bc <<< ${MPOINTY_nmi}*${coeff})e9 \
-d $bbb \
-t 1e12 \
-T 0.3 \
-c 250 \
-P
done
done

View File

@ -0,0 +1,24 @@
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
MISCDIR=../../../misc
source ${SCRIPTDIR}/00_params.sh
for bbb in 1 2 ; do
for coeff in $(seq 0.80 0.01 2.00 | sed -e s/,/./g) ; do
${MISCDIR}/lat2d_modes.py \
-n $BG_REFINDEX \
-b s${A1X_nm}e-9 s${A1Y_nm}e-9 \
-b s${A2X_nm}e-9 s${A2Y_nm}e-9 \
-p s${P1X_nm}e-9 s${P1Y_nm}e-9 \
-p s${P2X_nm}e-9 s${P2Y_nm}e-9 \
-L 3 -m $METAL -r ${RADIUS_nm}e-9 -H ${HEIGHT_nm}e-9 \
-k s$(bc <<< ${KPOINTX_nmi}*${coeff})e9 s$(bc <<< ${KPOINTY_nmi}*${coeff})e9 \
-d -$bbb \
-t 1e12 \
-T 0.2 \
-c 250 \
-P
done
done

View File

@ -0,0 +1,37 @@
#!/bin/bash
# Common parameters for a rectangular array
# N.B. We put those into bc, which does not understant exponential notation
export PX_nm=375
export PY_nm=375
export RADIUS_nm=30
export HEIGHT_nm=30
export METAL=Ag
export BG_REFINDEX=1.52
# Setup bc
echo 'scale=20;pi=3.14159265358979323846;' > bc_env
export BC_ENV_ARGS="bc_env"
# We have only one particle per unit cell here
export P1X_nm=0
export P1Y_nm=0
# Lattice vectors (for the general scripts)
export A1X_nm=${PX_nm}
export A1Y_nm=0
export A2X_nm=0
export A2Y_nm=${PY_nm}
# Reciprocal lattice vectors
export B1X_nmi=$(bc <<< '1/'${PX_nm})
export B1Y_nmi=0
export B2X_nmi=0
export B2Y_nmi=$(bc <<< '1/'${PY_nm})

View File

@ -0,0 +1,18 @@
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
MISCDIR=../../../misc
source ${SCRIPTDIR}/00_params.sh
${MISCDIR}/lat2d_modes.py \
-n $BG_REFINDEX \
-b s${A1X_nm}e-9 s${A1Y_nm}e-9 \
-b s${A2X_nm}e-9 s${A2Y_nm}e-9 \
-p s${P1X_nm}e-9 s${P1Y_nm}e-9 \
-p s${P2X_nm}e-9 s${P2Y_nm}e-9 \
-L 3 -m $METAL -r ${RADIUS_nm}e-9 -H ${HEIGHT_nm}e-9 \
-k s${KPOINTX_nmi}e9 s${KPOINTY_nmi}e9 \
-d -3 \
-t 0.01 \
-c 250 \
-P

View File

@ -0,0 +1,17 @@
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
MISCDIR=../../../misc
source ${SCRIPTDIR}/00_params.sh
# try several lMaxes
${MISCDIR}/lat2d_realfreqsvd.py \
-B $BG_REFINDEX \
-b s${A1X_nm}e-9 s${A1Y_nm}e-9 \
-b s${A2X_nm}e-9 s${A2Y_nm}e-9 \
-p s${P1X_nm}e-9 s${P1Y_nm}e-9 \
-L 2 -m $METAL -r ${RADIUS_nm}e-9 -H ${HEIGHT_nm}e-9 \
-k 0 0 \
-F 2.001 0.001 2.250 \
-P

View File

@ -0,0 +1,15 @@
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
MISCDIR=../../../misc
source ${SCRIPTDIR}/00_params.sh
for LMAX in 1 2 3 ; do # try several cutoffs
${MISCDIR}/infiniterectlat-k0realfreqsvd.py \
-B $BG_REFINDEX \
-p ${PX_nm}e-9 ${PY_nm}e-9 \
-L $LMAX -m $METAL -r ${RADIUS_nm}e-9 -H ${HEIGHT_nm}e-9 \
-F 2.001 0.001 2.250 \
-P
done

View File

@ -0,0 +1,22 @@
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
MISCDIR=../../../misc
source ${SCRIPTDIR}/00_params.sh
for bbb in 1 -2 -3 -4 ; do
for coeff in $(seq 0.80 0.01 1.50 | sed -e s/,/./g) ; do
${MISCDIR}/lat2d_modes.py \
-n $BG_REFINDEX \
-b s${A1X_nm}e-9 s${A1Y_nm}e-9 \
-b s${A2X_nm}e-9 s${A2Y_nm}e-9 \
-p s${P1X_nm}e-9 s${P1Y_nm}e-9 \
-p s${P2X_nm}e-9 s${P2Y_nm}e-9 \
-L 3 -m $METAL -r ${RADIUS_nm}e-9 -H ${HEIGHT_nm}e-9 \
-k s$(bc <<< ${KPOINTX_nmi}*${coeff})e9 s$(bc <<< ${KPOINTY_nmi}*${coeff})e9 \
-d $bbb \
-t 1e13 \
-T 0.2 \
-c 250
done
done

View File

@ -0,0 +1,24 @@
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
MISCDIR=../../../misc
source ${SCRIPTDIR}/00_params.sh
for bbb in 1 -2 -3 -4 ; do
for coeff in $(seq 0.00 0.01 1.00 | sed -e s/,/./g) ; do
${MISCDIR}/lat2d_modes.py \
-n $BG_REFINDEX \
-b s${A1X_nm}e-9 s${A1Y_nm}e-9 \
-b s${A2X_nm}e-9 s${A2Y_nm}e-9 \
-p s${P1X_nm}e-9 s${P1Y_nm}e-9 \
-p s${P2X_nm}e-9 s${P2Y_nm}e-9 \
-L 3 -m $METAL -r ${RADIUS_nm}e-9 -H ${HEIGHT_nm}e-9 \
-k s$(bc <<< ${MPOINTX_nmi}*${coeff})e9 s$(bc <<< ${MPOINTY_nmi}*${coeff})e9 \
-d $bbb \
-t 1e12 \
-T 0.3 \
-c 250 \
-P
done
done

View File

@ -0,0 +1,21 @@
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
MISCDIR=../../../misc
source ${SCRIPTDIR}/00_params.sh
for bbb in 1 -2 2 -3 ; do
for coeff in $(seq -0.200 0.010 0.200 | sed -e s/,/./g) ; do
${MISCDIR}/lat2d_modes.py \
-n $BG_REFINDEX \
-b s${A1X_nm}e-9 s${A1Y_nm}e-9 \
-b s${A2X_nm}e-9 s${A2Y_nm}e-9 \
-p s${P1X_nm}e-9 s${P1Y_nm}e-9 \
-L 3 -m $METAL -r ${RADIUS_nm}e-9 -H ${HEIGHT_nm}e-9 \
-k s$(bc <<< ${B1X_nmi}*${coeff})e9 s$(bc <<< ${B1Y_nmi}*${coeff})e9 \
-d $bbb \
-T 0.2 \
-c 250
done
done

View File

@ -0,0 +1 @@
../modes/00_params.sh

View File

@ -0,0 +1,19 @@
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
MISCDIR=../../../misc
source ${SCRIPTDIR}/00_params.sh
for PSI in 0 1; do
${MISCDIR}/infiniterectlat-scatter.py \
-B $BG_REFINDEX \
-p ${PX_nm}e-9 ${PY_nm}e-9 \
-L 3 -m $METAL -r ${RADIUS_nm}e-9 -H ${HEIGHT_nm}e-9 \
--theta "s-0.015:0.015|201" \
--phi 0 \
--psi $PSI \
--chi 0 \
-f "s2.110:2.230|100" \
-P
done

View File

@ -0,0 +1,19 @@
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
MISCDIR=../../../misc
source ${SCRIPTDIR}/00_params.sh
for PSI in 1; do
${MISCDIR}/finiterectlat-scatter.py \
--size 5 5\
-B $BG_REFINDEX \
-p ${PX_nm}e-9 ${PY_nm}e-9 \
-L 2 -m $METAL -r ${RADIUS_nm}e-9 -H ${HEIGHT_nm}e-9 \
--theta "s-0.05:0.05|101" \
--phi 0 \
--psi $PSI \
--chi 0 \
-f 2.15
done

View File

@ -0,0 +1,19 @@
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
MISCDIR=../../../misc
source ${SCRIPTDIR}/00_params.sh
for PSI in 0 1; do
${MISCDIR}/infiniterectlat-scatter.py \
-B $BG_REFINDEX \
-p ${PX_nm}e-9 ${PY_nm}e-9 \
-L 2 -m $METAL -r ${RADIUS_nm}e-9 -H ${HEIGHT_nm}e-9 \
--theta "s-0.05:0.05|101" \
--phi 0 \
--psi $PSI \
--chi 0 \
-P \
-f 2.15
done

View File

@ -0,0 +1,25 @@
#!/bin/bash
##SBATCH --mem=50000
##SBATCH -c 12
##SBATCH -t 14:00:00
##SBATCH -p batch
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
MISCDIR=../../../misc
source ${SCRIPTDIR}/00_params.sh
for PSI in 0 1; do
${MISCDIR}/finiterectlat-scatter.py \
--size 140 100 \
-B $BG_REFINDEX \
-p ${PX_nm}e-9 ${PY_nm}e-9 \
-L 2 -m $METAL -r ${RADIUS_nm}e-9 -H ${HEIGHT_nm}e-9 \
--theta "s-0.05:0.05|101" \
--phi 0 \
--psi $PSI \
--chi 0 \
-o 140x100.npz -O 140x100.pdf \
-P \
-f 2.15
done

View File

@ -0,0 +1,25 @@
#!/bin/bash
##SBATCH --mem=30000
##SBATCH -c 12
##SBATCH -t 14:00:00
##SBATCH -p batch
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
MISCDIR=../../../misc
source ${SCRIPTDIR}/00_params.sh
for PSI in 1; do
${MISCDIR}/finiterectlat-scatter.py \
--size 100 100 \
-B $BG_REFINDEX \
-p ${PX_nm}e-9 ${PY_nm}e-9 \
-L 2 -m $METAL -r ${RADIUS_nm}e-9 -H ${HEIGHT_nm}e-9 \
--theta "s-0.05:0.05|101" \
--phi 0 \
--psi $PSI \
--chi 0 \
-o 100x100.npz -O 100x100.pdf \
-P \
-f 2.15
done

View File

@ -0,0 +1,25 @@
#!/bin/bash
##SBATCH --mem=50000
##SBATCH -c 12
##SBATCH -t 14:00:00
##SBATCH -p batch
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
MISCDIR=../../../misc
source ${SCRIPTDIR}/00_params.sh
for PSI in 0 1; do
${MISCDIR}/finiterectlat-scatter.py \
--size 140 140 \
-B $BG_REFINDEX \
-p ${PX_nm}e-9 ${PY_nm}e-9 \
-L 2 -m $METAL -r ${RADIUS_nm}e-9 -H ${HEIGHT_nm}e-9 \
--theta "s-0.05:0.05|101" \
--phi 0 \
--psi $PSI \
--chi 0 \
-o 140x140.npz -O 140x140.pdf \
-P \
-f 2.15
done

View File

@ -0,0 +1,21 @@
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
MISCDIR=../../../misc
source ${SCRIPTDIR}/00_params.sh
for PSI in 1; do
${MISCDIR}/finiterectlat-scatter.py \
--size 20 20 \
-B $BG_REFINDEX \
-p ${PX_nm}e-9 ${PY_nm}e-9 \
-L 3 -m $METAL -r ${RADIUS_nm}e-9 -H ${HEIGHT_nm}e-9 \
--theta "s-0.005:0.005|101" \
--phi 0 \
--psi $PSI \
--chi 0 \
-P \
-f "s2.150:2.180|100" \
done

View File

@ -22,8 +22,8 @@ thegroup = 'D4h' if px == py and not a.D2 else 'D2h'
particlestr = ("sph" if a.height is None else "cyl") + ("_r%gnm" % (a.radius*1e9)) particlestr = ("sph" if a.height is None else "cyl") + ("_r%gnm" % (a.radius*1e9))
if a.height is not None: particlestr += "_h%gnm" % (a.height * 1e9) if a.height is not None: particlestr += "_h%gnm" % (a.height * 1e9)
defaultprefix = "%s_p%gnmx%gnm_m%s_n%g_f(%g..%g..%g)eV_L%d_SVGamma" % ( defaultprefix = "%s_p%gnmx%gnm_m%s_bg%s_f(%g..%g..%g)eV_L%d_SVGamma" % (
particlestr, px*1e9, py*1e9, str(a.material), a.refractive_index, *(a.eV_seq), a.lMax) particlestr, px*1e9, py*1e9, str(a.material), str(a.background), *(a.eV_seq), a.lMax)
logging.info("Default file prefix: %s" % defaultprefix) logging.info("Default file prefix: %s" % defaultprefix)
@ -87,6 +87,8 @@ for i, omega in enumerate(omegas):
with pgsl_ignore_error(15): # avoid gsl crashing on underflow; maybe not needed with pgsl_ignore_error(15): # avoid gsl crashing on underflow; maybe not needed
ImTW = ssw.modeproblem_matrix_full(k) ImTW = ssw.modeproblem_matrix_full(k)
for iri in range(ss1.nirreps): for iri in range(ss1.nirreps):
if ss1.saecv_sizes[iri] == 0:
continue
ImTW_packed = ss1.pack_matrix(ImTW, iri) ImTW_packed = ss1.pack_matrix(ImTW, iri)
SVs[iri][i] = np.linalg.svd(ImTW_packed, compute_uv = False) SVs[iri][i] = np.linalg.svd(ImTW_packed, compute_uv = False)