Qiskit / rustworkx

A high performance Python graph library implemented in Rust.
https://www.rustworkx.org
Apache License 2.0
1.06k stars 146 forks source link

`minimal_cycle_basis` #1029

Open quantumjim opened 10 months ago

quantumjim commented 10 months ago

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.

mtreinish commented 10 months ago

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

gluonhiggs commented 9 months ago

@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/?
mtreinish commented 9 months ago
  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?

gluonhiggs commented 9 months ago

@mtreinish yes, sure!