Questions tagged [quantum-gate]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
117 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
197 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 &...
4
votes
3answers
265 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 ...
6
votes
3answers
227 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
357 views

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

It seems $V(\pi/2, \qr{1}) = i \qr{1}.$ I didn't expect that. To me $\qr{1}$ points up because $\qr{0}$ points to the right. So rotating $\qr{1}$ by $\pi/2$ should yield $-\qr{0}$. What am I ...
8
votes
1answer
334 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 &...
3
votes
3answers
211 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 ...
7
votes
2answers
769 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 ...
7
votes
3answers
103 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\...
4
votes
1answer
174 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
349 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
253 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
132 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 ...
6
votes
1answer
397 views

Problem about qutrit teleportation protocol

I'm working through Scott Aaronson's Quantum Information Science problem sets, and I'm having trouble with a specific problem in ps5 (PDF). Specifically the following problem: A “qutrit” has the form ...
6
votes
1answer
92 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
1k 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 ...
5
votes
2answers
943 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 ...
19
votes
4answers
2k views

How to derive the CNOT matrix for a 3-qubit system where the control & target qubits are not adjacent?

In a three-qubit system, it's easy to derive the CNOT operator when the control & target qubits are adjacent in significance - you just tensor the 2-bit CNOT operator with the identity matrix in ...
7
votes
1answer
883 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 ...
6
votes
2answers
362 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
72 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?
5
votes
1answer
741 views

Classical XOR gate in Quantum Circuit

Can we use classical XOR gate in a quantum circuit? Or are there any alternatives for XOR gate?
18
votes
1answer
541 views

Explicit Conversion Between Universal Gate Sets

I'm interested in the conversion between different sets of universal gates. For example, it is known that each of the following sets is universal for quantum computation: $\{T,H,\textrm{cNOT}\}$ $\{H,...
12
votes
2answers
489 views

State of the art gate speeds and decoherence times

I am interested in the state of the art gate speeds and decoherence times for the qubit types I know are being pursued by companies presently: superconducting qubits, ion trap qubits, photonic qubits....
13
votes
2answers
827 views

Automatic compilation of quantum circuits

A recent question here asked how to compile the 4-qubit gate CCCZ (controlled-controlled-controlled-Z) into simple 1-qubit and 2-qubit gates, and the only answer given so far requires 63 gates! The ...
10
votes
6answers
5k views

How to construct a multi-qubit controlled-Z from elementary gates?

For the implementation of a certain quantum algorithm, I need to construct a multi-qubit (in this case, a three-qubit) controlled-Z gate from a set of elementary gates, as shown in the figure below. ....
6
votes
2answers
219 views

Just want to confirm: Do two CNOT gates cancel each other?

I see somewhere that this happens: But I wonder if this is just identity.
6
votes
3answers
972 views

Advantange of Hadamard gate over rotation about the X axis for creating superpositions

