Questions tagged [circuit-construction]

For questions about the construction of complex circuits using elementary quantum gates.

Filter by
Sorted by
Tagged with
5
votes
1answer
38 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 ...
1
vote
1answer
44 views

What is the syntax for general control gate in stim

For a stabilizer code with the stabilizers in canonical form, an encoding circuit has the form that's a product of hadamard gates and general control gates : $H_i C_i(U_i)$. For example for the $[[5,1,...
0
votes
0answers
55 views

How can I create a Qiskit function producing a quantum circuit such that $\langle Z^{\otimes n}\rangle=J_{n-1}/2^{n-1}$?

Problem: Create a function circ(n) that returns an $n$-qubits quantum circuit that, when measured in the $Z^{\otimes n}$ basis, should yield the following ...
1
vote
1answer
124 views

Getting non-Clifford after performing several Clifford gates in qiskit

I'm trying to test Clifford gates in qiskit according to the table in Fault-tolerant SQ, page 101. I tried 4 Cliffords in the test $$-X/2 - X -X/2,Y/2,X/2 - -X/2,Y/2,-X/2$$ using the following code <...
0
votes
1answer
37 views

Equivalent matrix for operators in qiskit

What is eqivalent matrix to qc.rx(np.pi, 0): ...
3
votes
1answer
62 views

How to implement a quantum array

I'm trying to implement a quantum array. That is one that stores qubits and can be indexed via qubits. I can create one that handles setting values fairly easy. Have two registers, one for the ...
1
vote
1answer
62 views

Is it possible to perform $z$ rotation in Qiskit with just $x$ and $y$ rotations?

Is it possible to perform $z$ rotation in Qiskit with just $x$ and $y$ rotations? I tried the following: ...
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 ...
2
votes
2answers
238 views

What is the circuit for grover's algorithm if N is not a power of 2?

From the literature it seems that grover's algorithm works if $N$ is not a power of $2$. For instance, https://en.wikipedia.org/wiki/Grover%27s_algorithm and https://arxiv.org/abs/quant-ph/0005055 I ...
2
votes
4answers
399 views

How is a Toffoli gate built without using T gates?

Can someone tell me how to make a Toffoli gate without using T gates? Can we use $R_x$ and $R_y$. If yes, then how? I tried many circuits but I was unable to create the CCNOT gate out of $R_x$, $R_y$ ...
3
votes
1answer
250 views

Controlled Z gate using Pauli rotation operators and Z tensor product Z

I am trying to construct a controlled Z gate using elementary gates. This is what I have so far: \begin{pmatrix} -i & 0 & 0 & 0\\ 0 & -1 & 0 & 0\\ 0 & 0 & 1 & 0\\ ...
3
votes
1answer
101 views

Qiskit's QFT not returning the expected state

I'm currently going through the lab problems for the Qiskit course here. I'm trying to finish lab set number 3 on QPE but I can't seem to get the desired output, even from the solution notebook. I'm ...
1
vote
0answers
57 views

What is the right way to teleport qubits on a real quantum computer?

I've been using the teleportation protocol to teleport qubits and then using Qiskit state tomography for reconstructing my qubits. Using this circuit using open qasm I regularly obtain fidelity 0.9. ...
5
votes
1answer
116 views

BHT algorithm implementation

Summary of Method Amplitude Amplification Summary The BHT algorithm uses amplitude amplification, a nice generalisation of Grover's algorithm, where there is a subset $G\subset X$ of good elements in ...
1
vote
0answers
64 views

Quantum Circuits for Time-Series Data

I am currently working with a dataset with autocorrelated features, i.e, x(t) affects the value of x(t+1) which affects the value of x(t+2). Suppose this is the circuit representing x(t): Does ...
1
vote
1answer
122 views

How to generate a quantum circuit from the quantum state $|1000\rangle+|0100\rangle+|0010\rangle+|0001\rangle$?

