generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 159
Closed
Labels
good first issueGood for newcomersGood for newcomers
Description
Describe the bug
When a user defined a FreeParameter("str") where the "str" is a OpenQASM keyword. For example, it fails for b, q, bit, qubit, input, OPENQASM, 3.0. 1,2.
To reproduce
from braket.circuits import Circuit, FreeParameter
from braket.devices import LocalSimulator
b = FreeParameter("b")
circ = Circuit().rx(0,b)
print(circ)
device = LocalSimulator()
task = device.run(circ, shots=1_000, inputs={"b": 0})
task.result().measurement_countsgives the error
221 return builtin_constants[node.name]
222 if not self.context.is_initialized(node.name):
--> 223 raise NameError(f"Identifier '{node.name}' is not initialized.")
224 return self.context.get_value_by_identifier(node)
NameError: Identifier 'b' is not initialized.Expected behavior
Expected the circuit to run correctly. For example, using FreeParameter("a") works correctly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers