tequilahub / tequila

A High-Level Abstraction Framework for Quantum Algorithms
MIT License
362 stars 101 forks source link

Fix `U.export_to("path.png)"` syntax #358

Closed ohuettenhofer closed 1 month ago

ohuettenhofer commented 1 month ago

The current code does not seem to allow writing U.export_to("path.png") for me, even though it claims to, so I might be missing something. But I believe the reason for this is that named arguments are processed after unnamed arguments, so even when adding a named argument for circuit, the filename still gets interpreted as a circuit argument.

A simple solution is to explicitly pass self as the first unnamed argument. Since this is a convenience function on the circuit, I can't think of a case where you'd want to pass something other than self.

kottmanj commented 1 month ago

This has annoyed quite some people for so long -- thanks!