Skip to content

Commit

Permalink
feat: implemented I() for cupy matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoLiegiBastonLiegi committed Feb 6, 2025
1 parent cb89902 commit ce4f083
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/qibojit/backends/matrices.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def __init__(self, dtype):

self.cp = cp

def I(self, n=2):
return self.cp.eye(n, dtype=self.dtype)

def _cast(self, x, dtype):
is_cupy = [
isinstance(item, self.cp.ndarray) for sublist in x for item in sublist
Expand Down

0 comments on commit ce4f083

Please sign in to comment.