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.

Ket convention statevector drawer ignores max_size

See original GitHub issue

Environment

  • Qiskit Terra version: 0.34.0
  • Python version: 3.9.8
  • Operating system: OSX

What is happening?

Currently, Statevector.draw('latex') ignores the max_size parameter.

How can we reproduce the issue?

from qiskit.quantum_info import Statevector
from qiskit.visualization.state_visualization import state_drawer

sv = Statevector.from_label('++++')
state_drawer(sv, 'latex', max_size=3)
Screenshot 2022-01-11 at 12 41 42

We get 12 terms, but I expect to get 3.

What should happen?

The drawer should change its behaviour according to the max_size parameter.

Any suggestions?

I think adding **args to this line might do it. https://github.com/Qiskit/qiskit-terra/blob/5ea6e9557655b144228c29d7099375f5d2c91120/qiskit/visualization/state_visualization.py#L1183

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
frankharkinscommented, Jun 7, 2022

Sorry I completely forgot about this, I’ll have a look this week

1reaction
IFWorkcommented, Jun 7, 2022

Oh and in case it isn’t the same bug in the code, the same issue occurs with .draw(output=“latex_source”)

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get all entries of an array via array to latex, in Qiskit ...
Looks like the ket convention drawer is ignoring max size, I've added a bug report for this (#7516). Once fixed, I think you...
Read more >
XDE User Guide - Bitsavers.org
On a 6085 keyboard, the CASE key has the same function as KEYBOARD-L on a 8010 ... recognize the Iv switch, which causes...
Read more >
FYSS5120 Efficient Numerical Programming Vesa Apaja ...
The option -O turns on basic optimization, sets __debug__ to false and also ignores all assert statements. However, it's a bit.
Read more >
Communications and Multimedia Security - Springer Link
Computer Congress and at open conferences are published as conference ... thentication exchange, public-key certificates and the certification hierarchy.
Read more >
Lecture Notes In Electrical Engineering 365 | Elizabeth Irenne ...
The primary objective of this book is to provide references for dissemination and discussion of the topics that have been presented in the...
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