Nanocone is known for its excellent anti-reflection property. Here, we simulate the transmission of light through an interface shaped with nanocones. The structure of the cone is shown below. The height of the nanocone is 660 nm. The tip radius of these nanocones is 10 nm and the base diameter is 300 nm. Its refractive index is assumed to be 3.5. The simulated wavelength ranges is from 0.6 to 0.69 micrometer. To construct the cone shape, we slice the cone into 11 layers. From the top to the bottom, the radius increases gradually. Together, this 11 layers form a layered cone shape. If you need better resolution to describe the cone in the vertical direction, you can use more layers. Again, we use parfor to enable high throughput calculation. Figure 1 The side view of the cross section of the nanocone.

The calculated transmission spectrum is shown by the figure below. Figure 2 The transmission spectrum of the nanocone.

The Lua script for this case is shown below and can be downloaded here.

```S = S4.NewSimulation()
S:SetLattice({0.3,0}, {0,0.3})
-- squrelattice of cone, lattice constant is 0.3um
S:SetNumG(100)
--the period is quite small compared to the wavelength, so we can use a small number of harmonics
--material defination, with real and imaginary part of dielectric constant
--setting up the layer structure. we have 11 layers reserved to describe the cone shape
S:SetLayerPatternCircle('Top1','Si',{0,0},0.01)
S:SetLayerPatternCircle('Top2','Si',{0,0},0.024)
S:SetLayerPatternCircle('Top3','Si',{0,0},0.038)
S:SetLayerPatternCircle('Top4','Si',{0,0},0.052)
S:SetLayerPatternCircle('Top5','Si',{0,0},0.066)
S:SetLayerPatternCircle('Top6','Si',{0,0},0.08)
S:SetLayerPatternCircle('Top7','Si',{0,0},0.094)
S:SetLayerPatternCircle('Top8','Si',{0,0},0.108)
S:SetLayerPatternCircle('Top9','Si',{0,0},0.122)
S:SetLayerPatternCircle('Top10','Si',{0,0},0.136)
S:SetLayerPatternCircle('Top11','Si',{0,0},0.15)
--add a disk of Si with an increasing radius size from Top1 layer to Top11 layer. They together form a cone
S:SetExcitationPlanewave(
{0,0}, -- incidence angles (spherical coordinates: phi in [0,180], theta in [0,360])
{1,0}, -- s-polarization amplitude and phase (in degrees)
{0,0}) -- p-polarization amplitude and phase
--set the excitation condition, incident angle and polarization.
--for angle sweep, these lines can also be put into a parfor loop
parfor lda = 0.6,0.69,0.001 do
--high throughput loop for wavelength sweep
freq = 1/lda
S:SetFrequency(freq)
forwardAirAbove,backwardAirAbove=S:GetPowerFlux('AirAbove')
forwardBottom,backwardBottom=S:GetPowerFlux('Bottom')
print(lda, forwardBottom/forwardAirAbove)
parend
-- transmission spectrum calculation
```