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

Add about() function #51

Open
quantshah opened this issue Jun 1, 2021 · 6 comments · May be fixed by qutip/qutip#1870
Open

Add about() function #51

quantshah opened this issue Jun 1, 2021 · 6 comments · May be fixed by qutip/qutip#1870
Labels
good first issue Good for newcomers

Comments

@quantshah
Copy link
Member

Since we are branching out and making qutip_qip a separate library, it might be beneficial to have something like qutip.about for qip. The about() function could list out the QuTiP version that the code is run with and help in debugging in the future.

Here is how the about function in QuTiP is written:

"""
Command line output of information on QuTiP and dependencies.
"""
__all__ = ['about']

import sys
import os
import platform
import numpy
import scipy
import inspect
from qutip.utilities import _blas_info
import qutip.settings
from qutip.hardware_info import hardware_info


def about():
    """
    About box for QuTiP. Gives version numbers for QuTiP, NumPy, SciPy, Cython,
    and MatPlotLib.
    """
    print("")
    print("QuTiP: Quantum Toolbox in Python")
    print("================================")
    print("Copyright (c) QuTiP team 2011 and later.")
    print(
        "Current admin team: Alexander Pitchford, "
        "Nathan Shammah, Shahnawaz Ahmed, Neill Lambert, Eric Giguère, "
        "Boxi Li, Jake Lishman and Simon Cross."
    )
    print(
        "Board members: Daniel Burgarth, Robert Johansson, Anton F. Kockum, "
        "Franco Nori and Will Zeng."
    )
    print("Original developers: R. J. Johansson & P. D. Nation.")
    print("Previous lead developers: Chris Granade & A. Grimsmo.")
    print("Currently developed through wide collaboration. "
          "See https://github.com/qutip for details.")
    print("")
    print("QuTiP Version:      %s" % qutip.__version__)
    print("Numpy Version:      %s" % numpy.__version__)
    print("Scipy Version:      %s" % scipy.__version__)
    try:
        import Cython
        cython_ver = Cython.__version__
    except ImportError:
        cython_ver = 'None'
    print("Cython Version:     %s" % cython_ver)
    try:
        import matplotlib
        matplotlib_ver = matplotlib.__version__
    except ImportError:
        matplotlib_ver = 'None'
    print("Matplotlib Version: %s" % matplotlib_ver)
    print("Python Version:     %d.%d.%d" % sys.version_info[0:3])
    print("Number of CPUs:     %s" % hardware_info()['cpus'])
    print("BLAS Info:          %s" % _blas_info())
    print("OPENMP Installed:   %s" % str(qutip.settings.has_openmp))
    print("INTEL MKL Ext:      %s" % str(qutip.settings.has_mkl))
    print("Platform Info:      %s (%s)" % (platform.system(),
                                           platform.machine()))
    qutip_install_path = os.path.dirname(inspect.getsourcefile(qutip))
    print("Installation path:  %s" % qutip_install_path)

    # citation
    longbar = "=" * 80
    cite_msg = "For your convenience a bibtex reference can be easily"
    cite_msg += " generated using `qutip.cite()`"
    print(longbar)
    print("Please cite QuTiP in your publication.")
    print(longbar)
    print(cite_msg)


if __name__ == "__main__":
    about()
@BoxiLi
Copy link
Member

BoxiLi commented Jun 1, 2021

Thanks for the suggestion @quantshah. I think for the versions we only need to keep qutip-qip, qutip, numpy, scipy, matplotlib. Maybe we can also add our preprint to the citation, replacing the qutip ones?

@BoxiLi
Copy link
Member

BoxiLi commented Jun 1, 2021

Maybe a better idea is to modify qutip.about() to include qutip-qip version if installed. And we just import that function? This can be generalized to qutip-control etc.

@paniash
Copy link

paniash commented Jun 10, 2021

Hi! Can I take up this issue?

@BoxiLi
Copy link
Member

BoxiLi commented Jun 10, 2021

@paniash Sure, thanks! How do would you like to proceed?

@BoxiLi BoxiLi added the good first issue Good for newcomers label Mar 26, 2022
@claretgrace0801
Copy link
Contributor

claretgrace0801 commented Apr 15, 2022

Hey @BoxiLi @quantshah , I'm interested in contributing to QuTiP and doing a project for GSoC '22
I would like to take up this issue.

Approach:
Add a caller argument to qutip's about function (defaulting to "qutip"). Modify qutip.about to handle the case when caller is "qutip_qip" (qutip_qip.about()). This can also be generalised to other qutip libraries.

@Anika-Roy
Copy link

Hello! is this still open?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants