Skip to content

Add 'about' function giving information on local installation.#1840

Closed
nonhermitian wants to merge 1 commit into
Qiskit:masterfrom
nonhermitian:about
Closed

Add 'about' function giving information on local installation.#1840
nonhermitian wants to merge 1 commit into
Qiskit:masterfrom
nonhermitian:about

Conversation

@nonhermitian
Copy link
Copy Markdown
Contributor

Summary

Gives information about local install:

Qiskit Details
==============
Package         Version Number
------------------------------
Qiskit-terra:       0.8.0
Numpy:              1.15.4
Scipy:              1.2.0
Networkx:           2.2
Python:             3.7.2

Available Providers
-------------------
builtinsimulators   
aer                 0.1.1
ibmq                0.1rc2

Additional Information
----------------------
Memory:             16.0 GB [30 qubits]
Number of CPUs:     4
Platform Info:      Darwin (x86_64)
Install path:       /Users/paul/anaconda3/lib/python3.7/site-packages/qiskit_terra-0.8.0-py3.7.egg/qiskit

Details and comments

Comment thread qiskit/_util.py
print("Install path: %s" % qiskit_install_path)


def get_available_providers():
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would only return providers that are within the qiskit.providers namespace, which currently is only BasicAer, Aer, and IBMQ i think.
For example, this 3rd party provider will not be returned?
https://github.com/Qiskit/qiskit-jku-provider

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually is a good match up with #1465 which will add a discovery mechanism for this and populate the providers off of qiskit.providers

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I am not sure how to handle providers that do not inject themselves into qiskit, but rather must be imported. One could imagine that you could look for all packages with instances of BaseProvider in them. But that seems less than ideal. There is a PR on provider registration #1465, and this could easily be modified to deal with that case when it comes.

Comment thread qiskit/_util.py
print("Qiskit-terra: %s" % qiskit.__version__)
print("Numpy: %s" % numpy.__version__)
print("Scipy: %s" % scipy.__version__)
print("Networkx: %s" % nx.__version__)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than hardcoding these, why not get them from requirements.txt?
because say we remove networkx in the future, someone then has to remember to update this.

Also, do the versions of dependencies make a difference to the user experience (assuming they meet the minimum requirement)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are not hardcoded but grabbed from the modules. These numbers are likely not the minimum values given in the requirements.txt.

If people remove packages, then of course you need to update stuff. That would be a one-line change. If I include a test, then in your situation, the test would fail telling people to remove the code in question.

So they could. What it does help is with bug reporting. It could be that new versions cause trouble, or version mismatches, and this info can be included in a bug report. Basically the "Information" section that the top of our bug reports could be replace with just the return from this function.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see what your saying. Because I do not want to list all the requirements. psutil, ply are probably not as important as the more 'core' packages above.

@jaygambetta
Copy link
Copy Markdown
Member

should this be in the mega qiskit as it should also give aer etc?

@jaygambetta
Copy link
Copy Markdown
Member

oh i see it does find aer :-)

@nonhermitian
Copy link
Copy Markdown
Contributor Author

So aer is injected as provider in qiskit.providers, as is ibmq. However in meta could have single about for all elements. May be verbose though

@mtreinish
Copy link
Copy Markdown
Member

It might be good to integrate this with qiskit.__qiskit_version__ or just call https://github.com/Qiskit/qiskit-terra/blob/master/qiskit/version.py#L20 directly which will pull in the installed package information for ignis and the metapackage version too.

@1ucian0
Copy link
Copy Markdown
Member

1ucian0 commented Apr 4, 2019

shall we try to merge this for 0.8? @nonhermitian can you keep it mergeable?

@nonhermitian
Copy link
Copy Markdown
Contributor Author

I am thinking just to close this. We can return to it if need be.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants