Closed pafloxy closed 5 months ago
Do we validate the behaviour modification of output_nodes
in pattern.py
around line 100? I don't yet understand how it works if the output nodes are specified by the user but if it is handled by the pattern, then I fear this modification will break the code since output_nodes is built iteratively.
Do we validate the behaviour modification of
output_nodes
inpattern.py
around line 100? I don't yet understand how it works if the output nodes are specified by the user but if it is handled by the pattern, then I fear this modification will break the code since output_nodes is built iteratively.
Thanks for pointing this out. I agreed to this change in the discussion on the issues page, but I suppose you are right, breaking change like this should be avoided. More so because we don’t need this change for the parametrised patterns to work.
Do we validate the behaviour modification of
output_nodes
inpattern.py
around line 100? I don't yet understand how it works if the output nodes are specified by the user but if it is handled by the pattern, then I fear this modification will break the code since output_nodes is built iteratively.Thanks for pointing this out. I agreed to this change in the discussion on the issues page, but I suppose you are right, breaking change like this should be avoided. More so because we don’t need this change for the parametrised patterns to work.
Maybe the error pointed out by @pafloxy could be resolved by calling the add
method directly in __init__
.
@pafloxy I accidentally deleted the target branch of this PR, sorry! what should we do with this feature? I think many of the changes I asked back when we were working on this are now likely unnecessary (sorry..) and your implementation may fit very nicely in the current version of graphix? if you feel like it, please open a PR to merge into master.
Hello @shinich1 ,
Its alright, I think it would be more convenient to rewrite it with the current version of graphix which would also be more convenient. Also we were reconsidering how we use the parameterised class for yourselves among oursleves so maybe this time we will write it in a different fashion, the Parameter
class on overall might not be changed but the way it interacts with rest of graphix should be require some re-thinking based on what we decide :)
Before submitting, please check the following:
pytest
)black -l 120 <filename>
Then, please fill in below:
Context (if applicable):
Description of the change: Introduced
Parameter
class for providing symbolic placeholder for parameterised arguments in circuit (rotation-angles) / patterns (measurement-angles).It is allowed to make numerical operation on the instances of the
Parameter
class which upadates the symbolic expression inplace, however interaction between multiple instances of the class are not allowed .Numerical value can be assigned using
Parameter.bind()
methodRelated issue:
45
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.