Skip to content

Commit

Permalink
Fix quadrant patch circuits
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed Dec 11, 2024
1 parent f3631da commit d679128
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
2 changes: 0 additions & 2 deletions rcs/sycamore_2019_elided_quadrant.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ def bench_qrack(width, depth):
gateSequence = [ 0, 3, 2, 1, 2, 1, 0, 3 ]
one_bit_gates = [ sqrt_x, sqrt_y, sqrt_w ]

row_len, col_len = factor_width(width)

for d in range(depth):
# Single-qubit gates
if d == 0:
Expand Down
2 changes: 0 additions & 2 deletions rcs/sycamore_2019_elided_quadrant_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ def bench_qrack(width, depth):
gateSequence = [ 0, 3, 2, 1, 2, 1, 0, 3 ]
one_bit_gates = [ sqrt_x, sqrt_y, sqrt_w ]

row_len, col_len = factor_width(width)

for d in range(depth):
# Single-qubit gates
if d == 0:
Expand Down
3 changes: 0 additions & 3 deletions rcs/sycamore_2019_patch_quadrant.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ def bench_qrack(width, depth):
gateSequence = [ 0, 3, 2, 1, 2, 1, 0, 3 ]
one_bit_gates = [ sqrt_x, sqrt_y, sqrt_w ]

row_len, col_len = factor_width(width)
patch_bound = (row_len + 1) >> 1

for d in range(depth):
# Single-qubit gates
if d == 0:
Expand Down
7 changes: 4 additions & 3 deletions rcs/sycamore_2019_patch_quadrant_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ def bench_qrack(width, depth):

patch_sim = QrackSimulator(width)

patch_bound = (width + 1) >> 1
row_len, col_len = factor_width(width)
row_bound = row_len >> 1
col_bound = col_len >> 1
lcv_range = range(width)
all_bits = list(lcv_range)
last_gates = []

# Nearest-neighbor couplers:
Expand Down Expand Up @@ -98,7 +99,7 @@ def bench_qrack(width, depth):
if (b1 >= width) or (b2 >= width) or (b1 == dead_qubit) or (b2 == dead_qubit):
continue

if ((b1 < patch_bound) and (b2 >= patch_bound)) or ((b2 < patch_bound) and (b1 >= patch_bound)):
if ((row < row_bound) and (temp_row >= row_bound)) or ((temp_row < row_bound) and row >= row_bound) or ((col < col_bound) and (temp_col >= col_bound)) or ((temp_col < col_bound) and (col >= col_bound)):
continue

patch_sim.fsim(-math.pi / 2, math.pi / 6, b1, b2)
Expand Down

0 comments on commit d679128

Please sign in to comment.