When I look at most circuits (admittedly small sample as I'm a beginner), the Hadamard gate is used a lot to prepare a superposition from say the $\mid0\rangle$ state. But upon a little reflection, we ...
9
votes
2answers
4k views

How do you implement the Toffoli gate using only single-qubit and CNOT gates?

I've been reading through "Quantum Computing: A Gentle Introduction", and I've been struggling with this particular problem. How would you create the circuit diagram, and what kind of reasoning would ...
5
votes
2answers
434 views

How do we code the matrix for a controlled operation knowing the control qubit, the target qubit and the $2\times 2$ unitary?

Having n qubits, I want to have the unitary described a controlled operation. Say for example you get as input a unitary, an index for a controlled qubit and another for a target. How would you code ...
8
votes
2answers
1k views

Possibility of a “reset” quantum gate

I wish to have a "reset" gate. This gate would have an effect to bring a qubit to the $\mid0\rangle$ state. Clearly, such a gate is not unitary (and so I'm unable to find any reliable implementation ...
7
votes
2answers
219 views

How do you represent the output of a quantum gate in terms of its basis vectors?

I'm stuck while trying to understand the Hadamard Gate in a more linear algebra understanding. (I understand the algebraic way). This is because I want to program a simulation of a quantum computer. ...
4
votes
1answer
304 views

Shorthand notation for the sign flip gate

I need to use the following matrix gate in a quantum circuit: $$\text{Sign Flip}=\left[\begin{matrix}0 & -1 \\ -1 & 0\end{matrix}\right]$$ $\text{Sign Flip}$ can be decomposed as (in terms ...
9
votes
2answers
319 views

Number of gates required to approximate arbitrary unitaries

If I understand correctly, there must exist unitary operations that can be approximated to a distance $\epsilon$ only by an exponential number of quantum gates and no less. However, by the Solovay-...
8
votes
1answer
791 views

Practical implementation of Hamiltonian Evolution

Following from this question, I tried to look at the cited article in order to simulate and solve that same problem... without success. Mainly, I still fail to understand how the authors managed to ...
9
votes
3answers
506 views

Does conditional gate collapse controller's superposition?

I've created a simple circuit in Q-Kit to understand conditional gates and outputted states on each step: In the beginning there is clear 00 state, which is the input The first qubit is passed ...
5
votes
2answers
230 views

Arbitrary powers of NOT and SWAP

The square-root of not and square-root of swap gates are often singled out for discussion of gates displaying important properties relating to quantum computers. How do I define arbitrary (non-...
7
votes
2answers
319 views

Is it possible to realize CNOT gate in 3 dimension?

CNOT gates have been realized for states living in 2-dimensional spaces (qubits). What about higher-dimensional (qudit) states? Can CNOT gates be defined in such case? In particular, is this possible ...
10
votes
2answers
2k views

CNOT Gate on Entangled Qubits

I was trying to generate Greenberger-Horne-Zeilinger (GHZ) state for $N$ states using quantum computing, starting with $|000...000\rangle$ (N times) The proposed solution is to first apply Hadamard ...
3
votes
1answer
109 views

Doing maths with controlled-half NOTs

In Quantum Computation with the simplest maths possible there is a section titled "Doing maths with a controlled-half NOT" which covers a reversible-(N)AND circuit with controlled-half NOTs. What ...
16
votes
3answers
2k views

Toffoli gate as FANOUT

I was searching for examples of quantum circuits to exercise with Q# programming and I stumbled on this circuit: From: Examples of Quantum Circuit Diagrams - Michal Charemza During my introductory ...
7
votes
1answer
388 views

SWAP gate(s) in the $R(\lambda^{-1})$ step of the HHL circuit for $4\times 4$ systems

Context: On the 5th page of the paper Quantum circuit design for solving linear systems of equations (Cao et al, 2012) there's this circuit: Schematic: A brief schematic of what's actually ...
7
votes
2answers
493 views

Matrix representation of continuous-variable gates

In the introduction to continuous-variable quantum computing by Strawberry Fields (Xanadu), it lists the primary CV gates (rotation, displacement, squeezing, beamsplitter, cubic phase) along with ...
7
votes
1answer
1k views

What are theta, phi and lambda in cu1(theta, ctl, tgt) and cu3(theta, phi, lam, ctl, tgt)? What are the rotation matrices being used?

I was reading the documentation for qiskit.QuantumCircuit and came across the functions cu1(theta, ctl, tgt) and ...
3
votes
1answer
152 views

How is the joint state of these qubits derived?

Can someone show to me the steps to derive the joint state at the bottom of this image, please? I tried to follow his explanation but I didn't get the same results… This is taken from the lecture ...
4
votes
1answer
302 views

Square root of NOT as a time-dependent unitary matrix

I want to express the square root of NOT as a time-dependent unitary matrix such that each $n$ units of time, the square root of NOT is produced. More precisely, I want to find a $U(t_0,t_1)$ such ...
5
votes
2answers
2k views

What is the matrix of the iSwap gate?

Mostly I'm confused over whether the common convention is to use +$i$ or -$i$ along the anti-diagonal of the middle $2\times 2$ block.
5
votes
0answers
117 views

How exactly is the stated composite state of the two registers being produced using the $R_{zz}$ controlled rotations?

This is a sequel to How are two different registers being used as "control"? I found the following quantum circuit given in Fig 5 (page 6) of the same paper i.e. Quantum Circuit Design for ...
4
votes
1answer
361 views

Projection operator on Time evolution Operator

From a 9×9 Hamiltonian lying 9D space, I choose a certain subspace of 4D for designing a two qubit gate. Now the original unitary time evolution operator also lies in 9D space and it's a 9×9 size ...
13
votes
2answers
2k views

How to prove/disprove universality for a set of gates?

A universal set of gates are able to mimic the operation of any other gate type, given enough gates. For example, a universal set of quantum gates are the Hadamard ( $H$ ), the $\pi/8$ phase ...