-
Notifications
You must be signed in to change notification settings - Fork 617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Can't initialize qml.GateFabric
with wires
as kwargs.
#5521
Comments
Hi @dwierichs, just one point. If we make
still would not work, so I think the only option would be to change the argument order. If we do that, then the above line of code works fine, but for:
we get a different error:
|
Hi @PietropaoloFrisoni ,thanks for looking into this!
I agree, but I think that if we made
Yeah, the input validation is not optimal, it assumes |
While this does break pennylane convention, it doesn't actually break any code. And though a different call signature would be better, it's not worth the problems and costs that accompany a breaking change of this sort. After discussion with relevant stakeholders, we are marking this as a "wont-fix". |
Expected behavior
Like any PennyLane operation,
qml.GateFabric
should be able to initialize withwires
given as kwarg, even when not givinginit_state
as kwarg.Actual behavior
The
GateFabric
errors out, unlessinit_state
is provided as kwarg as well.edit
AllSinglesDoubles
has the same problem, withhf_state
being the offending positional argument.BasisRotation
has the same problem, withunitary_matrix
being the offending positional argument.Additional information
This error is caused by
GateFabric
allowingwires
as a positional arg but not as the last positional arg, which is a requirement for PennyLane operations.We should either change the order of the positional args or make
init_state
a kwarg.Source code
Tracebacks
System information
Existing GitHub issues
The text was updated successfully, but these errors were encountered: