Skip to content

Commit

Permalink
Merge pull request #41 from CassiusThalles/master
Browse files Browse the repository at this point in the history
Refactor send_vector to use load_numpy_array
  • Loading branch information
gustavowl committed May 20, 2024
2 parents 6f97d9b + f907a38 commit 18b091d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hiperwalk/quantum_walk/_pyneblina_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,15 @@ def send_vector(v):
#
# vec = (neblina.vector_new(n, neblina.COMPLEX)
# if is_complex else neblina.vector_new(n, neblina.FLOAT))
vec = neblina.vector_new(n, neblina.COMPLEX)
# TODO: check if line below and the previou comment are still needed
# vec = neblina.vector_new(n, neblina.COMPLEX)

try:
# TODO: Pyneblina needs to accept 3 only arguments
# instead of 4?
# TODO: check if neblina.vector_set is idetifying
# the vector type right (i.e. real and not complex)
for i in range(n):
neblina.vector_set(vec, i, v[i].real, v[i].imag)
vec = neblina.load_numpy_array(v)
except AttributeError:
print("Error: vector entries must have real and imaginary parts.")
except TypeError:
Expand Down

0 comments on commit 18b091d

Please sign in to comment.