question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[unitaryhack] QNodes no longer display readable info when printed

See original GitHub issue

This issue has been tagged for contributions during unitaryHACK

The QNode currently does not display useful information when printed out:

>>> qnode
<pennylane.qnode.QNode at 0x7f4e29173d00>

We should add __str__ and __repr__ methods to the class to facilitate usage and debugging.

The __str__ method needs to be easily human-readable, while the __repr__ method should be more comprehensive.

Both methods should at least convey the qnode’s:

  • diff_method
  • interface
  • device.short_name
  • device.num_wires

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
paniashcommented, May 24, 2021

@josh146 Gotcha. Thanks for the explanation! I’ll make the changes accordingly in the PR. 😃

0reactions
paniashcommented, May 28, 2021

Fixed in be3c88d.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PennyLane is a cross-platform Python library for differentiable ...
[unitaryHACK] Create a Pytorch simulator #1225 ... QNodes now display readable information when in interactive environments or when printed.
Read more >
PennyLane is a cross-platform Python library for quantum ...
PennyLane is a cross-platform Python library for differentiable programming of quantum computers. Train a quantum computer the same way as a neural network....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found