-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgen_device_pool.py
More file actions
28 lines (21 loc) · 846 Bytes
/
gen_device_pool.py
File metadata and controls
28 lines (21 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from defective_surface_code_adapter import Device
import os
ds = [15, 21, 27]
drs = [0.005, 0.01, 0.015, 0.02]
for d in ds:
for dr in drs:
destination_dir = f'manuscript_data/defective_devices/qubit_equal_coupler/device_d{d}_qdr{dr}_cdr{dr}/devices'
# Create destination directory if it does not exist
if not os.path.exists(destination_dir):
os.makedirs(destination_dir)
# Parameters for generating devices
width = d
height = d
qubit_defect_rate = dr
coupler_defect_rate = dr
device_count = 100
# Generate devices
device = Device(width, height)
for i in range(device_count):
device.add_random_defect(qubit_defect_rate, coupler_defect_rate)
device.save(f'{destination_dir}/device_{device.strong_id}.pkl')