Questions tagged [transpile]

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.

Filter by
Sorted by
Tagged with
3 votes
1 answer
56 views

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 ...
Tristan Nemoz's user avatar
0 votes
0 answers
76 views

Qiskit cant run circuit with reset gate with error

In qiskit if i have a reset gate in a circuit. If i want to add noise to the circuit it wont transpile. For example: ...
Narcano's user avatar
  • 31
4 votes
1 answer
181 views

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 ...
mavzolej's user avatar
  • 1,901
0 votes
1 answer
60 views

Netlist of the transpiled circuit in Qiskit

I am new to running quantum circuits in Qiskit. In the IBM quantum learning lab, I transpiled a simple 4-qubit quantum circuit using a 7-qubit IBM quantum computer. I received a tranpiled circuit ...
mridula's user avatar
2 votes
1 answer
127 views

Coupling map in QISKIT transpile

I have a 3-qubit unitary represented by a circuit with the following dictionary: {'cx': 30, 'h': 22, 'rz': 15, 's': 4, 'sdg': 4}. I want to use this circuit on IBM ...
R.G.J's user avatar
  • 241
2 votes
0 answers
161 views

How to build the quantum circuit ansatz to implement a diagonal unitary operator with just 1 and -1 elements?

Let's consider a set of $N = 2^n$ binary values $S_i \in \left\{-1, 1\right\}$ and define the diagonal matrix $W$ as a quantum unitary operator acting on a system of $n$ qubits: $$ W = \begin{pmatrix} ...
SimoneGasperini's user avatar
2 votes
2 answers
234 views

Complexity of translation between Measurement Based and Circuit Based with Error Correction

As I know, translation between measurement-based and circuit-based is polynomial, not trivial, and might not be efficient in real time. It behaves this way because given some quantum circuit, we have ...
Ron Cohen's user avatar
  • 1,184
2 votes
0 answers
151 views

Qiskit Transpiler Error: Unknown Operation Type

I am trying to use the reset function and recieving the following error: ...
lightly's user avatar
  • 21
1 vote
1 answer
45 views

Step Optimize1qGatesDecomposition in qiskit transpilation

Is there a way to know what does it does qiskit in the step Optimize1qGatesDecomposition? What I can see is that each time qiskit wants to represent a rotation in ...
user2820579's user avatar
3 votes
1 answer
76 views

Is it possible to get step-by-step information about qiskit transpilation?

Is it possible to get the information about the step by step transpilation? I have circuits that I know how it is more or less structured after the transpilation, but when I join them to create a ...
user2820579's user avatar
1 vote
1 answer
279 views

Qiskit transpiler error: Unable to translate

This code worked in a previous version of ibmq_simulator and, I think, it works with qiskit_aer, but it doesn't work here and I don't understand the error message. The issue is there is no "path&...
Anna Naden's user avatar
3 votes
1 answer
62 views

Rotations with angle 0 after transpiling with qiskit

When using qiskit to transpile a circuit sometimes there is a gate Rz(0.0)in the result. I wonder 1) why this happens and 2) what does it mean for the executed ...
qcabepsilon's user avatar
2 votes
2 answers
119 views

Transpile mct to cx without QuantumCircuit

to convert my circuit mct instructions to cx I transpiled a Qiskit circuit, but I want to do it without a circuit, because I want more qubits than Qiskit can handle (50 or more). This is because I'm ...
Luis ALberto's user avatar
8 votes
0 answers
230 views

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 ...
Callum's user avatar
  • 893
1 vote
2 answers
142 views

Initial and final circuit layout with BQSKit compiler

The question concerns logical to physical qubit mapping when compiling quantum circuits with BQSKit. In Qiskit, I can specify the initial layout for the transpilation. It is also possible to retrieve ...
Peter Ivashkov's user avatar
3 votes
2 answers
109 views

How could compiler optimisations be used with fault-tolerant quantum circuits?

It is fairly well known that in a NISQ context you can often boost the fidelity of your quantum circuit by reducing the gate count and depth of your circuit. For example you can use the KAK ...
Callum's user avatar
  • 893
3 votes
1 answer
85 views

How to flatten a QuantumCircuit object to a single QuantumRegister and ClassicalRegister form in Qiskit?

In Qiskit, I am looking for a convenient way to "strip-off" a QuantumCircuit object from its multiple QuantumRegister ...
Ohad's user avatar
  • 1,739
1 vote
1 answer
65 views

Qubit configuration in Qiskit

Is it possible to make your custom qubit configuration in Qiskit? I know one can obtain the qubit configuration from different providers but I am curious whether one can somehow create their own ...
random person's user avatar
3 votes
3 answers
675 views

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 ...
Roberto Schiattarella's user avatar
1 vote
3 answers
478 views

What is the minimal set of gates to transpile any quantum circuit to minimal depth?

Suppose I am given a universal set of quantum gates $S_u$ (e.g. the single-qubit rotation gate $U$ and the controlled-not gate $CX$). This is known to be universal, so any quantum circuit can be ...
SimoneGasperini's user avatar
1 vote
1 answer
200 views

Removing barriers from a QuantumCircuit object in Qiskit

I find barriers useful for visualization purposes, naturally it helps observing a circuit that is separated to some logical segments than just watching a mixture of gates and qubits. However, before ...
Ohad's user avatar
  • 1,739
3 votes
1 answer
137 views

Why is the Qiskit transpiler not resolving the equivalence $I = R_y(-\theta) R_y(\theta)$?

Suppose you are given the following quantum circuit in Qiskit: ...
SimoneGasperini's user avatar
3 votes
1 answer
234 views

Is Qiskit transpile function (with basis_gates=['u', 'cx']) universal?

It's well known that the single-qubit rotation gate $U(\theta, \phi, \lambda)$ and the controlled-not gate $CX_{i,j}$ form one of the universal set of gates for quantum computation. So here's my ...
SimoneGasperini's user avatar
1 vote
1 answer
143 views

Qiskit throws error when changing basis gate for transpilation

I want to transpile a circuit composed of CNOT and 1Q gates into Rzz, CNOT and 1Q gates such that the total number of 2Q gates is minimized. In the example below, I would like the three gates to be ...
Pranav M's user avatar
1 vote
2 answers
121 views

What does circuit-xxx accomplish after circuit gets decomposed by qiskit?

as mentioned in the title, i have a problem with the qiskit decompose function. ...
Qubii's user avatar
  • 171
3 votes
2 answers
292 views

Qiskit Transpiler function - Why does Toffoli + Hadamard not work as a Basis Gate set?

It is a well established fact that Hadamard + Toffoli is a computationally universal gate set. Therefore I thought that the transpiler function in Qiskit would be able to decompose any valid quantum ...
Patrick Sinnott's user avatar
0 votes
2 answers
76 views

How $X$ noise propagates through controlled-$S$ gate

I am struggling to find how an $X$ noise propagates through a controlled-$S$ gate. Here`s the circuit.
Daniele Cuomo's user avatar
2 votes
1 answer
139 views

In Cirq, how do I separate transpilation from execution in simulator.simulate()?

In Qiskit, there are explicit transpile (where a circuit is transpiled to primitive gates) and backend.run (where the circuit is executed in either statevector simulation or real hardware) steps. What ...
pcr's user avatar
  • 121
0 votes
2 answers
130 views

Reducing circuit initialization complexity

I'm encoding data into a QuantumCircuit via the Initialize method for QFTs. In doing this and transpiling for IonQ backends, I'm getting rather complex circuits. Is there a way to encode this data ...
Jonathan Ortega's user avatar
2 votes
1 answer
142 views

What's the paper referenced by qiskit.compiler.transpile? My tranpile solution is wrong from the perspective of fidelity

Here I want to transpile a standard 3 qubit Quantum Fourier Transform circuit into a implementable circuit. The implementable 3 qubit circuit (qubit0, qubit1, qubit2) should have no SWAP gate and ...
chen amora's user avatar
1 vote
0 answers
125 views

Single Yang-Baxter reflection

Context and definitons I want to study the evolution of a three qubit Heisenberg Hamiltonian: $$H=(I\otimes X\otimes X)+(X\otimes X\otimes I)+(I\otimes Y\otimes Y)+(Y\otimes Y\otimes I)+(I\otimes Z\...
Mauricio's user avatar
  • 2,244
1 vote
1 answer
169 views

Using machine learning to determine a good initial mapping for a quantum circuit

I am trying to use a machine learning model to find a good initial mapping for a quantum circuit. I am trying to minimise the number of swap operations i.e. the number of CNOT gates. This is my ...
Anonymous's user avatar
1 vote
1 answer
437 views

Specifying Ancilla qubits for initial_layout parameter in qiskit.transpile

So I have an array which specifies the initial layout of a 4 qubit quantum circuit and I want to map the qubits to a 5 qubit quantum computer. As only 4 out of the 5 qubits will be used, Qiskit ...
Anonymous's user avatar
2 votes
1 answer
1k views

Qiskit custom multi controlled gate

I'm building a 3 qubit circuit with the control-ry rotation gate. The code is the following: ...
Марина Лисниченко's user avatar
1 vote
1 answer
530 views

Qiskit optimization_level values

Is there a clear explaination of how exactly optimization_level choice in qiskit's transpile() method affects on circuit? I expected to see some mathematical operations with the gates that similifies ...
Марина Лисниченко's user avatar
4 votes
1 answer
288 views

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 ...
3.14159's user avatar
  • 41
6 votes
1 answer
645 views

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 ...
Mauricio's user avatar
  • 2,244
1 vote
1 answer
169 views

Qiskit: Transpile circuit with custom equivalences

I would like to automatically get a phase gate of pi/2 converted to a S gate. I have: ...
John Brown's user avatar
4 votes
1 answer
195 views

Decomposing S gate in two T gate with qiskit

Let's suppose I define a basis gate set and the following circuit. ...
John Brown's user avatar
4 votes
1 answer
877 views

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 ...
AJ Rasmusson's user avatar
3 votes
2 answers
577 views

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 ...
Nikita Nemkov's user avatar
1 vote
1 answer
268 views

Does Qiskit transpiler execute multiple circuits in parallel? [closed]

I have something to ask about Qiskit's transpiler. Before that, please check this document. ...
김동민's user avatar
  • 897
4 votes
0 answers
92 views

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 ...
stopper's user avatar
  • 393
4 votes
1 answer
147 views

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 ...
Harshit Gupta's user avatar
2 votes
0 answers
63 views

How do you quantify the figurative 'cost' of a quantum circuit

Many gates are not available on a real computer and therefore the circuit must be transpiled into a specific set of gates. I have seen this equation below which is used to to determine the 'cost' of a ...
John's user avatar
  • 107
1 vote
1 answer
588 views

How to check accuracy of SABRE algorithm?

I'm studying the qubit mapping algorithm called SABRE. SABRE is an algorithm for solving qubit mapping problem effectively. It uses multiple SWAP gates to execute quantum circuit on real quantum ...
김동민's user avatar
  • 897
1 vote
1 answer
436 views

Why qiskit transpiler makes different results everytime? (Non-deterministic)

I tried to do qubit mapping called 'SABRE' and execute transpiled quantum circuit. I use FakeTokyo backend which has some noise because it is mock version of IBMQ 20-Tokyo. I know using this backend ...
김동민's user avatar
  • 897
2 votes
2 answers
271 views

Transpiling with dynamical decoupling sequence

I am testing circuits which contain mid-circuit reset operations, using Qiskit and IBM Quantum hardware. For 2 qubit simulations, I have a reset operation on one of the qubits and would like to test ...
Hmecher's user avatar
  • 41
2 votes
2 answers
295 views

Transpilation on restricted topology does not yield an equivalent circuit in Qiskit

Here is an MWE: a simple circuit on three qubits with a CNOT acting on qubits 0 and 2. The coupling map prohibits a two-qubit gate between qubits 0 and 2 and so qubit 1 must get involved. ...
Nikita Nemkov's user avatar
9 votes
2 answers
2k views

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) ...
Nikita Nemkov's user avatar