Adds method to list nodes on a wire#1975
Conversation
|
@maddy-tod while you are working on the file, can you rename |
|
I have also renamed |
…n added parameter to dictate if only op nodes are required
…n added parameter to dictate if only op nodes are required
497cca6 to
c123950
Compare
|
This looks good, there were some conflicts that I resolved. However during the review, I noticed that the |
|
@ajavadia That was done to allow for easier testing (there was a comment in the code about it at some stage but it must have been removed). I think this was mainly because the older version of The work @1ucian0 is doing should fix this but we could also refactor it out by having a method to return the |
* implemented a function to list the operations on a given wire * CHANGELOG * Updated function to make clear that it returns nodes not ops, and then added parameter to dictate if only op nodes are required * Updated function to make clear that it returns nodes not ops, and then added parameter to dictate if only op nodes are required * Linting! * Linting * Renamed _dagcircuit to dagcircuit * Refactoring
Summary
Fixes #1502
Adds a method
nodes_on_wire()to theDAGCircuit. This method yields all the nodes in the DAG which affect the given wire. The method takes 2 parameters -wire: the wire to be looked atonly_ops(optional) : default toFalse, ifTruethen only the op nodes are returned, otherwise all nodes on the wire are returned.This will be affected by #1815 and will be updated to return DAGNodes instead.