Skip to content

Incorrect program generated when iteratively updating a variable which was initialized with a Python value #15

@rmshaffer

Description

@rmshaffer

Example which currently does not produce a correct program:

@aq.main(num_qubits=3)
def main():
    val = 0.5
    for i in aq.range(3):
        val = val + measure(i)
    return val

Either need to handle this correctly, or raise an appropriate exception with instructions on how to fix it.

This issue is extracted from amazon-braket/amazon-braket-sdk-python#929, since it was not fixed by the corresponding PR amazon-braket/amazon-braket-sdk-python#930.

A possible starting point for detecting/fixing this can be found on this branch:
amazon-braket/amazon-braket-sdk-python@feature/autoqasm...rmshaffer/autoqasm-py-value-iterative-assignment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions