Skip to content

docs: document multigraph backend#441

Open
looooown2006 wants to merge 1 commit into
zxcalc:masterfrom
looooown2006:docs/multigraphs-440
Open

docs: document multigraph backend#441
looooown2006 wants to merge 1 commit into
zxcalc:masterfrom
looooown2006:docs/multigraphs-440

Conversation

@looooown2006

Copy link
Copy Markdown

Summary

Document the Multigraph backend in the graph guide.

This adds a new section covering:

  • how Multigraph differs from the default GraphS simple-graph backend;
  • how to create a multigraph with zx.Graph("multigraph") or Multigraph();
  • how set_auto_simplify(False) and get_auto_simplify() affect parallel-edge preservation;
  • how multigraph edges differ in the API, including edge triples and edge_set();
  • which rewrite-rule areas are specifically related to parallel edges, with caveats for rules that may not support multigraphs.

The page introduction is also adjusted so simple-graph storage is described as the default backend behavior, not a property of every PyZX graph backend.

Tests

  • git diff --check
  • uv run --isolated --with . python -
  • uv run --isolated --with '.[docs]' python -m sphinx -b html doc doc\_build\html
  • uv run --isolated --with '.[test]' --with pytest python -m pytest tests\test_jsonparser.py::TestGraphIO::test_load_multigraph_preserve_parallel_edges tests\test_tensor.py::TestTensor::test_multigraph_auto_simplify_parallel_edges tests\test_bialgebra_rule.py -q

Results:

  • docs snippet passed
  • Sphinx build passed with one existing warning about doc\simplify.rst not being included in any toctree
  • focused tests passed: 29 tests and 80 subtests

Closes #440.

@jvdwetering

Copy link
Copy Markdown
Collaborator

Hi @looooown2006 thanks for the addition.
Just in case you are bounty-hunting note that we're still waiting for Unitary Foundation to review and approve our issues, so the scope of this issue is subject to change. Therefore any work you do before June 3rd will not be considered for the hackathon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation for Multigraphs

2 participants