zxcalc / pyzx

Python library for quantum circuit rewriting and optimisation using the ZX-calculus
Apache License 2.0
387 stars 116 forks source link

Turn VertexType and EdgeType into enums #240

Closed boldar99 closed 5 months ago

boldar99 commented 5 months ago

VertexType and EdgeType were implemented as data classes with hard-coded types. A better solution for implementing these classes is using Enums.

Changes:

jvdwetering commented 5 months ago

Are you sure you got all the cases where this has to be updated? Did you do some kind of automated search?

boldar99 commented 5 months ago

I used PyCharm's automated search and replace to deal with EdgeType.Type and VertexType.Type. Now I double-checked it with grep as well which had no matches, so it seems good.