Share Your Experience: Take the 2024 Developer Survey

Tag Info

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 ...
• 5,813
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$, ...
• 58.8k
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,...
• 10.6k
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 ...
• 2,953
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 ...
• 2,953

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$. ...
• 5,813

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 ...
• 1,564
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 ...
• 1,655

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 ...
• 1,655

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

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 ...
• 1,542
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 ...
• 1,958
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 ...
• 5,813

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 ...
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 ...
• 10.6k

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 ...
• 96

Transpiling with dynamical decoupling sequence

The optimization level 0 wont merge the gates: ...
• 5,813
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 ...
• 1,617

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. ...

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 ...

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 ...
• 7,123
Accepted

• 632

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{...
• 2,666

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 ...
• 58.8k
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 ...
• 1,617
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: ...
• 5,813

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?" ...
• 38k
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 ...
• 96
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 ...
• 5,813