Questions tagged [gate-synthesis]

For questions about finding (short) gate sequences to implement a specific unitary operation, for example decomposing a complicated multi-qubit gate into a sequence of basic gates. It might apply to optimizing circuits with respect to length or depth or finding gate sequences to implement an algorithm.

Filter by
Sorted by
Tagged with
3 votes
0 answers
79 views

What is the correct name of this quantum gate? Possibly state control gate

Let $\vec v \in \mathbb{C}^2 $ be the following quantum state: $$ \vec v = \frac{1}{\sqrt{2}}\begin{bmatrix} v_{1} \\ v_{2} \\ \end{bmatrix},\space \lvert v_1 \rvert = 1,...
user avatar
5 votes
1 answer
120 views

Construction of unitary matrices built from linear combination of Pauli strings

Let's define $P_k \in \{ I, X, Y, Z \}^{\otimes n}$ and called each of these $P_k$ as a Pauli string (or word) then given that $$U = \sum_{k=1}^L c_kP_k $$ with the following conditions: $\sum_{k=1}...
user avatar
  • 12.3k
4 votes
1 answer
131 views

If $A^4=B^4=AB=I$, what is a good circuit for $\sqrt A\sqrt B$?

TL/DR What is a good circuit for: $$\frac{1}{2}\begin{pmatrix} -i & i & 1 & 1 \\ 1 & 1 & -i & i \\ i & -i & 1 & 1 \\ 1 & 1 & i & -i\end{...
user avatar
  • 6,777
2 votes
0 answers
56 views

Creating a unitary for binary encoding with respect to already encoded index states

Let us say that there are two quantum registers qr1 and qr2. Now the qr1 is in the state $\sum_i |x_i\rangle$(here $x_i$ is binary encoded value upto some precision) and originally qr2 is $|0\rangle$, ...
user avatar
3 votes
1 answer
153 views

How to perform a controlled Pauli string rotation gate?

I would like to know some circuit decomposition for an arbitrary controlled Pauli string rotation: \begin{equation} |0\rangle\langle 0| \otimes e^{i \theta (P_1\otimes...\otimes P_n)}+ |1\rangle\...
user avatar
  • 401
3 votes
0 answers
76 views

Relation between geometric and discrete circuit complexity

Geometric complexity of a unitary, as introduced for example here https://arxiv.org/abs/quant-ph/0502070, measures the length of a geodesic connecting the identity matrix and a given unitary in the ...
user avatar
5 votes
1 answer
75 views

Native Gate Decomposition

TL;DR: I've got a very small set of gates to use and need to find efficient decompositions for $R_y$ and controlled $R_y$ gates. Does anyone have any better ideas than what I have? I'm looking to ...
user avatar
4 votes
1 answer
72 views

Confusion with the number of CNOTs in a circuit

I am a bit puzzled on the following circuit. According to this Quantum Computing SE thread it holds that $$ e^{i(Z\otimes Z)t} = {\rm CNOT} (I\otimes e^{iZt}){\rm CNOT} \qquad (1) $$ As a result we ...
user avatar
5 votes
2 answers
97 views

How many quantum gates are needed to prepare an arbitrary state?

In this paper there is this sentence: [...] the description of a $2^n\times2^n$ unitary matrix $U$ (which is a poly($n$)-size quantum circuit) According to the meaning of "which" in ...
user avatar
2 votes
1 answer
58 views

Decompose bell measurement gate into combination of controlled-not gates and one-qubit gates

OPENQASM2.0 has only one two-qubit gate: controlled not. For a teleportation experiment, I need to perform a measurement in the Bell basis. That is, I need a two-qubit gate with matrix representation $...
user avatar
7 votes
1 answer
335 views

Is the Solovay-Kitaev theorem relevant for modern hardware?

The Solovay-Kitaev theorem (and more recent improvements) explains how to efficiently compile any 2-qubit unitary into any universal (dense) finite set of gates. My question is if this theorem is ...
user avatar
1 vote
2 answers
35 views

Circuit including phase factor in $XY(\beta, \theta)$ gate

In Implementation of the XY interaction family with calibration of a single pulse, the $XY(\beta, \theta)$ gate is defined as $$ XY(\beta, \theta) = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 &...
user avatar
  • 2,576
-2 votes
1 answer
79 views

Decomposition of U1 gate $U_1(\lambda)$ , Phase Shift gate $\phi(\delta) $, and Swap gate [closed]

Can we express U1 gate $U_1(\lambda)$ , Phase Shift gate $\phi(\delta) $, and Swap gate $$ U_1(\lambda) = \begin{pmatrix}1 & 0 \\ 0 & e^{i\lambda}\end{pmatrix}$$ $$ \phi(\delta) = \begin{...
user avatar
  • 163
2 votes
2 answers
63 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 ...
user avatar
2 votes
4 answers
581 views

How is a Toffoli gate built without using T gates?

Can someone tell me how to make a Toffoli gate without using T gates? Can we use $R_x$ and $R_y$. If yes, then how? I tried many circuits but I was unable to create the CCNOT gate out of $R_x$, $R_y$ ...
user avatar
2 votes
1 answer
57 views

Is it possible to decompose $\land(UXU^\dagger)$ in one-qubit operations and only a single $\land(X)$?

Let $U,V$ being any unitary. Is it possible to decompose $\land(UXU^\dagger)$ in one-qubit operations and only a single $\land(X)$? Something like the following: $\land(UXU^\dagger) \equiv (\mathbb{I}\...
user avatar
1 vote
1 answer
44 views

Generalized push for $\land_{ab}(X)$ gate

EDIT: In the following I am using the Feynman notation for controlled operations - e.g. $\land_{ab}(X)$ is equivalent to a $CNOT$ with control qubit $q_a$ and target $q_b$. Ultimately, for any single-...
user avatar
4 votes
0 answers
73 views

Universality for reversible classical computation

Is there any way to check whether a set of gates (for example, take the set comprising of the CNOT gate and the Hadamard gate) is universal for reversible classical computation? I can think of trial ...
user avatar
2 votes
2 answers
113 views

Is it possible to push back an $H$ gate to a $CZ$ gate?

Given the above scenario. Is it possible to "push back" the $H$ gate operation to occur before $CZ$? Formally I am looking for some operation $CZ\cdot(U_1\otimes U_2) = H\cdot CZ$.
user avatar
3 votes
0 answers
81 views

How exactly does the QuantumCircuit.decompose() method work?

From what I can understand from the source code, the circuit is converted into a DAG before the decomposition transpiler is performed onto the DAG circuit. How does converting to a DAG circuit help us ...
user avatar
  • 73
7 votes
2 answers
283 views

Complexity of $n$-Toffoli with phase difference

I'm interested in the $n$-Toffoli gates with phase differences. I found a quadratic technique in section 7.2 of this paper. Here's the front page of the paper. Here's an image of the section that I'm ...
user avatar
  • 101
6 votes
2 answers
954 views

How to visualize Hadamard gate as $X$-$Z$-$X$ decomposition?

In the book Quantum Computation and Quantum Information by Nielsen and Chuang, chapter 4, exercise 4.4 (pg. 175), the author has asked to express Hadamard gate as product of $R_x$, $R_z$ rotations and ...
user avatar
5 votes
2 answers
198 views

How to implement the power of a product of quantum gates as a circuit?

Suppose I have quantum gates (i.e. unitary matrices) $A$ and $B$, and I want to implement $(AB)^x$ in a circuit. If $x$ is integer, I can simply apply $A B$ repeatedly $x$-times. But what if $x$ is a ...
user avatar
  • 2,344
6 votes
1 answer
488 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) ...
user avatar
3 votes
0 answers
61 views

Reducing an ansatz to a shallower circuit

Given a very general hardware efficient ansatz as in Figure: and say that you already know all the rotation parameter for the gates in the red box, is there any way to build a gate sequence that ...
user avatar
  • 413
3 votes
1 answer
161 views

How to create CNOT from an entangling gate and arbitrary single-qubit gates?

I am working on the classical simulation of quantum circuits. I know how to efficiently implement the following entangling gate, which -- in the following paper: https://arxiv.org/pdf/1803.02118 -- ...
user avatar
4 votes
2 answers
89 views

What gate should one use to perform $R_y$ using a single $R_z$ + Clifford gates?

I know how to perform Rz rotations with the least amount of T gates, eg by using Efficient Clifford+T approximation of single-qubit operators by Peter Selinger. Similarly, one could use H Rz H to ...
user avatar
  • 401
3 votes
1 answer
73 views

Tool to verify $CNOT$ (or any interacting 2-qubit gate)

Is there any tool to define a circuit and verify if it works as desired? It would be interesting to find ways of performing interacting gates - e.g. CNOT gate - between non adjacent qubits. Hence I'd ...
user avatar
7 votes
3 answers
817 views

Is it possible to make a Toffoli gate using only CNOTS and ancillas?

I have tried to make a Toffoli gate using only CNOTs and some ancilla qubits but I do not get the unitary. It seems it is not possible without additional gates? What could I do to prove it? I have ...
user avatar
  • 1,015
2 votes
1 answer
61 views

Do we need to use an ancillary qubit when decomposing arbitrary $U(2^n)$ gates using Clifford+T universal gate sets?

As I know, we can decompose $U$ without ancilla if it's from special unitary group $SU(2^n)$. Do we need to use ancilla qubit on decomposing arbitrary $n$-qubit $U$ using Clifford+T universal gates ...
user avatar
3 votes
1 answer
242 views

What is Qiskit's Transpiler method for unitary synthesis?

As I could found in here how the transpile works in qiskit, I understood that transpile gets arbitrary Unitary gate $U$ and some set of basis gates as input, and produce some quantum circuit of $U$ ...
user avatar
3 votes
1 answer
89 views

From mathematical notation to quantum circuit, in general

I am learning the basics of quantum computing using Qiskit and I encountered a problem when I tried to solve some of our course exercises. I feel like I am missing an invisible step, the step from ...
user avatar
2 votes
3 answers
154 views

Find unitary such that $U:|i\rangle|0\rangle\rightarrow|i\rangle|A_i\rangle$

Let's assume I have two qubits of state $|A_0\rangle$ and $|A_1\rangle$ correspondingly stored in a quantum memory. How do I find a Unitary $U$ that acts on another register of 2-qubits such that $$U:|...
user avatar
  • 239
3 votes
1 answer
136 views

How does a general rotation $R_\hat{n}(\theta)$ related to $U_3$ gate?

From eqn. $(4.8)$ in Nielsen and Chuang, a general rotation by $\theta$ about the $\hat n$ axis is given by $$ R_\hat{n}(\theta)\equiv \exp(-i\theta\hat n\cdot\vec\sigma/2) = \cos(\theta/2)I-i\sin(\...
user avatar
  • 2,158
3 votes
2 answers
339 views

How to implement $\sqrt{iSWAP}$ in Qiskit

I want to implement the $\sqrt{iSWAP}$ operator using simple operations in Qiskit such as it is done for the $iSWAP$ here or $\sqrt{SWAP}$ gate here. How can I do this? If possible I would like to ...
user avatar
  • 483
2 votes
1 answer
79 views

How does MCPhaseGate/MCU1Gate works internally in qiskit?

I was curious about the implementation of MCPhase/MCU1Gate and how it works without ancilla qubits. I ended up checking the code of the some auxiliary (?) function ...
user avatar
  • 61
2 votes
1 answer
105 views

IBM Qiskit QAOA gate implementation question

In section $5.2$ of the QAOA chapter in Qiskit textbook, section $5.2$, state preparation uses the gate $U_{k,l}(\gamma) = e^{\frac{i \gamma}{2} (1-Z_k Z_l)}$. Later, in section $5.3$, this gate is ...
user avatar
  • 85
6 votes
1 answer
245 views

More efficient implementation of $4$-qubit gate

While working on an error detection algorithm, I stumbled upon the problem of simplifying the following implementation Here, the $S$ gate is defined by $$S=\left( \begin{array}{cc} \frac{\sqrt{3}}{2}...
user avatar
  • 125
4 votes
1 answer
379 views

How to construct a controlled-Hadamard gate using single qubit gates and controlled phase-shift?

How can I construct a controlled-Hadamard gate using single qubit gates and controlled phase-shift? I am stuck in this and any help would be appreciated.
user avatar
2 votes
0 answers
72 views

Representation of multiple qubit matrices in Dirac notation

Imagine one wants to represent the and function for any number of qubits in Dirac notation. The and gate flips the target qubit if all the control qubits are in state 1. This is its matrix ...
user avatar
6 votes
3 answers
109 views

How to create the state $\vert 0 \rangle+i \vert 1 \rangle$ using elementary gates?

I am trying to write $|0\rangle+i|1\rangle$ in terms of elementary gates like H, CNOT, Pauli Y, using the IBM QE circuit composer. I was thinking some kind of combination of H and Y since $Y|0\rangle=...
user avatar
  • 121
4 votes
1 answer
133 views

Single-qubit rotations on a subspace within two-qubit unitary

I would like to implement the operation $$ U(a,b) = \exp\left(i \frac{a}{2} (XX + YY) + i \frac{b}{2} (XY - YX) \right) $$ ($a,b \in \mathbb{R}$) without using Baker-Campbell-Hausdorf expansion, ...
user avatar
  • 4,537
3 votes
1 answer
256 views

Gate-level implementation of Eigenvalue-Inversion in HHL

I am trying to understand how does the gate-level implementation of eigenvalue-inversion step in the HHL algorithm works. I am following this reference, where it is stated (Lemma 4) that this can be ...
user avatar
7 votes
3 answers
141 views

Decomposing gates resembling exponentiated members of desired gateset

Suppose I have access to a pretty typical gate set, for example $\{\text{CNOT}, \text{SWAP}, \text{R}_{x}, \text{R}_{y}, \text{R}_{z}, \text{CR}_x, \text{CR}_y, \text{CR}_z\}$ where $\text{CR}$ is a ...
user avatar
  • 4,537
-1 votes
1 answer
50 views

How to create a gate with functionality CCX(a,b,b)?

Can we create a Controlled gate with below functionality? if {a==|1> && b==|1>} then {qc.x(b)} Basically, a CCX gate but the output Qubit is actually one of the input Qubits. Apparently, ...
user avatar
  • 65
6 votes
0 answers
82 views

Reducing the depth of quantum circuits with ancilla qubits

This question is two-fold and considers general $n$-qubit operations on a quantum computer. First, can a general $n$-qubit operation be implemented on a quantum computer without the use of ancilla ...
user avatar
  • 1,402
4 votes
1 answer
683 views

CNOT expressed with CZ and H gates by taking into account HZH =X

From this link: Where equation 1 is: I can probably brute-force this by explicitly calculating this quantum circuit's effective 4x4 matrix and seeing that its equivalent to this teleportation ...
user avatar
0 votes
1 answer
654 views

How to code a projector operator in qiskit?

I'm new to qiskit and I want to know how do I define a projector operator in qiskit? Specifically, I have prepared a 3 qubit system, and after applying a whole lot of gates and measuring it in a state ...
user avatar
3 votes
2 answers
115 views

Decomposition of $|110\rangle \leftrightarrow |000\rangle$ Exchange Gate

How to implement a 3 qubit gate, that exchanges the level $|110\rangle$ and $|000\rangle$, with elementary gates (CNOT, SWAP, Toffoli, local gates, etc.(everything Qiskit allows)): $$ U=\pmatrix{ 0 &...
user avatar
  • 608
1 vote
1 answer
241 views

Principal square root of Pauli Y gate in Qiskit?

I've seen a similar question asked (How do I compute the square root of the $Y$ gate?) but I'm trying to understand how I can use the gates $Y^{\frac{1}{2}}$ or $Y^{\frac{1}{4}}$ in Qiskit in terms of ...
user avatar
  • 111