Skip to content

Commit

Permalink
Fix MultiRZ
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed Jun 5, 2024
1 parent d939bfd commit 1d614d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pennylane_qrack/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.6.5"
__version__ = "0.6.6"
8 changes: 6 additions & 2 deletions pennylane_qrack/qrack_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,21 +258,25 @@ def _apply_gate(self, op):
op = op.base
opname = op.name + ".inv"

par = op.parameters

if opname == "MultiRZ":
device_wires = self.map_wires(op.wires)
for q in device_wires:
self._state.r(Pauli.PauliZ, par[0], q)
elif opname == "C(MultiRZ)":
return

if opname == "C(MultiRZ)":
device_wires = self.map_wires(op.wires)
control_wires = self.map_wires(op.control_wires)
for q in device_wires:
self._state.mcr(Pauli.PauliZ, par[0], control_wires, q)
return

# translate op wire labels to consecutive wire labels used by the device
device_wires = self.map_wires(
(op.control_wires + op.wires) if op.control_wires else op.wires
)
par = op.parameters

if opname in [
"".join(p)
Expand Down

0 comments on commit 1d614d7

Please sign in to comment.