Clear Filters
Clear Filters

how to plot bloch sphere

36 views (last 30 days)
Sowmya
Sowmya on 27 Mar 2023
Edited: DGM on 27 Mar 2023
There is a function plotBlochSphere and installed all the required support package. But still showing axis errors. Please help
Error using matlab.graphics.axis.Axes/set
Complex values are not supported.
Error in axis>LocSetLimits (line 293)
set(ax,...
Error in axis (line 114)
LocSetLimits(ax(j),cur_arg,names);
Error in plotBlochSphere (line 28)
axis([-limits limits -limits limits -limits limits]);
  1 Comment
DGM
DGM on 27 Mar 2023
Edited: DGM on 27 Mar 2023
Let's see.
The error message does not match the code of the plotBlochSphere() function given here
or the plotBlochSphere() function given here
It instead matches this plotBlochSphere() function
which wasn't even on the first page of search results. The variable 'limits' is being set to a complex value directly by you in your call to the function. How you're calling the function is unknown, but 'limits' needs to be a real-valued scalar.
I like how everything in that FEX submission is a function wrapped up as a livescript with no script content because someone doesn't know how to write a function synopsis. I especially like how everything being published as .mlx means that Firefox needs to eat three CPU cores for over six minutes in order for the page to render 30 lines of code.

Sign in to comment.

Answers (1)

Torsten
Torsten on 27 Mar 2023
Moved: Torsten on 27 Mar 2023
Too little information to give a helpful answer.
But apparently, you got complex results that cannot be plotted.

Categories

Find more on Quantum Mechanics in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!