Example #1
0
def ring2(radius, gap, gap1, wg_ring_width, wg_coupler_width,
          wg_coupler_width2):
    gap2 = gap + wg_ring_width / 2.0 + wg_coupler_width / 2.0
    gap3 = gap1 + wg_ring_width / 2.0 + wg_coupler_width / 2.0
    wg_ring = WireWaveguideTemplate()
    wg_coupler = WireWaveguideTemplate()
    wg_ring.Layout(core_width=wg_ring_width, cladding_width=wg_ring_width + 6)
    wg_coupler.Layout(core_width=wg_coupler_width,
                      cladding_width=wg_coupler_width + 6)
    wg_coupler2 = WireWaveguideTemplate()
    wg_coupler2.Layout(core_width=wg_coupler_width2,
                       cladding_width=wg_coupler_width2 + 6)

    ring = RingRect180DropFilter(
        ring_trace_template=wg_ring,
        coupler_trace_templates=[wg_coupler, wg_coupler2])
    ring_layout = ring.Layout(
        angle_step=0.1,
        bend_radius=radius,
        coupler_spacings=[gap2, gap3],
        straights=(0, 0),
        coupler_extensions=[i3.Coord2((20, 20)),
                            i3.Coord2((20, 20))])

    return ring
Example #2
0
        def _get_splitting_elem(self):

            pos_in = self.instances["in"].ports["out"].position
            pos_out_1 = self.instances["out1"].ports["in"].position
            pos_out_2 = self.instances["out2"].ports["in"].position

            wg_width = self.wg_template.core_width

            waypoint_shape_top = i3.Shape(points=[
                pos_in + i3.Coord2(0, wg_width / 2), pos_in +
                i3.Coord2(self.small_straights, wg_width /
                          2), self.waypoint, pos_out_2 +
                i3.Coord2(-self.small_straights, +wg_width / 2), pos_out_2 +
                i3.Coord2(0, +wg_width / 2)
            ])

            shape_top = SplinedShape(waypoint_shape=waypoint_shape_top,
                                     resolution=0.05)
            shape_top_m = shape_top.v_mirror_copy()

            start_parabole = i3.Coord2(self.split_base_pos,
                                       self.split_base_width / 2)
            end_parabole = pos_out_2 - i3.Coord2(self.small_straights,
                                                 wg_width / 2)

            x_parabole = np.linspace(start_parabole[0], end_parabole[0], 50)
            y_parabole = (end_parabole[1] - start_parabole[1]) * 1 / (
                end_parabole[0] - x_parabole[0])**0.5 * (
                    x_parabole - x_parabole[0])**0.5 + start_parabole[1]

            points_parabole = [
                i3.Coord2(x, y) for x, y in zip(x_parabole, y_parabole)
            ]
            points_parabole = [
                i3.Coord2(start_parabole[0], 0)
            ] + points_parabole + [pos_out_2 - i3.Coord2(0, wg_width / 2)]
            shape_parabole = i3.Shape(points=points_parabole)
            shape_parabole_m = shape_parabole.v_mirror_copy()

            shape_parabole_final = shape_parabole.reversed() + shape_parabole_m
            shape_parabole_final.remove_identicals()
            shape_bot = SplinedShape(
                waypoint_shape=i3.Shape(points=shape_parabole_final),
                resolution=0.05)

            shape_elem = shape_top + shape_bot + shape_top_m.reversed()
            shape_elem.remove_identicals()
            elem = i3.Boundary(layer=self.wg_template.core_layer,
                               shape=shape_elem)

            return elem
Example #3
0
    def _default_points(self, pts):
        from scipy import interpolate
        x = self.waypoint_shape.x_coords()
        y = self.waypoint_shape.y_coords()
        tck, u = interpolate.splprep([x, y], s=0)
        unew = np.arange(0, 1 + self.resolution, self.resolution)
        out = interpolate.splev(unew, tck)
        points = np.zeros([len(out[0]), 2])
        points[:, 0] = out[0]
        points[:, 1] = out[1]

        points = [i3.Coord2(x, y) for x, y in zip(out[0], out[1])]
        return points
Example #4
0
        def _generate_ports(self, ports):

            ports = super(DropRingAtWavelength.Layout,
                          self)._generate_ports(ports)
            port_loc = i3.Coord2(
                (-self.directional_coupler.coupler_length / 2.0 -
                 self.width_m1 / 2.0, 0.0))
            pin = i3.ElectricalPort(process=self.layer_heater.process,
                                    name="el_in",
                                    position=port_loc)
            ports += pin
            ports += pin.transform_copy(
                transformation=i3.HMirror()).modified_copy(name="el_out")

            return ports
Example #5
0
def ring1(radius, gap, wg_ring_width, wg_coupler_width):
    gap2 = gap + wg_ring_width / 2.0 + wg_coupler_width / 2.0
    wg_ring = WireWaveguideTemplate()
    wg_coupler = WireWaveguideTemplate()
    wg_ring.Layout(core_width=wg_ring_width, cladding_width=wg_ring_width + 6)
    wg_coupler.Layout(core_width=wg_coupler_width,
                      cladding_width=wg_coupler_width + 6)

    ring = RingRectNotchFilter(ring_trace_template=wg_ring,
                               coupler_trace_templates=[wg_coupler])
    ring_layout = ring.Layout(angle_step=0.1,
                              bend_radius=radius,
                              coupler_spacings=[gap2],
                              straights=(0, 0),
                              coupler_extensions=[i3.Coord2((20, 20))])

    return ring
Example #6
0
    def _default_points(self, pts):

        # If no control points are given.
        if len(self.control_points) == 0:
            pts = super(RouteManhattanControlPoints, self)._default_points(pts)
            return pts
        else:
            used_start_control_points, in_angles, used_stop_control_points, out_angles = self._get_used_control_point_in_out_angles(
            )
            pts.append(self.input_port.position)
            for cnt, (start_wp, ia, stop_wp, oa) in enumerate(
                    zip(used_start_control_points, in_angles,
                        used_stop_control_points, out_angles)):

                if cnt == 0 or cnt == len(self.control_points) + 1:
                    start_straight = self.start_straight
                    end_straight = self.end_straight
                else:
                    start_straight = 0
                    end_straight = 0

                to_add = route_manhattan(
                    start_wp,
                    ia,
                    stop_wp,
                    oa,
                    self.get_bend_size,
                    self.get_bend90_size,
                    min_straight=self.min_straight,
                    start_straight=start_straight,
                    end_straight=end_straight,
                    min_spacing=self.min_spacing)[
                        1:]  # Not the first point to avoid double counting

                for to in to_add:
                    pts.append(i3.Coord2(to))

        return pts
Example #7
0
# Creation of an S-Bend

from technologies import silicon_photonics
from ipkiss3 import all as i3

### Solution ###

wg_t_2 = WireWaveguideTemplate()
wg_t_2.Layout(core_width=0.3, cladding_width=2 * 3.0 + 0.47)

start_point = i3.Coord2((0.0, 0.0))
end_point = i3.Coord2((20.0, 20.0))
offset = i3.Coord2(10.0, 0)
middle_point = (start_point + end_point) * 0.5
bend_radius = (end_point[0] - start_point[0]) / 2.0

shape = [
    start_point, start_point + offset, middle_point, end_point - offset,
    end_point
]
wg = i3.RoundedWaveguide(trace_template=wg_t_2)
# Assign a shape to the waveguide.
layout = wg.Layout(shape=shape,
                   bend_radius=bend_radius,
                   manhattan=False,
                   draw_control_shape=True)

layout.visualize()
Example #8
0
 def _default_waypoint(self):
     return i3.Coord2(3.25522953, 1.10901057)
Example #9
0
 def _default_waypoint(self):
     return i3.Coord2(
         self.length_straights + self.length_splitting_shape / 2,
         self.spacing / 2)