Skip to main content

Python package for designing superconducting quantum chips

Project description

GDSQL 0.3.0

GDSQL(GDSII Quantum Layout)是基于gdsfactory[v7]的封装,相比之前的sqc-painter,绘制版图的速度提升超过100x,且无须依赖KLayout。

针对超导量子芯片版图绘制,提供了常用的图形库,包含CPW控制线、TSV、量子比特、短路谐振器、开路谐振器、RF-SQUID,目标是支持千比特版图的绘制。

通过图形库,可以快速生成仿真用的gds文件,用于SONNET、ANSYS、InductEX仿真,已开发SONNET、ANSYS部分自动化仿真功能。

安装说明

需要安装gdsfactory,该包是画图功能最基础的依赖,推荐在Anaconda环境下安装,python=3.11。

[注意] 目前gdsfactory官方更新到v8,但发现其PDK相关内容与gdsql不兼容,而且不支持shapely图形作为Cell的输入,需要替换成klayout格式,即shape模块需要全部重写。因此较长一段时间内仍用v7版本。

structure

根据需要的功能,可选择性地安装以下的包:

  • pandas, openpyxl: 网表导出功能。
  • plotly, nbformat: 在jupyter notebook内预览布线路径功能。
  • klive:可快捷传输版图到klayout内查看,需要在klayout内安装klive[v0.3.2]插件,在Tools -> Manage Packages搜索插件名字进行安装,该插件只支持v0.28.17及以上版本的klayout。
conda create -n gdsql-env python=3.11
activate gdsql-env
pip install gdsfactory==7.27.1
pip install pandas openpyxl plotly nbformat

使用说明

先通过gq.Cell建立画图单元,然后添加gq.cpwgq.padgq.via等图形,并指定图层名称或者图层编号。

图层名称和图层编号的映射关系见PKD说明。 在任何一个需要指定图层的函数里,图层名称和图层编号可以混用。 比如下面2种写法的效果相同:

c.add_polygon(gq.via(40,40),(11,0))
c.add_polygon(gq.via(40,40),"ViaB")

[注意] GDSQL 仍处于试验阶段,预计会在不通知的情况下更改 API(尽管我们会尽量减少更改!)。详细说明请见此处

基础方法

通过手动拼接画图,cpw图形只需要设定途径点和转弯半径,就能自动转弯

import gdsql as gq
c = gq.Cell()
c.add_polygon(gq.cpw(2,4,[(0,0),(200,0),(0,200),(200,200)],radius=50,startcut=50,endcut=50),"METB")
c.add_polygon(gq.pad(30,50,2,4,50),"METB")
c.add_polygon(gq.via(40,40),"ViaB")
c.add_polygon(gq.pad(30,50,2,4,50,angle=180,xoff=200,yoff=200),"METB")
c.add_polygon(gq.via(28,10,dh=20,angle=180,xoff=200,yoff=200),"ViaB")
c.write_gds("demo.gds")  # write it to a GDS file. You can open it in klayout.
c.show()  # show it in klayout
c.plot()  # plot it in jupyter notebook

高级方法

通过已配置好的画图参数gq.RouteConfig画图

import gdsql as gq
route_config = gq.RouteConfig(cpw_ab_existence=True,cpw_ab_simu=True)
line = [(0,0),(200,0),(0,200),(200,200)]
c = route_config.generate_cell(line)
c.plot()

导出方式

导出加工用版图时直接用write_gds,可以保留cell结构,减小文件体积。

如果想要用sonnet或者inductEX进行仿真,建议用write_flatten_gds

c.write_flatten_gds('flattend demo.gds') # export flattened cell
c.write_gds('demo.gds') # export unflattened cell

生成图形

默认PDK

内置默认PDK,包含图层名称和图层编号,图层颜色的映射信息。

LAYER_VIEWS = gq.PDK.layer_views
c = LAYER_VIEWS.preview_layerset()
c.plot()

图层颜色示意

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gdsql-0.3.0.tar.gz (49.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gdsql-0.3.0-py3-none-any.whl (51.5 kB view details)

Uploaded Python 3

File details

Details for the file gdsql-0.3.0.tar.gz.

File metadata

  • Download URL: gdsql-0.3.0.tar.gz
  • Upload date:
  • Size: 49.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for gdsql-0.3.0.tar.gz
Algorithm Hash digest
SHA256 feb8177909b1895ac9e61c434a938c90634c08c067f397f6e23a8e772ff91528
MD5 8149fc52a139d07e76ad5592051d3666
BLAKE2b-256 dae9a4bc808a1016a6afd6cf92ab35310bd0a4f7a38c66fd79c188ad8cf6844a

See more details on using hashes here.

File details

Details for the file gdsql-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: gdsql-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 51.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for gdsql-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b3b4c12ada026fe28f37c9850d625b65bed67006007ef7f3a940b5adfb9c9e9
MD5 de8a8bce010ae1a9078aa0d2847323a4
BLAKE2b-256 7cc1529aeac06cdf868260e3ed3235dd00aa3bbfb851475a1ae6a97e2ef5cdd0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page