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

Planar htron #98

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions docs/user/api.rst
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the api needs to get regenerated; angled_taper shouldn't be documented under devices.htron, since it's just in geometries

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Cells

.. automodule:: qnngds.cells
:members:
:exclude-members: alignment, etch_test, nanowires, nanowires_4pt, ntron, resolution_test, snspd_ntron, snspds, vdp
:exclude-members: alignment, etch_test, nanowires, nanowires_4pt, ntron, planar_htron, resolution_test, snspd_ntron, snspds, vdp
:undoc-members:
:show-inheritance:

Expand Down Expand Up @@ -36,6 +36,11 @@ Cells
.. image:: images/cells/ntron.png
:alt: ntron.png

.. autofunction:: planar_htron

.. image:: images/cells/planar_htron.png
:alt: planar_htron.png

.. autofunction:: resolution_test

.. image:: images/cells/resolution_test.png
Expand Down Expand Up @@ -97,10 +102,20 @@ htron

.. automodule:: qnngds.devices.htron
:members:
:exclude-members:
:exclude-members: angled_taper, planar_hTron
:undoc-members:
:show-inheritance:

.. autofunction:: angled_taper

.. image:: images/devices/htron/angled_taper.png
:alt: angled_taper.png

.. autofunction:: planar_hTron

.. image:: images/devices/htron/planar_hTron.png
:alt: planar_hTron.png

nanowire
~~~~~~~~

Expand Down Expand Up @@ -183,10 +198,15 @@ Geometries

.. automodule:: qnngds.geometries
:members:
:exclude-members: hyper_taper
:exclude-members: angled_taper, hyper_taper
:undoc-members:
:show-inheritance:

.. autofunction:: angled_taper

.. image:: images/geometries/angled_taper.png
:alt: angled_taper.png

.. autofunction:: hyper_taper

.. image:: images/geometries/hyper_taper.png
Expand Down
Binary file added docs/user/images/cells/planar_htron.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/devices/htron/angled_taper.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/devices/htron/planar_hTron.png
emmakbat marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/geometries/angled_taper.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "pdm.backend"
[project]
name = "qnngds"

version = "3.4.0"
version = "3.5.0"

authors = [
{ name="A. Jacquillat", email="[email protected]" },
Expand Down
105 changes: 105 additions & 0 deletions src/qnngds/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,111 @@ def resolution_test(

## devices:

def planar_htron(
die_parameters: utility.DieParameters = utility.DieParameters(),
wire_width: Union[int, float] = 0.2,
gate_width: Union[int, float] = 0.05,
channel_width: Union[int, float] = 0.05,
gap: Union[int, float] = 0.02,
gate_length: Union[int, float] = 0.01,
channel_length: Union[int, float] = 0.01,
device_layer: int = 1,
outline_dev: Union[int, float] = 1,
text: Union[None, str] = None
) -> Device:
"""Creates a cell containing a planar hTron

Parameters
-----------------
wire_width : int or float
Width of routing wires in microns
gate_width : int or float
Width of superconducting gate in microns
channel_width : int or float
Width of superconducting channel in microns
gap : int or float
Spacing between gate and channel in microns
gate_length : int or float
Length of superconducting gate in microns
channel_length : int or float
Length of superconducting channel in microns
outline : int or float
Width of positive tone outline in microns

Returns
-------------
HTRON : Device
A Device containing a single hTron

"""
if text is None:
text = f"w={wire_width}"
cell_text = text.replace(" \n", ", ")

HTRON_DIE = Device(f"CELL.HTRON({cell_text})")
DEVICE = Device(f"HTRON({cell_text})")
HTRON = device.htron.planar_hTron(
wire_width=wire_width,
gate_width=gate_width,
channel_width=channel_width,
gap=gap,
gate_length=gate_length,
channel_length=channel_length,
layer=device_layer
)

href = DEVICE << HTRON

die_contact_w = HTRON.xsize + die_parameters.contact_l
dev_contact_w = HTRON.xsize
routes_margin = 4 * die_contact_w
dev_max_size = (
2 * die_parameters.pad_size[0],
HTRON.ysize + routes_margin,
)

# die, with calculated parameters
BORDER = utility.die_cell(
die_parameters=die_parameters,
n_m_units=(1, 1),
contact_w=die_contact_w,
device_max_size=dev_max_size,
ports={"N": 2, "S": 2},
ports_gnd=[],
text=f"HTRON\n{cell_text}",
)

HTRON.add_port(port=href.ports[0], name=f"S{2}")
HTRON.add_port(port=href.ports[1], name=f"N{2}")
HTRON.add_port(port=href.ports[2], name=f"S{1}")
HTRON.add_port(port=href.ports[3], name=f"N{1}")

## Route the nanowires and the die

# hyper tapers
HT, dev_ports = utility.add_hyptap_to_cell(
BORDER.get_ports(), die_parameters.contact_l, dev_contact_w
)
DEVICE.ports = dev_ports.ports
DEVICE << HT

# routes from nanowires to hyper tapers
ROUTES = utility.route_to_dev(HT.get_ports(), HTRON.ports)
DEVICE << ROUTES

DEVICE.ports = dev_ports.ports
DEVICE = pg.outline(
DEVICE, outline_dev, open_ports=2 * outline_dev, layer=device_layer
)
DEVICE.name = f"NWIRES({cell_text})"

HTRON_DIE << DEVICE
HTRON_DIE << BORDER

from phidl import quickplot as qp
qp(HTRON_DIE)

return HTRON_DIE

def nanowires(
die_parameters: utility.DieParameters = utility.DieParameters(),
Expand Down
23 changes: 23 additions & 0 deletions src/qnngds/design.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,29 @@ def nanowires_cell(
device_layer=self.layers["device"],
text=text,
)

def htron_cell(
self,
wire_width: Union[int, float] = 0.2,
gate_width: Union[int, float] = 0.05,
channel_width: Union[int, float] = 0.05,
gap: Union[int, float] = 0.02,
gate_length: Union[int, float] = 0.01,
channel_length: Union[int, float] = 0.01,
text: Union[None, str] = None
):
return cell.planar_htron(
die_parameters=self.die_parameters,
wire_width=wire_width,
gate_width=gate_width,
channel_width=channel_width,
gap=gap,
gate_length=gate_length,
channel_length=channel_length,
device_layer=self.layers["device"],
outline_dev=self.device_outline,
text=text
)

def ntron_cell(
self,
Expand Down
77 changes: 77 additions & 0 deletions src/qnngds/devices/htron.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,80 @@

import phidl.geometry as pg
from typing import Tuple, Optional

# -*- coding: utf-8 -*-
"""
Created on Wed Mar 04 14:33:29 2024

@author: reedf

"""

import numpy as np
from phidl import Device
import phidl.geometry as pg
from qnngds.geometries import angled_taper
from typing import Tuple, List, Union, Optional

def planar_hTron(wire_width: Union[int, float]= 0.3,
gate_width: Union[int, float] = 0.1,
channel_width: Union[int, float] = 0.2,
gap: Union[int, float] = 0.02,
gate_length : Union[int, float]= 0.01,
channel_length: Union[int, float] = 0.01,
layer: int = 1
):
"""Create a planar hTron

Parameters
-----------------
wire_width : int or float
Width of routing wires in microns
gate_width : int or float
Width of superconducting gate in microns
channel_width : int or float
Width of superconducting channel in microns
gap : int or float
Spacing between gate and channel in microns
gate_length : int or float
Length of superconducting gate in microns
channel_length : int or float
Length of superconducting channel in microns
layer: int
Layer to draw device on

Returns
-------------
HTRON : Device
A Device containing a single hTron

"""

HTRON = Device('hTron')

ports = []
for direction,width,length in ((1,channel_width, channel_length), (-1,gate_width, gate_length)):
W = Device('wire')
constr = W << pg.straight(size=(width, np.max(length - 4*width,0)), layer=layer)
constr.center = [0,0]
constr.move([direction*(gap/2+width/2),0])
taper = angled_taper(wire_width, width, 45, layer=layer)
if direction < 0:
taper.mirror()
taper_lower = W << taper
taper_lower.connect(taper_lower.ports[1], constr.ports[2])
taper_upper = W << taper
taper_upper.mirror()
taper_upper.connect(taper_upper.ports[1], constr.ports[1])
ports.append(taper_lower.ports[2])
ports.append(taper_upper.ports[2])
HTRON << W

HTRON = pg.union(HTRON)
for p, port in enumerate(ports):
HTRON.add_port(name=p, port=port)

HTRON.center = [0,0]
HTRON.name = f"HTRON.planar(w={wire_width:.2f})"
HTRON.simplify(1e-3)
return HTRON
55 changes: 54 additions & 1 deletion src/qnngds/geometries.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

from phidl import Device
import numpy as np

import phidl.path as pp
from typing import Tuple, List, Union, Optional

def hyper_taper(length=10, wide_section=50, narrow_section=5, layer=1):
"""Hyperbolic taper (solid). Designed by colang.
Expand Down Expand Up @@ -38,3 +39,55 @@ def hyper_taper(length=10, wide_section=50, narrow_section=5, layer=1):
HT.add_port(name=2, midpoint=[taper_length, 0], width=wide, orientation=0)
HT.flatten(single_layer=layer)
return HT

def angled_taper(wire_width: Union[int, float] = 0.2,
constr_width: Union[int, float] = 0.1,
angle: Union[int, float] = 60,
layer: int = 1):
"""Create an angled taper with euler curves

Parameters
-----------------
wire_width : int or float
Width of wide end of taper
constr_width: int or float
Width of narrow end of taper
angle: int or float
Angle between taper ends in degrees

Returns
-------------
D : Device
A Device containing a single taper

"""

D = Device('taper')

# heuristic for length between narrow end and bend
l_constr = constr_width*2 + wire_width*2
# heuristic for length between wide end and bend
l_wire = constr_width*2 + wire_width*2
sin = np.sin(angle*np.pi/180)
cos = np.cos(angle*np.pi/180)
# path along the center of the taper
p_center = np.array([[0,0], [l_constr, 0], [l_constr+l_wire*cos,l_wire*sin]])
# upper (shorter) path along the inside edge of the taper
p_upper = np.array([[0,constr_width/2], [0, constr_width/2], p_center[2] + [-wire_width/2*sin, wire_width/2*cos]])
p_upper[1,0] = (constr_width/2-p_upper[2,1])*cos/sin + p_upper[2,0]
# lower (longer) path along the outside edge of the taper
p_lower = np.array([[0,-constr_width/2], [0, -constr_width/2], p_center[2] + [wire_width/2*sin, -wire_width/2*cos]])
p_lower[1,0] = (-constr_width/2-p_lower[2,1])*cos/sin + p_lower[2,0]
# interpolate euler curve between points
P_upper = pp.smooth(points=p_upper, radius=wire_width, corner_fun=pp.euler, use_eff=False)
P_lower = pp.smooth(points=p_lower, radius=wire_width, corner_fun=pp.euler, use_eff=False)

# create a polygon
points = np.concatenate((P_upper.points, P_lower.points[::-1]))
D.add_polygon(points, layer=layer)

# port 1: narrow/constr_width end, port 2: wide/wire_width end
D.add_port(name=1, midpoint=(P_upper.points[0] + P_lower.points[0])/2, width=constr_width, orientation=180)
D.add_port(name=2, midpoint=(P_upper.points[-1] + P_lower.points[-1])/2, width=wire_width, orientation=angle)

return D
Loading