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

HangerResonator breaks WaveguideComposite #69

Closed
iqmtestd opened this issue Oct 16, 2023 · 2 comments · Fixed by #70
Closed

HangerResonator breaks WaveguideComposite #69

iqmtestd opened this issue Oct 16, 2023 · 2 comments · Fixed by #70
Assignees
Labels
bug Something isn't working

Comments

@iqmtestd
Copy link
Contributor

iqmtestd commented Oct 16, 2023

WaveguideComposite does not always work with embedded HangerResonator. We'd expect this to always work.

WaveguideComposite Nodes may specify simple Elements to be embedded in the waveguide. This does not work well with HangerResonator. Often it breaks with a ERROR: IndexError: list index out of range in PCellDeclaration.produce message.

Other times it does succeed but even then the guiding lines may be wrong:

image

The macro to create the above example:

from kqcircuits.klayout_view import KLayoutView
from kqcircuits.elements.waveguide_composite import Node, WaveguideComposite
from kqcircuits.elements.hanger_resonator import HangerResonator

view = KLayoutView()

nodes = [
    Node(pya.DPoint(0, 0)),
    Node(pya.DPoint(500, 0)),
    Node(pya.DPoint(500, -300)),
    Node(pya.DPoint(200, -300), face_id="2b1"),
    Node(pya.DPoint(0, -300)),
    Node(pya.DPoint(-200, -300)),
    Node(pya.DPoint(-200, -600), face_id="1t1"),
    Node(pya.DPoint(-200, -1000)),
    Node(pya.DPoint(-200,-1600), HangerResonator),
    Node(pya.DPoint(-500, -1000)),
]
view.insert_cell(WaveguideComposite, nodes=nodes)

view.focus()

Similarly, when trying to use port_pl_a and port_pl_b, like this:

    Node(pya.DPoint(-200, -1600), HangerResonator, align=('port_pl_b', 'port_pl_a')),
    Node(pya.DPoint(-500, -2000)),

it does not always produce the expected shape:
image

Versions

KQCircuits: v4.7.0
KLayout: 0.28.12
Python: 3.10.12
OS: Ubuntu 22.04.3

Issue Severity

Medium: significant difficulty but I can work around it

@iqmtestd iqmtestd added the bug Something isn't working label Oct 16, 2023
@iqmtestd
Copy link
Contributor Author

We don't know why this happens. A possible reason is that HangerResonator uses WaveguideComposite and the recursive nature of this usage may confuse KLayout. Or we just have some logic error in WaveguideComposite that has not been discovered yet.

@iqmtestd iqmtestd self-assigned this Oct 18, 2023
iqmtestd added a commit that referenced this issue Oct 20, 2023
It uses the more efficient WaveguideCoplanar and thus also avoids recursive
element usage (disallowed by KLayout) when insertend in WaveguideComposite.

Fix #69
iqmtestd added a commit that referenced this issue Oct 20, 2023
It uses the more efficient WaveguideCoplanar and thus also avoids recursive
element usage (disallowed by KLayout) when insertend in WaveguideComposite.

Fix #69
@Qvadi
Copy link

Qvadi commented Oct 24, 2023

Awesome! Tested and works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants