Questions tagged [quantum-circuit]

a model in which a computation is a sequence of quantum gates, which are reversible transformations on an n-qubit register (the quantum-mechanical analog of an n-bit register)

Filter by
Sorted by
Tagged with
10
votes
3answers
461 views

Superposition of quantum circuits

Given a quantum circuit $C_1$ that generates a state $\vert\psi\rangle$ and another circuit $C_2$ that generates $\vert\phi\rangle$, is there a way to construct a circuit that outputs $$\frac{1}{\sqrt{...
9
votes
2answers
549 views

How to check if a quantum circuit can be constructed for a given matrix representation?

Let's say I have a matrix representation, e.g. $$ \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix}. $$ How ...
9
votes
1answer
1k views

What's meant by the depth of a quantum circuit?

I'm using Qiskit to create quantum circuits wherein I've this attribute called depth. The documentation states it is the length of the critical path here. What does ...
8
votes
1answer
268 views

How to distinguish between collapsed and uncertain qubits in a quantum circuit?

I have been through the Young's double slit experiment. It's a direct proof or instance of showing that a wave is collapsed via observation or measurement, and shows no interference patterns. I want ...
8
votes
1answer
76 views

How can one define contextuality within the circuit model?

It is in general believed that contextuality is one of the quantum resource that provides the quantum advantage. A context is usually defined in terms of a set of commuting observables. The quantum ...
7
votes
2answers
326 views

How to compute the measurement probability in swap test?

The figure of a circuit and the state are as follows. The final state before the measurement is $|O_{out}\rangle=\frac{1}{2}|0\rangle(|\phi\rangle|\psi\rangle+|\psi\rangle|\phi\rangle)+\frac{1}{2}|1\...
7
votes
2answers
119 views

Explicit states with high $T$ count

It is well known, that the Clifford $+T$ gate set consisting of the gates $\lbrace H, S, CNOT, T \rbrace$ is universal for quantum computation, that is, for any n-qubit unitary $U:\left( \mathbb{C}^2\...
6
votes
2answers
209 views

How to visualize Hadamard gate as $X$-$Z$-$X$ decomposition?

In the book Quantum Computation and Quantum Information by Nielsen and Chuang, chapter 4, exercise 4.4 (pg. 175), the author has asked to express Hadamard gate as product of $R_x$, $R_z$ rotations and ...
6
votes
2answers
244 views

Minimum number of 2 qubit gates to build any unitary

Any unitary $U$ acting on $N$ qubits can be decomposed in a finite product $U=U_1U_2...U_n$ where every $U_i$ acts on only 2 qubits, for example through decomposition in CNOT, phase shifts and 1 qubit ...
6
votes
1answer
112 views

Is the complexity of a quantum circuit constant in the depth of the circuit?

Take a quantum circuit on $n$ qubits, you have some sequence of gates. You can represent these gates as hermitian matrices, and then with some padding, you could take the product of these matrices, by ...
6
votes
2answers
89 views

Are SU($n$) operations enough for quantum computation?

Usually we want a quantum computer that can perform all foreseeable unitary operations U($n$). A quantum processor that can naturally perform at least 2 rotation operators $R_k(\theta)=\exp(-i\theta\...
5
votes
1answer
134 views

Qiskit - Circuit drawing aesthetics - Can I force the measurements in my circuit to show at the end?

I'm studying an introduction course to quantum computation at my uni and we got homework to draw a certain circuit using qiskit. I managed to understand how to do what is asked from me, and this is ...
5
votes
3answers
458 views

Why can I not apply a control gate/function to a gate like T, S, S dagger, ... (using IBM Quantum Experience)? Is there another option?

I am trying to use the circuit composer of the IBM QE. I am doing the inverse QFT on 3 qubits and therefore need a control on T and S dagger gates, but it won't let me. Does anyone know why or know a ...
5
votes
1answer
39 views

Why do we care about the number of $T$ gates in a quantum circuit?

When reading this question and quickly reading some of the linked papers, I wondered why was the number of $T$ gates specified along the number of controlled-$X$ gates. I've often read that ...
5
votes
1answer
100 views

What is the correlation between Toffoli and a more generic rotation shown in qiskit textbook

Can someone help me understand the correlation between the 2 diagrams in the qiskit textbook.
5
votes
2answers
78 views

Cascade/Feedforward quantum circuits

I would like to know if it is possible implement the following situation in Qiskit (either using the simulators or real quantum computers). Consider this illustrative toy example: The arrows ...
5
votes
1answer
92 views

Unknown quantum circuit symbol

I was reading DiCarlo, L., Reed, M., Sun, L. et al. Preparation and measurement of three-qubit entanglement in a superconducting circuit. Nature 467, 574–578 (2010). https://doi.org/10.1038/...
5
votes
1answer
50 views

Is there a way to use titles on circuit drawing?

As you may know, one can use barriers in Qiskit to seperate gates on a circuit in a proper way. So, I was wondering is there a way to give a title to these "sections" seperated by barriers? ...
5
votes
1answer
98 views

Pennylane: creating QNodes for large numbers of circuits that only differ by number of wires

Take the following simple quantum function: ...
4
votes
1answer
259 views

How could one implement a circuit using Grover's algorithm to solve a linear system of equations?

Given the following system: $$\begin{bmatrix}0 & 1 & 0\\1 & 1 & 1\\1 & 0 & 1\end{bmatrix} \begin{bmatrix}s_2\\ s_1\\ s_0\end{bmatrix} = \begin{bmatrix}0\\ 0\\ 0\end{bmatrix}$...
4
votes
1answer
52 views

How can I write unit tests for a pennylane circuit?

I have several mixing unitary circuits written using Pennylane to be used in the QAOA algorithm. Furthermore, I'd like to write unit tests for these mixing circuits to ensure that the code is doing ...
4
votes
1answer
57 views

Understanding the quantum circuit for the quantum adder Toffoli gate

I am trying to understand the toffoli operation for the quantum adder below: (especially for the second toffoli gate) but I am stuck in understanding the calculation to get the correct outputs. The ...
4
votes
1answer
61 views

What is the shortest-circuit-depth quantum-benchmarking algorithm?

An algorithm implementing a model whose results are known, and from the known results, the benchmarking of the device could be done. What is the currently known shortest circuit depth algorithm that ...
3
votes
2answers
76 views

Show that the two circuits are equivalent mathematically

This exercise wants me to prove the equivalence of the two circuits using their mathematical representations. Circuit 1: Circuit 2: Circuit 1 (q1 CNOT ...
3
votes
2answers
121 views

Transforming $|100\rangle$ state into $|000\rangle + |111\rangle$ state using only Hadamard and CNOT gates

Hi, How to convert $|100\rangle$ 3-qubit quantum state into $\frac{1}{\sqrt{2}}(|000\rangle + |111\rangle)$ state using only Hadamard and CNOT gates? Also, is output state an entangled one?
3
votes
2answers
128 views

How to construct a controlled $V$ gate in qiskit?

I have come across most of the quantum circuit which contains gate such as controlled $V$ and $V^{\dagger}$ but I dont know how to code it in Qiskit.
3
votes
1answer
60 views

Why are 3, rather than 2 gates used in quantum variational circuits?

In the hello many worlds tensorflow tutorial and in the lockwood paper (2020) I have seen that often in QVC the following combination of gates is used: $R_z(\theta), R_y(\theta), R_x(\theta)$ I am ...
3
votes
1answer
68 views

How is quantum transpilation scaled?

While thinking about a quantum transpiler's working I had a pretty basic doubt. Say that we are trying to transpile an $n$ qubit circuit where $n > 100$. What transpiler does is that it first tries ...
3
votes
1answer
100 views

How to make a half adder for x number of qubits with min. cost?

How to make a half adder for N inputs and getting the output on another x+1 output. Where x ...
3
votes
1answer
48 views

How does $|00\rangle$ evolve through an Hadamard and a CNOT gate?

If we have this given circuit: So the output for $|0\rangle$ will be: $\frac{1}{\sqrt{2}}\left(|00\rangle + |11\rangle\right)$ And we have this given circuit: What will be the output for $|00\rangle$...
3
votes
1answer
117 views

Using principle of deferred measurement to replace gates conditional on classical bits (c_if)

I am trying to implement the Iterative Phase Estimation algorithm on one of Qiskit's labs. I can do it for a 'nice' phase, such as 1/4 : But if I want to implement the algo generally (as a subroutine ...
3
votes
1answer
79 views

Complexity of quantum circuits in a specific protocol

Consider the following simultaneous communication problem. Alice and Bob do not share any entanglement or any common randomness, and cannot communicate directly with each other. As inputs, $x$ is ...
3
votes
1answer
67 views

Exercise 4.41 in N&C book QCQI: how can i implement $R_z(\theta)$ using the circuit shown and $Z$?

I'm studying Nielsen and Chuang's book. I cannot solve one of the questions in the exercise 4.41. The question is the last one that is Explain how repeated use of this circuit and Z gates may be used ...
3
votes
1answer
68 views

Can an arbitrary circuit be represented using two commands (qsel package)?

I was watching this entertaining video by David Bacon (as in "Bacon-Shor code", Cirq, ...) : video of talk where he mentions the package he wrote: (qsel), that describes simulating quantum ...
3
votes
1answer
50 views

How can a Sagnac interferometer be described by a quantum circuit?

I am looking to translate interferometric processes onto a quantum circuit model and am running into issues regarding feedback and the reuse of circuit elements. My question is framed in terms of a ...
3
votes
1answer
66 views

Weird Grover's Algorithm Behavior

I am attempting to use Grover's to find elements in an array that satisfy a comparative query (=, <, >, etc). I am using Qiskit, and am using a qRAM to encode my array. I have experimented with ...
3
votes
1answer
63 views

Getting exponential sequence of coefficients with not so many $T$-gates

Let $\Psi \in (\mathbb{C}^2)^{\otimes n}$ be a $n$-qubit quantum state. In the computational basis, we can write $\Psi$ as $$\Psi = \sum_{(i_1, \dots, i_n) \in \mathbb{F}_2^n} \Psi_{i_1, \dots, i_n} |...
3
votes
1answer
45 views

Is there a way to within a quantum circuit work out if a qubit is in a superposition or not?

Preferably using the gates found in QASM/Qiskit and the qubit stays in the superposition and no measurement is made, i.e. the output of if it is in a superposition or not is a binary answer in another ...
3
votes
2answers
53 views

Method to derive Matrix description of a circuit [duplicate]

This question is about finding a matrix description of a specific circuit. I am learning quantum computing through edX's Quantum Information Science lecture series. The question below is the one I am ...
3
votes
1answer
80 views

How can I create an ADD gate for two quantum states? [duplicate]

I want to create an ADD gate like this: in qiskit using elementary gates. Can it be done?
3
votes
0answers
21 views

How to design a RF-SQUID qubit by Qiskit Metal?

I am now learning how to use Qiskit Metal to design superconducting circuits. I found that there are only several transmon qubits in the library. Can I design an RF-SQUID qubit by using Qiskit metal? ...
3
votes
0answers
40 views

Writing circuits in Qiskit using only Clifford and T gates

Is there a way in Qiskit to write my circuit using only Clifford and T gates (CX, S, H, T and I think also $S^\dagger$ and $T^\dagger$)? With the function compile (with aer simulator) it gives me some ...
3
votes
0answers
42 views

How to efficiently construct quantum circuits of oracles in multi-target quantum search?

In standard Grover's quantum search with only one target or its extension of multi-target quantum search, one of the two key parts is to quantize the boolean function $$f(x):\{0,1,\cdots,N-1\}\...
3
votes
1answer
51 views

Block encoding technique: what is it and what is it used for?

I was wondering if someone could explain to me what this technique called "block encoding" does, and what it is used for at a high level, found in arXiv:1806.01838. It is in section 4.1, ...
3
votes
0answers
43 views

Feynman method and polynomial time algorithm for XQUATH

Consider the Feynman algorithm for simulating quantum circuits, as given here. Consider the XQUATH conjecture for random quantum circuits from here, given by (XQUATH, or Linear Cross-Entropy Quantum ...
3
votes
0answers
41 views

Query complexity on Quantum Pattern Matching of Mateus Algorithm

I am trying to understand the complexity of the Mateus and Omar algorithm for quantum pattern matching, it is clear to me from the pseudocode that the query complexity is $O(\sqrt{N})$, apart from the ...
3
votes
0answers
53 views

What are some standard ways to visualize non-unitary processes

In quantum computing, quantum circuits are a common model for visualizing unitary evolution. If I want to represent a unitary $U$ acting on a $2$-qubit state $|00\rangle$ followed by a measurement in ...
2
votes
2answers
68 views

Is it possible to push back an $H$ gate to a $CZ$ gate?

Given the above scenario. Is it possible to "push back" the $H$ gate operation to occur before $CZ$? Formally I am looking for some operation $CZ\cdot(U_1\otimes U_2) = H\cdot CZ$.
2
votes
1answer
116 views

Initial state preparation for Hadamard test

I thought I understood Hadamard test but it seems to be shaky. I understand that to get the expectation value $\langle\psi\ | V^\dagger|{\bf Q}|V|\psi\rangle$ we need to have gate $V$ (in blue) below ...
2
votes
2answers
134 views

Why are these two QFT circuits equivalent?

I am new to quantum computing and have been trying to understand the Quantum Fourier Transform (QFT). Through my research using both the Qiskit textbook and other sources, I see differences in how the ...