Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slightly updated the "bragg_tmm_object_apodized_1310.py" file to account for conor case #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,16 @@ def kappa(self):

# return -1.53519e19 * self.dw**2 + 2.2751e12 * self.dw
# Adjusted to waveguide dimension 350nm x 220nm
return -6.37130e19 * self.dw**2 + 8.61915e12 * self.dw + 6.87012e3

# period = 265 nm
# return -8.90545e19 * self.dw ** 2 + 9.77165e12 * self.dw - 5.66549e3

# period = 270 nm
return -6.62634e19 * self.dw ** 2 + 8.73236e12 * self.dw + 6.27178e3

# period = 275 nm
# return -6.11280e19 * self.dw ** 2 + 8.57437e12 * self.dw + 9.04911e3


@property
def lambda_bragg(self):
Expand All @@ -79,7 +88,16 @@ def n_delta(self):
return self.kappa * self.lambda_bragg / 2

def n_delta_param(self, dwidth):
kappa = -6.37130e19 * dwidth ** 2 + 8.61915e12 * dwidth + 6.87012e3

# period = 265 nm
# kappa = -8.90545e19 * dwidth ** 2 + 9.77165e12 * dwidth - 5.66549e3

# period = 270 nm
kappa = -6.62634e19 * dwidth ** 2 + 8.73236e12 * dwidth + 6.27178e3

# period = 275 nm
# kappa = -6.11280e19 * dwidth ** 2 + 8.57437e12 * dwidth + 9.04911e3

return kappa * self.lambda_bragg / 2

@property
Expand Down Expand Up @@ -229,22 +247,26 @@ def Grating_Matrix(self, wavl, l, index):
T = []
i = 0
while i < self.N:
# apodization paramater addon
profileFunction = math.exp(-0.5*(2*self.gaussianIndex*(i-self.N/2)/(self.N))**2)

# From KLayout PCell "amf_bragg_apodized.py"
# "profile = int(round(self.corrugation_width/2/dbu))*profileFunction"
# Breaking down into setps from the above equation, I had to mimic the implmentation in KLayout but it is not necessary
profile = self.dw/2/1e-9
profile = int(round(profile))
profile = profile * profileFunction

# Get total dwidth
# Option 1 - No apodization
# dwidth_apodized = self.dw

# Option 2 - With apodization
dwidth_apodized = (profile * 2 * 1e-9)
if self.gaussianIndex == 0:
dwidth_apodized = self.dw
else:
# apodization paramater addon
profileFunction = math.exp(-0.5*(2*self.gaussianIndex*(i-self.N/2)/(self.N))**2)

# From KLayout PCell "amf_bragg_apodized.py"
# "profile = int(round(self.corrugation_width/2/dbu))*profileFunction"
# Breaking down into setps from the above equation, I had to mimic the implmentation in KLayout but it is not necessary
profile = self.dw/2/1e-9
profile = int(round(profile))
profile = profile * profileFunction

# Get total dwidth
# Option 1 - No apodization
# dwidth_apodized = self.dw

# Option 2 - With apodization
dwidth_apodized = (profile * 2 * 1e-9)

# Calculate the total width of the bragg for sanity check
total_width_1 = (self.width + dwidth_apodized)*1e6
Expand Down Expand Up @@ -305,20 +327,21 @@ def visualize(self):
ax.plot(
self.lambda_0 * 1e9,
10 * np.log10(self.T),
label="Transmission",
label="Reflection",
color="blue",
)
ax.plot(
self.lambda_0 * 1e9, 10 * np.log10(self.R), label="Reflection", color="red"
self.lambda_0 * 1e9, 10 * np.log10(self.R), label="Transmission", color="red"
)
ax.set_ylabel("Response (dB)", color="black")
ax.set_xlabel("Wavelength (nm)", color="black")
ax.set_title("Calculated response of the structure using TMM (dB scale)")
ax.legend()


if __name__ == "__main__":
bragg = bragg_wg(
period=270e-9, dw=40e-9, N=300, width=350e-9, thickness=220e-9, gaussianIndex=2
period=270e-9, dw=10e-9, N=500, width=350e-9, thickness=220e-9, gaussianIndex=2
)
bragg.visualize()

Expand Down