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

Fix alias bug #14

Merged
merged 1 commit into from
Oct 15, 2024
Merged

Fix alias bug #14

merged 1 commit into from
Oct 15, 2024

Conversation

TheGupta2012
Copy link
Member

Summary of changes

  • Aliased bits can be used in combination with global qubits. Eg -
    OPENQASM 3;
    include "stdgates.inc";
    qubit[4] q;
    bit[4] c;

    let alias = q[0:2];

    h q;
    measure q -> c;

    if(c[1] == 1){
        cx alias[1], q[2];
    }
  • The semantic check currently raises the error -
pyqasm.exceptions.ValidationError: Missing register declaration for q in operation QuantumGate ...
  • Reason is that while getting the bits of cx alias[1], q[2]; we force alias replacement for all bits. This is an incorrect assumption as q[2] is a not an aliased bit.

@TheGupta2012 TheGupta2012 merged commit ddbb16e into main Oct 15, 2024
5 checks passed
@TheGupta2012 TheGupta2012 deleted the fix-alias-bug branch October 18, 2024 07:00
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

Successfully merging this pull request may close these issues.

1 participant