diff --git a/qiskit/transpiler/passes/ms_basis_decomposer.py b/qiskit/transpiler/passes/ms_basis_decomposer.py index 9028e7dbc960..526876ba9de6 100644 --- a/qiskit/transpiler/passes/ms_basis_decomposer.py +++ b/qiskit/transpiler/passes/ms_basis_decomposer.py @@ -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. diff --git a/qiskit/transpiler/transpile_circuit.py b/qiskit/transpiler/transpile_circuit.py index 29988cbe09ff..aed51e61501b 100644 --- a/qiskit/transpiler/transpile_circuit.py +++ b/qiskit/transpiler/transpile_circuit.py @@ -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: