From f7afbec5fe857e3584b9357fba9cf4a46cde8891 Mon Sep 17 00:00:00 2001 From: Stavros <35475381+stavros11@users.noreply.github.com> Date: Mon, 28 Mar 2022 17:09:44 +0400 Subject: [PATCH] Change .ravel() to .flatten() for gates --- src/qibojit/custom_operators/platforms.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qibojit/custom_operators/platforms.py b/src/qibojit/custom_operators/platforms.py index 09684321..060e7d0b 100644 --- a/src/qibojit/custom_operators/platforms.py +++ b/src/qibojit/custom_operators/platforms.py @@ -334,7 +334,7 @@ def one_qubit_base(self, state, nqubits, target, kernel, gate, qubits=None): if kernel in ("apply_x", "apply_y", "apply_z"): args = (state, tk, m) else: - args = (state, tk, m, self.cast(gate, dtype=state.dtype).ravel()) + args = (state, tk, m, self.cast(gate, dtype=state.dtype).flatten()) ktype = self.get_kernel_type(state) if ncontrols: @@ -366,7 +366,7 @@ def two_qubit_base(self, state, nqubits, target1, target2, kernel, gate, qubits= if kernel == "apply_swap": args = (state, tk1, tk2, m1, m2, uk1, uk2) else: - args = (state, tk1, tk2, m1, m2, uk1, uk2, self.cast(gate).ravel()) + args = (state, tk1, tk2, m1, m2, uk1, uk2, self.cast(gate).flatten()) assert state.dtype == args[-1].dtype ktype = self.get_kernel_type(state) @@ -384,7 +384,7 @@ def two_qubit_base(self, state, nqubits, target1, target2, kernel, gate, qubits= def multi_qubit_base(self, state, nqubits, targets, gate, qubits=None): assert gate is not None state = self.cast(state) - gate = self.cast(gate.ravel()) + gate = self.cast(gate.flatten()) assert state.dtype == gate.dtype ntargets = len(targets)