-
Notifications
You must be signed in to change notification settings - Fork 616
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BugFix]
KeyError
when running QNode(qfun, dev)(graph)
with graph…
… 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]>
- Loading branch information
1 parent
c9af833
commit eb37a95
Showing
4 changed files
with
52 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters