Skip to content

Commit

Permalink
flatten vector
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoRenaud committed Nov 21, 2023
1 parent 64e65e8 commit cb921f0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vqls_prototype/solver/vqls.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ def construct_circuit( # pylint: disable=too-many-branches
# ensure the vector is double
vector = vector.astype("float64")

if vector.ndim == 2:
vector = vector.flatten()

# create the circuit
nqbit = int(np.log2(len(vector)))
self.vector_circuit = QuantumCircuit(nqbit, name="Ub")
Expand Down

0 comments on commit cb921f0

Please sign in to comment.