qcor
qcor copied to clipboard
asserts in quantum kernels
__qpu__ void hwe(qreg q, std::vector<double> x, const int layers,
std::vector<std::pair<int,int>> cnot_coupling) {
assert(x.size() == layers*q.size()*5);
...
}
we should try to support asserts like the above in quantum kernels. right now this is a compile error
<built-in>:21:154: error: use of undeclared identifier 'extension__'
( static_cast < bool > ( x . size ( ) == layers * q . size ( ) * 5 ) ? void ( 0 ) : assert_fail ( "x.size() == layers*q.size()*5" , "hwe_test.cpp" , 3 , extension__ PRETTY_FUNCTION__ ) ) ;