Skip to content

Commit

Permalink
dia_array to dia_matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
purva-thakre committed Oct 2, 2024
1 parent 11575cc commit 0d0cba4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion toqito/perms/permute_systems.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,10 @@ def permute_systems(
row_perm = permute_systems(vec_arg, perm, dim[0][:], False, inv_perm)

# This condition is only necessary if the `input_mat` variable is sparse.
if isinstance(input_mat, (sparse.csr_array, sparse.dia_array)):
if isinstance(input_mat, sparse.csr_array):
input_mat = input_mat.toarray()
elif isinstance(input_mat, sparse.dia_matrix):
input_mat = input_mat.tocsr()
permuted_mat = input_mat[row_perm, :]
permuted_mat = np.array(permuted_mat)
else:
Expand Down

0 comments on commit 0d0cba4

Please sign in to comment.