I am trying to understand the steps of how make a state preparation circuit from a quantum state. For making my question more clearer, for example, for the state is $\frac{|00\rangle+|11\rangle}{\...
5
votes
1answer
336 views

Implement a projection operator as a quantum circuit

Let the state $|\Psi\rangle\equiv a|0\rangle\otimes|\psi_0\rangle + b|1\rangle\otimes|\psi_1\rangle$, where $|\psi_0\rangle$ and $\psi_1\rangle$ belong to a multi-qubit register $R$ and the ...
3
votes
3answers
743 views

Why do we have to measure the circuit before sending it to the real quantum computer?

If I want to run a circuit on a real quantum computer, I have to measure it before running it. For example: ...
0
votes
1answer
37 views

How to perform a plot histogram for a circuit?

I have created a circuit and I don't know how to plot a histogram. I tried to plot a histogram but it gives me output for 0000 case only, how to get to know the probability for all of the cases. The ...
2
votes
0answers
29 views

Managing memory while running a high depth circuit simulation (amplitude amplification) using Qiskit

I am running an instance of amplitude amplification using Qiskit (v 26) on Google Colab. The circuit is approximately 17 qubits in space and $O(ck)$ in depth where $k \in \left \{1,2,3....,22 \right \...
4
votes
1answer
76 views

How do you represent a Hadamard gate as a product of $R_x$ and $R_y$ gates?

I'm looking for a representation of Hadamard gate that uses only $R_x(x)$ and $R_y(y)$ gates. The values $x$ and $y$ may be the same, but they don't necessarily need to be.
0
votes
2answers
92 views

How to assemble two quantum circuits whose qubit mapping states are different each other?

I uploaded similar question before, but the answer was not I want. I think I should show you in more detail about my question. I use SABRE algorithm which can do qubit mapping for executing quantum ...
5
votes
1answer
99 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.
0
votes
1answer
91 views

How to build and visualize circuit from matrix?

In paper Efficient quantum algorithm for solving travelling salesman problem: An IBM quantum experience, the authors use gate $U_j$ and its decomposition $$ U_j = \begin{pmatrix} \mathrm{e}^{ia} &...
3
votes
1answer
66 views

Data encoding in the quantum perceptron model

In this paper, this figure shows the perceptron model used for quantum neural network. When realizing the inner product between weight vector and input vector, it defines a unitary transformation $U_W$...
2
votes
0answers
76 views

Two possible ways how to implement Shor's Algorithm

Among many paper describing circuit solving period finding problem and discrete logarithm problem (DLP) (for simplity, let's say $g \equiv x^r$ (mod n) and try to find $r$), there are two variants ...
1
vote
0answers
74 views

Circuit state preparation using amplitude encoding

I am following an example of preparing an input state using amplitude encoding from this book. How to calculate $\beta_1^1$ using given formula above? In my understanding, $\beta_1^1 = 2\arcsin(\frac{\...
4
votes
0answers
60 views

An algorithm to perform Gram-Schmidt orthogonalization of linearly independent state vectors

In the first paragraph of the 2nd section of this article, it is stated that given a set of linearly independent $n$-qubit state vectors, Alice can perform the Gram-Schmidt procedure to obtain ...
2
votes
0answers
35 views

Marginal output probability of first bit for constant-depth circuits

Consider a constant depth $1\text{D}$ quantum circuit, which is applied to the input state $|0^{n}\rangle$, and whose output is measured in the standard basis. You can assume that the gates of the ...
7
votes
2answers
222 views

Complexity of $n$-Toffoli with phase difference

I'm interested in the $n$-Toffoli gates with phase differences. I found a quadratic technique in section 7.2 of this paper. Here's the front page of the paper. Here's an image of the section that I'm ...
3
votes
1answer
110 views

Understanding Grover’s Oracle for 3-SAT

First of all I'm very new to the quantum computing world so this might seem trivial to you, but it's a hump I was unable to get over for days now. So I'm talking about the version that Qiskit has ...
2
votes
1answer
63 views

Is there an efficient way to create entangled states using Qiskit?

I am trying to implement Grover's search using Qiskit. And I would like to create entangled states so I could search for the index of a specific value in a list. For example, if the third element in ...
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 ...
9
votes
1answer
212 views

Minimum number of T gates needed to perform two overlapping Toffolis

Consider this circuit: How many T gates are needed to implement it, in the stabilizer+T gate set? The circuit can use cliffords, measurement, classical feedback, ancilla qubits, and T gates. Only T ...
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
49 views

Which single fixed unitary can be used to efficiently simulate arbitrary quantum circuit?

Let $|p\rangle|00\ldots0\rangle$ be an initial (basis) state, where $p$ is a binary encoding of the circuit to be simulated and zeros are the working space. We apply some fixed unitary transformation $...
2
votes
1answer
67 views

Can I freely rearrange the controlled-shift gates in this 3-qubit circuit?

Consider a fixed set of gates of the kind $\land_n(P_{\varphi})$. With $P_{\varphi}$ being a relative phase shift gate by $\varphi$. Can I assert that any permutation of that set is equivalent? ...
1
vote
1answer
32 views

What are standard/most popular data formats to represent quantum circuits including hardware specifications?

On an abstract level one draws a circuit diagram with wires and gates. Different software frameworks like qiskit, circ etc. ...
3
votes
1answer
69 views

How to create CNOT from an entangling gate and arbitrary single-qubit gates?

I am working on the classical simulation of quantum circuits. I know how to efficiently implement the following entangling gate, which -- in the following paper: https://arxiv.org/pdf/1803.02118 -- ...
1
vote
1answer
45 views

Transform circuit with 3 CNOTs in one with limited interactions on the first qubit

Is it possible to translate the above circuit into an equivalent one where the number of interaction gates with the first qubit is 1?
0
votes
0answers
52 views

How do you build the modified Toffoli gate using only local unitary and CNOT operations?

How do you build a circuit for a modified Toffoli gate using only local unitary operations and CNOT operations? The two-qubit unitary operation is given by: $\text{diag}\{1, 1, 1, e^{i\phi}\}$.
5
votes
2answers
72 views

Can any "control-something unitary" be written with control and target spaces flipped?

Consider a simple two-qubit gate such as the CNOT. The typical presentation of this gate is $$\text{CNOT} = |0\rangle\!\langle0|\otimes I + |1\rangle\!\langle1|\otimes X,$$ with $X$ the Pauli $X$ gate....
3
votes
1answer
71 views

Toffolli upside down - an equivalent circuit

It is known that an "upside-down" CNOT is equivalent to a "normal CNOT" surrounded by Hadamard gates as shown in this picture. I am wondering whether there is a similar circuit ...
2
votes
1answer
109 views

Is RYY gate not available in IBM Quantum Composer?

If so, why? How to create the RYY-gate in the composer?
2
votes
2answers
252 views

How to make a circuit for the CNOT using $H$ and $CZ$ gates?

How can we draw a circuit that is based on the gates $H, CZ$ that implements $CNOT$. I know that the $H$ gate is like that: And also the $CZ$ gate is: But I'm not sure how to draw this with the ...
4
votes
1answer
158 views

How do you build a circuit to make an equal superposition of $n$ outcomes?

Suppose we start with $|00...0\rangle$. We want to build an equal superposition over $|0\rangle + ... + |n-1\rangle$. When $n=2^m$ for some $m$, I know I can do this using $H^{\otimes m}$. What is the ...
4
votes
0answers
101 views

Is the No-Cloning Theorem Violated in $C^\ast$-Circuit Models?

In Cleve, et al., the authors discuss self-embezzlement of a catalyst state $\psi$, making the statement on page 2, [B]y local operations, state $\psi\otimes(\vert 0 \rangle \otimes \vert 0 \rangle)$ ...
5
votes
1answer
171 views

Does the circuit with qubit-wise CZ gates compute the inner product of two states? If not, is there another circuit that does?

I've been searching for a quantum algorithm to compute the the inner product between two $n$-qubit quantum states, namely $\langle\phi|\psi\rangle$, which is in general a complex number. One can get $|...
0
votes
0answers
47 views

Method to mark only when certain conditions are satisfied in the superposition states of qubits

I am Newbie in Quantum Computing World. While studying on my own, I was curious about one thing, so I asked this question. My question is as follows: When I configure the superposition states of ...
2
votes
1answer
144 views

Can Qiskit decompose circuits into non-IBMQ basis gate sets?

Let circ be a QuantumCircuit object. Running circ.decompose() returns a circuit that ...

1
2 3 4 5
10