code: from simphony.library import siepic
  from simphony.netlist import Subcircuit
  
  
  def ring_double_siepic(
      wg_width=0.5,
      gap=0.2,
      length_x=4,
      bend_radius=5,
      length_y=2,
      coupler=siepic.ebeam_dc_halfring_straight,
      straight=siepic.ebeam_wg_integral_1550,
      terminator=siepic.ebeam_terminator_te1550,
  ):
      r"""Return double bus ring made of two couplers (ct: top, cb: bottom).
  
      connected with two vertical straights (wyl: left, wyr: right)
  
      .. code::
  
           --==ct==--
            |      |
            wl     wr length_y
            |      |
           --==cb==-- gap
  
            length_x
  
  
       drop   n1 _        _ n3 cdrop
                  \______/
                   ______
       in     n2 _/      \_n4
                 |        |
              n1 |        | n3
                  \______/
                   ______
       in     n2 _/      \_n4 output
  
  
      """
      straight = straight() if callable(straight) else straight
      coupler = coupler() if callable(coupler) else coupler
  
      # Create the circuit, add all individual instances
      circuit = Subcircuit("mzi")
      circuit.add([(coupler, "ct"), (coupler, "cb"), (straight, "wl"), (straight, "wr")])
  
      # Circuits can be connected using the elements' string names:
      circuit.connect_many(
          [
              ("cb", "n1", "wl", "n1"),
              ("wl", "n2", "ct", "n2"),
              ("ct", "n4", "wr", "n1"),
              ("wr", "n2", "cb", "n3"),
          ]
      )
      circuit.elements["cb"].pins["n2"] = "input"
      circuit.elements["cb"].pins["n4"] = "output"
      circuit.elements["ct"].pins["n1"] = "drop"
      circuit.elements["ct"].pins["n3"] = "cdrop"
      return circuit
  
  
  if __name__ == "__main__":
      import matplotlib.pyplot as plt
  
      from gdsfactory.simulationsimphony import plot_circuit
  
      c = ring_double_siepic()
      plot_circuit(c)
      plt.show()
   import numpy as np
  
  from gdsfactory.simulation.modes.find_mode_dispersion import find_mode_dispersion
  
  
  def test_find_modes_waveguide_dispersion() -> None:
      modes = find_mode_dispersion(wg_width=0.45, resolution=20, cache=None)
      m1 = modes
  
      # print(f"neff1 = {m1.neff}")
      # print(f"ng1 = {m1.ng}")
  
      # neff1 = 2.3948
      # ng1 = 4.23194
  
      neff1 = 2.362907833437435
      ng1 = 4.202169359808116
  
      assert np.isclose(m1.neff, neff1), (m1.neff, neff1)
      assert np.isclose(m1.ng, ng1), (m1.ng, ng1)
  
  
  if __name__ == "__main__":
      test_find_modes_waveguide_dispersion()
  
apis: matplotlib.pyplot.show
apis: numpy.isclose