Closed d1ssk closed 1 year ago
Is the intention to merge this before the resource state visualisation?
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.
@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?
@d1ssk please squash and merge, with commit message add input_nodes attribute to pattern class (#88)
Before submitting, please check the following:
tox
)black -l 120 <filename>
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 haveinput_nodes
as an attribute to accommodate more general situations.Description of the change:
input_nodes
attribute to thePattern
class and theLocalPattern
classinput
attributes to theCommandNode
classinput_nodes
during various pattern generation processes (e.g., transpiling from circuits, generating from graphs).leave_inputs
option toperform_pauli_measurements()
(default: False). When set to True, input nodes will not be removed even if their measurement basis is Pauli. When set to False, indices of removed input nodes will be deleted from theinput_nodes
attribute.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.