The openqasm spec references NaN values for floats, but oqpy does not support them.
To reproduce:
import math
import oqpy
from oqpy.base import to_ast
program = oqpy.Program()
float_var = to_ast(program, 1.0)
print(float_var)
float_var_nan = to_ast(program, math.nan)
print(float_var_nan)
outputs
FloatLiteral(span=None, value=1.0)
ValueError: cannot convert float NaN to integer
This should be handled, perhaps yielding FloatLiteral(span=None, value=math.nan)
The openqasm spec references NaN values for floats, but oqpy does not support them.
To reproduce:
outputs
This should be handled, perhaps yielding
FloatLiteral(span=None, value=math.nan)