Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
ajavadia committed Sep 30, 2019
1 parent 8c327af commit ce54edd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
4 changes: 0 additions & 4 deletions qiskit/transpiler/passes/ms_basis_decomposer.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ def __init__(self, basis):
self.basis = basis
self.requires = [Unroller(list(set(basis).union(['u3', 'cx'])))]

if set(basis) != {gate_name for gate_name in self.supported_basis_names}:
raise QiskitError("Cannot unroll the circuit to the given basis, %s. "
% str(self.basis))

def run(self, dag):
"""Replace U3,CX nodes in input dag with equivalent Rx,Ry,Rxx gates.
Expand Down
9 changes: 4 additions & 5 deletions qiskit/transpiler/transpile_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,11 @@ def transpile_circuit(circuit, transpile_config):
device_insts = set(transpile_config.basis_gates).union(basic_insts)

ms_basis_swap = None
if (
'rxx' in transpile_config.basis_gates
and not device_insts >= circuit.count_ops().keys()
):
if 'rxx' in transpile_config.basis_gates and \
not device_insts >= circuit.count_ops().keys():
ms_basis_swap = transpile_config.basis_gates
transpile_config.basis_gates = ['u3', 'cx']
transpile_config.basis_gates = list(set(['u3', 'cx']).union(
transpile_config.basis_gates))

level = transpile_config.optimization_level
if level is None:
Expand Down

0 comments on commit ce54edd

Please sign in to comment.