QuTech-Delft / OpenSquirrel

A flexible (Python-based) quantum program compiler
Apache License 2.0
4 stars 1 forks source link

Type annotations at runtime #219

Closed S-Linde closed 2 months ago

S-Linde commented 2 months ago

The named_gate and named_measruement wrappers check the type annotations at runtime. This is undesirable as it is 1) Not Pythonic. 2) Dangerous, there are edge cases were type annotations can be correct by an error is raised ("opensquirrel.ir.Qubit" would be a correct typehint for an Expression, but an error will be raised.)

These checks should be removed and handled by a static type checker like mypy.