Skip to content

visualization: fix Bloch vector_style line plot TypeError - #16823

Open
sundeep8967 wants to merge 2 commits into
Qiskit:mainfrom
sundeep8967:fix/bloch-simple-line-vector-style
Open

visualization: fix Bloch vector_style line plot TypeError#16823
sundeep8967 wants to merge 2 commits into
Qiskit:mainfrom
sundeep8967:fix/bloch-simple-line-vector-style

Conversation

@sundeep8967

Copy link
Copy Markdown

Summary

Fixes an issue where setting Bloch.vector_style = "" (the documented simple line style) raises TypeError: plot() for multiple values for argument 'zs' when rendering.

Details and Explanation

In qiskit/visualization/bloch.py, zs3d is passed positionally as the 3rd argument to Axes3D.plot(), and zs=0 was also passed as a keyword argument. Matplotlib explicitly forbids providing zs both positionally and by keyword.

Fix: Removed the redundant zs=0 keyword argument.

Fixes #16740

Testing

  • Added regression test test_bloch_vector_style_line in test/python/visualization/test_state_plot_tools.py.

@sundeep8967
sundeep8967 requested a review from a team as a code owner August 24, 2026 16:03
@sundeep8967
sundeep8967 requested a review from gadial August 24, 2026 16:03
@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label Aug 24, 2026
@qiskit-bot

Copy link
Copy Markdown
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the following people are relevant to this code:

@CLAassistant

CLAassistant commented Aug 24, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Community PR PRs from contributors that are not 'members' of the Qiskit repo

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Bloch.plot_vectors() raises TypeError when vector_style is set to the documented empty-string 'simple line' style

3 participants