Skip to content

Commit

Permalink
corrected a bug in place_on_chip
Browse files Browse the repository at this point in the history
  • Loading branch information
audrey01mit committed May 7, 2024
1 parent 265137c commit 75df6bc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 33 deletions.
28 changes: 4 additions & 24 deletions docs/user/api.rst
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, ntron, resolution_test, snspd, snspd_ntron, vdp
:exclude-members: alignment, etch_test, nanowires, ntron, resolution_test, snspd, vdp
:undoc-members:
:show-inheritance:

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

.. autofunction:: snspd_ntron

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

.. autofunction:: vdp

.. image:: images/cells/vdp.png
Expand All @@ -57,15 +52,10 @@ Circuits

.. automodule:: qnngds.circuits
:members:
:exclude-members: snspd_ntron
:exclude-members:
:undoc-members:
:show-inheritance:

.. autofunction:: snspd_ntron

.. image:: images/circuits/snspd_ntron.png
:alt: snspd_ntron.png

.. _Design:
Design
------
Expand Down Expand Up @@ -115,7 +105,7 @@ ntron

.. automodule:: qnngds.devices.ntron
:members:
:exclude-members: sharp, smooth, smooth_compassPorts
:exclude-members: sharp, smooth
:undoc-members:
:show-inheritance:

Expand All @@ -129,17 +119,12 @@ ntron
.. image:: images/devices/ntron/smooth.png
:alt: smooth.png

.. autofunction:: smooth_compassPorts

.. image:: images/devices/ntron/smooth_compassPorts.png
:alt: smooth_compassPorts.png

resistor
~~~~~~~~

.. automodule:: qnngds.devices.resistor
:members:
:exclude-members: meander, meander_sc_contacts, sc_contacts
:exclude-members: meander, meander_sc_contacts
:undoc-members:
:show-inheritance:

Expand All @@ -153,11 +138,6 @@ resistor
.. image:: images/devices/resistor/meander_sc_contacts.png
:alt: meander_sc_contacts.png

.. autofunction:: sc_contacts

.. image:: images/devices/resistor/sc_contacts.png
:alt: sc_contacts.png

snspd
~~~~~

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "pdm.backend"

[project]
name = "qnngds"
version = "2.3.0"
version = "2.4.0"

authors = [
{ name="A. Jacquillat", email="[email protected]" },
Expand Down
4 changes: 2 additions & 2 deletions src/qnngds/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ def ntron(
NTRON = utility.rename_ports_to_compass(NTRON)
if text is None:
text = f"chk: {choke_w} \nchnl: {channel_w}"
cell_text = text.replace("\n", ",")
cell_text = text.replace(" \n", ", ")
DIE_NTRON = Device(f"CELL.NTRON({cell_text})")

DEVICE = Device(f"NTRON({cell_text})")
Expand Down Expand Up @@ -640,7 +640,7 @@ def snspd(
contact_l=overlap_w,
ports={"N": 1, "S": 1},
ports_gnd=["S"],
text=f"SNSPD {text}",
text=f"SNSPD \n{text}",
isolation=outline_die,
layer=die_layer,
pad_layer=pad_layer,
Expand Down
4 changes: 2 additions & 2 deletions src/qnngds/design.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ def place_on_chip(

# move the cell
cell_bottom_left = (
-(n_cell - 1 + (n_cell % 2) * 0.5) * die_w,
-(m_cell - 1 + (m_cell % 2) * 0.5) * die_w,
-(n_cell - 1 + (n_cell % 2)) * 0.5 * die_w,
-(m_cell - 1 + (m_cell % 2)) * 0.5 * die_w,
)
cell.move(cell_bottom_left, ((coordinates[0]) * die_w, (coordinates[1]) * die_w))

Expand Down
10 changes: 6 additions & 4 deletions src/qnngds/devices/snspd.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ def basic(
num_squares: Optional[int] = None,
turn_ratio: Union[int, float] = 4,
terminals_same_side: bool = False,
layer: int = 0,
layer: int = dflt.layers["device"],
) -> Device:
"""Creates an optimally-rounded SNSPD.
Takes Phidl's snspd, rename it and flatten the device.
Takes Phidl's snspd, perform a union and rename it.
Parameters:
wire_width (float): Width of the nanowire.
Expand All @@ -34,7 +34,7 @@ def basic(
Returns:
Device: A Device containing an optimally-rounded SNSPD, as provided by
Phidl but renamed and flattened.
Phidl but renamed and unified.
"""
# check parameters constrains
if wire_pitch <= wire_width:
Expand All @@ -53,7 +53,9 @@ def basic(
terminals_same_side,
layer,
)
SNSPD.flatten()
ports = SNSPD.ports
SNSPD = pg.union(SNSPD, layer=layer)
SNSPD.ports = ports
SNSPD.name = f"SNSPD.BASIC(w={wire_width}, pitch={wire_pitch})"
return SNSPD

Expand Down

0 comments on commit 75df6bc

Please sign in to comment.