Skip to content

Commit b42a672

Browse files
author
Jeremiah Hauth
committed
fixed for readability
1 parent f505a20 commit b42a672

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pygsti/extras/ml/encoding.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,12 @@ def create_probability_data(circs:list,
498498
x_alpha = _np.array(alpha_values)
499499
x_px = _np.array(ideal_probabilities)
500500
if return_separate:
501-
return x_circs, x_signs, x_indices, x_alpha, x_px, y
501+
xc_reshaped = _np.zeros((x_circs.shape[0], x_circs.shape[2], x_circs.shape[1] * x_circs.shape[3]), float)
502+
for qi in range(num_qubits):
503+
for ci in range(num_channels):
504+
xc_reshaped[:, :, qi * num_channels + ci] = x_circs[:, qi, :, ci].copy()
505+
506+
return xc_reshaped, x_signs, x_indices, x_alpha, x_px, y
502507

503508
else:
504509
len_gate_encoding = num_qubits * num_channels

0 commit comments

Comments
 (0)