From ed169e6c33f1f30973f6d33bffececb339fca7e5 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Mon, 4 Mar 2019 10:45:49 -0500 Subject: [PATCH 01/14] fix BasicAer sampling bug (#1624) (#1859) * fix BasicAer sampling bug (#1624) * fix BasicAer sampling bug * changelog * remove legacysimulator from test_compile Conflicts: CHANGELOG.rst test/python/tools/test_compiler.py The changelog conflicts were inevitable as the stable branch doesn't have the same history as master. As for the test conflict it was a difference in the simulator (python vs c++) used, this backport switches to use the python like on master. (cherry picked from commit 5f7b2e7fc6e3dd92fc4476c8756fdf99ad4027bf) * Try pinning isort version * Use constraints from last working version of lint * Add requirements constraints too --- .travis.yml | 4 +- CHANGELOG.rst | 9 ++ constraints.txt | 109 ++++++++++++++++++ .../builtinsimulators/qasm_simulator.py | 4 +- test/python/tools/test_compiler.py | 5 +- 5 files changed, 124 insertions(+), 7 deletions(-) create mode 100644 constraints.txt diff --git a/.travis.yml b/.travis.yml index b9149c0dfc8a..9c8de9412460 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,8 +27,8 @@ sudo: false stage_generic: &stage_generic install: # Install step for jobs that require compilation and qa. - - pip install -U -r requirements.txt - - pip install -U -r requirements-dev.txt + - pip install -U -r requirements.txt -c constraints.txt + - pip install -U -r requirements-dev.txt -c constraints.txt # Create the basic cmake structure, setting out/ as the default dir. - mkdir out && cd out && cmake $CMAKE_FLAGS .. script: diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a6a3730c0f5d..fbc6023269f6 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -16,6 +16,15 @@ The format is based on `Keep a Changelog`_. - **Fixed**: for any bug fixes. - **Security**: in case of vulnerabilities. +============= +`UNRELEASED`_ +============= + +Fixed +----- + +- Fixed a bug with measurement sampling optimization in BasicAer + qasm_simulator (#1624). `0.7.0`_ - 2018-12-19 ===================== diff --git a/constraints.txt b/constraints.txt new file mode 100644 index 000000000000..63b6c086f889 --- /dev/null +++ b/constraints.txt @@ -0,0 +1,109 @@ +MarkupSafe==1.1.0 +PrettyTable==0.7.2 +PyYAML==3.13 +Pygments==2.3.1 +Send2Trash==1.5.0 +Sphinx==1.7.5 +alabaster==0.7.12 +argparse==1.4.0 +astroid==1.6.5 +babel==2.6.0 +backcall==0.1.0 +better-apidoc==0.2.0 +bleach==3.0.2 +cliff==2.14.0 +cmd2==0.9.6 +colorama==0.4.1 +coverage==4.5.2 +cycler==0.10.0 +defusedxml==0.5.0 +docutils==0.14 +entrypoints==0.2.3 +extras==1.0.0 +fixtures==3.0.0 +future==0.17.1 +imagesize==1.1.0 +ipykernel==5.1.0 +ipython==7.2.0 +ipython-genutils==0.2.0 +ipywidgets==7.4.2 +isort==4.3.4 +jedi==0.13.2 +jinja2==2.10 +jupyter==1.0.0 +jupyter-client==5.2.4 +jupyter-console==6.0.0 +jupyter-core==4.4.0 +kiwisolver==1.0.1 +lazy-object-proxy==1.3.1 +linecache2==1.0.0 +matplotlib==3.0.2 +mccabe==0.6.1 +mistune==0.8.4 +multidict==4.5.2 +nbconvert==5.4.0 +nbformat==4.4.0 +notebook==5.7.4 +nxpd==0.2.0 +packaging==18.0 +pandocfilters==1.4.2 +parso==0.3.1 +pexpect==4.6.0 +pickleshare==0.7.5 +prometheus-client==0.5.0 +prompt-toolkit==2.0.7 +ptyprocess==0.6.0 +pycodestyle==2.4.0 +pydot==1.4.1 +pylint==1.8.4 +pyparsing==2.3.0 +pyperclip==1.7.0 +python-dateutil==2.7.5 +python-mimeparse==1.6.0 +python-subunit==1.3.0 +pytz==2018.7 +pyzmq==17.1.2 +qtconsole==4.4.3 +snowballstemmer==1.2.1 +sphinx-materialdesign-theme==0.1.11 +sphinxcontrib-fulltoc==1.2.0 +sphinxcontrib-websupport==1.1.0 +stestr==2.2.0 +stevedore==1.30.0 +terminado==0.8.1 +testpath==0.4.2 +testtools==2.3.0 +tornado==5.1.1 +traceback2==1.4.0 +traitlets==4.3.2 +unittest2==1.1.0 +vcrpy==2.0.1 +voluptuous==0.11.5 +wcwidth==0.1.7 +webencodings==0.5.1 +wheel==0.32.3 +widgetsnbextension==3.4.2 +wrapt==1.10.11 +yarl==1.3.0 +asn1crypto==0.24.0 +cffi==1.11.5 +chardet==3.0.4 +cryptography==2.4.2 +decorator==4.3.0 +idna==2.8 +jsonschema==2.6.0 +marshmallow==2.16.3 +marshmallow-polyfield==3.2 +mpmath==1.1.0 +networkx==2.2 +ntlm-auth==1.2.0 +numpy==1.15.4 +pillow==5.3.0 +ply==3.11 +psutil==5.4.8 +pycparser==2.19 +requests==2.21.0 +requests-ntlm==1.1.0 +scipy==1.2.0 +sympy==1.3 +urllib3==1.24.1 diff --git a/qiskit/providers/builtinsimulators/qasm_simulator.py b/qiskit/providers/builtinsimulators/qasm_simulator.py index b91d78c3ab19..d66d67248402 100644 --- a/qiskit/providers/builtinsimulators/qasm_simulator.py +++ b/qiskit/providers/builtinsimulators/qasm_simulator.py @@ -206,8 +206,8 @@ def _add_sample_measure(self, measure_params, num_samples): memory = [] for sample in samples: classical_state = self._classical_state - for qubit, cbit in measure_params: - qubit_outcome = int((sample & (1 << qubit)) >> qubit) + for count, (qubit, cbit) in enumerate(sorted(measure_params)): + qubit_outcome = int((sample & (1 << count)) >> count) bit = 1 << cbit classical_state = (classical_state & (~bit)) | (qubit_outcome << cbit) value = bin(classical_state)[2:] diff --git a/test/python/tools/test_compiler.py b/test/python/tools/test_compiler.py index a3e87a8e4aec..ed48d3b8831d 100644 --- a/test/python/tools/test_compiler.py +++ b/test/python/tools/test_compiler.py @@ -22,7 +22,7 @@ from qiskit.providers.ibmq import least_busy from .._mockutils import FakeBackend from ..common import QiskitTestCase -from ..common import requires_qe_access, requires_cpp_simulator +from ..common import requires_qe_access class TestCompiler(QiskitTestCase): @@ -472,13 +472,12 @@ def test_compile_coupling_map(self): threshold = 0.05 * shots self.assertDictAlmostEqual(counts, target, threshold) - @requires_cpp_simulator def test_example_swap_bits(self): """Test a toy example swapping a set bit around. Uses the mapper. Pass if results are correct. """ - backend = qiskit.LegacySimulators.get_backend('qasm_simulator') + backend = qiskit.BasicAer.get_backend('qasm_simulator') coupling_map = [[0, 1], [0, 8], [1, 2], [1, 9], [2, 3], [2, 10], [3, 4], [3, 11], [4, 5], [4, 12], [5, 6], [5, 13], [6, 7], [6, 14], [7, 15], [8, 9], [9, 10], [10, 11], From d5791fa62f246b5f91219f0ba75e67c2a6555215 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Mon, 4 Mar 2019 14:30:59 -0500 Subject: [PATCH 02/14] Bump version and prepare for 0.7.1 release (#1886) * Bump version and prepare for 0.7.1 release To prepare for the 0.7.1 bugfix release we need to increase the version number and update the changelog. This commit takes care of that so we can tag the release and build it. --- CHANGELOG.rst | 8 +++++++- qiskit/VERSION.txt | 2 +- setup.py | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index fbc6023269f6..2ccb0ae2785b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -20,12 +20,17 @@ The format is based on `Keep a Changelog`_. `UNRELEASED`_ ============= +`0.7.1`_ - 2019-03-04 +===================== + + Fixed ----- - Fixed a bug with measurement sampling optimization in BasicAer qasm_simulator (#1624). + `0.7.0`_ - 2018-12-19 ===================== @@ -878,7 +883,8 @@ Fixed - Correct operator precedence when parsing expressions (#190). - Fix "math domain error" in mapping (#111, #151). -.. _UNRELEASED: https://github.com/Qiskit/qiskit-terra/compare/0.7.0...HEAD +.. _UNRELEASED: https://github.com/Qiskit/qiskit-terra/compare/0.7.1...HEAD +.. _0.7.1: https://github.com/Qiskit/qiskit-terra/compare/0.7.0...0.7.1 .. _0.7.0: https://github.com/Qiskit/qiskit-terra/compare/0.6.0...0.7.0 .. _0.6.0: https://github.com/Qiskit/qiskit-terra/compare/0.5.7...0.6.0 .. _0.5.7: https://github.com/Qiskit/qiskit-terra/compare/0.5.6...0.5.7 diff --git a/qiskit/VERSION.txt b/qiskit/VERSION.txt index faef31a4357c..39e898a4f952 100644 --- a/qiskit/VERSION.txt +++ b/qiskit/VERSION.txt @@ -1 +1 @@ -0.7.0 +0.7.1 diff --git a/setup.py b/setup.py index c62538acc9ab..c9e85a943d5d 100755 --- a/setup.py +++ b/setup.py @@ -89,7 +89,7 @@ def has_ext_modules(self): setup( name="qiskit-terra", - version="0.7.0", + version="0.7.1", description="Software for developing quantum computing programs", long_description="""Terra provides the foundations for Qiskit. It allows the user to write quantum circuits easily, and takes care of the constraints of real hardware.""", From 36d5d5dfac8c92886a987e70d22d75db66bfb127 Mon Sep 17 00:00:00 2001 From: Ryan Wood Date: Thu, 7 Mar 2019 07:01:13 +0900 Subject: [PATCH 03/14] Fix instruction inheritance issues (#1900) * Addressed issue with instruction.py which prohibited inheritance of QuantumRegisters and ClassicalRegisters * Updated changelog * Fixed typo --- CHANGELOG.rst | 11 +++++++++++ qiskit/circuit/instruction.py | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2ccb0ae2785b..a7a5c6fe9839 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -20,6 +20,17 @@ The format is based on `Keep a Changelog`_. `UNRELEASED`_ ============= + +`0.7.2`_ - 2019-03-05 +===================== + + +Fixed +----- + +- Fixed a bug whereby inheriting from QuantumRegister or ClassicalRegister + would cause a QiskitError in instruction.py + `0.7.1`_ - 2019-03-04 ===================== diff --git a/qiskit/circuit/instruction.py b/qiskit/circuit/instruction.py index 8fd363c78b11..d73068d1f2bf 100644 --- a/qiskit/circuit/instruction.py +++ b/qiskit/circuit/instruction.py @@ -47,9 +47,9 @@ def __init__(self, name, param, qargs, cargs, circuit=None): Raises: QiskitError: when the register is not in the correct format. """ - if not all((type(i[0]), type(i[1])) == (QuantumRegister, int) for i in qargs): + if not all(isinstance(i[0], QuantumRegister) and isinstance(i[1], int) for i in qargs): raise QiskitError("qarg not (QuantumRegister, int) tuple") - if not all((type(i[0]), type(i[1])) == (ClassicalRegister, int) for i in cargs): + if not all(isinstance(i[0], ClassicalRegister) and isinstance(i[1], int) for i in cargs): raise QiskitError("carg not (ClassicalRegister, int) tuple") self.name = name self.param = [] # a list of gate params stored as sympy objects From 1d8d386192323ade371df6b0435f3bbfab232df3 Mon Sep 17 00:00:00 2001 From: Ali Javadi-Abhari Date: Wed, 6 Mar 2019 17:03:14 -0500 Subject: [PATCH 04/14] Revert "Fix instruction inheritance issues (#1900)" (#1906) This reverts commit 36d5d5dfac8c92886a987e70d22d75db66bfb127. --- CHANGELOG.rst | 11 ----------- qiskit/circuit/instruction.py | 4 ++-- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a7a5c6fe9839..2ccb0ae2785b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -20,17 +20,6 @@ The format is based on `Keep a Changelog`_. `UNRELEASED`_ ============= - -`0.7.2`_ - 2019-03-05 -===================== - - -Fixed ------ - -- Fixed a bug whereby inheriting from QuantumRegister or ClassicalRegister - would cause a QiskitError in instruction.py - `0.7.1`_ - 2019-03-04 ===================== diff --git a/qiskit/circuit/instruction.py b/qiskit/circuit/instruction.py index d73068d1f2bf..8fd363c78b11 100644 --- a/qiskit/circuit/instruction.py +++ b/qiskit/circuit/instruction.py @@ -47,9 +47,9 @@ def __init__(self, name, param, qargs, cargs, circuit=None): Raises: QiskitError: when the register is not in the correct format. """ - if not all(isinstance(i[0], QuantumRegister) and isinstance(i[1], int) for i in qargs): + if not all((type(i[0]), type(i[1])) == (QuantumRegister, int) for i in qargs): raise QiskitError("qarg not (QuantumRegister, int) tuple") - if not all(isinstance(i[0], ClassicalRegister) and isinstance(i[1], int) for i in cargs): + if not all((type(i[0]), type(i[1])) == (ClassicalRegister, int) for i in cargs): raise QiskitError("carg not (ClassicalRegister, int) tuple") self.name = name self.param = [] # a list of gate params stored as sympy objects From 6aae8b3c15e4fecd0b4be3fde174467bc476467e Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 30 Apr 2019 18:15:41 -0400 Subject: [PATCH 05/14] Relax schema validation on backendconfiguration (#2258) * Relax schema validation on backendconfiguration The schema validation for backendconfig was set too tightly and it was rejecting valid responses from the backend API. This potentially causes issues when running against the api. This commit addresses this by changing the schema validation to ensure that we properly validate the response received by the backends and no longer reject valid responses moving forward. * Add changelog * Fix tests and lint --- CHANGELOG.rst | 6 ++++++ qiskit/providers/models/backendconfiguration.py | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2ccb0ae2785b..5b35b749a7fd 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -20,6 +20,12 @@ The format is based on `Keep a Changelog`_. `UNRELEASED`_ ============= +Fixed +----- + +- A potential issue where the backend configuration schema validation would + improperly reject valid responses from the API (#2258) + `0.7.1`_ - 2019-03-04 ===================== diff --git a/qiskit/providers/models/backendconfiguration.py b/qiskit/providers/models/backendconfiguration.py index f6a1fc7c4b22..689b55cb82b8 100644 --- a/qiskit/providers/models/backendconfiguration.py +++ b/qiskit/providers/models/backendconfiguration.py @@ -7,7 +7,7 @@ """Model and schema for backend configuration.""" -from marshmallow.validate import Equal, Length, OneOf, Range, Regexp +from marshmallow.validate import Length, OneOf, Range, Regexp from qiskit.validation import BaseModel, BaseSchema, bind_schema from qiskit.validation.fields import Boolean, DateTime, Integer, List, Nested, String @@ -47,7 +47,7 @@ class BackendConfigurationSchema(BaseSchema): local = Boolean(required=True) simulator = Boolean(required=True) conditional = Boolean(required=True) - open_pulse = Boolean(required=True, validate=Equal(False)) + open_pulse = Boolean(required=True) memory = Boolean(required=True) max_shots = Integer(required=True, validate=Range(min=1)) @@ -56,7 +56,7 @@ class BackendConfigurationSchema(BaseSchema): sample_name = String() coupling_map = List(List(Integer(), validate=Length(min=1)), - validate=Length(min=1)) + validate=Length(min=1), allow_none=True) n_registers = Integer(validate=Range(min=1)) register_map = List(List(Integer(validate=OneOf([0, 1])), validate=Length(min=1)), From 13bd519ffffe640f1337c66d65aeb9f494ea0938 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 1 May 2019 10:28:30 -0400 Subject: [PATCH 06/14] Bump version and prepare for 0.7.2 release (#2269) To prepare for the 0.7.2 bugfix release we need to increase the version number and update the changelog. This commit takes care of that so we can tag the release and build it. --- CHANGELOG.rst | 9 ++++++++- qiskit/VERSION.txt | 2 +- setup.py | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5b35b749a7fd..d4d52a51641b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -20,12 +20,18 @@ The format is based on `Keep a Changelog`_. `UNRELEASED`_ ============= + +`0.7.2`_ - 2019-05-01 +===================== + + Fixed ----- - A potential issue where the backend configuration schema validation would improperly reject valid responses from the API (#2258) + `0.7.1`_ - 2019-03-04 ===================== @@ -889,7 +895,8 @@ Fixed - Correct operator precedence when parsing expressions (#190). - Fix "math domain error" in mapping (#111, #151). -.. _UNRELEASED: https://github.com/Qiskit/qiskit-terra/compare/0.7.1...HEAD +.. _UNRELEASED: https://github.com/Qiskit/qiskit-terra/compare/0.7.2...HEAD +.. _0.7.1: https://github.com/Qiskit/qiskit-terra/compare/0.7.1...0.7.2 .. _0.7.1: https://github.com/Qiskit/qiskit-terra/compare/0.7.0...0.7.1 .. _0.7.0: https://github.com/Qiskit/qiskit-terra/compare/0.6.0...0.7.0 .. _0.6.0: https://github.com/Qiskit/qiskit-terra/compare/0.5.7...0.6.0 diff --git a/qiskit/VERSION.txt b/qiskit/VERSION.txt index 39e898a4f952..7486fdbc50b3 100644 --- a/qiskit/VERSION.txt +++ b/qiskit/VERSION.txt @@ -1 +1 @@ -0.7.1 +0.7.2 diff --git a/setup.py b/setup.py index c9e85a943d5d..f972b4be25bb 100755 --- a/setup.py +++ b/setup.py @@ -89,7 +89,7 @@ def has_ext_modules(self): setup( name="qiskit-terra", - version="0.7.1", + version="0.7.2", description="Software for developing quantum computing programs", long_description="""Terra provides the foundations for Qiskit. It allows the user to write quantum circuits easily, and takes care of the constraints of real hardware.""", From 12812ed84cdea1e5c110b1f38cc68b2b13c570c8 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 1 May 2019 13:55:14 -0400 Subject: [PATCH 07/14] Fix typo in changelog (#2270) This finishes a last minute typo in the changelog to link to the correct version. --- CHANGELOG.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d4d52a51641b..7e8cb056b0b7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -896,7 +896,7 @@ Fixed - Fix "math domain error" in mapping (#111, #151). .. _UNRELEASED: https://github.com/Qiskit/qiskit-terra/compare/0.7.2...HEAD -.. _0.7.1: https://github.com/Qiskit/qiskit-terra/compare/0.7.1...0.7.2 +.. _0.7.2: https://github.com/Qiskit/qiskit-terra/compare/0.7.1...0.7.2 .. _0.7.1: https://github.com/Qiskit/qiskit-terra/compare/0.7.0...0.7.1 .. _0.7.0: https://github.com/Qiskit/qiskit-terra/compare/0.6.0...0.7.0 .. _0.6.0: https://github.com/Qiskit/qiskit-terra/compare/0.5.7...0.6.0 From 09ed6a15b068259d5e36d55aa0973af5b8099287 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Fri, 3 May 2019 14:05:13 -0400 Subject: [PATCH 08/14] Install twine in wheel build jobs (#2290) The wheel build jobs failed to install twine so when the jobs completed and went to upload the wheels this failed because the command wasn't found. This commit fixes the issue by installing twine as part of the wheel build job set ups so that we can actually upload our built binaries. --- .travis.yml | 4 ++-- appveyor.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7225fa474d6f..5377e706e44d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -102,7 +102,7 @@ jobs: - CIBW_TEST_COMMAND="python3 {project}/examples/python/stochastic_swap.py" if: tag IS present script: - - sudo pip install cibuildwheel==0.10.1 + - sudo pip install cibuildwheel==0.10.1 twine - cibuildwheel --output-dir wheelhouse - twine upload wheelhouse/* - os: osx @@ -115,7 +115,7 @@ jobs: - TWINE_USERNAME=qiskit - CIBW_TEST_COMMAND="python3 {project}/examples/python/stochastic_swap.py" script: - - sudo pip2 install cibuildwheel==0.10.1 + - sudo pip2 install cibuildwheel==0.10.1 twine - cibuildwheel --output-dir wheelhouse - twine upload wheelhouse/* diff --git a/appveyor.yml b/appveyor.yml index 8206e785ef95..f20ff3175404 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -59,7 +59,7 @@ deploy: false skip_branch_with_pr: true build_script: - - if defined WHEEL (pip install cibuildwheel==0.10.1) + - if defined WHEEL (pip install cibuildwheel==0.10.1 twine) - if defined WHEEL (cibuildwheel --output-dir wheelhouse) - if defined WHEEL {twine upload wheelhouse\*} artifacts: From fb0caabe0333f91b9fbe736c1497ba7e375a426c Mon Sep 17 00:00:00 2001 From: Luciano Bello Date: Wed, 8 May 2019 11:08:11 -0400 Subject: [PATCH 09/14] fix --- qiskit/compiler/transpile.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/qiskit/compiler/transpile.py b/qiskit/compiler/transpile.py index 5aa84c0b4b18..322bccc5aa0d 100644 --- a/qiskit/compiler/transpile.py +++ b/qiskit/compiler/transpile.py @@ -234,10 +234,14 @@ def _parse_basis_gates(basis_gates, backend, circuits): if basis_gates is None or (isinstance(basis_gates, list) and all(isinstance(i, str) for i in basis_gates)): basis_gates = [basis_gates] * len(circuits) - # no basis means don't unroll (all circuit gates are valid basis) - basis_gates = [[inst.name for inst, _, _ in circuit.data] if basis is None - else basis for basis, circuit in zip(basis_gates, circuits)] + # no basis means don't unroll (all circuit gates are valid basis) + for index, circuit in enumerate(circuits): + basis = basis_gates[index] + if basis is None: + gates_in_circuit = set(inst.name for inst, _, _ in circuit.data) + # Other passes might add new gates that need to be supported + basis_gates[index] = list(gates_in_circuit.union(['U', 'CX'])) return basis_gates From 7d804951b871998b730f086fa59de20e076252e9 Mon Sep 17 00:00:00 2001 From: Luciano Bello Date: Wed, 8 May 2019 11:32:13 -0400 Subject: [PATCH 10/14] check at the end --- qiskit/transpiler/preset_passmanagers/level1.py | 2 +- qiskit/transpiler/preset_passmanagers/level2.py | 2 +- qiskit/transpiler/preset_passmanagers/level3.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qiskit/transpiler/preset_passmanagers/level1.py b/qiskit/transpiler/preset_passmanagers/level1.py index e7793d2d0bde..8abdd8f43de5 100644 --- a/qiskit/transpiler/preset_passmanagers/level1.py +++ b/qiskit/transpiler/preset_passmanagers/level1.py @@ -129,6 +129,6 @@ def _opt_control(property_set): # pm1.append(_direction_check) # TODO pm1.append(_direction, condition=_direction_condition) pm1.append(_reset) - pm1.append(_depth_check + _opt, do_while=_opt_control) + pm1.append(_opt + _depth_check, do_while=_opt_control) return pm1 diff --git a/qiskit/transpiler/preset_passmanagers/level2.py b/qiskit/transpiler/preset_passmanagers/level2.py index 934480369b3a..8dccb36c10c4 100644 --- a/qiskit/transpiler/preset_passmanagers/level2.py +++ b/qiskit/transpiler/preset_passmanagers/level2.py @@ -126,6 +126,6 @@ def _opt_control(property_set): # pm2.append(_direction_check) # TODO pm2.append(_direction, condition=_direction_condition) pm2.append(_reset) - pm2.append(_depth_check + _opt, do_while=_opt_control) + pm2.append(_opt + _depth_check, do_while=_opt_control) return pm2 diff --git a/qiskit/transpiler/preset_passmanagers/level3.py b/qiskit/transpiler/preset_passmanagers/level3.py index efb397dd8a6e..b96585539045 100644 --- a/qiskit/transpiler/preset_passmanagers/level3.py +++ b/qiskit/transpiler/preset_passmanagers/level3.py @@ -118,6 +118,6 @@ def _opt_control(property_set): if coupling_map: pm3.append(_swap_check) pm3.append(_swap, condition=_swap_condition) - pm3.append(_depth_check + _opt, do_while=_opt_control) + pm3.append(_opt + _depth_check, do_while=_opt_control) return pm3 From 31b97ba67707a187fc99e52366256af26018fed6 Mon Sep 17 00:00:00 2001 From: Luciano Bello Date: Wed, 8 May 2019 14:20:25 -0400 Subject: [PATCH 11/14] undo order flip --- qiskit/compiler/transpile.py | 2 +- qiskit/transpiler/preset_passmanagers/level1.py | 2 +- qiskit/transpiler/preset_passmanagers/level2.py | 2 +- qiskit/transpiler/preset_passmanagers/level3.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qiskit/compiler/transpile.py b/qiskit/compiler/transpile.py index 322bccc5aa0d..a77e1a171229 100644 --- a/qiskit/compiler/transpile.py +++ b/qiskit/compiler/transpile.py @@ -241,7 +241,7 @@ def _parse_basis_gates(basis_gates, backend, circuits): if basis is None: gates_in_circuit = set(inst.name for inst, _, _ in circuit.data) # Other passes might add new gates that need to be supported - basis_gates[index] = list(gates_in_circuit.union(['U', 'CX'])) + basis_gates[index] = list(gates_in_circuit.union(['u3', 'cx'])) return basis_gates diff --git a/qiskit/transpiler/preset_passmanagers/level1.py b/qiskit/transpiler/preset_passmanagers/level1.py index 8abdd8f43de5..e7793d2d0bde 100644 --- a/qiskit/transpiler/preset_passmanagers/level1.py +++ b/qiskit/transpiler/preset_passmanagers/level1.py @@ -129,6 +129,6 @@ def _opt_control(property_set): # pm1.append(_direction_check) # TODO pm1.append(_direction, condition=_direction_condition) pm1.append(_reset) - pm1.append(_opt + _depth_check, do_while=_opt_control) + pm1.append(_depth_check + _opt, do_while=_opt_control) return pm1 diff --git a/qiskit/transpiler/preset_passmanagers/level2.py b/qiskit/transpiler/preset_passmanagers/level2.py index 8dccb36c10c4..934480369b3a 100644 --- a/qiskit/transpiler/preset_passmanagers/level2.py +++ b/qiskit/transpiler/preset_passmanagers/level2.py @@ -126,6 +126,6 @@ def _opt_control(property_set): # pm2.append(_direction_check) # TODO pm2.append(_direction, condition=_direction_condition) pm2.append(_reset) - pm2.append(_opt + _depth_check, do_while=_opt_control) + pm2.append(_depth_check + _opt, do_while=_opt_control) return pm2 diff --git a/qiskit/transpiler/preset_passmanagers/level3.py b/qiskit/transpiler/preset_passmanagers/level3.py index b96585539045..5336a82e00d2 100644 --- a/qiskit/transpiler/preset_passmanagers/level3.py +++ b/qiskit/transpiler/preset_passmanagers/level3.py @@ -118,6 +118,6 @@ def _opt_control(property_set): if coupling_map: pm3.append(_swap_check) pm3.append(_swap, condition=_swap_condition) - pm3.append(_opt + _depth_check, do_while=_opt_control) + pm3.append(_depth_check + _optdo_while=_opt_control) return pm3 From 376788109106d4f9ee837d4151c40539f938eaaf Mon Sep 17 00:00:00 2001 From: Luciano Bello Date: Wed, 8 May 2019 14:27:57 -0400 Subject: [PATCH 12/14] syntax --- qiskit/transpiler/preset_passmanagers/level3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit/transpiler/preset_passmanagers/level3.py b/qiskit/transpiler/preset_passmanagers/level3.py index 5336a82e00d2..efb397dd8a6e 100644 --- a/qiskit/transpiler/preset_passmanagers/level3.py +++ b/qiskit/transpiler/preset_passmanagers/level3.py @@ -118,6 +118,6 @@ def _opt_control(property_set): if coupling_map: pm3.append(_swap_check) pm3.append(_swap, condition=_swap_condition) - pm3.append(_depth_check + _optdo_while=_opt_control) + pm3.append(_depth_check + _opt, do_while=_opt_control) return pm3 From e9957eca3318f76bf90c79db124d520e4ce741ef Mon Sep 17 00:00:00 2001 From: Luciano Date: Wed, 8 May 2019 15:16:57 -0400 Subject: [PATCH 13/14] DeprecationWarning message (#2350) --- qiskit/converters/qobj_to_circuits.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit/converters/qobj_to_circuits.py b/qiskit/converters/qobj_to_circuits.py index 6789eafba379..15205ece4e3f 100644 --- a/qiskit/converters/qobj_to_circuits.py +++ b/qiskit/converters/qobj_to_circuits.py @@ -30,7 +30,7 @@ def qobj_to_circuits(qobj): """ warnings.warn('qiskit.converters.qobj_to_circuit() is deprecated and will ' 'be removed in Qiskit Terra 0.9. Please use ' - 'qiskit.compiler.disassemble_circuits() to convert a qobj ' + 'qiskit.assembler.disassemble() to convert a qobj ' 'to list of circuits.', DeprecationWarning) variables = disassemble(qobj) From 68cddc29ad3a72fcfbd1c16f84a053784f6b2ed6 Mon Sep 17 00:00:00 2001 From: Luciano Bello Date: Wed, 8 May 2019 17:51:58 -0400 Subject: [PATCH 14/14] clean up stable --- .travis.yml | 4 ++-- CHANGELOG.rst | 1 - appveyor.yml | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5b6c2f818b2a..1fc4e2fe28b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -102,7 +102,7 @@ jobs: - CIBW_TEST_COMMAND="python3 {project}/examples/python/stochastic_swap.py" if: tag IS present script: - - sudo pip install cibuildwheel==0.10.1 twine + - sudo pip install cibuildwheel==0.10.1 - cibuildwheel --output-dir wheelhouse - twine upload wheelhouse/* - os: osx @@ -115,7 +115,7 @@ jobs: - TWINE_USERNAME=qiskit - CIBW_TEST_COMMAND="python3 {project}/examples/python/stochastic_swap.py" script: - - sudo pip2 install cibuildwheel==0.10.1 twine + - sudo pip2 install cibuildwheel==0.10.1 - cibuildwheel --output-dir wheelhouse - twine upload wheelhouse/* diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 81733cd90326..9fbef2e88d9f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -16,7 +16,6 @@ The format is based on `Keep a Changelog`_. - **Fixed**: for any bug fixes. - **Security**: in case of vulnerabilities. -============= `UNRELEASED`_ ============= diff --git a/appveyor.yml b/appveyor.yml index c60b564c6412..7dfbc311bb0e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -59,7 +59,7 @@ deploy: false skip_branch_with_pr: true build_script: - - if defined WHEEL (pip install cibuildwheel==0.10.1 twine) + - if defined WHEEL (pip install cibuildwheel==0.10.1) - if defined WHEEL (cibuildwheel --output-dir wheelhouse) - if defined WHEEL {twine upload wheelhouse\*} artifacts: