Skip to content

Comments

Implement Graph State#34

Merged
masa10-f merged 76 commits intomasterfrom
graphstate
Apr 24, 2025
Merged

Implement Graph State#34
masa10-f merged 76 commits intomasterfrom
graphstate

Conversation

@masa10-f
Copy link
Collaborator

@masa10-f masa10-f commented Apr 7, 2025

Before submitting, please check the following:

  • Make sure you have tests for the new code and that test passes (run pytest)
  • If applicable, add a line to the [unreleased] part of CHANGELOG.md, following keep-a-changelog.
  • Format added code by ruff
  • Type checking by mypy and pyright
  • Make sure the checks (github actions) pass.
  • Check that the docs compile without errors (run make html in ./docs/ - you may need to install dependency for sphinx docs, see docs/requirements.txt.)

Then, please fill in below:

Description of the change:

Implement GraphState, which provides an interface to design graph state and measurement in MBQC.

Close #33

@masa10-f masa10-f self-assigned this Apr 7, 2025
@masa10-f masa10-f added the enhancement New feature or request label Apr 7, 2025
@masa10-f masa10-f mentioned this pull request Apr 7, 2025
@masa10-f masa10-f requested a review from Copilot April 8, 2025 12:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.

Files not reviewed (2)
  • docs/source/graphstate.rst: Language not supported
  • docs/source/references.rst: Language not supported
Comments suppressed due to low confidence (1)

tests/test_graphstate.py:44

  • Consider using a more specific exception type (e.g., ValueError) when testing for duplicate nodes to maintain consistency with similar error cases in the file.
with pytest.raises(Exception, match="Node already exists"):

@masa10-f masa10-f requested a review from nabe98 April 8, 2025 12:17
@masa10-f
Copy link
Collaborator Author

masa10-f commented Apr 8, 2025

@nabe98 I have slightly modified the API from the mf branch, so please comment on this PR if any. I will implement visualizer and improve append method later.

@masa10-f
Copy link
Collaborator Author

memo: I'll add some examples of graph operation (graph edit and graph composition)

memo: I'll add this when the visualizer is implemented

@masa10-f masa10-f requested a review from EarlMilktea April 20, 2025 11:13
Copy link
Collaborator Author

@masa10-f masa10-f left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

memo: Local Cliffords can be removed from pattern layer if I properly design canonical form of graphstate.

Copy link
Collaborator

@nabe98 nabe98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@masa10-f
There's one point I'm concerned about. Can you take a look and make any necessary adjustments?

@masa10-f
Copy link
Collaborator Author

I also replaced MappingProxyType with .copy() method.

Copy link
Collaborator

@EarlMilktea EarlMilktea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

@masa10-f masa10-f merged commit 8d6f175 into master Apr 24, 2025
21 checks passed
@masa10-f masa10-f deleted the graphstate branch April 24, 2025 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reconsider q_index attribute

3 participants