New issue
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
heavy_hex generator functions raises PanicException if you pass d=1 #452
Comments
The source of the problem is this line L1536 since |
Yeah, I agree there's no reason to error, I think we should just add a short circuit return of a single node graph if |
The *heavy_hex_graph and *heavy_square_graph generator functions all previously had an issue where they would panic when d=1 was passed as the input to the functions. The d=1 is just a single node, so to avoid a panic a special case is added to return a graph with a single node which avoids the panic. Fixes Qiskit#452
* Handle d=1 edge case in heavy graph functions The *heavy_hex_graph and *heavy_square_graph generator functions all previously had an issue where they would panic when d=1 was passed as the input to the functions. The d=1 is just a single node, so to avoid a panic a special case is added to return a graph with a single node which avoids the panic. Fixes #452 * Document behavior when d=1
Information
What is the current behavior?
When passed d=1 to
retworkx.generators.heavy_hex_graph
orretworkx.generators.directed_heavy_hex_graph
it raises aPanicException
(meaning there was a panic in rust):with
RUST_BACKTRACE=full
setWhat is the expected behavior?
The function either works, or raises an exception on why 1 is an invalid value for d.
Steps to reproduce the problem
The text was updated successfully, but these errors were encountered: