Skip to main content
Share Your Experience: Take the 2024 Developer Survey
12 votes

Transpilation into custom gate set in qiskit

The Qiskit standard gate list You can find the full list of Qiskit standard gates in the module qiskit.circuit.library.standard_gates (documentation). The matrix ...
luciano's user avatar
  • 5,813
8 votes
Accepted

Can W gate be written only using H,T?

Try the sequence: $$ HT^6HT^2H. $$ What was my thinking? I'm used to doing a transformation that looks something like $$ S^\dagger H S. $$ The action is the $S$ is to preserve the $Z$ term inside $H$, ...
DaftWullie's user avatar
  • 58.8k
6 votes
Accepted

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

Although $\{\textrm{CCX}, \textrm{H}\}$ is a universal gate set, it is not universal in the sense that any unitary can be expressed in terms of finite sequence of its elements. For any quantum circuit,...
Egretta.Thula's user avatar
6 votes
Accepted

Qiskit: Transpilation and the CircuitSampler

This post contains a few questions, so let's first recap the steps the circuit sampler goes through (you can also check out the source code here), before answering your questions. How the Circuit ...
Cryoris's user avatar
  • 2,953
5 votes
Accepted

Replace Gate with Known Identity in Quantum Circuit

The proper way to implement this would be writing your own transpiler pass, a TransformationPass to be more precise, which replaces the RYY and RZZ gates with your ...
Cryoris's user avatar
  • 2,953
4 votes

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

CX is a spacial case of CCX when one of the control qubit is $|1\rangle$. ...
luciano's user avatar
  • 5,813
4 votes

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

It was a bug, now fixed in release 0.40.0. In the release notes, you can read: Fixed an issue with the transpile() function when run with optimization_level=3 and no backend, basis_gates, or target ...
Michele Amoretti's user avatar
4 votes
Accepted

How is quantum transpilation scaled?

tl;dr Indeed, if at any point one would need to compute and store $2^n\times2^n$ unitary of the circuit in memory that would be infeasible and render the quantum computation obsolete (it may still be ...
Nikita Nemkov's user avatar
3 votes

Optimal decompositions of some standard multi-qubit gates

I was pointed to this very nice paper On the CNOT-cost of TOFFOLI gates . The issue appears to be much more complicated than I thought. Apparently there are theses yet to be written on the ...
Nikita Nemkov's user avatar
3 votes

Optimal decompositions of some standard multi-qubit gates

As detailed in The simplified Toffoli gate implementation by Margolus is optimal, a construction of the simplified Toffoli (which introduces for some relative phase) cannot be constructed with fewer ...
epelaez's user avatar
  • 2,895
3 votes

Transpiling qiskit quantum circuits on IonQ Native Gates

I had a try implementing the general algorithm you posted as it is proposed on the IonQ Native Gates guide. Since 1-qubit rotation gates $R_x$, $R_y$, $R_z$ together with the 2-qubits $CNOT$ form a ...
SimoneGasperini's user avatar
3 votes
Accepted

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

The compilation is, indeed, currently one of the best ways to increase the fidelity of a run. Also under the assumpution of fault-tolerant computation, compilation would eventually reduce the depth of ...
Daniele Cuomo's user avatar
3 votes
Accepted

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

The standard way to debug transpile is via the callback option. From the documentation: A callback function that will be called ...
luciano's user avatar
  • 5,813
3 votes

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

Accourding to Browne et al. it seems the translation from GBQC to MBQC is of size O(N^3) and from MBQC to GBQC the translation is of size ...
Dr. Eyal Cornfeld's user avatar
3 votes
Accepted

How to transpile a quantum circuit using the $\{H,T,CNOT\}$ universal set of gates?

Solovay-Kitaev algorithm is implemented in SolovayKitaev class. You can use it by transpiling your circuit using ...
Egretta.Thula's user avatar
2 votes

Transpilation into custom gate set in qiskit

You can use BQSKit to accomplish this very easily. BQSKit is a powerful and portable quantum compiler/transpiler. You will need to calculate the unitary of your gate and you can just plug that into ...
edyounis's user avatar
2 votes

Transpiling with dynamical decoupling sequence

The optimization level 0 wont merge the gates: ...
luciano's user avatar
  • 5,813
2 votes
Accepted

Does Qiskit transpiler execute multiple circuits in parallel?

It depends on your local environment and local configuration. By default if you're running on Linux with Python < 3.9 or macOS with Python < 3.8 then passing mutiple circuit's to ...
Matthew Treinish's user avatar
2 votes

Qiskit: Transpile circuit with custom equivalences

If you look at Qiskit's equivalence_library.py, you'll notice that each gate and equivalent circuit include their parameters. ...
Evan McKinney's user avatar
2 votes

Decomposing S gate in two T gate with qiskit

The transpile doesn't work because the identity $S = TT$ is not there in the SessionEquivalenceLibrary. You can add an entry ...
Peter Ivashkov's user avatar
2 votes

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

There are some serious issues in the choice of model architecture that will make learning almost impossible. Below I'll comment on why this specific architecture and implementation is not going to ...
forky40's user avatar
  • 7,123
2 votes
Accepted

Qiskit custom multi controlled gate

I think you are looking about this: ...
poig's user avatar
  • 632
2 votes

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

Given any arbitrary one-qubit gate you can only approximately decompose it into a product of gates from a finite universal basis gate set $\mathcal{S}$. In other words, if the basis gate set $\mathcal{...
MonteNero's user avatar
  • 2,666
2 votes

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

I'm still not sure that this question is well posed. Imagine I have some set of gates that I can implement in a single step (this may be a finite set, but the argument still follows if it's a ...
DaftWullie's user avatar
  • 58.8k
2 votes
Accepted

Qubit configuration in Qiskit

I assume you're talking about creating a custom qubit connectivity. This is very easy to experiment with in Qiskit. The simplest way is to create a CouplingMap ...
Matthew Treinish's user avatar
2 votes
Accepted

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

The easiest way from the top of my head is to simply compose your multiregistered circuit to a flat one: Say you have this circuit: ...
luciano's user avatar
  • 5,813
2 votes

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

A good strategy is to optimize the macroscopic and microscopic details of fault tolerance separately. At the microscopic level you focus on "how do I make a fault tolerant H gate available?" ...
Craig Gidney's user avatar
2 votes
Accepted

Initial and final circuit layout with BQSKit compiler

This is an awesome question about BQSKit. Currently, the off-the-shelf (bqskit.compile) workflows do not provide a mechanism for this besides what you have ...
edyounis's user avatar
2 votes
Accepted

Transpile mct to cx without QuantumCircuit

I dont think your problem is related with QuantumCircuit, but with synthesis of such as big MCT. By default, the amount of resulting gates grows very quickly (it ...
luciano's user avatar
  • 5,813
2 votes

Rotations with angle 0 after transpiling with qiskit

why this happens This happens because of the way BasisTranslator transpiler pass works. BasisTranslator translates gates to a ...
Egretta.Thula's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible