Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classical registers are set incorrectly after being Permuted #116

Open
perlinm opened this issue Dec 17, 2024 · 0 comments
Open

Classical registers are set incorrectly after being Permuted #116

perlinm opened this issue Dec 17, 2024 · 0 comments

Comments

@perlinm
Copy link

perlinm commented Dec 17, 2024

This example:

import pecos.slr
prog = pecos.slr.Main(
    a := pecos.slr.CReg("a", size=1),
    b := pecos.slr.CReg("b", size=1),
    pecos.slr.Permute(a, b),
    a[0].set(1),
    a.set(1),
)
print(prog.qasm())

prints

...
// Permuting: b[0] -> a[0]
b[0] = 1;
a = 1;

This behavior will cause problems when using the values of classical registers that have been permuted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant