Stack Exchange Network

Stack Exchange network consists of 175 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.

0
votes
1answer
63 views

What is the meaning of the state $|1\rangle-|1\rangle$?

I don't understand it. But suppose you have a state of two qubits in superposition and it looks like $|10\rangle-|11\rangle$. Now you have in your circuits two gates one is a controlled-NOT from the ...
1
vote
0answers
17 views

Qiskit gates in LaTeX representation: notation meaning [duplicate]

I started working in Qiskit, and here is an example of how gates of a circuit are represented graphically in LaTeX format: Obviously, $R_y(\theta)$, is a y rotation by a certain angle. But all the ...
2
votes
1answer
60 views

If CNOTs and single qubit gates are universal then why do we need to prove that controlled U operations can be composed by them as well?

In the book by Chuang and Nielsen they prove that controlled U operations can be made out of CNOTs and single qubit gates. But then they go on to prove that they are universal by showing that every n ...
7
votes
2answers
82 views

Equivalent unitary transformations

Suppose $x \in \{0,1\}^n$. The standard way to make a query is with an oracle $O_x$ that given an input $|i,b \rangle $ returns $|i,b \oplus x_i \rangle$. Via the phase kick-back trick, this can be ...
2
votes
1answer
83 views

Decompose a general two-qubit gate into general controlled-qubit gates

We often seek to decompose multi-qubit unitaries into single-qubit rotations and controlled-rotations, minimising the latter or restricting to gates like CNOTs. I'm interested in expressing a general ...
2
votes
0answers
49 views

ProjectQ - In which part of the controlled gate object are the control bits scored

I've been trying to decompose the ProjectQ objects and I could manage to decompose non-controlled gates and daggered gates. But I noticed that the object of a controlled version of a gate is the ...
0
votes
1answer
69 views

Why does $|P_U − P_V |$ equal $\langle \psi |U^{\dagger} M U|\psi\rangle −\langle \psi |V^{\dagger} M V |\psi\rangle$?

In QC and QI by Chuang and Nielsen, they state that the $P_U$ of operation $U$ acting on $\psi$ can be reached by $\langle \psi |U^{\dagger} M U |\psi\rangle$. Where $P_U$ (or $P_V$) is the ...
6
votes
1answer
28 views

If $|\psi\rangle, U|\psi\rangle$ are known, how many pairs of such qubits are required to find the operator $U$?

Assume that we know a quantum state and the result of applying an unknown unitary $U$ on it. For example, if the quantum states are pure qubits, we know $|\psi\rangle=\alpha|0\rangle+\beta|1\rangle$ ...
2
votes
1answer
51 views

How to implement a $\frac{\theta}{2}$ rotation from $\theta$ rotation?

Is there a way to create a rotation gate which has half the angle of some implementable gate? I am looking to implement a gate on Quirk which allows for standard time-dependent rotations $$R_x(\...
3
votes
2answers
92 views

SWAP test inputs

I'm using the SWAP test circuit for implementing a qubit registers comparison From the documentation I could find I've understood it can be applied to input qubits |$\alpha\rangle$ and |$\beta\...
3
votes
0answers
24 views

Decomposition of any 2-level matrix into single qubit and CNOT gates

I saw an example which takes a 2 level matrix. Which is a $8\times8$ matrix that acts non trivially only on 2 levels of only states $|000\rangle$ and $|111\rangle$. The way they do it is by using a ...
1
vote
3answers
71 views

Is it correct to say that we need controlled gates because unitary matrices are reversible?

I am new to quantum computing and saw this argument on this site but I don't understand it. First of all, I don't understand what is exactly meant by 'reversible'. Because even if you had a unitary ...
3
votes
2answers
165 views

Composing the CNOT gate as a tensor product of two level matrices

I don't understand, why is the control not gate used so often. As far as I understand it, if you apply two 2 level operations on two qubits then you get a 4 x 4 matrix by the tensor product. So how ...
5
votes
1answer
52 views

How does a $2 \pi$ pulse in Cirac Zoller give a -1 sign to the state?

I understand the first step in the Cirac-Zoller controlled-phase gate; about how to move the state from the electronic state to the vibrational mode state. However, I am unable to understand how a $2\...
5
votes
2answers
354 views

How to recognize if a paper is talking about quantum annealing or gate logic?

I am currently reading various survey papers in Quantum Machine Learning, such as "Quantum Machine Learning" by Biamonte, Wittek, Pancotti, Rebentrost, Wiebe, and Lloyd. To me, it is not clear when ...
2
votes
1answer
60 views

Proof that $2^n \times 2^n$ operator be decomposed in terms of $2 \times 2$ operators

What is the proof that any $2^n\times 2^n$ quantum operator can be expressed in terms of the tensor product of $n$ number of $2\times 2$ quantum operators acting on a single qubit space each?
4
votes
1answer
155 views

Creating controlled R1 gates in Q#?

I know how to create controlled versions of gates like X, Y, Z. For example, a controlled X gate would be implemented by writing (Controlled X)([control],target); ...
3
votes
1answer
27 views

Type error creating R gate in Q#?

The R operation in Q# is listed by Microsoft in the documentation as follows operation R (pauli : Pauli, theta : Double, qubit : Qubit) : Unit However, when I try ...
6
votes
3answers
392 views

Is there any method of adding two operators in a circuit?

I am trying to reconstruct the time evolution of a Hamiltonian on the quantum computing simulator, quirk. Ideally I would like to generalise this to any simulator. The unitary matrix is $$U(t)=e^{-...
1
vote
1answer
36 views

Reversibility and irreversibility of logic gates (quantum vs classical)

I have been told that one of the great keys that unlock quantum computing's potential is the reversibility of quantum logic gates as for classical gates there's some loss of information, but I cannot ...
4
votes
3answers
66 views

Hadamard gate as a product of $R_x$, $R_z$ and a phase

I am having problems with this task. Since the Hadamard gate rotates a state $180°$ about the $\hat{n} = \frac{\hat{x} + \hat{z}}{\sqrt{2}}$ axis, I imagine the solution can be found the following ...
1
vote
1answer
45 views

Creating a time dependent custom gate in Quirk

I have created a $16\times 16$ unitary operator using a Hamiltonian by finding its exponential $$U=\exp(-iH\delta t)$$ If I set $\delta t=1$ then I can take this matrix and input it into quirk using ...
6
votes
1answer
410 views

Decomposition of a unitary matrix

Following is an excerpt from QCQI: I can understand that this matrix satisfies a unitary matrix. Also, intuitively, I am able to understand it. However, what is the proof that any given Unitary ...
5
votes
3answers
600 views

How to construct matrix of regular and “flipped” 2-qubit CNOT?

When constructing the matrices for the two CNOT based on the target and control qubit, I can use reasoning: "If $q_0$==$|0\rangle$, everything simply passes through", resulting in an Identity matrix ...
4
votes
1answer
134 views

Extending a square matrix to a unitary matrix

Suppose we have a square matrix $M$ of size $n\times n$. It is given that any element $M_{ij}$ of $M$ is a real number and satisfies $0 \leq M_{ij} \leq 1$, $\forall$ $i,j$. No other property for $M$ ...
5
votes
0answers
81 views

How many qubits and how many gates, are required for finding the eigenvalues of a matrix?

Say I have an $N \times N$ matrix and I want to know the eigenvalues to a precision of $\pm \epsilon$. How many qubits and how many gates do I need?
1
vote
1answer
70 views

FANOUT with Toffoli Gate

Figure 1.16: FANOUT with the Toffoli gate, with the second bit being the input to the FANOUT (and the other two bits standard ancilla states), and the output from the FANOUT appearing on the second ...
4
votes
2answers
70 views

How does quantum function parallelism work?

Quantum parallelism is usually introduced from CNOT schema, saying that there it results, calling $ |c\rangle $ the control and $|t\rangle$ the target $$ |0\rangle |t\rangle \implies |0\rangle |t\...
10
votes
3answers
368 views

Approximating unitary matrices

I currently have 2 unitary matrices that I want to approximate to a good precision with the fewer quantum gates possible. In my case the two matrices are: $$G = \frac{-1}{\sqrt{2}}\begin{pmatrix} i &...
3
votes
0answers
32 views

Why does state preparation of 'off the shelf' qubits not follow from the Born rule (Mermin)?

In Mermin's Quantum Computer Science, section 1.10 (Measurement gates and state preparation), Mermin writes that: This role of measurement gates in state preparation follows from the Born rule if ...
4
votes
1answer
86 views

Problem with approximating adiabatic evolution with quantum circuit

I am reading on how to approximate adiabatic evolution with quantum circuit and I had some trouble following the arguments given in the early papers which proves this results. I am mainly following ...
3
votes
1answer
71 views

How to decompose 4 qubits Toffoli-gate into two-qubits CNOT gate?

Can I decompose a 4-qubit Toffoli gate into two qubit CNOT gate without ancillary state?
4
votes
0answers
57 views

Clock matrix vs matrix clock

In the process of research leading up to my previous question, I found out about matrix, vector & logical clocks. The citation in the aforementioned question mentions clock and shift matrices. ...
1
vote
1answer
51 views

Multiple random coin flips without measurements

The question is similar to this one. As suggested in the answer, I can easily do this with just one qubit: I repeatedly Hadamard it and measure in order to have a fair coin flip at every point. The ...
5
votes
4answers
163 views

How do I build a gate from a matrix on Qiskit?

I'm creating a gate for a project and need to test if it has the same results as the original circuit in a simulator, how do I build this gate on Qiskit? It's a 3 qubit gate, 8x8 matrix: $$ \frac{1}{...
1
vote
1answer
75 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
54 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
106 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)}$, ${...
2
votes
1answer
42 views
2
votes
1answer
82 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
98 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
89 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. ...
5
votes
2answers
131 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
65 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 ...
1
vote
2answers
81 views

Is it possible to create controlled gates with an exponent in Cirq?

Is it possible to create controlled gates with an exponent in Cirq? For example, a controlled $\sqrt Z$ gate.
3
votes
4answers
527 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
85 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
97 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
73 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
49 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$$ ...