Closed DevelopDaily closed 4 years ago
Here is a test case (a slightly modified example code shipped with the staq).
staq
The Verilog file toffoli_4.v
toffoli_4.v
module top ( a, b, c, d, e ); input a, b, c, d; output e; wire subprod1, subprod2; assign subprod1 = a & b; assign subprod2 = c & d; assign e = subprod1 & subprod2; endmodule
The QASM file oracle_example.qasm
oracle_example.qasm
OPENQASM 2.0; include "qelib1.inc"; oracle tof4 a,b,c,d,e { "toffoli_4.v" } qreg q[5]; tof4 q[1],q[1],q[2],q[3],q[4];
Now run this. It will hang.
./staq -S -m -d tokyo -f resources oracle_example.qasm
Note that I deliberately introduced the typo q[1],q[1]. When that happens, would it be better for staqto throw an exception or something, instead of hanging?
q[1],q[1]
Thanks for the bug report! I just pushed a fix. staq should now identify these errors in the semantic analysis phase and throw an exception.
Here is a test case (a slightly modified example code shipped with the
staq
).The Verilog file
toffoli_4.v
The QASM file
oracle_example.qasm
Now run this. It will hang.
./staq -S -m -d tokyo -f resources oracle_example.qasm
Note that I deliberately introduced the typo
q[1],q[1]
. When that happens, would it be better forstaq
to throw an exception or something, instead of hanging?