Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transpiler add passes that might be out of the default basis #2357

Merged
merged 18 commits into from
May 9, 2019
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/*

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The format is based on `Keep a Changelog`_.
- **Fixed**: for any bug fixes.
- **Security**: in case of vulnerabilities.

=============
`UNRELEASED`_
=============

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 7 additions & 3 deletions qiskit/compiler/transpile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
ajavadia marked this conversation as resolved.
Show resolved Hide resolved
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(['u3', 'cx']))
return basis_gates


Expand Down
2 changes: 1 addition & 1 deletion qiskit/converters/qobj_to_circuits.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down