rustworkx icon indicating copy to clipboard operation
rustworkx copied to clipboard

`minimal_cycle_basis`

Open quantumjim opened this issue 2 years ago • 4 comments

What is the expected enhancement?

Add minimal_cycle_basis, with the same functionality as that of NetworkX.

Will be used in Qiskit QEC's ArcCircuit.

quantumjim avatar Nov 13 '23 20:11 quantumjim

For reference to anyone interested in implementing this the algorithm networkx is implementing is published here: https://link.springer.com/article/10.1007/s00453-007-9064-z

mtreinish avatar Nov 13 '23 20:11 mtreinish

@quantumjim @mtreinish I want to try this, but I want to make it clear first.

  1. Do we need to add minimal_cycle_basis module written in Rust?
  2. Should I add this to rustworkx-core/src/connectivity/?

gluonhiggs avatar Nov 23 '23 14:11 gluonhiggs

  1. Yes we need to implement an equivalent function in rust.
  2. Yes, implementing the core algorithm in rustworkx-core/src/connectivity is ideal, that would mean we could expose the functionality to any rust user. We'll still need to add a pyfunction to src/connectivity/mod.rs but that will just call rustworkx_core::connectivity::minimal_cycle_basis. You can use the existing cycle_basis function as a model for how you can implement this.

@gluonhiggs would you like me to assign this issue to you?

mtreinish avatar Nov 23 '23 14:11 mtreinish

@mtreinish yes, sure!

gluonhiggs avatar Nov 23 '23 23:11 gluonhiggs