Questions tagged [quantum-gate]

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

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

Find a circuit implementing a 3-qubit unitary matrix preparing $|b\rangle\simeq(0,c,c,c,c,c,c,0)$ with $c=1/\sqrt6$

I am trying to find a circuit to represent a 3 Qubit unitary matrix such that $U|0\rangle = |b\rangle$ for $b = \left[0~c~c~c~c~c~c~0\right]$, where $c = 1/\sqrt{6}$. Although I am working in Qiskit, ...
0
votes
1answer
23 views

Parameterized swap test and perfect swap test

Suppose one has parameterized a swap test by using an ansatz $U(\theta) = \exp(-i\theta \text{ CSWAP})$, and one tries to find an angle $\theta$ such that one can distinguish given two quantum states ...
2
votes
0answers
29 views

What is the explicit best known quantum algorithm for LWE?

Consider the learning with errors(LWE) problem which is known to be hard for quantum computers. Let $q \geq 2$ be a prime integer. Consider us being given (polynomially many samples of) either: $$A, ...
2
votes
1answer
30 views

Can the ancilla for Qiskit's mcx with mode="recursion" be dirty?

I think their implementation is close to the one from here which does use a dirty ancilla, but I just want to make sure
3
votes
1answer
91 views

What are the possible gates that I can use to vary input states before CNOT?

We know that the noise of the $\text{CNOT}$ gate varies depending on the input state before it. What are the gates that I can put in the place of the 4 identity gates above to change the input state ...
2
votes
2answers
92 views

Is there a function in qiskit that allows me to insert quantum gates at certain indices of a circuit?

Here's my quantum circuit with mid-circuit measurements: ...
2
votes
1answer
38 views

Multiplication using nearest neighbour quantum gates

Let $A$ be an $n \times m$ matrix, and $x$ be an $m \times 1$ vector and $q$ be a number such that $q$ is polynomial in $n$. Let us be given both $A$, $q$, and $x$ as input and let us also have a 2D ...
1
vote
1answer
42 views

Quantum Image Processing Application

I have been reading about Quantum Wavelet transform and finding some problems. One of its application is that image is given as input and same image is retrieved as output with reduced size(Please ...
5
votes
1answer
48 views

Does the Eastin-Knill theorem hold for repetition codes?

The Eastin-Knill theorem states that For any nontrivial local-error-detecting quantum code, the set of transversal, logical unitary operators is not universal. see original paper. Does this theorem ...
1
vote
1answer
36 views

Qiskit Encoding of a Hamiltonian

I am not sure if this is a trivial question and I am just stuck or this is worth posting. I have a Hamiltonian, which is written in terms of Pauli matrices, such as H = 4.5$I$ - 16 $X_1$ - 16 $X_2$ - ...
1
vote
1answer
41 views

How to implement *nested* Grover search (in Quirk)?

$\newcommand{\ket}[1]{|#1 \rangle}$ $\newcommand{\bra}[1]{\langle #1 |}$ PS: I suppose this question could also ask "How to implement $2 \ket{s}\bra{s} - I$ for any (identifiable) $\ket{s} \in \...
4
votes
1answer
53 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 ...
24
votes
3answers
8k views

How can I implement an n-bit Toffoli gate?

I want to create a Toffoli gate controlled by n qubits, and implement it in QISKit. Can this be done? If so, how?
4
votes
1answer
65 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 ...
0
votes
1answer
39 views

Are quantum gates superoperators? How to write a quantum circuit as superoperator?

I have some questions related to superoperators: What is the differences between quantum operators and superoperators? For instance quantum gates are also unitary operators but can we say quantum ...
5
votes
2answers
67 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 ...
2
votes
1answer
31 views

Why the Ry rotation matrix give counterclockwise rotation?

The y-axis centered rotation matrix is $R_{y}(\delta)=\left[\begin{matrix} \cos \frac{\delta}{2} & -\sin \frac{\delta}{2} \\ \sin \frac{\delta}{2} & \cos \frac{\delta}{2} \end{matrix} \right]$....
1
vote
1answer
46 views

How to implement general 2-qubit gate in n-qubit system?

I am trying to implement a general 2-qubit gate in an n-qubit system (not using qiskit or cirq). Example: Consider 4 qubits. Assume we want to act a CX on qubit 2 as control and qubit 3 as target. The ...
1
vote
1answer
65 views

Writing Toffoli Gate Matrix by one and two qubit gate matrices

I am trying to write Toffoli gate matrice by using one and two qubit gates matrices. I follow this circuit link for the circuit I first started to write the matrices of one and two qubit gates: ...
1
vote
2answers
184 views

Are input/output nodes only a fiction?

When running quantum algorithms, are input and output nodes of any gate in a quantum circuit two separate sets of (physical qubit) nodes, or are we only mutating/overwriting one fixed set of nodes? ...
1
vote
1answer
33 views

Statistical 'process' behind quantum gates

Thinking about gate creating entangled state, it looks to me that the inputs to the gate look like marginal/independent distributions, and the output looks like their joint distribution. Does this ...
3
votes
2answers
382 views

Does the X (NOT) gate affect superpositions at all?

Does "NOT" gate have any effect on qubit in superposition state? After applying Hadamard gate on qubit seems like the "NOT" gate doesn't have any effect on it. Could somebody ...
1
vote
3answers
258 views

Creating a parameterized Operator in Qiskit

I'm trying to run a VQE for a specific custom Anzats. The Anzats is built up of an unitary matrix $U_H$, which I'm trying to created in this way: ...
1
vote
1answer
49 views

When can we unprepare a circuit using Clifford + measurements?

I have seen sometimes that in some protocols, one can uncompute a circuit using only Clifford + measurements. See for example Erase the two qubits containing $p_{w,r}$ and $p_{w,s}$, then the ...
4
votes
2answers
93 views

Can we rotate Bloch vectors for qudits like we do with qubits in the Bloch sphere?

I have been looking into the Bloch vectors for qudits and have been wondering if we can do rotations that are similar to the rotations in the qubit Bloch sphere. Like, once we create a Bloch vector ...
2
votes
1answer
159 views

How fast is qiskit to_gate() method, which is used to convert circuit to gate?

I have prepared a quantum circuit, which is using 13 qubits. Now, I am converting this circuit to gate but it is taking around avg. 35s for conversion. It would have have been fine, if I require only ...
0
votes
0answers
29 views

How can I delay the construction of the power of a gate in a parametric circuit?

I want to implement the parametric power of a gate. I know that the parametric power is impractical to implement (cf https://github.com/Qiskit/qiskit-terra/issues/4751). So, I want to delay the ...
3
votes
1answer
435 views

What is the purpose of gates with more than 2 inputs?

What is the purpose of multi-qubit gates (n>=3), if gates with one or two inputs are enough for any computation?
0
votes
0answers
18 views

Why are the angle coding of the samples cascaded and only use so few qubits

I want to ask about the angle coding. Is the angle coding that Abbas said really like this? There are two samples and four features. Why does she only use two qubits? Instead of four. And the sample ...
3
votes
1answer
85 views

Entanglement entropy and depth

I wanted to verify two intuitions about the entanglement entropy of quantum states. Consider an $n$ qubit quantum state, prepared by a depth $d$ circuit acting on $|0\rangle^{\otimes n}$ and a ...
1
vote
1answer
59 views

Implement approximate $Ry(2\pi /3)$ with gate set {$Rx(\pi),Ry(\pi),Rz(\pi),Rx(\pm \pi/2),Ry(\pm \pi/2),Rz(\pm \pi/2),T,S,H,CZ$}

With gate sets {$Rx(\pi),Ry(\pi),Rz(\pi),Rx(\pm \pi/2),Ry(\pm \pi/2),Rz(\pm \pi/2),T,S,H,CZ$}, I want to implement an approximate $2\pi/3$ rotation around Y axis. An ancilla qubit can be used as well. ...
1
vote
1answer
59 views

What does the expression $\langle y^{(n)}|\otimes𝟙 \,|\Psi_b\rangle$ mean?

I'm trying to understand the following paper, https://journals.aps.org/prresearch/abstract/10.1103/PhysRevResearch.3.013167, but I'm new to quantum computing. In it they use this expression: $$\langle ...
6
votes
3answers
541 views

Quantum Fourier Transform without SWAPs

The Quantum Fourier Transform from Nielsen and Chuang chapter 5 is pictured here: In the textbook the author refers to "swap gates at the end of the circuit which reverse the order of the qubits". ...
15
votes
2answers
855 views

What is the mathematical justification for the "universality" of the universal set of quantum gates (CNOT, H, Z, X and π/8)?

In this answer I mentioned that the CNOT, H, X, Z and $\pi/8$ gates form a universal set of gates, which given in sufficient number of gates can get arbitrarily close to replicating any unitary ...
2
votes
2answers
110 views

Do quantum gates rotate a qubit around the Bloch sphere, or do quantum gates rotate the Bloch sphere around a qubit?

Do quantum gates rotate a qubit around the Bloch sphere? Or do quantum gates rotate the Bloch sphere around a qubit? "The simplest quantum gates are the Paulis: X, Y, and Z. Their action is to ...
2
votes
1answer
390 views

Is a quantum circuit with a controlled-T gate possible?

This diagram comes from the textbook, Quantum information (Author: Stephen Barnett), fig. 6.13. The problem is what I know that T gate isn't a multi-qubit gate, so is it possible that T gate becomes ...
1
vote
1answer
68 views

Show that the effect of a Controlled Unitary on qubits followed by a measurement is unchanged depending on when measurement is taken

I understand that a Controlled Unitary is just a generalization of a control gate, such as CNOT etc, and that it is given in state representation as $$\hat C_U = |0\rangle\langle0|\otimes\mathbb{I} + |...
2
votes
1answer
49 views

Deutsch-Josza on balanced 3 bit function

I am trying to understand the Deutsch-Jozsa algorithm for general $U_f$, but the following function is causing me trouble $f(x,y,z)=x\cdot y \oplus z$. It gives rise to the following quantum gate $U_f:...
7
votes
2answers
145 views

What quantum gates admit a basis-independent interpretation of their action?

The SWAP gate swaps the state of the two qubits so that in the computational basis $|01\rangle \rightarrow |10 \rangle$ with a matrix representation given by: \begin{bmatrix} 1 & 0 & 0 & 0 ...
1
vote
1answer
72 views

Measuring the accuracy of a circuit output?

I have created a circuit and got the output which matches the truth table but, I'm not understanding the measuring the circuit output in terms of the probabilities, power or error. This is the circuit ...
2
votes
1answer
111 views

A Simon's algorithm with secret string b = 01, IBM Quantum experience gives a different result from whay I calculate

I try to design the circuit for $b = 11$ and succeeded in running. Therefore, I start to think of the circuit for different secret string $b = 01$. The circuit I made is down below: Here is the ...
1
vote
1answer
57 views

Clifford gates are transversal What exactly does this transversal mean? What is the difference between non-Clifford gates and Clifford gates?

Clifford gates are transversal What exactly does this transversal mean? What is the difference between non-Clifford gates and Clifford gates? Why is it simple for Clifford gates to implement ...
2
votes
1answer
41 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 $...
5
votes
1answer
555 views

Understanding quantum circuit diagrams: a circuit that compares two states $|YX\rangle$ and $|AB\rangle$

I have a quantum circuit which I would like to understand, which compares two standard basis states $|YX\rangle$ and $|AB\rangle$. It operates on the corresponding bits in each of the two states: i.e.,...
3
votes
1answer
62 views

Implication of SWAP being not positive in terms of quantum channel

I am going over chapter 3 of Preskill's lecture notes regarding complete positivity. Specifically, on page 19, it is mentioned that since SWAP has eigenstates with eigenvalue -1, it is not positive, ...
3
votes
1answer
566 views

Matrix representation of multiple qubit gates (Hadamard transform on single wire)

I would like to know how the unitary matrix for this circuit looks like: I'm not sure but I would try something like this: First part: $\begin{pmatrix}1&0\\0&0\end{pmatrix}\otimes H_1=\...
5
votes
1answer
302 views

Can the spin-1/2 720° rotation trick apply to qubits?

The idea of a 4π rotation to return an electron to its original state instead of just a single 2π rotation exists - but can this idea apply to qubits or entangled qubits? Are there any use cases for ...
1
vote
1answer
42 views

How many single and double qubit gates are required to create a uniform superposition of vertices of a Johnson Graph J(n,r)?

Can I in $\tilde{O}(r)$ number of gates (single and double qubit) create a uniform superposition of vertices of Johnson Graph $J(n,r)$? I would like to create a state $|\psi\rangle = \frac{1}{\sqrt{n \...
1
vote
1answer
62 views

Defining native gate dictionary in pyGSTi

In pyGSTi in order to construct Randomized Benchmarking circuits, we first need to define a pspec object that contains information about the number of qubits, basis ...
1
vote
1answer
81 views

How do I get sate vector for each shot running on a quantum computer?

I was running this code on a quantum computer how can I generate a state vector for each shot while running on a quantum computer? qikit code ...

1
2 3 4 5
22