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
48 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 ...
  • 1,574
1 vote
1 answer
41 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 ...
3 votes
3 answers
118 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 ...
1 vote
3 answers
160 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 ...
1 vote
0 answers
47 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 ...
  • 1,574
3 votes
1 answer
75 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: ...
3 votes
1 answer
73 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 ...
0 votes
1 answer
68 views

Changing basis gates 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 ...
1 vote
2 answers
75 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. ...
  • 117
3 votes
2 answers
154 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 ...
0 votes
2 answers
61 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.
1 vote
1 answer
74 views

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

In Qiskit, there are explicit transpile [1] (where a circuit is transpiled to primitive gates) and backend.run [2] (where the ...
  • 111
0 votes
2 answers
101 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 ...
2 votes
1 answer
76 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 ...
1 vote
0 answers
108 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\...
  • 1,953
1 vote
1 answer
96 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 ...
1 vote
1 answer
132 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 ...
2 votes
1 answer
475 views

Qiskit custom multi controlled gate

I'm building a 3 qubit circuit with the control-ry rotation gate. The code is the following: ...
1 vote
1 answer
169 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 ...
3 votes
1 answer
153 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 ...
  • 31
6 votes
1 answer
584 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 ...
  • 1,953
1 vote
1 answer
73 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: ...
4 votes
1 answer
135 views

Decomposing S gate in two T gate with qiskit

Let's suppose I define a basis gate set and the following circuit. ...
4 votes
1 answer
488 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 ...
3 votes
2 answers
144 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 ...
1 vote
1 answer
175 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. ...
  • 807
3 votes
0 answers
79 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 ...
  • 385
4 votes
1 answer
121 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 ...
2 votes
0 answers
50 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 ...
  • 97
1 vote
1 answer
355 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 ...
  • 807
1 vote
1 answer
286 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 ...
  • 807
2 votes
2 answers
205 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 ...
  • 41
2 votes
2 answers
239 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. ...
9 votes
2 answers
887 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) ...
1 vote
1 answer
51 views

What are standard/most popular data formats to represent quantum circuits including hardware specifications?

On an abstract level one draws a circuit diagram with wires and gates. Different software frameworks like qiskit, circ etc. ...
4 votes
1 answer
413 views

Qiskit: Transpilation and the CircuitSampler

I am using Qiskit's opflow and its CircuitSampler to evaluate matrix elements / expectation values. Now, going beyond ...
  • 531
3 votes
0 answers
120 views

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: ...
  • 2,338