Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
renatomello committed Oct 31, 2024
1 parent 4a1f466 commit cc4b69e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/qibo/models/encodings.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def __init__(

basis_element = list(map(int, basis_element))

if nqubits is None:
nqubits = len(basis_element)

super().__init__(nqubits, **kwargs)
for qubit, elem in enumerate(basis_element):
if elem == 1:
Expand Down

0 comments on commit cc4b69e

Please sign in to comment.