Skip to content

Commit 057721c

Browse files
committed
cast
1 parent 8020ccc commit 057721c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/qibo/backends/npmatrices.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,9 +498,11 @@ def FanOut(self, *q):
498498
# based on Backend.matrix_fused method
499499
rank = len(q)
500500
matrix = self.I(2**rank)
501+
matrix = self._cast(matrix, dtype=self.dtype)
501502

502503
gmatrix = self.CNOT
503504
eye = self.I(2 ** (rank - 2))
505+
eye = self._cast(eye, dtype=self.dtype)
504506
gmatrix = self.engine.kron(gmatrix, eye)
505507
original_shape = gmatrix.shape
506508
gmatrix = self.engine.reshape(gmatrix, 2 * rank * (2,))

0 commit comments

Comments
 (0)