Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [quantum-gate]

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

1
vote
1answer
31 views

Building a matrix corresponding to the teleportation circuit

I'm trying to build the matrix that corresponds to this quantum teleportation circuit, but it never works when I test it in the quirk simulator, I tried finding the matrix corresponding to every part ...
2
votes
1answer
32 views

CNOT gate - control qubit is in superposition

If a control qubit is in superposition, how it will affect target qubit if it is collapsed or in superposition? Is it true that CNOT works only if the control bit collapsed to 1? Also, is it possible ...
4
votes
1answer
67 views

Construction of ${R_n(\theta)}$ using only the Hadamard and ${\pi/8}$ gates

In the "Quantum Computation and Quantum Information 10th Anniversary textbook by Nielsen & Chuang", they claim that Eqn(4.75) is a rotation about the axis along the direction ( ${cos(\pi/8)}$, ${...
3
votes
1answer
30 views

What's the notion of input size for Quantum Verification?

I've been looking into $\mathsf{QPIP}_\tau$ as a complexity class. The following will be a summary of definition 3.12 in Classical Verification of Quantum Computations by Urmila Mahadev. A language ...
2
votes
1answer
35 views
2
votes
1answer
72 views

A quantum circuit with entanglement with Eve

I'm trying to work through a self-made exercise, which may be ill formed as a question. Any general advice in dealing with these types of problems is also much appreciated! I'm looking at a quantum ...
3
votes
2answers
68 views

Implementing gate with two parameters using Qiskit in Python

I am trying to implement the HHL algorithm (for solving $Ax=b$). I am assuming $A$ to be unitary and Hermitian so that I can find the Hamiltonian simulation for it easily. For any $A$ to be Hermitian ...
4
votes
1answer
82 views

Unitary gate(s) from product of exponent

Often unitary gates are defined as a product of exponentials, with some parameter in the power-term. However, often it is not clear how to construct unitary gates from it, at least not for me that is. ...
3
votes
1answer
56 views

How to obtain Y rotation with only X and Z rotations gates?

Let's say you have a system with which you can perform arbitrary rotations around the X and Z axis. How would you then be able to use these rotations to obtain an arbitrary rotation around the Y axis? ...
1
vote
2answers
63 views

How to properly write the action of a quantum gate implementing an operator $U$ on the superposition of its eigenvectors?

Let's say, that we are in the possession of a quantum gate, that is implementing the action of such an operator $$ \hat{U}|u \rangle = e^{2 \pi i \phi}|u\rangle $$ Moreover, let's say, that this ...
3
votes
4answers
505 views

What circuit or operation corresponds to the tensor product?

What Clifford gate circuit operating on states $|\psi_1\rangle$ and $|\psi_2\rangle$ prepares the state $|\Psi\rangle=|\psi_1\rangle \otimes |\psi_2\rangle$ ?
2
votes
1answer
83 views

How to you encode a network as an adjacency-list in the quantum-gate model?

I have a network problem that I believe would be represented as an adjacency-list on a quantum circuit. Typically, the list is up for traversing from various perspectives (e.g., shortest-path between ...
0
votes
1answer
85 views

What's the matrix representation of this 3 qubit circuit?

How do I calculate the matrix representation of this part of a teleportation circuit? It must be a matrix of dimension 8.
7
votes
0answers
69 views

Is it better to use fewer gates or fewer working qubits? [closed]

I have a script that takes a while to simulate. I can modify it in such a way where I can use fewer qubits at a time, but it will require more iterations of manipulation. I believe this will cut down ...
5
votes
1answer
42 views

Mapping Algebraic Normal Form of Exclusive Sum of Products to Toffoli Network

How does one map an ANF to a toffoli network? Is there a straight-forward procedure for doing this? For example, given the ANF for the Sum function of an adder: $$S = A \oplus B \oplus C \oplus ABC$$ ...
5
votes
2answers
68 views

Clarification needed: “Simulation” of $e^{-iHt}$ and its time complexity

On page 3 here it is mentioned that: However, building on prior works [32, 36, 38] recently it has been shown in [39] that to simulate $e^{−iHt}$ for an $s$-sparse Hamiltonian requires only $\...
3
votes
0answers
53 views

Circuit to construct a $n$-qubit state which is a superposition of states with only a single qubit being $\lvert1\rangle$ [duplicate]

So the question came up in a book I am working through. Given a circuit with $n$ qubits, construct a state with only $n$ possible measurement results, each of which has only $1$ of $n$ qubits as $1$, ...
7
votes
2answers
382 views

Transformation of a Bell state

I am relatively new and interested in quantum computing. Specifically, I am interested in transforming an equation that I found on Wikipedia. But I did not quite understand the transformation. $ \...
4
votes
1answer
99 views

BB84 attack with entangled qubits example

BB84 attack with entangled qubits example Hi, I'am interested in an attack for BB84 protocol with entangled quibits. Lets say Alice sends a qubit $x$ in state $\left|1\right>_x$ to Bob and Eve ...
3
votes
2answers
60 views

Unitary acting on standard qubit basis properties

If we have a $U$ (unitary with all real entries) such that: $U|0\rangle =a|0\rangle +b|1\rangle$ What is $U|1\rangle=?$ I know: the definition of what it means to be unitary ie. $U^\dagger U=UU^\...
3
votes
1answer
133 views

Why is the CNOT gate matrix a valid representation for two-qubit states?

Can anyone explain how the CNOT matrix below is a valid presentation for the four-qubit states that follow after? ...
7
votes
1answer
564 views

How to prevent future loops using a control qubit?

I am trying to construct a quantum multiplier using the method described here: https://arxiv.org/abs/quant-ph/0403048. However, it seems that the control qubit would only disable the following gates ...
1
vote
2answers
89 views

How can the state $\lvert0\rangle+M^{-1/2}\sum_{j=1}^M\lvert j\rangle$ be generated?

I was wondering if anybody to help me to generate the following state. It would be preferable if you use only Hadamard, CNOT and T-gates, on $\lceil\log_2(M+1)\rceil$ qubits: $$|\psi\rangle = \frac{1}{...
5
votes
2answers
77 views

Why are oracles Hermitian by construction?

$\newcommand{\qr}[1]{|#1\rangle}$In this lecture, it is nicely explained how to define an operator that computes a function $f(x)$. I know how to implement such operators. (We just define $O\qr{x}\...
1
vote
1answer
37 views

Matrix representation and CX gate [duplicate]

I am having hard time figuring out how the CX (controlled-NOT) gate is represented in the matrix representation. I understood that tensor product and the identity matrix are the keys, and I ...
3
votes
1answer
62 views

Outcome of Hadamard transformation on a complex state

I would like to calculate the state after a transformation using the Hadamard gate on a complex state. I get stuck mid-calculation, most likely due to not being able to dealing with the global state. ...
2
votes
1answer
100 views

How to construct a quantum gate producing 1 if r divides x, 0 otherwise?

If you have two registers in the state $\frac{1}{2^{n/2}} \sum_{x = 0}^{2^{n/2} - 1} |x\rangle |0\rangle$, how could you construct a gate that produces a superposition of states $|x\rangle|1\rangle$ ...
4
votes
2answers
84 views

What happens when I input two qubits starting at state $|00\rangle$ into a hadamard gate

I was watching the following video https://www.youtube.com/watch?v=IrbJYsep45E And around 3 minutes in, they do an example computation with two qubits. The qubits started off in the state $|00\rangle$...
1
vote
1answer
41 views

Solving a circuit implementing a two-level unitary operation

The circuit below implements the following two-level unitary transformation: $\tilde{U}$ is a unitary matrix: $\tilde{U} = \left[\begin{matrix} a & c \\ b & d \end{matrix}\right]$ where $a, ...
1
vote
1answer
76 views

Applying Group Leaders Optimization to Quantum Belief Systems

Context: I am particularly interested in quantum cognition & would like to use a tool like pyZX to perform the following types of optimizations. In Preparing a (quantum) belief system they "...
1
vote
2answers
32 views

How does the stated Pauli decomposition for $\operatorname{CP\cdot A\cdot CP}$ arise?

I'm having a bit of trouble understand @DaftWullie's answer here. I understood that the $4\times 4$ matrix $A$ $$ \frac{1}{4} \left[\begin{matrix} 15 & 9 & 5 & -3 \\ 9 & 15 & 3 &...
3
votes
3answers
123 views

What is the matrix for the operator that implements a function to tell the parity of its argument?

$\newcommand{\qr}[1]{|#1\rangle}$ I gave myself the task of building an operator that implements the following function: $f(0) = 0$, $f(1) = 1$, $f(2) = 1$, $f(3) = 0$. I restricted myself to $x$ up ...
4
votes
3answers
76 views

What's an example of building a circuit $U_f$ that implements a simple function $f$?

I'd like to be able to program simple functions into simulators such as QCL. I read that any function $f$ can be implemented, but I don't know how to get say a unitary matrix that implements $f$. $\...
1
vote
2answers
49 views

Why does a rotation of $\pi/2$ on $|1\rangle$ yield $i|1\rangle$?

$\newcommand{\q}[2]{\langle #1 | #2 \rangle} \newcommand{\qr}[1]{|#1\rangle} \newcommand{\ql}[1]{\langle #1|}$ It seems $V(\pi/2, \qr{1}) = i \qr{1}.$ I didn't expect that. To me $\qr{1}$ points ...
4
votes
1answer
77 views

Understanding the Group Leaders Optimization Algorithm

Context: I have been trying to understand the genetic algorithm discussed in the paper Decomposition of unitary matrices for finding quantum circuits: Application to molecular Hamiltonians (Daskin &...
2
votes
3answers
104 views

Calculating measurement result of quantum swap circuit

Consider the following circuit, where $F_n$ swaps two n-qubit states. If the inital state is $|0\rangle \otimes |\psi\rangle \otimes |\phi\rangle = |0\rangle|\psi\rangle|\phi\rangle$, the state ...
5
votes
2answers
82 views

Simulation vs Construction of Fredkin gate with Toffoli gates

I'm working my way through the book "Quantum computation and quantum information" by Nielsen and Chuang. (EDIT: the 10th anniversary edition). On chapter 3 (talking about reversibility of the ...
6
votes
3answers
73 views

$R_z$ gate representations

Why is the $R_z$ gate sometimes written as: $$ R_{z}\left(\theta\right)=\begin{pmatrix}1 & 0\\ 0 & e^{i\theta} \end{pmatrix}, $$ while other times it is written as: $$ R_{z}\left(\theta\...
2
votes
0answers
52 views

Simulating Read only QRAM (constructing an oracle) [closed]

In many algorithms an array that stores a classical data or quantum data is crucial. The QRAM (quantum random access memory) that stores classical data in the circuit has been done. My question ...
4
votes
1answer
66 views

Applying CNOT With Local Operations and Two EPR Pairs

Suppose Alice and Bob hold one qubit each of an arbitrary two-qubit state $|\psi \rangle$ that is possibly entangled. They can apply local operations and are allowed classical communication. Their ...
5
votes
1answer
66 views

How to apply the outer product operator?

$\newcommand{\q}[2]{\langle #1 | #2 \rangle} \newcommand{\qr}[1]{|#1\rangle} \newcommand{\ql}[1]{\langle #1|} \renewcommand{\v}[2]{\langle #1,#2\rangle} \newcommand{\norm}[1]{\left\lVert#1\right\...
2
votes
1answer
56 views

What quantum gate is XNOR equivalent to?

The standard way to implement a reversible XOR gate is by means of a controlled-NOT gate or CNOT; this is the "standard quantum XOR operation". Physics.Stackexchange Is there a "standard quantum XNOR ...
5
votes
1answer
63 views

How can I decompose a gate into $\{\mathrm{CNOT}, \mathrm{H}, \mathrm{P}(\theta)\}$?

I am working with the set $\{\mathrm{CNOT}, \mathrm{H}, \mathrm{P}(\theta)\}$ where $\mathrm{H}$ is the Hadamard gate, and $\mathrm{P}(\theta)$ is the phase gate with angle $\theta$. I want to build ...
4
votes
1answer
144 views

Qutrit Teleportation

I'm working through Scott Aaronson's Quantum Information Science problemsets, and I'm having trouble with a specific problem. Specifically the following problem: Here's what I've done: after applying ...
6
votes
1answer
56 views

How to say “apply CNOT on q-bit 1 controlled by q-bit 2”?

Say you have $2$ q-bits, namely $q_1, q_2$. What's the right language for saying apply CNOT on $q_1$ and $q_2$ where $q_1$ is the control bit and $q_2$ is the target? For instance, can I say "apply ...
6
votes
1answer
146 views

How would one implement a quantum equivalent of a while loop in IBM QISkit?

I'm writing a simple multiplication algorithm that uses the Quantum Fourier Transform to repetitively add a number (the multiplicand) to itself and decrements another number (the multiplier). The ...
4
votes
2answers
115 views

How to create a condition on only one classical bit when we have a total of 2 classic bits in the system

I am trying to make a quantum circuit with one qubit and 2 classical bits for each measurment in the system below: I want to make condition on the first bit: if the first collapse to zero so x ...
6
votes
1answer
171 views

Decomposition of arbitrary 2 qubit operator

As you know, universal quantum computing is the ability to construct a circuit from a finite set of operations that can approximate to arbitrary accuracy any unitary operation. There also exist some ...
5
votes
2answers
83 views

Symmetry in Conditional Phase Shift Gates and Realizing CNOT through HCZH

Why are conditional phase shift gates, such as CZ, symmetrical? Why do both the control and target qubit pick up a phase? Furthermore, assuming that they are symmetrical, when using a CNOT gate as an ...
4
votes
1answer
53 views

What is the significance of recent demonstration of a passive photon–atom qubit swap operation?

In reference to this recent nature article: https://www.nature.com/articles/s41567-018-0241-6 Specifically, does this warrant a new type of gate?