Statevector drawer - state_to_latex
's max_size parameter cause unintended rounding
#9297
Labels
bug
Something isn't working
Environment
What is happening?
When I try to render the following state -
using
sv.draw('latex', max_size=5)
I get the following latext output with the coefficient round to 5 decimal point.
The arg
max_size=5
should only affect "Maximum number of non-zero terms in the expression", but also affects "Number of decimal places to round to".How can we reproduce the issue?
Code to reproduce the issue -
What should happen?
Expected output should be like this :
Any suggestions?
In
state_visualization.py
, inside function_state_to_latex_ket
, at line 1330、1336、1339.When calling
np.around()
andnumbers_to_latex_terms()
, shouldn't usemax_size
as an argument to the parameterdecimals
.https://github.com/Qiskit/qiskit-terra/blob/dd7f9390cf076f9545fa6086de486f2c06764ea5/qiskit/visualization/state_visualization.py#L1330-L1339
The text was updated successfully, but these errors were encountered: