Skip to content

Commit

Permalink
Update pennylane_qulacs/qulacs_device.py
Browse files Browse the repository at this point in the history
Co-authored-by: Frederik Wilde <[email protected]>
  • Loading branch information
Hosseinberg and frederikwilde authored Aug 9, 2023
1 parent 52a8d7c commit cbe1632
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pennylane_qulacs/qulacs_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def _apply_controlled_qubit_unitary(self, op, inverse=False):
if len(control_wires) + len(target_wires) != len(device_wires):
raise ValueError("len(device_wire) should be equal to len(control_wires) + len(target_wires)")

if len(par[0]) != 2 ** len(target_wires):
if qml.math.shape(par) != (2 ** len(target_wires), 2 ** len(target_wires)):
raise ValueError("Unitary matrix must be of shape (2**target_wires, 2**target_wires).")

if inverse:
Expand Down

0 comments on commit cbe1632

Please sign in to comment.