I installed a matlab support package, how do I use the functions in it?

12 views (last 30 days)
I wanted to make a plot of a quantum state represented on a Bloch sphere. Upon googling this, I found the introduction to quantum computing page, which has a function that does that, but says I need to install the MATLAB Support Package for Quantum Computing. Great, I installed it, and it shows up as an installed package:
matlabshared.supportpkg.getInstalled
Name Version Base Product
-------------------------------------------- ------- ------------
MATLAB Support Package for Quantum Computing 23.2.2
And then I try the command that was described in the introduction, but it is still an unrecognized function.
plotBlochSphere([1; 0])
Unrecognized function or variable 'plotBlochSphere'.
So I read the page about how to get and manage Add-ons. And it doesn't say anything about what I need to do to run the functions in the package I've just added. So I read the page about importing functions, but I don't know the code name for the MATLAB Support Package for Quantum Computing. It is obviously not that thing with all the spaces. And I'm not really sure that page even applies to this package?
Can you please tell me what I need to do to use this package I just installed? And may I gently suggest to anybody who does the (generally fabulous) support documentation for MATLAB that this information could go in one of the four matlab pages linked above?
  1 Comment
Emily
Emily on 17 Jan 2024
By the way, the text of the function is at the bottom of the the introduction to quantum computing page, so I am able to use the function just by including it as a function in my script. But I'd still like to understand how to make use of this package I installed. :)

Sign in to comment.

Accepted Answer

Cris LaPierre
Cris LaPierre on 17 Jan 2024
It would appear the plotBlochSphere is not a function included in the support package. It is a helper function created for some of the examples on the doc page. Therefore, in order to run it, you will need to create a local copy of the helper function(s).

More Answers (0)

Categories

Find more on Quantum Computing in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!