TeamGraphix / graphix

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

Add input_nodes attribute #88

Closed d1ssk closed 1 year ago

d1ssk commented 1 year ago

Before submitting, please check the following:

Then, please fill in below:

Context (if applicable): In the current implementation, the Pattern class does not explicitly possess the attribute of input nodes. Instead, it implicitly assumes that nodes with indices ranging from 0 to (width-1) are the inputs. It is considered preferable to have input_nodes as an attribute to accommodate more general situations.

Description of the change:

Related issue:

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

Is the intention to merge this before the resource state visualisation?

d1ssk commented 1 year ago

Yes, my intention is to merge this change first, then make a minor update to the resource state visualisation and after that, merge the visualization.

masa10-f commented 1 year ago

@d1ssk The code looks good! Could you add a test for the 'leave_input' option of 'perform_pauli_measurements' into 'test_pattern.py' to automatically verify the new option functions correctly?

shinich1 commented 1 year ago

@d1ssk please squash and merge, with commit message add input_nodes attribute to pattern class (#88)