Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make interactive visualizations default for Jupyter #806

Closed
ajavadia opened this issue Aug 21, 2018 · 3 comments · Fixed by #862
Closed

Make interactive visualizations default for Jupyter #806

ajavadia opened this issue Aug 21, 2018 · 3 comments · Fixed by #862
Assignees
Labels
type: enhancement It's working, but needs polishing

Comments

@ajavadia
Copy link
Member

ajavadia commented Aug 21, 2018

What is the expected enhancement?

The interactive visualizations contributed in PR #765 are much better than the static ones, and should be default when the environment is a Jupyter notebook. This is related to Epic #707 for providing better jupyter tools.

Several issues must be solved first:

  • These visualizations need internet connection. Can we eliminate that?
  • The interface of the static and interactive visualizations are all the same, except for plot_histogram vs iplot_histogram. These should be made similar for consistency. But the interactive visualization is able to plot multiple histograms in one plot.
  • How "heavy" is it to run these interactive visualizations? I hear my laptop fan.
@delapuente delapuente added the type: enhancement It's working, but needs polishing label Aug 22, 2018
@filemaster
Copy link
Contributor

  1. Commented on Interactive visualizations require internet connection #805, the visual library must be online due Jupyter limitations.
  2. All visualizations (except histogram) are working in the same way than the static visualizations.
  3. Next week a new version of the JS library will be released (it will require less CPU/GPU usage).

@nonhermitian
Copy link
Contributor

I am closing this Issue as it seems there is no way to run the interactive visualizations offline, thus making it impossible to have them as default.

@ajavadia
Copy link
Member Author

ajavadia commented Sep 5, 2018

Reopening this to rethink for 0.6 release:

  1. Can we default to interactive visualizations if the environment is Jupyter AND there is internet connection?
  2. We have to rework the static histogram plot to show multiple histograms in one graph. This way we can make its signature consistent with the interactive one.

@ajavadia ajavadia reopened this Sep 5, 2018
mtreinish added a commit to mtreinish/qiskit-core that referenced this issue Sep 5, 2018
This commit switches the default graphing method to use the interactive
plot_state method if the environment conditions support it. There are 2
conditions when iplot_state can be used, the first is that things are
running inside jupyter, the second is that the environment has an
internet connection and can reach the js source needed for the
visualization. This will verify these 2 conditions by checking if the
ipykernel module is present and they trying to do an HTTP GET on
the url where the page is hosted to verify the plot function can do the
same.

The requests library is used directly to perform the HTTP GET call so it
is added to the requirements.txt file in this commit. However this was
already an implicit requirement for qiskit-terra because it's what the
IBMQuantumExperience package uses for its HTTP client. This only adds it
to the requirements file because it is now directly called.

Fixes Qiskit#806
ajavadia pushed a commit that referenced this issue Sep 5, 2018
This commit switches the default graphing method to use the interactive
plot_state method if the environment conditions support it. There are 2
conditions when iplot_state can be used, the first is that things are
running inside jupyter, the second is that the environment has an
internet connection and can reach the js source needed for the
visualization. This will verify these 2 conditions by checking if the
ipykernel module is present and they trying to do an HTTP GET on
the url where the page is hosted to verify the plot function can do the
same.

The requests library is used directly to perform the HTTP GET call so it
is added to the requirements.txt file in this commit. However this was
already an implicit requirement for qiskit-terra because it's what the
IBMQuantumExperience package uses for its HTTP client. This only adds it
to the requirements file because it is now directly called.

Fixes #806
lia-approves pushed a commit to edasgupta/qiskit-terra that referenced this issue Jul 30, 2019
This commit switches the default graphing method to use the interactive
plot_state method if the environment conditions support it. There are 2
conditions when iplot_state can be used, the first is that things are
running inside jupyter, the second is that the environment has an
internet connection and can reach the js source needed for the
visualization. This will verify these 2 conditions by checking if the
ipykernel module is present and they trying to do an HTTP GET on
the url where the page is hosted to verify the plot function can do the
same.

The requests library is used directly to perform the HTTP GET call so it
is added to the requirements.txt file in this commit. However this was
already an implicit requirement for qiskit-terra because it's what the
IBMQuantumExperience package uses for its HTTP client. This only adds it
to the requirements file because it is now directly called.

Fixes Qiskit#806
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement It's working, but needs polishing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants