Effect of front pyramid texture and/or rear grating on absorption in Si

This example is based on Figures 6, 7 and 8 from this paper. This compares three different structures, all based on a 200 micron thick slab of silicon with different surface textures:

  1. Planar front surface (TMM), crossed grating at rear (RCWA)

  2. Inverted pyramids on the front surface (RT_Fresnel), planar rear surface (TMM)

  3. Inverted pyramids on the front surface (RT_Fresnel), crossed grating at rear (RCWA)

The methods which will be used to calculate the redistribution matrices in each case are given in brackets. If case 1 and 2 are calculated first, then case 3 does not require the calculations of any additional matrices, since it will use the rear matrix from (1) and the front matrix from (2).

First, importing relevant packages:

[19]:
import numpy as np
import os
# solcore imports
from solcore.structure import Layer
from solcore import material
from solcore import si

from rayflare.structure import Interface, BulkLayer, Structure
from rayflare.matrix_formalism import process_structure, calculate_RAT
from rayflare.utilities import get_savepath
from rayflare.transfer_matrix_method import tmm_structure
from rayflare.angles import theta_summary, make_angle_vector
from rayflare.textures import regular_pyramids
from rayflare.options import default_options

from solcore.material_system import create_new_material
import matplotlib.pyplot as plt
import matplotlib as mpl
import seaborn as sns
from sparse import load_npz

To make sure we are using the same optical constants for Si, load the same Si n/k data used in the paper linked above:

[20]:
create_new_material('Si_OPTOS', 'Si_OPTOS_n.txt', 'Si_OPTOS_k.txt')

You only need to do this one time, then the material will be stored in Solcore’s material database.

Setting options (taking the default options for everything not specified explicitly):

[21]:
angle_degrees_in = 8

wavelengths = np.linspace(900, 1200, 30)*1e-9

Si = material('Si_OPTOS')()
Air = material('Air')()

options = default_options()
options.wavelength = wavelengths
options.theta_in = angle_degrees_in*np.pi/180
options.n_theta_bins = 100
options.c_azimuth = 0.25
options.n_rays = 25*25*1300
options.project_name = 'OPTOS_comparison'
options.orders = 60 # decrease number of orders to speed up calculation
options.pol = 'u'

Now, set up the grating basis vectors for the RCWA calculations and define the grating structure. These are squares, rotated by 45 degrees. The halfwidth is calculated based on the area fill factor of the etched pillars given in the paper.

[22]:
x = 1000

d_vectors = ((x, 0),(0,x))
area_fill_factor = 0.36
hw = np.sqrt(area_fill_factor)*500

back_materials = [Layer(si('120nm'), Si,
                        geometry=[{'type': 'rectangle', 'mat': Air,
                                   'center': (x/2, x/2),
                                   'halfwidths': (hw, hw), 'angle': 45}])]

Now we define the pyramid texture for the front surface in case (2) and (3) and make the four possible different surfaces: planar front and rear, front with pyramids, rear with grating. We specify the method to use to calculate the redistribution matrices in each case and create the bulk layer.

[23]:
surf = regular_pyramids(elevation_angle=55, upright=False)

front_surf_pyramids = Interface('RT_Fresnel', texture = surf, layers=[],
                                name = 'inv_pyramids_front_' + str(options['n_rays']))

front_surf_planar = Interface('TMM', layers=[], name='planar_front')

back_surf_grating = Interface('RCWA', layers=back_materials, name='crossed_grating_back',
                              d_vectors=d_vectors, rcwa_orders=60)

back_surf_planar = Interface('TMM', layers=[], name = 'planar_back')

bulk_Si = BulkLayer(201.8e-6, Si, name = 'Si_bulk')

Now we create the different structures and ‘process’ them (this will calculate the relevant matrices if necessary, or do nothing if it finds the matrices have previously been calculated and the files already exist). We don’t need to process the final structure because it will use matrices calculated for SC_fig6 and SC_fig7.

[24]:
SC_fig6 = Structure([front_surf_planar, bulk_Si, back_surf_grating],
                    incidence=Air, transmission=Air)
SC_fig7 = Structure([front_surf_pyramids, bulk_Si, back_surf_planar],
                    incidence=Air, transmission=Air)
SC_fig8 = Structure([front_surf_pyramids, bulk_Si, back_surf_grating],
                    incidence=Air, transmission=Air)

process_structure(SC_fig6, options)
process_structure(SC_fig7, options)
INFO: Making matrix for planar surface using TMM for element 0 in structure
INFO: RCWA calculation for element 2 in structure
INFO: RCWA calculation for wavelength = 962.0689655172415 nm
INFO: RCWA calculation for wavelength = 982.7586206896552 nm
INFO: RCWA calculation for wavelength = 910.3448275862069 nm
INFO: RCWA calculation for wavelength = 941.3793103448277 nm
INFO: RCWA calculation for wavelength = 993.1034482758622 nm
INFO: RCWA calculation for wavelength = 900.0000000000001 nm
INFO: RCWA calculation for wavelength = 920.6896551724138 nm
INFO: RCWA calculation for wavelength = 972.4137931034483 nm
INFO: RCWA calculation for wavelength = 931.0344827586207 nm
INFO: RCWA calculation for wavelength = 951.7241379310346 nm
INFO: RCWA calculation for wavelength = 1003.448275862069 nm
INFO: RCWA calculation for wavelength = 1013.7931034482759 nm
INFO: RCWA calculation for wavelength = 1024.1379310344828 nm
INFO: RCWA calculation for wavelength = 1034.4827586206898 nm
INFO: RCWA calculation for wavelength = 1044.8275862068965 nm
INFO: RCWA calculation for wavelength = 1055.1724137931035 nm
INFO: RCWA calculation for wavelength = 1065.5172413793102 nm
INFO: RCWA calculation for wavelength = 1075.8620689655174 nm
INFO: RCWA calculation for wavelength = 1086.2068965517244 nm
INFO: RCWA calculation for wavelength = 1096.5517241379314 nm
INFO: RCWA calculation for wavelength = 1106.8965517241381 nm
INFO: RCWA calculation for wavelength = 1117.2413793103449 nm
INFO: RCWA calculation for wavelength = 1127.5862068965516 nm
INFO: RCWA calculation for wavelength = 1137.9310344827586 nm
INFO: RCWA calculation for wavelength = 1148.2758620689656 nm
INFO: RCWA calculation for wavelength = 1158.6206896551726 nm
INFO: RCWA calculation for wavelength = 1168.9655172413793 nm
INFO: RCWA calculation for wavelength = 1179.3103448275863 nm
INFO: RCWA calculation for wavelength = 1189.655172413793 nm
INFO: RCWA calculation for wavelength = 1200.0000000000002 nm
INFO: Ray tracing with Fresnel equations for element 0 in structure
INFO: Calculating matrix only for incidence theta/phi
INFO: RT calculation for wavelength = 900.0000000000001 nm
INFO: RT calculation for wavelength = 910.3448275862069 nm
INFO: RT calculation for wavelength = 920.6896551724138 nm
INFO: RT calculation for wavelength = 931.0344827586207 nm
INFO: RT calculation for wavelength = 941.3793103448277 nm
INFO: RT calculation for wavelength = 951.7241379310346 nm
INFO: RT calculation for wavelength = 962.0689655172415 nm
INFO: RT calculation for wavelength = 972.4137931034483 nm
INFO: RT calculation for wavelength = 982.7586206896552 nm
INFO: RT calculation for wavelength = 993.1034482758622 nm
INFO: RT calculation for wavelength = 1003.448275862069 nm
INFO: RT calculation for wavelength = 1013.7931034482759 nm
INFO: RT calculation for wavelength = 1024.1379310344828 nm
INFO: RT calculation for wavelength = 1034.4827586206898 nm
INFO: RT calculation for wavelength = 1044.8275862068965 nm
INFO: RT calculation for wavelength = 1055.1724137931035 nm
INFO: RT calculation for wavelength = 1065.5172413793102 nm
INFO: RT calculation for wavelength = 1075.8620689655174 nm
INFO: RT calculation for wavelength = 1086.2068965517244 nm
INFO: RT calculation for wavelength = 1096.5517241379314 nm
INFO: RT calculation for wavelength = 1106.8965517241381 nm
INFO: RT calculation for wavelength = 1117.2413793103449 nm
INFO: RT calculation for wavelength = 1127.5862068965516 nm
INFO: RT calculation for wavelength = 1137.9310344827586 nm
INFO: RT calculation for wavelength = 1148.2758620689656 nm
INFO: RT calculation for wavelength = 1158.6206896551726 nm
INFO: RT calculation for wavelength = 1168.9655172413793 nm
INFO: RT calculation for wavelength = 1179.3103448275863 nm
INFO: RT calculation for wavelength = 1189.655172413793 nm
INFO: RT calculation for wavelength = 1200.0000000000002 nm
INFO: RT calculation for wavelength = 900.0000000000001 nm
INFO: RT calculation for wavelength = 910.3448275862069 nm
INFO: RT calculation for wavelength = 920.6896551724138 nm
INFO: RT calculation for wavelength = 931.0344827586207 nm
INFO: RT calculation for wavelength = 941.3793103448277 nm
INFO: RT calculation for wavelength = 951.7241379310346 nm
INFO: RT calculation for wavelength = 962.0689655172415 nm
INFO: RT calculation for wavelength = 972.4137931034483 nm
INFO: RT calculation for wavelength = 982.7586206896552 nm
INFO: RT calculation for wavelength = 993.1034482758622 nm
INFO: RT calculation for wavelength = 1003.448275862069 nm
INFO: RT calculation for wavelength = 1013.7931034482759 nm
INFO: RT calculation for wavelength = 1024.1379310344828 nm
INFO: RT calculation for wavelength = 1034.4827586206898 nm
INFO: RT calculation for wavelength = 1044.8275862068965 nm
INFO: RT calculation for wavelength = 1055.1724137931035 nm
INFO: RT calculation for wavelength = 1065.5172413793102 nm
INFO: RT calculation for wavelength = 1075.8620689655174 nm
INFO: RT calculation for wavelength = 1086.2068965517244 nm
INFO: RT calculation for wavelength = 1096.5517241379314 nm
INFO: RT calculation for wavelength = 1106.8965517241381 nm
INFO: RT calculation for wavelength = 1117.2413793103449 nm
/Users/z3533914/.pyenv/versions/3.11.5/envs/main_develop/lib/python3.11/site-packages/joblib/externals/loky/process_executor.py:752: UserWarning: A worker stopped while some jobs were given to the executor. This can be caused by a too short worker timeout or by a memory leak.
  warnings.warn(
INFO: RT calculation for wavelength = 1127.5862068965516 nm
INFO: RT calculation for wavelength = 1137.9310344827586 nm
INFO: RT calculation for wavelength = 1148.2758620689656 nm
INFO: RT calculation for wavelength = 1158.6206896551726 nm
INFO: RT calculation for wavelength = 1168.9655172413793 nm
INFO: RT calculation for wavelength = 1179.3103448275863 nm
INFO: RT calculation for wavelength = 1189.655172413793 nm
INFO: RT calculation for wavelength = 1200.0000000000002 nm
INFO: Making matrix for planar surface using TMM for element 2 in structure

Then we ask RayFlare to calculate the reflection, transmission and absorption through matrix multiplication, and get the required result out (absorption in the bulk) for each cell. We also load the results from the reference paper to compare them to the ones calculated with RayFlare.

[25]:
results_fig6= calculate_RAT(SC_fig6, options)
results_fig7 = calculate_RAT(SC_fig7, options)
results_fig8 = calculate_RAT(SC_fig8, options)

RAT_fig6 = results_fig6[0]
RAT_fig7 = results_fig7[0]
RAT_fig8 = results_fig8[0]

sim_fig6 = np.loadtxt('optos_fig6_sim.csv', delimiter=',')
sim_fig7 = np.loadtxt('optos_fig7_sim.csv', delimiter=',')
sim_fig8 = np.loadtxt('optos_fig8_sim.csv', delimiter=',')
INFO: After iteration 1: maximum power fraction remaining = 0.3390767988491944
INFO: After iteration 2: maximum power fraction remaining = 0.30115027048076126
INFO: After iteration 3: maximum power fraction remaining = 0.2794103067969819
INFO: After iteration 4: maximum power fraction remaining = 0.2608871685770714
INFO: After iteration 5: maximum power fraction remaining = 0.24414957143228044
INFO: After iteration 6: maximum power fraction remaining = 0.22886368226910847
INFO: After iteration 7: maximum power fraction remaining = 0.21488674177275593
INFO: After iteration 8: maximum power fraction remaining = 0.20210678449060396
INFO: After iteration 9: maximum power fraction remaining = 0.19041961010461073
INFO: After iteration 10: maximum power fraction remaining = 0.1797261662523402
INFO: After iteration 11: maximum power fraction remaining = 0.16993320405701834
INFO: After iteration 12: maximum power fraction remaining = 0.16095418362519298
INFO: After iteration 13: maximum power fraction remaining = 0.1527097561379609
INFO: After iteration 14: maximum power fraction remaining = 0.14512779368491202
INFO: After iteration 15: maximum power fraction remaining = 0.1381431068199806
INFO: After iteration 16: maximum power fraction remaining = 0.13169699114512137
INFO: After iteration 17: maximum power fraction remaining = 0.12573670198090273
INFO: After iteration 18: maximum power fraction remaining = 0.12021491594094812
INFO: After iteration 19: maximum power fraction remaining = 0.11508921062052861
INFO: After iteration 20: maximum power fraction remaining = 0.11032157717529949
INFO: After iteration 21: maximum power fraction remaining = 0.10587797153961881
INFO: After iteration 22: maximum power fraction remaining = 0.10172790534532461
INFO: After iteration 23: maximum power fraction remaining = 0.09784407528972089
INFO: After iteration 24: maximum power fraction remaining = 0.09420202864084079
INFO: After iteration 25: maximum power fraction remaining = 0.09077986215016572
INFO: After iteration 26: maximum power fraction remaining = 0.08755795154940264
INFO: After iteration 27: maximum power fraction remaining = 0.0845187088749055
INFO: After iteration 28: maximum power fraction remaining = 0.08164636500709865
INFO: After iteration 29: maximum power fraction remaining = 0.07892677498976589
INFO: After iteration 30: maximum power fraction remaining = 0.07634724388290995
INFO: After iteration 31: maximum power fraction remaining = 0.07389637109128394
INFO: After iteration 32: maximum power fraction remaining = 0.07156391129243837
INFO: After iteration 33: maximum power fraction remaining = 0.06934065026001428
INFO: After iteration 34: maximum power fraction remaining = 0.0672182940385374
INFO: After iteration 35: maximum power fraction remaining = 0.06518937007458372
INFO: After iteration 36: maximum power fraction remaining = 0.06324713904591599
INFO: After iteration 37: maximum power fraction remaining = 0.06138551625538807
INFO: After iteration 38: maximum power fraction remaining = 0.059599001570620994
INFO: After iteration 39: maximum power fraction remaining = 0.05788261699431674
INFO: After iteration 40: maximum power fraction remaining = 0.05623185104428926
INFO: After iteration 41: maximum power fraction remaining = 0.05464260920756055
INFO: After iteration 42: maximum power fraction remaining = 0.053111169809896754
INFO: After iteration 43: maximum power fraction remaining = 0.051634144711618674
INFO: After iteration 44: maximum power fraction remaining = 0.050208444303060935
INFO: After iteration 45: maximum power fraction remaining = 0.048831246329286926
INFO: After iteration 46: maximum power fraction remaining = 0.04755415373928028
INFO: After iteration 47: maximum power fraction remaining = 0.046402991581911704
INFO: After iteration 48: maximum power fraction remaining = 0.04528895612841906
INFO: After iteration 49: maximum power fraction remaining = 0.04421004096128724
INFO: After iteration 50: maximum power fraction remaining = 0.043164408988746836
INFO: After iteration 51: maximum power fraction remaining = 0.04215037500115919
INFO: After iteration 52: maximum power fraction remaining = 0.041166390142597147
INFO: After iteration 53: maximum power fraction remaining = 0.04021102808477605
INFO: After iteration 54: maximum power fraction remaining = 0.03928297271383314
INFO: After iteration 55: maximum power fraction remaining = 0.03838100716132685
INFO: After iteration 56: maximum power fraction remaining = 0.037504004029475096
INFO: After iteration 57: maximum power fraction remaining = 0.03665091667729515
INFO: After iteration 58: maximum power fraction remaining = 0.03582077144915102
INFO: After iteration 59: maximum power fraction remaining = 0.035012660740441716
INFO: After iteration 60: maximum power fraction remaining = 0.03422573680694343
INFO: After iteration 61: maximum power fraction remaining = 0.03345920623480347
INFO: After iteration 62: maximum power fraction remaining = 0.032712324997508646
INFO: After iteration 63: maximum power fraction remaining = 0.031984394034442726
INFO: After iteration 64: maximum power fraction remaining = 0.03127475529301447
INFO: After iteration 65: maximum power fraction remaining = 0.030582788182882518
INFO: After iteration 66: maximum power fraction remaining = 0.029907906396613955
INFO: After iteration 67: maximum power fraction remaining = 0.029249555056271068
INFO: After iteration 68: maximum power fraction remaining = 0.02860720814999691
INFO: After iteration 69: maximum power fraction remaining = 0.027980366226730374
INFO: After iteration 70: maximum power fraction remaining = 0.02736855432078079
INFO: After iteration 71: maximum power fraction remaining = 0.02677132008118494
INFO: After iteration 72: maximum power fraction remaining = 0.026188232083598353
INFO: After iteration 73: maximum power fraction remaining = 0.025618878304981062
INFO: After iteration 74: maximum power fraction remaining = 0.025062864743560405
INFO: After iteration 75: maximum power fraction remaining = 0.024519814168522704
INFO: After iteration 76: maximum power fraction remaining = 0.023989364985631076
INFO: After iteration 77: maximum power fraction remaining = 0.023471170206511953
INFO: After iteration 78: maximum power fraction remaining = 0.022964896510723014
INFO: After iteration 79: maximum power fraction remaining = 0.022470223390928492
INFO: After iteration 80: maximum power fraction remaining = 0.021986842372582967
INFO: After iteration 81: maximum power fraction remaining = 0.021514456300477137
INFO: After iteration 82: maximum power fraction remaining = 0.021052778685343228
INFO: After iteration 83: maximum power fraction remaining = 0.020601533104465667
INFO: After iteration 84: maximum power fraction remaining = 0.020160452650905346
INFO: After iteration 85: maximum power fraction remaining = 0.019729279426533804
INFO: After iteration 86: maximum power fraction remaining = 0.019307764074594287
INFO: After iteration 87: maximum power fraction remaining = 0.01889566534796897
INFO: After iteration 88: maximum power fraction remaining = 0.018492749709741376
INFO: After iteration 89: maximum power fraction remaining = 0.018098790963006865
INFO: After iteration 90: maximum power fraction remaining = 0.017713569907206503
INFO: After iteration 91: maximum power fraction remaining = 0.017336874018546746
INFO: After iteration 92: maximum power fraction remaining = 0.016968497152321647
INFO: After iteration 93: maximum power fraction remaining = 0.01660823926518066
INFO: After iteration 94: maximum power fraction remaining = 0.016255906155586267
INFO: After iteration 95: maximum power fraction remaining = 0.01591130922088467
INFO: After iteration 96: maximum power fraction remaining = 0.01557426522957192
INFO: After iteration 97: maximum power fraction remaining = 0.01524459610747984
INFO: After iteration 98: maximum power fraction remaining = 0.014922128736732314
INFO: After iteration 99: maximum power fraction remaining = 0.014606694766435386
INFO: After iteration 100: maximum power fraction remaining = 0.014298130434165042
INFO: After iteration 101: maximum power fraction remaining = 0.013996276397406356
INFO: After iteration 102: maximum power fraction remaining = 0.013700977574178007
INFO: After iteration 103: maximum power fraction remaining = 0.013412082992147804
INFO: After iteration 104: maximum power fraction remaining = 0.013129445645609314
INFO: After iteration 105: maximum power fraction remaining = 0.012852922359746947
INFO: After iteration 106: maximum power fraction remaining = 0.012582373661668806
INFO: After iteration 107: maximum power fraction remaining = 0.012317663657732668
INFO: After iteration 108: maximum power fraction remaining = 0.01205865991673229
INFO: After iteration 109: maximum power fraction remaining = 0.01180523335854852
INFO: After iteration 110: maximum power fraction remaining = 0.011557258147903636
INFO: After iteration 111: maximum power fraction remaining = 0.011314611592887451
INFO: After iteration 112: maximum power fraction remaining = 0.011077174047951423
INFO: After iteration 113: maximum power fraction remaining = 0.010844828821091595
INFO: After iteration 114: maximum power fraction remaining = 0.01061746208496373
INFO: After iteration 115: maximum power fraction remaining = 0.010394962791694278
INFO: After iteration 116: maximum power fraction remaining = 0.010177222591169124
INFO: After iteration 117: maximum power fraction remaining = 0.009964135752598937
INFO: After iteration 1: maximum power fraction remaining = 0.6797684756675073
INFO: After iteration 2: maximum power fraction remaining = 0.5516792753160298
INFO: After iteration 3: maximum power fraction remaining = 0.4986733320145059
INFO: After iteration 4: maximum power fraction remaining = 0.433600818233323
INFO: After iteration 5: maximum power fraction remaining = 0.3965095087500758
INFO: After iteration 6: maximum power fraction remaining = 0.3500096187268579
INFO: After iteration 7: maximum power fraction remaining = 0.3194666599110687
INFO: After iteration 8: maximum power fraction remaining = 0.28454334075799415
INFO: After iteration 9: maximum power fraction remaining = 0.2589990608208122
INFO: After iteration 10: maximum power fraction remaining = 0.23196034678618363
INFO: After iteration 11: maximum power fraction remaining = 0.21068848614596755
INFO: After iteration 12: maximum power fraction remaining = 0.18936901099245412
INFO: After iteration 13: maximum power fraction remaining = 0.17175911277105205
INFO: After iteration 14: maximum power fraction remaining = 0.15473693160455826
INFO: After iteration 15: maximum power fraction remaining = 0.14021896693845443
INFO: After iteration 16: maximum power fraction remaining = 0.12651262552443088
INFO: After iteration 17: maximum power fraction remaining = 0.11457589487631994
INFO: After iteration 18: maximum power fraction remaining = 0.10347709232774377
INFO: After iteration 19: maximum power fraction remaining = 0.09367930548480602
INFO: After iteration 20: maximum power fraction remaining = 0.08465837228659029
INFO: After iteration 21: maximum power fraction remaining = 0.07662473703872129
INFO: After iteration 22: maximum power fraction remaining = 0.06927461091135963
INFO: After iteration 23: maximum power fraction remaining = 0.06269176798853875
INFO: After iteration 24: maximum power fraction remaining = 0.0566933086891066
INFO: After iteration 25: maximum power fraction remaining = 0.051301409498324076
INFO: After iteration 26: maximum power fraction remaining = 0.04640086186127547
INFO: After iteration 27: maximum power fraction remaining = 0.0419855145200914
INFO: After iteration 28: maximum power fraction remaining = 0.03797914850876835
INFO: After iteration 29: maximum power fraction remaining = 0.03436401217458762
INFO: After iteration 30: maximum power fraction remaining = 0.031087185217130435
INFO: After iteration 31: maximum power fraction remaining = 0.028127491375334858
INFO: After iteration 32: maximum power fraction remaining = 0.025446564377500445
INFO: After iteration 33: maximum power fraction remaining = 0.023023601638547227
INFO: After iteration 34: maximum power fraction remaining = 0.020829784688451394
INFO: After iteration 35: maximum power fraction remaining = 0.01884627715711933
INFO: After iteration 36: maximum power fraction remaining = 0.01705083877419651
INFO: After iteration 37: maximum power fraction remaining = 0.015427109247959658
INFO: After iteration 38: maximum power fraction remaining = 0.013957586635134751
INFO: After iteration 39: maximum power fraction remaining = 0.0126283892233587
INFO: After iteration 40: maximum power fraction remaining = 0.011425556454249083
INFO: After iteration 41: maximum power fraction remaining = 0.010337470702783319
INFO: After iteration 42: maximum power fraction remaining = 0.009352894513672012
INFO: After iteration 1: maximum power fraction remaining = 0.7827837399742319
INFO: After iteration 2: maximum power fraction remaining = 0.673033210321438
INFO: After iteration 3: maximum power fraction remaining = 0.5815457389931538
INFO: After iteration 4: maximum power fraction remaining = 0.5019838092443067
INFO: After iteration 5: maximum power fraction remaining = 0.4319936542775653
INFO: After iteration 6: maximum power fraction remaining = 0.3713057784760482
INFO: After iteration 7: maximum power fraction remaining = 0.31884845461093414
INFO: After iteration 8: maximum power fraction remaining = 0.27366977099385514
INFO: After iteration 9: maximum power fraction remaining = 0.23482303710740626
INFO: After iteration 10: maximum power fraction remaining = 0.2014570145139176
INFO: After iteration 11: maximum power fraction remaining = 0.17281522981601888
INFO: After iteration 12: maximum power fraction remaining = 0.14823731287907208
INFO: After iteration 13: maximum power fraction remaining = 0.12715083224062387
INFO: After iteration 14: maximum power fraction remaining = 0.1090618617352349
INFO: After iteration 15: maximum power fraction remaining = 0.09354531466622842
INFO: After iteration 16: maximum power fraction remaining = 0.0802358656202525
INFO: After iteration 17: maximum power fraction remaining = 0.06881982077393833
INFO: After iteration 18: maximum power fraction remaining = 0.0590279450448752
INFO: After iteration 19: maximum power fraction remaining = 0.050629226638222224
INFO: After iteration 20: maximum power fraction remaining = 0.043425480885355576
INFO: After iteration 21: maximum power fraction remaining = 0.03724670118999727
INFO: After iteration 22: maximum power fraction remaining = 0.03194706008957725
INFO: After iteration 23: maximum power fraction remaining = 0.02740147417045517
INFO: After iteration 24: maximum power fraction remaining = 0.023502655033588733
INFO: After iteration 25: maximum power fraction remaining = 0.020158578597253528
INFO: After iteration 26: maximum power fraction remaining = 0.017290313830162485
INFO: After iteration 27: maximum power fraction remaining = 0.01483016011282529
INFO: After iteration 28: maximum power fraction remaining = 0.012720049467882593
INFO: After iteration 29: maximum power fraction remaining = 0.010910176053304686
INFO: After iteration 30: maximum power fraction remaining = 0.009357820620342815

Finally, we use TMM to calculate the absorption in a structure with a planar front and planar rear, as a reference.

[26]:
struc = tmm_structure([Layer(si('200um'), Si)], incidence=Air, transmission=Air)
options.coherent = False
options.coherency_list = ['i']
RAT = tmm_structure.calculate(struc, options)

Plot everything together:

[27]:
palhf = sns.color_palette("hls", 4)

fig = plt.figure()
plt.plot(sim_fig6[:,0], sim_fig6[:,1], '--', color=palhf[0],
         label= 'OPTOS - rear grating (1)')
plt.plot(wavelengths*1e9, RAT_fig6['A_bulk'][0], '-o', color=palhf[0],
         label='RayFlare - rear grating (1)', fillstyle='none')
plt.plot(sim_fig7[:,0], sim_fig7[:,1], '--', color=palhf[1],
         label= 'OPTOS - front pyramids (2)')
plt.plot(wavelengths*1e9, RAT_fig7['A_bulk'][0], '-o', color=palhf[1],
         label= 'RayFlare - front pyramids (2)', fillstyle='none')
plt.plot(sim_fig8[:,0], sim_fig8[:,1], '--', color=palhf[2],
         label= 'OPTOS - grating + pyramids (3)')
plt.plot(wavelengths*1e9, RAT_fig8['A_bulk'][0], '-o', color=palhf[2],
         label= 'RayFlare - grating + pyramids (3)', fillstyle='none')
plt.plot(wavelengths*1e9, RAT['A_per_layer'][:,0], '-k', label='Planar')
plt.legend(loc='lower left')
plt.xlabel('Wavelength (nm)')
plt.ylabel('Absorption in Si')
plt.xlim([900, 1200])
plt.ylim([0, 1])
plt.show()
../_images/Examples_grating_pyramids_OPTOS_17_0.png

We can see good agreement between the reference values and our calculated values. The structure with rear grating also behaves identically to the planar TMM reference case at the short wavelengths where front surface reflection dominates the result, as expected. Clearly, the pyramids perform much better overall, giving a large boost in the absorption at long wavelengths and also reducing the reflection significantly at shorter wavelengths. Plotting reflection and transmission emphasises this:

[28]:
fig = plt.figure()
plt.plot(wavelengths*1e9, RAT_fig6['R'][0], '-o', color=palhf[0],
         label='RayFlare - rear grating (1)', fillstyle='none')
plt.plot(wavelengths*1e9, RAT_fig7['R'][0], '-o', color=palhf[1],
         label= 'RayFlare - front pyramids (2)', fillstyle='none')
plt.plot(wavelengths*1e9, RAT_fig8['R'][0], '-o', color=palhf[2],
         label= 'RayFlare - grating + pyramids (3)', fillstyle='none')

plt.plot(wavelengths*1e9, RAT_fig6['T'][0], '--o', color=palhf[0])
plt.plot(wavelengths*1e9, RAT_fig7['T'][0], '--o', color=palhf[1])
plt.plot(wavelengths*1e9, RAT_fig8['T'][0], '--o', color=palhf[2])

# these are just to create the legend:
plt.plot(-1, 0, 'k-o', label='R', fillstyle='none')
plt.plot(-1, 0, 'k--o', label='T')

plt.legend()
plt.xlabel('Wavelength (nm)')
plt.ylabel('Reflected/transmitted fraction')
plt.xlim([900, 1200])
plt.ylim([0, 0.6])
plt.show()
../_images/Examples_grating_pyramids_OPTOS_19_0.png

Plot the redistribution matrix for the rear grating (summed over azimuthal angles) at 1100 nm:

[29]:
theta_intv, phi_intv, angle_vector = make_angle_vector(options['n_theta_bins'],
                                                       options['phi_symmetry'],
                                                       options['c_azimuth'])


path = get_savepath('default', options.project_name)
sprs = load_npz(os.path.join(path, SC_fig6[2].name + 'frontRT.npz'))

wl_to_plot = 1100e-9

wl_index = np.argmin(np.abs(wavelengths-wl_to_plot))

full = sprs[wl_index].todense()

summat = theta_summary(full, angle_vector, options['n_theta_bins'], 'front')

summat_r = summat[:options['n_theta_bins'], :]

summat_r = summat_r.rename({r'$\theta_{in}$': r'$\sin(\theta_{in})$',
                            r'$\theta_{out}$': r'$\sin(\theta_{out})$'})

summat_r = summat_r.assign_coords({r'$\sin(\theta_{in})$':
                                       np.sin(summat_r.coords[r'$\sin(\theta_{in})$']).data,
                                    r'$\sin(\theta_{out})$':
                                        np.sin(summat_r.coords[r'$\sin(\theta_{out})$']).data})


palhf = sns.cubehelix_palette(256, start=.5, rot=-.9)
palhf.reverse()
seamap = mpl.colors.ListedColormap(palhf)

fig = plt.figure()
ax = plt.subplot(111)
ax = summat_r.plot.imshow(ax=ax, cmap=seamap, vmax=0.3)
plt.show()
../_images/Examples_grating_pyramids_OPTOS_21_0.png