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.
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.