I implemented the general diffuser (for arbitrary qubits) in Grover's algorithm in terms of an Multi-controlled Toffoli (MCT) gate (it flips target when all controlled gates are 1). However, this gate is not accepted by the IBM quantum computers (not among the basis gates).
Sorry for my naïve question, but how can I replace a mct gate with something that works on IBM quantum computers?
Edit 1: Thank you for the answer. I added
backend = provider.get_backend('ibmq_lima') custom_basis = backend.configuration().basis_gates grover = transpile(grover,basis_gates=custom_basis)
Now, I can send it to the simulators. But not an actual quantum computer such as ibmq_lima. In https://arxiv.org/pdf/2106.09976.pdf section IV, they talk about approximating mct gates (still reading and learning). I'm just a hobbyist.
The solution given by Ohad works, i.e. using
transpile(grover, backend = backend) in the code. Many thanks. And indeed, I sent the job (Grover's algorithm to find the solution $|00000\rangle$) to ibmq_lima (5 qubits) and it gave me: