The process of rewriting a given input circuit to match the topology of a specific quantum device, and/or to optimize the circuit for execution on present-day noisy quantum systems.
Questions tagged [transpile]
70 questions
11
votes
2 answers
Transpilation into custom gate set in qiskit
In qiskit, I can transpile a given circuit into a some predefined gate set as follows (just an example)
from qiskit import QuantumCircuit
from qiskit.compiler import transpile
from qiskit.circuit.random import random_circuit
basis_gates = ['id',…
Nikita Nemkov
- 1,725
- 7
- 23
9
votes
0 answers
Can you programatically check whether a given set of gates is universal?
I am wondering if there is an automated way to determine whether a given set of quantum operations is universal.
More precisely, given a set of 1 and 2 qubit gates, can we write a program to determine whether this constitutes a universal gate set?…
Callum
- 1,260
- 1
- 5
- 24
6
votes
1 answer
Can W gate be written only using H,T?
I want to write the decompose the gate $W=(X+Y)/\sqrt{2}$ using only $H$ and $T$ (and all the derived Clifford gates basically). I know $H=(X+Z)/\sqrt{2}$ is it possible to obtain exactly $W$ from this set (no approximation)?
Mauricio
- 2,541
- 5
- 26
6
votes
0 answers
Writing circuits in Qiskit using only Clifford and T gates
Is there a way in Qiskit to write my circuit using only Clifford and T gates (CX, S, H, T and I think also $S^\dagger$ and $T^\dagger$)? With the function compile (with aer simulator) it gives me some errors using that one as a basis. I found the…
stopper
- 533
- 2
- 11
5
votes
4 answers
Transpiling qiskit quantum circuits on IonQ Native Gates
I have a certain quantum circuit (qc) in qiskit. My goal is to see it transpiled in IonQ Native Gates, to see the qc that is effectively run on the hardware.
However, the Ionq basis gate set which I see by using qiskit is the following:
['ccx',…
Roberto Schiattarella
- 185
- 6
4
votes
1 answer
How to use Qiskit translation pass manager with Clifford + T gate basis?
Context
In qiskit, the translation stage of the transpilation "translates (or unrolls) the gates specified in a circuit to the native basis gates of a specified backend." (cf doc)
For that, the generate_translation_passmanager() function accepts 2…
alxthm
- 71
- 4
4
votes
1 answer
How to transpile a quantum circuit using the $\{H,T,CNOT\}$ universal set of gates?
If I'm not mistaken, the $\{H,T,CNOT\}$ set of gates is universal in the sense that any unitary can be approximated arbiratrily close by a combination of these gates.
The transpile function of Qiskit allows to decompose a quantum circuit into a…
Tristan Nemoz
- 8,694
- 3
- 11
- 39
4
votes
2 answers
Questions on multi-controlled Toffolis and their implementation in Qiskit
Is it possible to decompose an $n$-controlled Toffoli into $O(n)$ CNOTs without extra working qubits?
If so, is such an decomposition currently available in Qiskit or any other (preferably Python and QASM-friendly) packages?
If not:
Has such an…
mavzolej
- 2,291
- 10
- 18
4
votes
1 answer
Qiskit unable to transpile the circuit for Rigetti Aspen M 1 on AWS
I am trying to run a Qiskit QAOA algorithm on AWS Rigetti Aspen M 1 Backend using qiskit braket provider. However qiskit is not able to properly transpile the circuit
optimizer = COBYLA(maxiter=50)
provider = AWSBraketProvider()
backend =…
3.14159
- 41
- 2
4
votes
1 answer
Decomposing S gate in two T gate with qiskit
Let's suppose I define a basis gate set and the following circuit.
import qiskit as qk
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit,Aer
backend = Aer.get_backend('unitary_simulator')
basis_gates=['h',"cx",'t']
qreg_q =…
John Brown
- 61
- 3
4
votes
1 answer
Replace Gate with Known Identity in Quantum Circuit
I have a quantum circuit with 3 two-qubits gates XX, YY, and ZZ (as defined in the qiskit circuit library) with arbitrary angles on each gate. I'd like to replace the YY and ZZ gates with XXs. I know how to do this mathematically with RZ and RY…
AJ Rasmusson
- 349
- 1
- 11
4
votes
2 answers
Optimal decompositions of some standard multi-qubit gates
To have a concrete example in mind: 3-qubit Toffoli gate can be decomposed into 6 $CNOT$s as shown here
I believe this is the most economic decomposition in terms of the number of $CNOT$s used. My questions are:
Is it proven that it is not…
Nikita Nemkov
- 1,725
- 7
- 23
4
votes
1 answer
How is quantum transpilation scaled?
While thinking about a quantum transpiler's working I had a pretty basic doubt. Say that we are trying to transpile an $n$ qubit circuit where $n > 100$. What transpiler does is that it first tries to find a mapping, decompose the gates into basis…
Harshit Gupta
- 485
- 2
- 9
4
votes
1 answer
Qiskit: Transpilation and the CircuitSampler
I am using Qiskit's opflow and its CircuitSampler to evaluate matrix elements / expectation values. Now, going beyond statevector and simple qasm simulations, I want to introduce noise of a real device, specify qubit-connectivity (coupling_map), and…
Durd3nT
- 571
- 2
- 16
4
votes
0 answers
Transpiler fails after 1000 iterations
I'm transpiling a set of quantum circuits using ibmq_5_yorktown. However, as the number of circuits gets larger, it shows me the following error message:
TranspilerError: 'Maximum iteration reached. max_iteration=1000'
How can I fix this issue? Is…
ZR-
- 2,408
- 10
- 24