diff --git a/.travis.yml b/.travis.yml index bbddec7cb1..ee47ac2229 100644 --- a/.travis.yml +++ b/.travis.yml @@ -243,7 +243,7 @@ jobs: - sudo apt-get -y install libgfortran5 # Installing pyquante2 master branch... - pip install https://github.com/rpmuller/pyquante2/archive/master.zip --progress-bar off - - pip install cplex + - pip install cplex pyscf before_script: - export PYTHON="coverage3 run --source qiskit/aqua,qiskit/chemistry,qiskit/finance,qiskit/ml,qiskit/optimization --omit */gauopen/* --parallel-mode" script: @@ -266,6 +266,7 @@ jobs: - sudo apt-get -y install libgfortran5 # Installing pyquante2 master branch... - pip install https://github.com/rpmuller/pyquante2/archive/master.zip --progress-bar off + - pip install pyscf script: - stestr --test-path test/chemistry run 2> >(tee /dev/stderr out.txt > /dev/null) - python tools/extract_deprecation.py -file out.txt -output chemistry38.dep diff --git a/README.md b/README.md index e9ee8b8532..46635cf87b 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ these on a quantum backend, whether a real device or simulator. * **IBM CPLEX** may be [installed](https://qiskit.org/documentation/apidoc/qiskit.aqua.algorithms.minimum_eigen_solvers.cplex.html) to allow use of the `ClassicalCPLEX` classical solver algorithm. `pip install cplex` may be used as an alternative. -* **PyTorch**, may be installed either using command `pip install qiskit-aqua[torch]` to install the +* **PyTorch**, may be installed either using command `pip install torch` to install the package or refer to PyTorch [getting started](https://pytorch.org/get-started/locally/). PyTorch being installed will enable the neural networks `PyTorchDiscriminator` component to be used with the QGAN algorithm. @@ -161,10 +161,6 @@ Several, as listed below, are supported, and while logic to interface these prog the chemistry module via the above pip installation, the dependent programs/libraries themselves need to be installed separately. -Note: As `PySCF` can be installed via pip the installation of Qiskit (Aqua) will install PySCF -where it's supported (MacOS and Linux x86). For other platforms see the PySCF information as to -whether this might be possible manually. - 1. [Gaussian 16™](https://qiskit.org/documentation/apidoc/qiskit.chemistry.drivers.gaussiand.html), a commercial chemistry program 2. [PSI4](https://qiskit.org/documentation/apidoc/qiskit.chemistry.drivers.psi4d.html), a chemistry program that exposes a Python interface allowing for accessing internal objects 3. [PySCF](https://qiskit.org/documentation/apidoc/qiskit.chemistry.drivers.pyscfd.html), an open-source Python chemistry program diff --git a/qiskit/chemistry/drivers/__init__.py b/qiskit/chemistry/drivers/__init__.py index a0de442ed6..86e7d7a239 100644 --- a/qiskit/chemistry/drivers/__init__.py +++ b/qiskit/chemistry/drivers/__init__.py @@ -74,9 +74,6 @@ the relevant installation instructions below for your program/library that you intend to use. -Note: `PySCF` is automatically installed for `macOS` and `Linux` platforms when Qiskit -is installed. For other platforms again consult the relevant installation instructions below. - .. toctree:: :maxdepth: 1 diff --git a/qiskit/chemistry/drivers/pyscfd/__init__.py b/qiskit/chemistry/drivers/pyscfd/__init__.py index 9bced21601..5b3fcb76e5 100644 --- a/qiskit/chemistry/drivers/pyscfd/__init__.py +++ b/qiskit/chemistry/drivers/pyscfd/__init__.py @@ -23,10 +23,6 @@ the preferred installation method is via the pip package management system. Doing so, while in the Python virtual environment where Qiskit's chemistry module is also installed, will automatically make PySCF available to Qiskit at run time. - -Note: `PySCF` is automatically installed for `macOS` and `Linux` platforms when Qiskit is -installed via the pip package management system. - """ from .pyscfdriver import PySCFDriver, InitialGuess diff --git a/requirements.txt b/requirements.txt index b0f3da39ce..50798af7c4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,6 @@ fastdtw setuptools>=40.1.0 h5py networkx>=2.2 -pyscf; sys_platform != 'win32' pandas quandl yfinance diff --git a/setup.py b/setup.py index 8fde42bc7d..7d7ddd476c 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,6 @@ "setuptools>=40.1.0", "h5py", "networkx>=2.2", - "pyscf; sys_platform != 'win32'", "pandas", "quandl", "yfinance", @@ -88,6 +87,7 @@ 'torch': ["torch; sys_platform == 'linux' or (python_version < '3.8' and sys_platform != 'win32')"], 'cplex': ["cplex; python_version >= '3.6' and python_version < '3.8'"], 'cvx': ['cvxpy>1.0.0,<1.1.0'], + 'pyscf': ["pyscf; sys_platform != 'win32'"], }, zip_safe=False ) diff --git a/test/chemistry/test_driver_fcidump_dumper.py b/test/chemistry/test_driver_fcidump_dumper.py index 6bf75ff126..ec2e9318ec 100644 --- a/test/chemistry/test_driver_fcidump_dumper.py +++ b/test/chemistry/test_driver_fcidump_dumper.py @@ -115,18 +115,20 @@ def setUp(self): charge=0, spin=0, basis='sto3g') - except QiskitChemistryError: - self.skipTest('PYSCF driver does not appear to be installed') - - qmolecule = driver.run() + qmolecule = driver.run() - dump = tempfile.NamedTemporaryFile() - FCIDumpDriver.dump(qmolecule, dump.name) + dump = tempfile.NamedTemporaryFile() + FCIDumpDriver.dump(qmolecule, dump.name) - from pyscf.tools import fcidump as pyscf_fcidump # pylint: disable=import-outside-toplevel - self.dumped = pyscf_fcidump.read(dump.name) + # pylint: disable=import-outside-toplevel + from pyscf.tools import fcidump as pyscf_fcidump + self.dumped = pyscf_fcidump.read(dump.name) - dump.close() + dump.close() + except QiskitChemistryError: + self.skipTest('PYSCF driver does not appear to be installed.') + except ImportError: + self.skipTest('PYSCF driver does not appear to be installed.') if __name__ == '__main__':