qBraid / pyqasm

Python toolkit providing OpenQASM 3 semantic analyzer and utilities for program analysis and compilation.
https://sdk.qbraid.com/projects/pyqasm
GNU General Public License v3.0
2 stars 1 forks source link

Fix alias bug #14

Closed TheGupta2012 closed 4 days ago

TheGupta2012 commented 4 days ago

Summary of changes

    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];
    }