https://github.com/epiqc/ScaffCC
Raw File
Tip revision: 4d7bfa034cfaea4e8346396c6198cdd3e271d272 authored by Andrew Litteken on 23 April 2020, 16:55:47 UTC
Version 5 Upgrade! (#40)
Tip revision: 4d7bfa0
cat_state.n04.scaffold

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

scaff_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