QuLab 2.11.16__tar.gz → 2.12.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {qulab-2.11.16 → qulab-2.12.0}/PKG-INFO +1 -1
- {qulab-2.11.16 → qulab-2.12.0}/QuLab.egg-info/PKG-INFO +1 -1
- qulab-2.12.0/qulab/version.py +1 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/visualization/plot_layout.py +79 -0
- qulab-2.11.16/qulab/version.py +0 -1
- {qulab-2.11.16 → qulab-2.12.0}/LICENSE +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/MANIFEST.in +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/QuLab.egg-info/SOURCES.txt +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/QuLab.egg-info/dependency_links.txt +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/QuLab.egg-info/entry_points.txt +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/QuLab.egg-info/requires.txt +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/QuLab.egg-info/top_level.txt +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/README.md +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/pyproject.toml +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/__init__.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/__main__.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/cli/__init__.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/cli/commands.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/cli/config.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/cli/decorators.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/executor/__init__.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/executor/analyze.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/executor/cli.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/executor/load.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/executor/registry.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/executor/schedule.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/executor/storage.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/executor/template.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/executor/utils.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/monitor/__init__.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/monitor/__main__.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/monitor/config.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/monitor/dataset.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/monitor/event_queue.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/monitor/mainwindow.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/monitor/monitor.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/monitor/ploter.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/monitor/qt_compat.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/monitor/toolbar.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/scan/__init__.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/scan/curd.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/scan/models.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/scan/optimize.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/scan/query.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/scan/record.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/scan/scan.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/scan/server.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/scan/space.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/scan/utils.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/storage/__init__.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/storage/__main__.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/storage/backend/__init__.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/storage/backend/redis.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/storage/base_dataset.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/storage/chunk.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/storage/dataset.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/storage/file.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/storage/models/__init__.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/storage/models/base.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/storage/models/config.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/storage/models/file.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/storage/models/ipy.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/storage/models/models.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/storage/models/record.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/storage/models/report.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/storage/models/tag.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/storage/storage.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/__init__.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/chat.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/device/__init__.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/device/basedevice.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/device/loader.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/device/utils.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/drivers/FakeInstrument.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/drivers/__init__.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/ipy_events.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/net/__init__.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/net/bencoder.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/net/cli.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/net/dhcp.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/net/dhcpd.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/net/kad.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/net/kcp.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/net/nginx.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/progress.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/rpc/__init__.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/rpc/client.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/rpc/exceptions.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/rpc/msgpack.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/rpc/msgpack.pyi +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/rpc/router.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/rpc/rpc.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/rpc/serialize.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/rpc/server.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/rpc/socket.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/rpc/utils.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/rpc/worker.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/sys/rpc/zmq_socket.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/tools/__init__.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/tools/connection_helper.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/typing.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/utils.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/visualization/__init__.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/visualization/__main__.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/visualization/_autoplot.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/visualization/plot_circ.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/visualization/plot_seq.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/visualization/qdat.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/visualization/rot3d.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/qulab/visualization/widgets.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/setup.cfg +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/setup.py +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/src/qulab.h +0 -0
- {qulab-2.11.16 → qulab-2.12.0}/tests/test_scan.py +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "2.12.0"
|
@@ -54,6 +54,85 @@ def complete_layout(layout):
|
|
54
54
|
return layout
|
55
55
|
|
56
56
|
|
57
|
+
def read_xlsx_to_dict(filepath: str,
|
58
|
+
key_col: int = 0,
|
59
|
+
value_col: int = 4,
|
60
|
+
sheet_name: str = 0) -> dict:
|
61
|
+
"""
|
62
|
+
读取 .xlsx 文件,将第 key_col 列和第 value_col 列的值分别作为 key、value,返回一个字典。
|
63
|
+
|
64
|
+
:param filepath: Excel 文件路径
|
65
|
+
:param key_col: 用作字典键的列索引(0 表示第一列)
|
66
|
+
:param value_col: 用作字典值的列索引(0 表示第一列)
|
67
|
+
:param sheet_name: 要读取的 sheet 名称或索引,默认第一个 sheet
|
68
|
+
:return: { key: value, ... } 形式的字典
|
69
|
+
"""
|
70
|
+
import pandas as pd
|
71
|
+
|
72
|
+
# 读取整个表格
|
73
|
+
# df = pd.read_excel(filepath, sheet_name=sheet_name, header=None)
|
74
|
+
df = pd.read_excel(filepath, sheet_name=sheet_name)
|
75
|
+
|
76
|
+
# 提取指定列,生成键值对并返回字典
|
77
|
+
keys = df.iloc[:, key_col]
|
78
|
+
values = df.iloc[:, value_col]
|
79
|
+
return dict(zip(keys, values))
|
80
|
+
|
81
|
+
|
82
|
+
def load_layout_from_xlsx(qubit_info, coupler_info, pad_info):
|
83
|
+
"""
|
84
|
+
从 .xlsx 文件中加载布局信息。
|
85
|
+
|
86
|
+
:param qubit_info: 量子比特信息文件路径
|
87
|
+
:param coupler_info: 耦合器信息文件路径
|
88
|
+
:param pad_info: 垫片信息文件路径
|
89
|
+
:return: 布局信息
|
90
|
+
"""
|
91
|
+
import pandas as pd
|
92
|
+
|
93
|
+
_qubits = {}
|
94
|
+
|
95
|
+
qubit_pad = read_xlsx_to_dict(qubit_info, value_col=4)
|
96
|
+
coupler_pad = read_xlsx_to_dict(coupler_info, value_col=3)
|
97
|
+
pads = {
|
98
|
+
v: k
|
99
|
+
for k, v in qubit_pad.items()
|
100
|
+
} | {
|
101
|
+
v: k
|
102
|
+
for k, v in coupler_pad.items()
|
103
|
+
}
|
104
|
+
pad_info = read_xlsx_to_dict(pad_info, value_col=2)
|
105
|
+
|
106
|
+
lyt = {'qubits': {}, 'couplers': {}, 'feedlines': {}}
|
107
|
+
|
108
|
+
for pad, script in pad_info.items():
|
109
|
+
info = eval(script)
|
110
|
+
match info['style']:
|
111
|
+
case 'Q':
|
112
|
+
qubit = pads[pad]
|
113
|
+
lyt['qubits'][qubit] = {'pos': info['qb'], 'pad': pad}
|
114
|
+
_qubits[info['qb']] = qubit
|
115
|
+
case 'C':
|
116
|
+
coupler = pads[pad]
|
117
|
+
if 'cpl' in info:
|
118
|
+
pos = tuple(info['cpl'])
|
119
|
+
else:
|
120
|
+
pos = tuple(info['qb'])
|
121
|
+
lyt['couplers'][coupler] = {'qubits': pos, 'pad': pad}
|
122
|
+
case 'TL':
|
123
|
+
l = info['tl']
|
124
|
+
if f"T{l}" in lyt['feedlines']:
|
125
|
+
lyt['feedlines'][f"T{l}"]['pads'].append(pad)
|
126
|
+
else:
|
127
|
+
lyt['feedlines'][f"T{l}"] = {'pads': [pad]}
|
128
|
+
|
129
|
+
for coupler in lyt['couplers']:
|
130
|
+
qubits = lyt['couplers'][coupler]['qubits']
|
131
|
+
lyt['couplers'][coupler]['qubits'] = [_qubits[p] for p in qubits]
|
132
|
+
|
133
|
+
return complete_layout(lyt)
|
134
|
+
|
135
|
+
|
57
136
|
def get_shared_coupler(layout, q1, q2):
|
58
137
|
for c in layout['qubits'][q1]['couplers']:
|
59
138
|
if q2 in layout['couplers'][c]['qubits']:
|
qulab-2.11.16/qulab/version.py
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "2.11.16"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|