Skip to content

Commit

Permalink
changed _variable import to public one
Browse files Browse the repository at this point in the history
  • Loading branch information
yomach committed May 12, 2024
1 parent d4761ca commit e314ddb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions qualang_tools/loops/loops.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import numpy as np
import warnings
from qm.qua import Cast
from qm.qua._dsl import _Variable
from qm.qua import Variable


def from_array(var, array):
Expand All @@ -27,7 +27,7 @@ def from_array(var, array):
elif len(array) == 1:
return var, array[0], var <= array[0], var + 1
# Check QUA vs python variables
if not isinstance(var, _Variable):
if not isinstance(var, Variable):
raise Exception("The first argument must be a QUA variable.")
if (not isinstance(array[0], (np.generic, int, float))) or (isinstance(array[0], bool)):
raise Exception("The array must be an array of python variables.")
Expand Down Expand Up @@ -145,7 +145,7 @@ def qua_arange(var, start, stop, step):
:return: QUA for_ loop parameters (var, init, cond, update) as defined in https://qm-docs.qualang.io/api_references/qua/dsl_main?highlight=for_#qm.qua._dsl.for_.
"""
# Check QUA vs python variables
if not isinstance(var, _Variable):
if not isinstance(var, Variable):
raise Exception("The first argument must be a QUA variable.")
if (
(not isinstance(start, (np.generic, int, float)))
Expand Down Expand Up @@ -186,7 +186,7 @@ def qua_linspace(var, start, stop, num):
:return: QUA for_ loop parameters (var, init, cond, update) as defined in https://qm-docs.qualang.io/api_references/qua/dsl_main?highlight=for_#qm.qua._dsl.for_.
"""
# Check QUA vs python variables
if not isinstance(var, _Variable):
if not isinstance(var, Variable):
raise Exception("The first argument must be a QUA variable.")
if (
(not isinstance(start, (np.generic, int, float)))
Expand Down Expand Up @@ -227,7 +227,7 @@ def qua_logspace(var, start, stop, num):
:return: QUA for_ loop parameters (var, init, cond, update) as defined in https://qm-docs.qualang.io/api_references/qua/dsl_main?highlight=for_#qm.qua._dsl.for_.
"""
# Check QUA vs python variables
if not isinstance(var, _Variable):
if not isinstance(var, Variable):
raise Exception("The first argument must be a QUA variable.")
if (
(not isinstance(start, (np.generic, int, float)))
Expand Down

0 comments on commit e314ddb

Please sign in to comment.