hashberg-io / pauliopt

A Python library to simplify quantum circuits of phase and Pauli gadgets.
https://hashberg-io.github.io/pauliopt/
GNU Affero General Public License v3.0
13 stars 9 forks source link

Replaced the prims-Steiner tree code with networkx's steiner_tree #18

Closed Aerylia closed 1 year ago

Aerylia commented 1 year ago

Fix for issue #3 Replaced the Steiner-tree code with the built-in from networkx. The Steiner-tree is built in the Topology class, rather than in a global function in phase_circuits.py, which would make it more accessible for when issue #12 is implemented. There is now also only a single function, rather than 3 to build the tree. The weight can be obtained from the Graph and the branches should not have existed in the first place, since they caused the issue.

The old issue still persists in the PauliGadget class, but I think it's better for the PauliGadgets to be turned into a PhaseGadget and then use the code from there in stead of recreating the PhaseGadget code in the PauliGadget class. But I also expect that that should maybe be a different issue.