1

Among the several universal gate sets, the Clifford$+T$ set seems the most important one (since it should provide fault-tolerant computing).

However, that set is logical and it differs from physical implementations, e.g. IBM processors use the gate set $\{CNOT, I, R_z, \sqrt{X}, X\}$.

Hence, my question is: how does the Qiskit framework handle the switch from a gate set, such as the Clifford$+T$, to the real one?

At this link there's an interesting possible answer. But I'd like to get a deeper understanding of the criteria Qiskit applies.

EDIT:

I'd like to input to the Qiskit transpile method a simple circuit performing a control S gate:

qc = QuantumCircuit(2)
cs = SGate().control()
qc.append(cs, [0,1])

with basis gate set $\{H, S, T, CNOT\}$, i.e.:

new_qc = transpile(qc, basis_gates=['h','s','t',cx'])

However, the method cannot complete the task.

Daniele Cuomo
  • 1,742
  • 8
  • 21

1 Answers1

2

Qiskit has a component called transpiler. One of the task of the transpiler is to convert the circuit gates into the backend basis gates. For example:

new_circuit = transpiler(circuit, backend=provider.get_backend('simulator_extended_stabilizer')

You can set your own basis with the parameter basis_gates. For example:

new_circuit = transpiler(circuit, basis_gates=['h', 'x', ...]
luciano
  • 5,763
  • 1
  • 12
  • 34
  • Thank you for the answer. I am trying to use the "transpile" method with basis_gates=['h','s','t','cx'], but it doesn't work. I expected it to work since it is a universal set. – Daniele Cuomo Mar 30 '21 at 09:53
  • 1
    Maybe you can add your circuit to the question? It could be a bug in the basis translator, which is not complete. – luciano Mar 30 '21 at 09:58
  • 1
    I have ran into issue like this before too actually. So I have to use $U3$ gate and CNOT. But theoretically, the set ${H, T, CNOT }$ should be enough. – KAJ226 Mar 30 '21 at 15:15
  • Probably related to this issue? https://github.com/Qiskit/qiskit-terra/issues/6047 – luciano Mar 31 '21 at 11:16