Questions tagged [quantum-gate]

For questions regarding usage, performance, implementation, application or theory related to quantum gates.

Filter by
Sorted by
Tagged with
2
votes
2answers
73 views

Generate a 3-qubit SWAP unitary in terms of elementary gates

I wish to generate the following unitary ...
2
votes
0answers
21 views

Keeping data around in an entangled state: use cases

I'm following the IBM Quantum roadmap and really excited to see what the next 3 years bring. As part of the unveiling, they mentioned that the 1000 Qubit machine goal will really stabilize things with ...
0
votes
2answers
56 views

Custom Gate/Instruction with classical bits in Qiskit

In Qiskit, I need to define a custom gate or instruction that, once decomposed, turns into a series of basis gates, including measurements and classically controlled gates (this is the part that I can'...
4
votes
3answers
51 views

Bell state preparation

I was watching some lectures on qubits. They were talking about how to generate a Bell state. They described it as follows: Prepare state 00: $$\left |0 \right> \otimes \left |0 \right>$$ Apply ...
0
votes
1answer
87 views

What is the matrix representation of the Hadamard gate in the computational basis?

I read about Hadamard gate H and found it's matrix representation as follows: $$H_1=\frac{1}{\sqrt 2}\begin{pmatrix}1 & 1 \\1 & -1\end{pmatrix}$$ I wanted to know what will be the matrix ...
3
votes
1answer
47 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 ...
-1
votes
1answer
24 views

Implementing Cirq Coding Gates

Can someone please help me making these gates on CIRQ programming: Decrement Gate (-1) Splitter Gate (If possible) I was having trouble implementing these and was not sure if it's possible either. ...
2
votes
1answer
51 views

How can I convert the unitary matrix $e^\frac{i\pi}{2}$ into a quantum circuit in Qiskit?

How can I put the unitary matrix $$e^\frac{i\pi}{2}I$$ to the quantum circuit? I don't know if it is belong to $$U3(\theta, \phi, \lambda), U2(\phi, \lambda), U1(\lambda)$$ Thanks a lot.
3
votes
0answers
58 views

What is the thought process for circuit making after seeing input and output of a matrix?

Here is an exercise (4.27) from Nielsen and Chuang and I found the answer (given in the figure below) online without any explanation. The question was to construct a circuit by seeing a matrix (given ...
2
votes
1answer
47 views

Counting Achievable Operations

I'm struggling to find an analytic way to solve this problem. There are $4! = 24$ possible classical operations on the four 2-Cbit basis states. How many of these are achievable via the classical ...
1
vote
1answer
43 views

Quantum Circuit Optimization with Machine Learning [closed]

I read some paper about Quantum Circuit Optimization but I am on a low level. And have some experience in ML. But what I don't understand is it possible that ML can help to optimize Quantum Circuits ...
3
votes
1answer
102 views

How to implement linear combination of two unitary gates in a quantum circuit?

I wanted to implement a non-unitary operation. I came to know that I can do it as a linear combination of unitaries from this paper (published version). Let us say I want to implement an operation ...
-1
votes
1answer
112 views

Implementing a circuit that returns $|01\rangle$ and $|10\rangle$ with equal probability

Using Python how can I implement a quantum circuit that returns $|01\rangle$ or $|10\rangle$ using only $CX$, $RX$ and $RY$ gates, starting with random parametric gates as parameters and optimizing it ...
-1
votes
3answers
104 views

Google Colab - ImportError: The class MatplotlibDrawer needs pylatexenc

When I run the following command qc.draw(output='mpl') for my circuit qc, I get this error: ...
2
votes
1answer
34 views

What is the connection between $RX$ gates and $X$ gates (similar for $Y$ and $Z$)?

I am new to quantum gates but do not understand the connection between the $RX$ and $X$ gates. I know that $$R X(\theta)=\exp \left(-i \frac{\theta}{2} X\right)=\left(\begin{array}{cc} \cos \frac{\...
3
votes
1answer
33 views

How to understand intuitively the quantum gate phase kickback?

I do understand the math behind phase kickback. The math makes sense. For more context, I find this document very helpful. But I’m struggling a lot to intuitively understand, why the conditional phase ...
3
votes
1answer
62 views

How can we only use 8192 shots for an experiment with 14 or more qubits?

Let's say you want to do an experiment with 14+ qubits. You apply some arbitrary unitary operator $U \in (\mathbb{C}^2)^{\otimes n} \times (\mathbb{C}^2)^{\otimes n}$ to the state $|\psi\rangle \in (...
2
votes
1answer
34 views

Qiskit: Get gates from circuit object

Is there a way in Qiskit to take a circuit object and return a list of tuples where each tuple consists of a gate and the qubit(s) they act on? The list obeys some partial order since the gate order ...
2
votes
0answers
23 views

What is the elementary gate set for ion-trap quantum computers?

I asked earlier Which quantum gates can we use in terms of depth?. In the question, I asked I want to measure the depth of a circuit, but I do not know which quantum gates should be used when the ...
3
votes
1answer
49 views

Implement U2 and U3 gate in Q#

I know that U1 equivalent gate of Qiskit in Q# is R1, but I would like to implement U2 and U3 gate of Qiskit in Q#, what is the best way ? Thank you.
5
votes
2answers
117 views

Is the square root of SWAP gate “maximally entangling”?

I'm not sure if this is a good question for the site, but here goes. On the "Quantum logic gate" Wikipedia page, it is said that: The $\sqrt{\mathrm{SWAP}}$ gate is not, however maximally ...
1
vote
1answer
37 views

Can I append gates in a certain position in a Qiskit circuit

I have a question regarding modifying Qiskit circuits. I have a set of circuits that are pretty similar to each other. The only difference being some gates in the beginning of each circuit. I was ...
1
vote
1answer
27 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 ...
1
vote
1answer
67 views

controlled-Z rotation gates in symmetrical fashion

I was going through the qiskit textbook and in this chapter, i came across a statement under the topic "Kickback with the T-gate" related to the Controlled-Z gate that "the controlled-...
1
vote
1answer
57 views

How do quantum gates work on qubits in the physical world?

How do quantum gates work on qubits in the physical world? What are different ways through which qubits can be manipulated in the physical world? For example, by analogy a classical NOT gate uses ...
2
votes
1answer
35 views

How to define Q-operator in Quantum Amplitude Estimation

I'm trying to implement a circuit for Quantum Amplitude Estimation in Qiskit using elementary gates. I have created the circuit that represent my algorithm $A$ but now from the theory I know that I ...
2
votes
2answers
474 views

Is a 0 degree rotation around an axis meaningless?

For example, if I had a gate rz(0), it holds no value in a circuit. It comes out to a matrix of [[1,0], [0,1]], which seems to ...
2
votes
1answer
56 views

Unexpected Relative Phase while making the Toffoli Gate

I was trying to build the Toffoli gate using the following diagram (found in the qiskit textbook): So, I set V := Rx(pi/2) (as shown in the following diagram) (...
2
votes
1answer
32 views

Optimize chains of single-qubit u1, u2, u3 gates by combining them into a single gate in Qikist

Can anyone explain how Qiskit does the merging of single-qubit gates for the purpose of optimization? u1(lambda1) * u1(lambda2) = u1(lambda1 + lambda2) ...
2
votes
0answers
19 views

Can low-rank factorizations approximate quantum circuits?

Quantum circuits can be expressed as the matrix product of each gate in the circuit, where each gate is a unitary matrix (say) $G_i$. So, the whole circuit is $S = G_n G_{n-1} \cdots G_1$. Since $S$ ...
2
votes
0answers
35 views

What is known about the quantum version of Schoening's algorithm for 3SAT?

Schoening's algorithm for 3SAT can be converted to a quantum algorithm.  The classical circuit representing a 3SAT expression in CNF form can be converted to a quantum version involving reversible ...
3
votes
1answer
32 views

Can we always find a unitary operation connecting qubit states with given eigendecompositions?

Consider the density matrices $\rho_0 = |0 \rangle \langle 0|$ and $\rho_1 = |1 \rangle \langle 1|$. Let $\{p_1, p_2\}$, and $\{p_3, p_4\}$ be two probability distributions, that is, $$0 \leq p_1, p_2,...
2
votes
0answers
11 views

Are there already hypothetical durations of how long a continuous-variable gate would take on a continuous-variable quantum computer?

I've heard that you run up against the very large constant factors when comparing run times of quantum and classical computers -- things simply take much longer in a carefully controlled quantum setup ...
0
votes
0answers
32 views

Why QuantumCircuit.diagonal does not provide global phase when it is used in a controlling circuit

When it is used in a controlling circuit, QuantumCircuit.diagonal() decomposition in Qiskit does not provide global phase (as a relative phase), but instead only identity operator is used. Here the ...
4
votes
1answer
41 views

Adding a phase to qubit: why is it necessary for arbitrary single qubit gate

An arbitrary single qubit gate can be decomposed as: $$U=e^{i \alpha} R_z(\beta) R_y(\gamma) R_z(\delta)$$ We notice that in addition to the three rotations, there is a coefficient $e^{i \alpha}$. ...
1
vote
1answer
57 views

Hadamard direct mapping of input to output in $\theta$ and $\varphi$ form

I was wondering what would be an equation for Hadamard operation for a single qubit, given the input as the current $\theta$ (0 to $+\pi/2$) and $\varphi$ ($-\pi$ to $+\pi$) and output expected in $\...
4
votes
1answer
94 views

Why are there such different UGate and U3Gate implementations in the Qiskit documentation?

The documentation for the new version Qiskit 0.20.0 states that: UGate is "Implemented using two X90 pulses on IBM Quantum systems: $U(θ,ϕ,λ)=RZ(ϕ−π/2)RX(π/2)RZ(π−θ)RX(π/2)RZ(λ−π/2)$" ...
1
vote
0answers
26 views

Gate definitions for quantum random access codes

I would like to know how the gates are defined in quantum random access codes? Consider the $2 \to 1$ code described in Lemma 3.1 of this paper. The section defines the encoding and decoding circuits. ...
2
votes
2answers
102 views

Is there a good way to mathematically write a CNOT operation over non-neighboring qubits in a circuit? [duplicate]

I was wondering if there is any way to present the CNOT matrix as we usually present single qubit operations $$... 1 \otimes NOT \otimes 1 ...$$ I know that for adjacent qubits in a circuit we can ...
1
vote
0answers
21 views

How to implement gate error mitigation in Qiskit?

I have been using the Ignis module for performing error mitigation but it accounts only for the measurement errors. For this reason, I want to know if there is some way to perform gate error ...
7
votes
1answer
1k views

Would IBM's “compiler” turn my identity circuit into nothing?

If I were to create a circuit with the following gate: $$\tag{1}R_\phi = \begin{bmatrix} 1 & 0 \\ 0 & e^{i \phi} \end{bmatrix},$$ with $\phi$ specified to be equal to 0, then the gate that I ...
0
votes
0answers
11 views

There seems to be a bias against states with more 1s, in IBM's calibration matrix generator: What are the consequences and possible solutions?

Qiskit's function CompleteMeasFitter builds a calibration matrix in this way (2 qubit case): Everything is initialized in the state $|00\rangle$, which is the ...
3
votes
1answer
37 views

Can you take infinitely many square roots of Pauli-X?

I am trying to find the cost for a n-bit Toffoli gate based on the recurrent circuit presented on Barenco's Work in Lemma 7.5 (Elementary gates for quantum computation) The construction requires that ...
3
votes
1answer
64 views

Why is the action of controlled-Z unaltered by exchanging target control qubits?

In the book "Quantum Computer Science", when explaining the error correction code, it uses this picture and says "the action of controlled-z is unaltered by exchanging the target and ...
2
votes
1answer
41 views

How can you decompose Grover's diffusion operator into gates?

I know how Grover's diffusion operator works ($U_s = 2|s\rangle\langle s|-I$) with the inversion around the mean. However, I want to implement it in simpler gates, to use the algorithm. How can I do ...
3
votes
1answer
27 views

Limitations on the number of qubits for a $\mathrm{CNOT}$-gate in cluster states

I'm reading about cluster states using this online source. It is explained that a CNOT can be performed on cluster states using as little as $4$ qubits. However, the standard implementation is with $...
1
vote
1answer
54 views

What are the I, X, Z gates in quantum gates? [closed]

Can someone please explan how the $\rm I$, $\rm X$ and $\rm Z$ gates work? If $\rm{I = X^2 = Z^2}$, can you explain why this is the case or why it wouldn't work?
2
votes
1answer
95 views

Why is declared that $0 \le \theta \le \pi$ for Qiskit's U3 gate?

It stated in Qiskit's documentation. This question arose after I accidentally called the U3 gate with parameter $\theta$=$2\pi$ in the program and Qiskit executed the program without error: ...
2
votes
2answers
121 views

How is it not a contradiction that it is possible to build fault tolerant circuits with strictly contractive (e.g.: depolarizing noise) channels?

This paper discusses strictly contractive channels, i.e. channels that strictly decrease the trace distance between any two input quantum states. It is shown that if a quantum circuit is composed of ...
1
vote
1answer
68 views

Can SWAP operators change trace of a product state? [closed]

I am currently reading https://arxiv.org/abs/1501.03099. In the third part of the paper, "Measuring and detecting quantumness", the authors define the SWAP operators, use them on the initial ...

1
2 3 4 5
14