Skip to content

Commit

Permalink
Extend unvec() to accept 1d arrays too
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Harrigan committed Jan 10, 2019
1 parent b4ee278 commit a65c671
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions forest_qcvv/superop_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def unvec(vector):
:param vector: A N^2 x 1 numpy array.
:return: Returns a column vector with N x N rows.
"""
row, col = vector.shape
dim = int(np.sqrt(row))
n_row = vector.shape[0]
dim = int(np.sqrt(n_row))
matrix = vector.reshape(dim, dim).T
return matrix

Expand Down

0 comments on commit a65c671

Please sign in to comment.