diff options
Diffstat (limited to 'dev-python/qiskit-terra')
-rw-r--r-- | dev-python/qiskit-terra/Manifest | 4 | ||||
-rw-r--r-- | dev-python/qiskit-terra/files/qiskit-terra-0.19.2-test-corrections.patch | 36 | ||||
-rw-r--r-- | dev-python/qiskit-terra/metadata.xml | 24 | ||||
-rw-r--r-- | dev-python/qiskit-terra/qiskit-terra-0.19.2.ebuild | 70 |
4 files changed, 134 insertions, 0 deletions
diff --git a/dev-python/qiskit-terra/Manifest b/dev-python/qiskit-terra/Manifest new file mode 100644 index 000000000000..590c23506499 --- /dev/null +++ b/dev-python/qiskit-terra/Manifest @@ -0,0 +1,4 @@ +AUX qiskit-terra-0.19.2-test-corrections.patch 1730 BLAKE2B 7fe634eefa9d1548c11b2dfd12c70972d2d8a789e7975aca85966105cd3b899d9a0bbed133fae765c9be3f806f146e6248a4b2409fc1f5449cf5bf15f9ab2dc4 SHA512 e3d3dafdb9165073dabace613cc82d48144e8a0bc2f21d41421614430b636237bd11e398ee741a4e1641f8cfa4df938b5c7e51c263e1fc6685670c2bd62830b6 +DIST qiskit-terra-0.19.2.gh.tar.gz 9536647 BLAKE2B 966370a782179512f3c4cd209f604f536ac4ac503f4805681d5729f4d6df4020bbaa5a2beb2fc393506eaa67a81666254375f14b827e07e1c1478a381fde5b45 SHA512 d02c028a86927610f1bca63830cb489069e68e016ed744a4092a96ddde163ea8ca1071048fc82b1807d4136e1fb2b0fcdde6d1a639ffc2ebe7c99dfd50c2e3d4 +EBUILD qiskit-terra-0.19.2.ebuild 2475 BLAKE2B 2203e109245dbf62e7e6cc6c9167f64f55019f5b764951b5a03c7ca8eccc66c4fe943b90475c88eb18880f88e7814c9148e6c6bdc12da9df6c9e9d5b6f3ae18b SHA512 19603bda615d7dc7df0d27e73aa536ed19f7f0c6d8f04c6e6c9010735a30d54c59470220e6ab1d6f0b41d1d4a315419c93f49876b424f68174f7288e810eeedd +MISC metadata.xml 1016 BLAKE2B 8c5c45c89d36f75cb33636f719bf555be04673de324e4d36aa4800e8f39d353ad8eb3425efe6538af2f430c6ae38aa3af9f8ca602e64e6621fde2d102a7da572 SHA512 a3ada6b1746eca6dcc93aa2d94e8ca7537d41b012a5b1ebd8de95376d72b4b80fdf048a9bc2ae61ae93b06283a1f5714395b0e74584aad21a93a53963ee3ecfb diff --git a/dev-python/qiskit-terra/files/qiskit-terra-0.19.2-test-corrections.patch b/dev-python/qiskit-terra/files/qiskit-terra-0.19.2-test-corrections.patch new file mode 100644 index 000000000000..ec44ebe75faa --- /dev/null +++ b/dev-python/qiskit-terra/files/qiskit-terra-0.19.2-test-corrections.patch @@ -0,0 +1,36 @@ +diff --git a/test/python/qobj/test_pulse_converter.py b/test/python/qobj/test_pulse_converter.py +index ea5b77e78..cde568ecf 100644 +--- a/test/python/qobj/test_pulse_converter.py ++++ b/test/python/qobj/test_pulse_converter.py +@@ -341,7 +341,8 @@ class TestQobjToInstructionConverter(QiskitTestCase): + + self.assertEqual(evaluated_instruction.start_time, 1) + self.assertEqual(evaluated_instruction.duration, 1) +- self.assertEqual(evaluated_instruction.instructions[0][-1], instruction) ++ self.assertEqual(evaluated_instruction.instructions[0][-1].channel, instruction.channel) ++ self.assertAlmostEqual(evaluated_instruction.instructions[0][-1].frequency, instruction.frequency) + + def test_delay(self): + """Test converted qobj from Delay.""" +diff --git a/test/randomized/test_transpiler_equivalence.py b/test/randomized/test_transpiler_equivalence.py +index 302760279..1d0a3e16f 100644 +--- a/test/randomized/test_transpiler_equivalence.py ++++ b/test/randomized/test_transpiler_equivalence.py +@@ -21,7 +21,7 @@ from hypothesis.stateful import Bundle, RuleBasedStateMachine + + import hypothesis.strategies as st + +-from qiskit import execute, transpile, Aer ++from qiskit import execute, transpile, BasicAer + from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister + from qiskit.circuit import Measure, Reset, Gate, Barrier + from qiskit.test.mock import ( +@@ -98,7 +98,7 @@ class QCircuitMachine(RuleBasedStateMachine): + qubits = Bundle("qubits") + clbits = Bundle("clbits") + +- backend = Aer.get_backend("qasm_simulator") ++ backend = BasicAer.get_backend("qasm_simulator") + max_qubits = int(backend.configuration().n_qubits / 2) + + def __init__(self): diff --git a/dev-python/qiskit-terra/metadata.xml b/dev-python/qiskit-terra/metadata.xml new file mode 100644 index 000000000000..02ea1aee258b --- /dev/null +++ b/dev-python/qiskit-terra/metadata.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <!-- comaintainers-welcomed --> + <maintainer type="person" proxied="yes"> + <email>gaboroszkar@protonmail.com</email> + <name>Gábor Oszkár Dénes</name> + </maintainer> + <maintainer type="project" proxied="proxy"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> + <longdescription> + Qiskit is an open-source framework for working with noisy quantum computers at the level of pulses, circuits, and algorithms. + Qiskit is made up of elements that work together to enable quantum computing. This element is Terra and is the foundation on which the rest of Qiskit is built. + </longdescription> + <use> + <flag name="visualization">Enable visualization modules</flag> + </use> + <upstream> + <remote-id type="github">Qiskit/qiskit-terra</remote-id> + <remote-id type="pypi">qiskit-terra</remote-id> + </upstream> +</pkgmetadata> diff --git a/dev-python/qiskit-terra/qiskit-terra-0.19.2.ebuild b/dev-python/qiskit-terra/qiskit-terra-0.19.2.ebuild new file mode 100644 index 000000000000..36f8af6afe18 --- /dev/null +++ b/dev-python/qiskit-terra/qiskit-terra-0.19.2.ebuild @@ -0,0 +1,70 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{8..10} ) + +inherit distutils-r1 + +DESCRIPTION="Terra is the foundation on which Qiskit is built" +HOMEPAGE="https://github.com/Qiskit/qiskit-terra" +SRC_URI="https://github.com/Qiskit/qiskit-terra/archive/refs/tags/${PV}.tar.gz -> ${P}.gh.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +IUSE="+visualization" +KEYWORDS="~amd64" + +BDEPEND=">=dev-python/cython-0.27.1[${PYTHON_USEDEP}] + test? ( + >=dev-python/ddt-1.4.4[${PYTHON_USEDEP}] + >=dev-python/hypothesis-4.24.3[${PYTHON_USEDEP}] + >=dev-python/networkx-2.2[${PYTHON_USEDEP}] + app-text/poppler[png] + >=sci-libs/scikit-learn-0.20.0[${PYTHON_USEDEP}] + )" + +RDEPEND=" + >=dev-python/retworkx-0.10.1[${PYTHON_USEDEP}] + >=dev-python/numpy-1.17[${PYTHON_USEDEP}] + >=dev-python/ply-3.10[${PYTHON_USEDEP}] + >=dev-python/psutil-5[${PYTHON_USEDEP}] + >=dev-python/scipy-1.5[${PYTHON_USEDEP}] + >=dev-python/sympy-1.3[${PYTHON_USEDEP}] + >=dev-python/dill-0.3[${PYTHON_USEDEP}] + >=dev-python/python-constraint-1.4[${PYTHON_USEDEP}] + >=dev-python/python-dateutil-2.8.0[${PYTHON_USEDEP}] + >=dev-python/stevedore-3.0.0[${PYTHON_USEDEP}] + >=dev-python/symengine-0.8[${PYTHON_USEDEP}] + >=dev-python/tweedledum-1.1[${PYTHON_USEDEP}] + visualization? ( + >=dev-python/matplotlib-3.3[${PYTHON_USEDEP}] + >=dev-python/ipywidgets-7.3.0[${PYTHON_USEDEP}] + dev-python/pydot[${PYTHON_USEDEP}] + >=dev-python/pillow-4.2.1[${PYTHON_USEDEP}] + >=dev-python/pylatexenc-1.4[${PYTHON_USEDEP}] + >=dev-python/seaborn-0.9.0[${PYTHON_USEDEP}] + >=dev-python/pygments-2.4[${PYTHON_USEDEP}] + )" + +distutils_enable_tests pytest + +# Small issues with the tests. +# qiskit.Aer module depends on qiskit-terra, it cannot be used, +# and an exact comparison of float switched to approximate comparison. +PATCHES=( "${FILESDIR}/qiskit-terra-0.19.2-test-corrections.patch" ) + +python_test() { + # We have to hide the source code directory so tests + # do not use these, but instead the compiled library. + mv qiskit qiskit.hidden || die + + # Some small tests are failing which test optional features. + # Why they fail is still under investigation. + # transpiler_equivalence tests take too long time, they are also skipped. + epytest -k 'not (TestOptions and test_copy) and not TestUnitarySynthesisPlugin and not test_transpiler_equivalence and not (TestPauliSumOp and test_to_instruction)' + + mv qiskit.hidden qiskit || die +} |