Open hmillerbakewell opened 6 years ago
We could view a gate as an ordered collection of wire vertices. Four lists of wire vertices, starting in the top left and proceeding clockwise. Data would be "name" (string) then "reflection marker" (bool) then "reflection flags" (int) then arities (int, int, int, int). Should we allow user data? We may need to examine more use-cases before we include that as an option.
Reflection flags: 1st-bit: reflection top-to-bottom 2nd-bit: reflection left-to-right
Arities: Top, right, bottom, left
Some names can be reserved; creating a gate with this name will infer the (arity, style, reflection) data from the Theory.
Choosing "create a gate" on a given graph selection of wire vertices should make an intelligent guess at arity and create a gate there. "Bundle into a gate" on a graph should make an intelligent guess at arity based on the boundaries, prompt for a name, and create a bundle-unbundle rule.
The user should be able convert a graph to a gate, given a prompt for the name of the new gate. This should automatically create a rule that goes from gate-expanded to gate-as-gate. There should be a seperate directory for gates; consider having these auto-included in the rule application window for derivations.
ZXFest feature request