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
0 votes
0 answers
17 views

BQSkit Selecting Starting Circuit Structure

Background On the BQSKit repository, there is a nice example of using the qfactor algorithm to instantiate a 3-qubit Toffoli circuit. For this to work, however, it is first necessary to specify an ...
Shadow43375's user avatar
2 votes
0 answers
46 views

Layout error with after compilation with custom Qiskit pass manager

I am trying to implement the custom Qiskit pass manager from this paper. The code from the authors is provided here on GitHub. I am able to get the pass manager working, and a compiled circuit is ...
greelious's user avatar
  • 121
1 vote
1 answer
46 views

Transpile and run don't use GPU device

I'm trying to run an implementation of Shor's algorithm using a GPU device. While running with $N<1023$ works (23 qubits), when running with a higher number of qubits, the program ends before ...
Pablo Falegre's user avatar
2 votes
0 answers
24 views

Controlled Ry gate on IBM and IonQ basis gates

As far as I know the basis gates for IBM and IonQ are: IBM: ['cx', 'id', 'rz', 'x', 'sx'] IonQ: ['rx', 'ry', 'rz', 'rxx', 'id'] I used qiskit.transpile to see check how Controlled Ry gate can be ...
user20762126's user avatar
0 votes
1 answer
33 views

How to remove or change the Coupling-Map limit is qiskit?

I am trying to implement large qiskit circuits which give coupling map error as coupling map cannot exceed 31 is basic aer_simulator or even ...
Syed Shahmir Kazmi's user avatar
2 votes
1 answer
39 views

Increasing qubit limit in Qiskit for benchmarking

I am aware that each backend in Qiskit has a qubit limit. Across all backends in Aer, the limit is 24. When we employ ...
Zee's user avatar
  • 361
3 votes
1 answer
68 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
  • 6,162
0 votes
0 answers
128 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
211 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,921
0 votes
1 answer
72 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
208 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
177 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
237 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,204
2 votes
0 answers
168 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
46 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
83 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
363 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
68 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
176 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
248 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
  • 1,015
1 vote
2 answers
162 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
116 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
  • 1,015
3 votes
1 answer
90 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
67 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
787 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
531 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
223 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
147 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
269 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
147 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
132 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
330 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
78 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
148 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
133 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
146 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
126 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,306
1 vote
1 answer
179 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
479 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
575 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
312 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
652 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,306
1 vote
1 answer
180 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
201 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
937 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
678 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
284 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
  • 907
4 votes
0 answers
105 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
  • 443
4 votes
1 answer
150 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