ContraDC Class Documentation
Chirp your CDC, engineer your response.
Based on Matlab model by Jonathan St-Yves as well as Python model by Mustafa Hammood.
Created by Jonathan Cauchon, September 2019.
Last updated November 2020.
Contents
- ContraDC Class
- Examples of Usage
ContraDC Class
-
class
ContraDC.
ContraDC
(N=1000, period=3.22e-07, polyfit_file=None, a=10, apod_shape='gaussian', kappa=48000, T=300, resolution=500, N_seg=100, wvl_range=[1.53e-06, 1.58e-06], central_wvl=1.55e-06, alpha=10, w1=5.6e-07, w2=4.4e-07, w_chirp_step=1e-09, period_chirp_step=2e-09)¶ Contra-directional coupler class constructor. Defines parameters for simulation purposes.
Parameters: - N (int) – Number of grating periods.
- period (float or list) – Period of the grating [m]. If a float is passed, the period is considered uniform. If a list of 2 is passed, the period will be considered as a linear chirp from the first to the second value given, with a step given by period_chirp_step.
- polyfit_file (str, default=None) – Path to the text file containing the polyfit for the supermode indices from a MODE simulation. The text file should follow the structured as: fit start wavelength, fit stop wavelength, w1 coefficient 1, w1 coefficient 2, w2 coefficient 1, w2 coefficient 2. For instance: 1.5e-06,1.6e-06,1.97004,-201040,1.98997,-257755. If polyfit_file is None, the supermode indices will be interpolated for a 100-nm gap MODE simulation on the SOI platform, using w1 and w2. If not None, then the parameters w1, w2 and wvl_range have no impact on the simulation.
- resolution (int) – Number of wavelength points to be used in the simulation.
- N_seg (int) – Number of grating segments to be used for propagation.
- wvl_range (list) – Wavelength range to be used for simulation [m]. List of 2 elements where the simulations will be performed and plotted from first to second value.
- alpha (float) – Propagation loss in the grating [dB/cm].
- w1 (float, list) – Width of waveguide 1 [m], if polyfit_file is None. If w1 is a float, w1 will be considered uniform. If w1 is a list of 2, w1 will be considered as linearly chirped between the first and second value, following the chirp step given by w_chirp_step.
- w2 (float, list) – Width of waveguide 1 [m], if polyfit_file is None. If w2 is a float, w2 will be considered uniform. If w2 is a list of 2, w2 will be considered as linearly chirped between the first and second value, following the chirp step given by w_chirp_step.
- apod_shape (str) – Specifies the apodization profile shape, either “gaussian” or “tanh’.
- a (int) – Sepcifies the gaussian constant to be used in the apodization profile, if apod_shape is “gaussian”.
- kappa (float) – Maximum coupling power [1/m].
- T (float or list) – Device Temperature [K]. If a float is passed, T is considered uniform. If a list of 2 is passed, the temperature is considered as linear along the device, varying from the first value to the second value.
- period_chirp_step (float) – Chirp step of the period [m].
- w_chirp_step (float) – Chirp step of the waveguide widths [m].
Returns: ContraDC object, not yet simulated.
- Class Attributes: Are calculated by the different member functions during simulation.
They can be obverriden for custom contra-DC designs.
- apod_profile (np array) - Apodization profile, calculated by the getApodProfile() function.
- period_profile (np array) - Period chirp profile along grating, calculated by getChirpProfile() fucntion.
- w1_profile (np array) - w1 chirp profile along grating, calculated by getChirpProfile() function.
- w2_profile (np array) - w2 chirp profile along grating, calculated by getChirpProfile() function.
- T_profile (np array) - Temperature chirp profile along grating, calculated by getChirpProfile() function.
- is_simulated (bool) - True if simulation has taken place by invoking simulate().
-
displayResults
(tag_url=False)¶ Displays the result of the simulation in a user-friendly way. Convenient for design and optimization. Interface show the device’s specifications and grating profiles, a graph of the spectral response, as well as key performance figures calculated in getPerormance().
Parameters: tag_url (bool) – Either to tag the github repo URL or not.
-
gen_sparams
(file_name="ContraDC_sparams.mat")¶ Exports the device's S-matrix to a .mat file for use with Lumerical INTERCONNECT. Requires self.is_simulated=True.
Parameters: file_name (str) – Name of file to write (must have a .mat extension).
-
getApodProfile
()¶ - Calculates the apodization profile, based on the apod_profile
- (either “gaussian” of “tanh”).
Returns: ContraDC object with calculated apodization profile (self.apod_profile).
-
getChirpProfile
()¶ Creates linear chirp profiles along the CDC device. Chirp is specified by assigning 2-element lists to the constructor for period, w1, w2 and T. The profiles are then created as linear, and granularity is brought by the chirp_resolution specicfications to match the fabrication process capabilities for realism (for instance, w_chirp_step is set to 1 nm because GDS has a grid resolution of 1 nm for submission at ANT and AMF).
Returns: ContraDC object with calculated chirp profiles (self.period_profile, self.w1_profile, self.w2_profile, self.T_profile).
-
getGroupDelay
()¶ Calculates the group delay of the device, using the phase derivative. Requires self.is_simulated=True.
-
getPerformance
()¶ Calculates a couple of basic performance figures of the contra-DC, such as center wavelength, bandwidth, maximum reflection, etc.
Returns: ContraDC object, with a self.performance attibute containing the performance data (self.performance).
-
getPropConstants
()¶ Calculates propagation constants, either through interpolation (for silicon), or through regression, given a text file containing the polyfit parameters (for nitride).
Returns: ContraDC object with calculated propagation constant profiles (self.beta1_profile, self.beta2_profile).
-
makeRightShape
(param)¶ Simply adds dimensionality to the parameters in sights of matrix operations in the “propagate” method The correct shape is (self.resolution, self.N_seg ,4, 4).
Parameters: param – Any ContraDC parameter. Returns: The given parameter, with the right dimensionality.
-
propagate
()¶ - Propagates the optical field through the contra-DC, using the transfer-matrix
- method in a computationally-efficient way to calculate the total transfer matrix and extract the thru and drop electric field responses.
Returns: ContraDC object with computed values for self.thru, self.drop, self.E_thru, self.E_drop, self.transferMatrix.
-
simulate
()¶ Simulates the contra-DC, in logical order as prescribed by the TMM method. Succintly calls self.getApodProfile(), self.getChirpProfile(), self.getPropConstants(), and self.propagate().
Returns: Simulated ContraDC object.
Examples of Usage
Important: When using out-of-the-box model parameters (w1 and w2), the model assumes 220-nm-thick SOI waveguide with a gap of 100 nm, and a maximum coupling power (kappa) of 48 000 /m. In more general circumstances, w1 and w2 cannot be used and those three properties must be overridden. If another platform is used (other than slicon on silicon dioxide), the thermo-optic coefficient does not hold and must be overriden.
Example 1 shows how instantiation, simulation and performance assessment can be done in a single line of code using the simulation tool. A regular contra-DC is created and simulated. The performances are output in the result interface. The group delay is also obtained and plotted afterwards.
""" Example 1: regular SOI Contra-DC """
# instantiate, simulate and show result
device = ContraDC().simulate().displayResults()
# calculate the group delay
device.getGroupDelay()
# plot group delay
plt.figure()
plt.plot(device.wavelength*1e9, device.group_delay*1e12)
plt.xlabel("Wavelength (nm)")
plt.ylabel("Tg (ps)")
plt.show()
Output:
Example 2 shows the chirping capabality of the model. You can use waveguide width chirp, period chirp and temperature chirp. You can also use the apodization profile to be hyperbolic-tangent-shaped, to better perform with a chirped operation.
""" Example 2: Full chirped example.
Create a CDC with chirped w1, w2, period, temperature.
"""
# Waveguide chirp
w1 = [.56e-6, .562e-6]
w2 = [.44e-6, .442e-6]
w_chirp_step = .1e-9
# Period chirp
period = [318e-9, 322e-9]
# apod shape
apod_shape = "tanh"
N = 1200
device = ContraDC(N=N, w1=w1, w2=w2, apod_shape=apod_shape,
w_chirp_step=w_chirp_step, period=period)
device.simulate().displayResults()
Output:
Example 3 shows how the chirp profiles can be customized at will. By default, a ContraDC object assumes linear chirp profiles. Here, we show how this can be overriden to us sinusoidal chirp profiles.
""" Example 3: defining custom chirp profiles """
device = ContraDC(apod_shape="tanh")
z = np.linspace(0, device.N_seg, device.N_seg)
device.w1_profile = device.w1*np.cos(z/600)
device.w2_profile = device.w2*np.cos(z/600)
device.simulate().displayResults()
Output:
Example 4 shows how a custom waveguide geometry or platform can be used from previously-run eingenmode simulations. Simply include a text file containt the first degree polynomial fit coefficients of the supermodes in the form:
""" Example 4: using custom supermode indices.
You might want to use this if you are designing
with silicon nitride, of using other waveguide specs than
SOI, 100-nm gap.
"""
device = ContraDC(polyfit_file="polyfit.txt", period=335e-9)
device.simulate().displayResults()
Output: