Skip to content

Commit

Permalink
Reuse np.eye()
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed Dec 6, 2024
1 parent 4c7fecd commit 65bd996
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyqrack/qrack_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,13 +369,13 @@ def string_to_qiskit_circuit(circ_string):

payloads[key] = op

identity = np.eye(2, dtype=complex)
gate_list=[]
control_pow = 1 << control_count
for j in range(control_pow):
for j in range(1 << control_count):
if j in payloads:
gate_list.append(payloads[j])
else:
gate_list.append(np.array([[1, 0],[0, 1]]))
gate_list.append(identity)
circ.append(UCGate(gate_list), controls + [target])

return circ
Expand Down

0 comments on commit 65bd996

Please sign in to comment.