https://github.com/epiqc/ScaffCC
Raw File
Tip revision: 067cc59bd7a234226b81962ea78260b95061620b authored by ah744 on 01 February 2017, 21:14:46 UTC
Afree() Implemetation Complete
Tip revision: 067cc59
cat_state.n04.scaffold

module catN ( qbit *bit, const int n ) {
    H( bit[0] );
    for ( int i=1; i < n; i++ ) {
        CNOT( bit[i], bit[i-1] );
    }
}

module unCatN ( qbit *bit, const int n ) {
    for ( int i=n-1; i > 0; i-- ) {
        CNOT( bit[i], bit[i-1] );
    }
    H( bit[0] );
}

int main () {
    qbit bits[4];
    catN( bits, 4 );
    return 0;
}

back to top