Skip to content

Commit

Permalink
Fix Github Actions (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
manoelmarques authored Feb 8, 2021
1 parent e8e7b73 commit 0c1acf4
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 18 deletions.
10 changes: 3 additions & 7 deletions .github/actions/install-master-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@ runs:
conda activate
fi
pip install https://github.com/Qiskit/qiskit-terra/archive/master.zip
pip install https://github.com/Qiskit/qiskit-ibmq-provider/archive/master.zip
sudo apt-get -y install g++-7
sudo apt-get -y install libopenblas-dev
git clone https://github.com/Qiskit/qiskit-aer.git /tmp/qiskit-aer
cd /tmp/qiskit-aer
python /tmp/qiskit-aer/setup.py bdist_wheel -- -DCMAKE_CXX_COMPILER=g++-7 -DAER_THRUST_BACKEND=OMP -- -j4
pip install /tmp/qiskit-aer/dist/qiskit_aer*whl
pip install https://github.com/Qiskit/qiskit-ignis/archive/master.zip
pip install https://github.com/Qiskit/qiskit-aer/archive/master.zip
# install Aqua until code is converted to use qiskit-terra
pip install https://github.com/Qiskit/qiskit-aqua/archive/master.zip
shell: bash
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ sphinx-autodoc-typehints
jupyter-sphinx
discover
qiskit-aer
qiskit-ibmq-provider
mypy>=0.780
mypy-extensions>=0.4.3
networkx>=2.2
Expand Down
3 changes: 2 additions & 1 deletion test/test_readme_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def setUp(self):
# pylint: disable=import-outside-toplevel
# pylint: disable=unused-import
from qiskit import Aer
except Exception as ex: # pylint: disable=broad-except
_ = Aer.get_backend('statevector_simulator')
except ImportError as ex: # pylint: disable=broad-except
self.skipTest("Aer doesn't appear to be installed. Error: '{}'".format(str(ex)))
return

Expand Down
12 changes: 6 additions & 6 deletions test/test_uccsd_hartree_fock.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ def test_uccsd_hf_aer_statevector(self):
try:
# pylint: disable=import-outside-toplevel
from qiskit import Aer
except Exception as ex: # pylint: disable=broad-except
backend = Aer.get_backend('statevector_simulator')
except ImportError as ex: # pylint: disable=broad-except
self.skipTest("Aer doesn't appear to be installed. Error: '{}'".format(str(ex)))
return
backend = Aer.get_backend('statevector_simulator')
solver = VQE(var_form=self.var_form, optimizer=self.optimizer,
quantum_instance=QuantumInstance(backend=backend))

Expand All @@ -108,10 +108,10 @@ def test_uccsd_hf_aer_qasm(self):
try:
# pylint: disable=import-outside-toplevel
from qiskit import Aer
except Exception as ex: # pylint: disable=broad-except
backend = Aer.get_backend('qasm_simulator')
except ImportError as ex: # pylint: disable=broad-except
self.skipTest("Aer doesn't appear to be installed. Error: '{}'".format(str(ex)))
return
backend = Aer.get_backend('qasm_simulator')
optimizer = SPSA(maxiter=200, last_avg=5)
solver = VQE(var_form=self.var_form, optimizer=optimizer,
expectation=PauliExpectation(),
Expand All @@ -129,10 +129,10 @@ def test_uccsd_hf_aer_qasm_snapshot(self):
try:
# pylint: disable=import-outside-toplevel
from qiskit import Aer
except Exception as ex: # pylint: disable=broad-except
backend = Aer.get_backend('qasm_simulator')
except ImportError as ex: # pylint: disable=broad-except
self.skipTest("Aer doesn't appear to be installed. Error: '{}'".format(str(ex)))
return
backend = Aer.get_backend('qasm_simulator')
optimizer = SPSA(maxiter=200, last_avg=5)
solver = VQE(var_form=self.var_form, optimizer=optimizer,
expectation=AerPauliExpectation(),
Expand Down
4 changes: 2 additions & 2 deletions test/test_vqe_uccsd_adapt.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ def test_vqe_adapt(self):
try:
# pylint: disable=import-outside-toplevel
from qiskit import Aer
except Exception as ex: # pylint: disable=broad-except
backend = Aer.get_backend('statevector_simulator')
except ImportError as ex: # pylint: disable=broad-except
self.skipTest("Aer doesn't appear to be installed. Error: '{}'".format(str(ex)))
return

self.var_form_base = UCCSD(self.num_spin_orbitals,
self.num_particles, initial_state=self.init_state)
backend = Aer.get_backend('statevector_simulator')
optimizer = L_BFGS_B()

warnings.filterwarnings('ignore', category=DeprecationWarning)
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ setenv =
ARGS="-V"
deps = https://github.com/Qiskit/qiskit-terra/archive/master.zip
https://github.com/Qiskit/qiskit-aer/archive/master.zip
https://github.com/Qiskit/qiskit-ibmq-provider/archive/master.zip
https://github.com/Qiskit/qiskit-aqua/archive/master.zip
-r{toxinidir}/requirements-dev.txt
commands =
Expand Down

0 comments on commit 0c1acf4

Please sign in to comment.