TeamGraphix / graphix

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

[Bug]: remove isolated nodes from pattern #36

Closed masato-fuk closed 1 year ago

masato-fuk commented 1 year ago

Describe the bug

When executing pauli measurements, Graphix removes isolated nodes from a pattern. However, the current version failed to remove them.

To Reproduce

Run 3-qubit QFT with perform_pauli_measurements() and show a graph with networkx.draw(). Then, one can see four isolated nodes, one of them is an output node.

Expected behavior

Isolated nodes, excluding outputs, should be removed from a pattern.

Environment (please complete the following information):

Additional context

na