-
Notifications
You must be signed in to change notification settings - Fork 615
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
[BugFix] KeyError
when running QNode(qfun, dev)(graph)
with graph an instance of networkx
Graph object
#6600
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6600 +/- ##
=======================================
Coverage 99.45% 99.45%
=======================================
Files 450 450
Lines 42088 42088
=======================================
Hits 41857 41857
Misses 231 231 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks harmless enough 🤞🏻
… an instance of `networkx` Graph object (#6600) **Context:** Issue #6585 indicates that we don't currently allow arguments with types defined in libraries not listed in the supported interfaces. In #6225, the convention of treating internally as `interface=None` parameters of the `numpy` interface has been introduced. The idea of this PR is to allow non-trainable `qnode` inputs to "just work" as arguments, without any special consideration or treatment. We want to rely on the default `numpy` interface for libraries we know nothing about. **Description of the Change:** By default, we set `None` as the value of the interface if the latter is not found in the list of supported interfaces. According to the convention introduced in #6225, this should automatically map the interface to `numpy`. **Benefits:** Now the `qnode` accepts arguments with types defined in libraries that are not necessarily in the list of supported interfaces, such as the `Graph` class defined in `networkx`. **Possible Drawbacks:** None that I can think of. **Related GitHub Issues:** #6585 **Related Shortcut Stories:** [sc-78344] --------- Co-authored-by: Christina Lee <[email protected]>
Context: Issue #6585 indicates that we don't currently allow arguments with types defined in libraries not listed in the supported interfaces.
In #6225, the convention of treating internally as
interface=None
parameters of thenumpy
interface has been introduced.The idea of this PR is to allow non-trainable
qnode
inputs to "just work" as arguments, without any special consideration or treatment. We want to rely on the defaultnumpy
interface for libraries we know nothing about.Description of the Change: By default, we set
None
as the value of the interface if the latter is not found in the list of supported interfaces. According to the convention introduced in #6225, this should automatically map the interface tonumpy
.Benefits: Now the
qnode
accepts arguments with types defined in libraries that are not necessarily in the list of supported interfaces, such as theGraph
class defined innetworkx
.Possible Drawbacks: None that I can think of.
Related GitHub Issues: #6585
Related Shortcut Stories: [sc-78344]