Open king-p3nguin opened 1 year ago
@king-p3nguin thank you for the issue report! Actually we've added a new class of circuits in the tests: see here, random_circuit.py, and tests now run for 10 different realisations of this. Do you think it can be generalised/improved? Please let me know what you think.
@shinich1
In that case, I think it would be better to test all the circuits that get_rand_circuit
can create instead of picking up certain circuits. It will definitely increase the time for testing, but since the pattern optimization is one of the most important features in graphix, it should not be a bad price to pay.
Also, we have starting using the hypothesis
package that is good at generating strategies and finding pathological cases. Sometimes it's a bit too much (like testing for NaN parameter values) but it can be very useful.
We'll take a closer look at the testing strategy and give you feedback!
Is your feature request related to a problem? Please describe. The use of random numbers in testing can be cited as a reason why transpiler bugs were not found until recently. A simple way to avoid this is to fix the seed value, but the best approach is to increase the number of deterministic test cases that cover various scenarios without relying on random numbers.
Describe the feature you'd like Create as many test cases as possible to cover various scenarios in
tests/test_pattern.py
andtests/test_transpiler.py
.Additional context
54
62