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 * h
meansg AFTER h
. I suggest keeping an operator for composing in diagram order, but changing it from from+
to>>
. - change
auto_detect_inputs
toauto_detect_io
. I find current name confusing, because it does both.
- There is also a
+
operator forCircuit
s, where it does exactly what you would expect in Python: append the lists of gates to one another. So we could remove+
forGraph
s, but then there is an additional syntax thing you have to remember, or we could remove+
forCircuit
s and replace it by>>
, which I find slightly less natural (although it does have precedence in C++). - I agree that
inputs
is a bit confusing, but I don't really likeauto_detect_io
, what aboutauto_detect_boundaries
?