We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
During some tests I do, CostBasedFusion::aggregate_operations crashes.
CostBasedFusion::aggregate_operations
I'm executing some randomly generated circuits, I'm not yet sure how to reproduce it, but I think I could point out to a reason and a solution.
This is the problem code:
double estimated_cost = estimate_cost(ops, (uint_t)j, i) // fusion gate from j-th to i-th, and + (j == 0 ? 0.0 : costs[j - 1 - fusion_start]); // cost of (j-1)-th
With debug, I end up with j being 2, fusion_start also 2 and costs size being 2. This results in a costs[-1], resulting in a crash.
Not crashing, obviously :)
Replace the j == 0 check with j == fusion_start.
j == 0
j == fusion_start
The text was updated successfully, but these errors were encountered:
More info:
I think this commit introduced the issue: a5e3aa2
Sorry, something went wrong.
We believe that #2075 fixes this issue.
No branches or pull requests
Informations
What is the current behavior?
During some tests I do,
CostBasedFusion::aggregate_operations
crashes.Steps to reproduce the problem
I'm executing some randomly generated circuits, I'm not yet sure how to reproduce it, but I think I could point out to a reason and a solution.
This is the problem code:
With debug, I end up with j being 2, fusion_start also 2 and costs size being 2. This results in a costs[-1], resulting in a crash.
What is the expected behavior?
Not crashing, obviously :)
Suggested solutions
Replace the
j == 0
check withj == fusion_start
.The text was updated successfully, but these errors were encountered: