iqm-finland / KQCircuits

KLayout Python library for integrated quantum circuit design.
GNU General Public License v3.0
142 stars 73 forks source link

WaveguideComposite uses wrong parameters when adding a meander and changing a,b in the same node. #37

Closed caspar-iqm closed 1 year ago

caspar-iqm commented 1 year ago

Minimum working example:

from kqcircuits.pya_resolver import pya
import kqcircuits.util.macro_prepare as macroprep

from kqcircuits.elements.waveguide_composite import WaveguideComposite
from kqcircuits.elements.waveguide_composite import Node

(layout, top_cell, layout_view, cell_view) = macroprep.prep_empty_layout()

wg_cell = WaveguideComposite.create(layout, nodes=[Node((-1600.0, -2400.0)), Node((-900.0, -2400.0), length_increment=500.0, a=30, b=20), Node((100.0, -2400.0))])
top_cell.insert(pya.DCellInstArray(wg_cell.cell_index(), pya.DTrans()))

Generated layout: image

Expected result: the meandering segment should appear with the initial dimensions (a=10 and b=6 in this case). Instead, it uses the a and b value of the node.

dgploss commented 1 year ago

The above example is outdated, now we can use:

from kqcircuits.klayout_view import KLayoutView
from kqcircuits.elements.waveguide_composite import Node
from kqcircuits.elements.waveguide_composite import WaveguideComposite

view = KLayoutView()
view.insert_cell(WaveguideComposite, nodes=[Node((-1600.0, -2400.0)), Node((-900.0, -2400.0), length_increment=500.0, a=30, b=20), Node((100.0, -2400.0))])
view.focus()

But the fastest way to reproduce is to take a WaveguideComposite in KLayout and change its nodes parameter to (-1600.0, -2400.0),(-900.0, -2400.0, {'a': 30, 'b': 20, 'length_increment': 500.0}),(100.0, -2400.0)

dgploss commented 1 year ago

I'll work on this.