diff --git a/examples/hexagonal/modes/00_params.sh b/examples/hexagonal/modes/00_params.sh index 050c80f..367bf54 100644 --- a/examples/hexagonal/modes/00_params.sh +++ b/examples/hexagonal/modes/00_params.sh @@ -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 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 HEIGHT_nm=50 export METAL=Au diff --git a/examples/hexagonal/modes/01_compute_modes.sh b/examples/hexagonal/modes/01_compute_modes.sh index 1741fc9..2114f7d 100755 --- a/examples/hexagonal/modes/01_compute_modes.sh +++ b/examples/hexagonal/modes/01_compute_modes.sh @@ -13,4 +13,6 @@ ${MISCDIR}/lat2d_modes.py \ -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 diff --git a/examples/hexagonal/modes/02_compute_disp.sh b/examples/hexagonal/modes/02_compute_disp.sh new file mode 100755 index 0000000..be70113 --- /dev/null +++ b/examples/hexagonal/modes/02_compute_disp.sh @@ -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 diff --git a/examples/hexagonal/modes/02b_compute_disp_0M.sh b/examples/hexagonal/modes/02b_compute_disp_0M.sh new file mode 100755 index 0000000..969c028 --- /dev/null +++ b/examples/hexagonal/modes/02b_compute_disp_0M.sh @@ -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 + diff --git a/examples/hexagonal/modes/02x_compute_disp.sh b/examples/hexagonal/modes/02x_compute_disp.sh new file mode 100755 index 0000000..911a43f --- /dev/null +++ b/examples/hexagonal/modes/02x_compute_disp.sh @@ -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 + diff --git a/examples/rectangular/modes/00_params.sh b/examples/rectangular/modes/00_params.sh new file mode 100644 index 0000000..49cf6fc --- /dev/null +++ b/examples/rectangular/modes/00_params.sh @@ -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}) + + diff --git a/examples/rectangular/modes/01_compute_modes.sh b/examples/rectangular/modes/01_compute_modes.sh new file mode 100755 index 0000000..2114f7d --- /dev/null +++ b/examples/rectangular/modes/01_compute_modes.sh @@ -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 diff --git a/examples/rectangular/modes/01a_realfreq_svd.sh b/examples/rectangular/modes/01a_realfreq_svd.sh new file mode 100755 index 0000000..dae7277 --- /dev/null +++ b/examples/rectangular/modes/01a_realfreq_svd.sh @@ -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 diff --git a/examples/rectangular/modes/01b_realfreq_svd_sym.sh b/examples/rectangular/modes/01b_realfreq_svd_sym.sh new file mode 100755 index 0000000..9e5db87 --- /dev/null +++ b/examples/rectangular/modes/01b_realfreq_svd_sym.sh @@ -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 diff --git a/examples/rectangular/modes/02_compute_disp.sh b/examples/rectangular/modes/02_compute_disp.sh new file mode 100755 index 0000000..be70113 --- /dev/null +++ b/examples/rectangular/modes/02_compute_disp.sh @@ -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 diff --git a/examples/rectangular/modes/02b_compute_disp_0M.sh b/examples/rectangular/modes/02b_compute_disp_0M.sh new file mode 100755 index 0000000..969c028 --- /dev/null +++ b/examples/rectangular/modes/02b_compute_disp_0M.sh @@ -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 + diff --git a/examples/rectangular/modes/02x_compute_disp.sh b/examples/rectangular/modes/02x_compute_disp.sh new file mode 100755 index 0000000..c17bfaa --- /dev/null +++ b/examples/rectangular/modes/02x_compute_disp.sh @@ -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 + diff --git a/examples/rectangular/scattering/00_params.sh b/examples/rectangular/scattering/00_params.sh new file mode 120000 index 0000000..9b3b9eb --- /dev/null +++ b/examples/rectangular/scattering/00_params.sh @@ -0,0 +1 @@ +../modes/00_params.sh \ No newline at end of file diff --git a/examples/rectangular/scattering/01_scattering_infinite.sh b/examples/rectangular/scattering/01_scattering_infinite.sh new file mode 100755 index 0000000..fe2c24f --- /dev/null +++ b/examples/rectangular/scattering/01_scattering_infinite.sh @@ -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 + diff --git a/examples/rectangular/scattering/02_scattering_finite_single.sh b/examples/rectangular/scattering/02_scattering_finite_single.sh new file mode 100755 index 0000000..9ee166c --- /dev/null +++ b/examples/rectangular/scattering/02_scattering_finite_single.sh @@ -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 + diff --git a/examples/rectangular/scattering/02b_scattering_infinite_single.sh b/examples/rectangular/scattering/02b_scattering_infinite_single.sh new file mode 100755 index 0000000..1af5c7a --- /dev/null +++ b/examples/rectangular/scattering/02b_scattering_infinite_single.sh @@ -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 + diff --git a/examples/rectangular/scattering/02c_scattering_finite_single_huge.sh b/examples/rectangular/scattering/02c_scattering_finite_single_huge.sh new file mode 100755 index 0000000..eee8bfd --- /dev/null +++ b/examples/rectangular/scattering/02c_scattering_finite_single_huge.sh @@ -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 + diff --git a/examples/rectangular/scattering/02d_scattering_finite_single_big.sh b/examples/rectangular/scattering/02d_scattering_finite_single_big.sh new file mode 100755 index 0000000..0da17f3 --- /dev/null +++ b/examples/rectangular/scattering/02d_scattering_finite_single_big.sh @@ -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 + diff --git a/examples/rectangular/scattering/02e_scattering_finite_single_huge.sh b/examples/rectangular/scattering/02e_scattering_finite_single_huge.sh new file mode 100755 index 0000000..2366206 --- /dev/null +++ b/examples/rectangular/scattering/02e_scattering_finite_single_huge.sh @@ -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 + diff --git a/examples/rectangular/scattering/03_scattering_finite.sh b/examples/rectangular/scattering/03_scattering_finite.sh new file mode 100755 index 0000000..d1156a8 --- /dev/null +++ b/examples/rectangular/scattering/03_scattering_finite.sh @@ -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 + diff --git a/misc/infiniterectlat-k0realfreqsvd.py b/misc/infiniterectlat-k0realfreqsvd.py index 4e8f8d6..fb85093 100755 --- a/misc/infiniterectlat-k0realfreqsvd.py +++ b/misc/infiniterectlat-k0realfreqsvd.py @@ -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)) 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" % ( - particlestr, px*1e9, py*1e9, str(a.material), a.refractive_index, *(a.eV_seq), a.lMax) +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), str(a.background), *(a.eV_seq), a.lMax) 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 ImTW = ssw.modeproblem_matrix_full(k) for iri in range(ss1.nirreps): + if ss1.saecv_sizes[iri] == 0: + continue ImTW_packed = ss1.pack_matrix(ImTW, iri) SVs[iri][i] = np.linalg.svd(ImTW_packed, compute_uv = False)