# Check if we're in IPython. try: __IPYTHON__ qutip.settings.ipython = True except: qutip.settings.ipython = False # ----------------------------------------------------------------------------- # Check for minimum requirements of dependencies, give the user a warning # if the requirements aren't fulfilled # numpy_requirement = "1.8.0" try: import numpy if _version2int(numpy.__version__) < _version2int(numpy_requirement): print("QuTiP warning: old version of numpy detected " + ("(%s), requiring %s." % (numpy.__version__, numpy_requirement))) except: warnings.warn("numpy not found.") scipy_requirement = "0.15.0" try: import scipy if _version2int(scipy.__version__) < _version2int(scipy_requirement): print("QuTiP warning: old version of scipy detected " + ("(%s), requiring %s." % (scipy.__version__, scipy_requirement))) except: warnings.warn("scipy not found.") # -----------------------------------------------------------------------------
from qutip import (mat2vec, tensor, identity, operator_to_vector) import qutip.settings as settings from qutip.utilities import _version2int from qutip.cy.spconvert import dense2D_to_fastcsr_fmode import qutip.logging_utils logger = qutip.logging_utils.get_logger() logger.setLevel('DEBUG') # Load MKL spsolve if avaiable if settings.has_mkl: from qutip._mkl.spsolve import (mkl_splu, mkl_spsolve) # test if scipy is recent enought to get L & U factors from superLU _scipy_check = _version2int(scipy.__version__) >= _version2int('0.14.0') def _empty_info_dict(): def_info = { 'perm': [], 'solution_time': None, 'residual_norm': None, 'solver': None, 'method': None } return def_info def _default_steadystate_args():
from qutip.graph import reverse_cuthill_mckee, weighted_bipartite_matching from qutip import (mat2vec, tensor, identity, operator_to_vector) import qutip.settings as settings from qutip.utilities import _version2int from qutip.cy.spconvert import dense2D_to_fastcsr_fmode import qutip.logging_utils logger = qutip.logging_utils.get_logger() logger.setLevel('DEBUG') # Load MKL spsolve if avaiable if settings.has_mkl: from qutip._mkl.spsolve import (mkl_splu, mkl_spsolve) # test if scipy is recent enought to get L & U factors from superLU _scipy_check = _version2int(scipy.__version__) >= _version2int('0.14.0') def _empty_info_dict(): def_info = {'perm': [], 'solution_time': None, 'residual_norm': None, 'solver': None, 'method': None} return def_info def _default_steadystate_args(): def_args = {'sparse': True, 'use_rcm': False, 'use_wbm': False, 'weight': None, 'use_precond': False, 'all_states': False, 'M': None, 'x0': None, 'drop_tol': 1e-4, 'fill_factor': 100, 'diag_pivot_thresh': None, 'maxiter': 1000,
import sys import platform import qutip.settings import qutip.version from qutip.version import version as __version__ from qutip.utilities import _version2int # ----------------------------------------------------------------------------- # Check for minimum requirements of dependencies, give the user a warning # if the requirements aren't fulfilled # numpy_requirement = "1.6.0" try: import numpy if _version2int(numpy.__version__) < _version2int(numpy_requirement): print("QuTiP warning: old version of numpy detected " + ("(%s), requiring %s." % (numpy.__version__, numpy_requirement))) except: print("QuTiP warning: numpy not found.") scipy_requirement = "0.11.0" try: import scipy if _version2int(scipy.__version__) < _version2int(scipy_requirement): print("QuTiP warning: old version of scipy detected " + ("(%s), requiring %s." % (scipy.__version__, scipy_requirement))) except: print("QuTiP warning: scipy not found.")
# The combination of scipy<1.5 and MKL causes wrong results when calling # eigh for big matrices. See #1495, #1491 and #1498. or (is_old_scipy and (_blas_info() == 'INTEL MKL'))) del platform, _blas_info, scipy, pac_version, is_old_scipy # ----------------------------------------------------------------------------- # setup the cython environment # try: import Cython as _Cython except ImportError: pass else: from qutip.utilities import _version2int _cy_require = "0.29.20" if _version2int(_Cython.__version__) < _version2int(_cy_require): warnings.warn( "Old version of Cython detected: needed {}, got {}.".format( _cy_require, _Cython.__version__)) # Setup pyximport import qutip.cy.pyxbuilder as _pyxbuilder _pyxbuilder.install() del _pyxbuilder, _Cython, _version2int # ----------------------------------------------------------------------------- # cpu/process configuration # from qutip.utilities import available_cpu_count # Check if environ flag for qutip processes is set if 'QUTIP_NUM_PROCESSES' in os.environ: