pyzx
pyzx copied to clipboard
proposed Graph API changes
Two proposed changes to the API. (We can keep the old methods as aliases, but deprecate them if you like.)
- I've recently overloaded
*to compose diagrams in fomula-order. I.e.g * hmeansg AFTER h. I suggest keeping an operator for composing in diagram order, but changing it from from+to>>. - change
auto_detect_inputstoauto_detect_io. I find current name confusing, because it does both.
- There is also a
+operator forCircuits, where it does exactly what you would expect in Python: append the lists of gates to one another. So we could remove+forGraphs, but then there is an additional syntax thing you have to remember, or we could remove+forCircuits and replace it by>>, which I find slightly less natural (although it does have precedence in C++). - I agree that
inputsis a bit confusing, but I don't really likeauto_detect_io, what aboutauto_detect_boundaries?