TeamGraphix / graphix

measurement-based quantum computing (MBQC) compiler and simulator
https://graphix.readthedocs.io
Apache License 2.0
55 stars 20 forks source link

40 improve pattern minimize space method #41

Closed masato-fuk closed 1 year ago

masato-fuk commented 1 year ago

Before submitting, please check the following:

Then, please fill in below:

Context (if applicable):

na

Description of the change:

Reversed the dependency structure between gflow and pattern. In the original version, gflow.py dependes on the Pattern. However, gflow is purely a graph theory concept, so this structure is not preferable. An improved minimize_space method was implemented which ensures max_space equals (width+1) if a graph has flow and after the minimize_space method applied. See Pattern.get_measurement_order_from_flow() for details.

Related issue:

40

also see that checks (github actions) pass. If lint check keeps failing, try installing black==22.8.0 as behavior seems to vary across versions.

shinich1 commented 1 year ago

Should we add CHANGELOG.md in this repository to keep track of API changes? this time we are changing the way generate_from_flow() is imported and it might be good to make this kind of breaking changes listed (also add to readthedocs, c.f. https://qutip.org/docs/latest/changelog.html)

we already do this in releases https://github.com/TeamGraphix/graphix/releases/tag/v0.2.0 but it's not very visible

shinich1 commented 1 year ago

if we agree changelog.md will be useful, I will update PR template to explicitly ask contributors to add to changelog.md

masato-fuk commented 1 year ago

I totally agree with your idea. The CHANGELOG wil surely be helpful for newcomers who are following up with the graphix. By the way, where should I put the CHANGELOG.md file? Also, could you please guide me on how to add it to readthedocs?

shinich1 commented 1 year ago

@masato-fuk please squash and merge. commit message should read, e.g., flow-based pattern minimization method (#40).