Questions tagged [circuit-construction]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
15 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 ...
2
votes
2answers
671 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
28 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 ...
1
vote
0answers
24 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 \...
3
votes
1answer
61 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
84 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 ...
4
votes
1answer
76 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
82 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
55 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
68 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
53 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
51 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
196 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
90 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
54 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
190 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
36 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
43 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
58 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
29 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
54 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
43 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
46 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
61 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
52 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
91 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
174 views

Making a Controlled-Z from a CNOT

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
145 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
91 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
150 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
45 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
97 views

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

Let circ be a QuantumCircuit object. Running circ.decompose() returns a circuit that ...
0
votes
0answers
25 views

QAOA Circuit for MWIS

Hi thanks for taking a quick look! I’ve got a question of how weights are implemented in the angles for gates in the QAOA. I'm trying to solve the Maximum Weighted Independent Set Problem This is the ...
2
votes
1answer
65 views

Is there any way to assign a colour for a single gate in Qiskit?

I'm drawing with Qiskit a big circuit with some predefined and custom gates. I want to colour some of them in non-default colours for a better reading of it. Is it possible to do it for predefined ...
1
vote
1answer
80 views

Expectation value of an arbitrary observable. My own definition and `cirq` limitations

In my previous question I was struggling with the definition of expectation value of an observable for a circuit. Here is what I have derived after some support (I simplify the definition to 2-qubit ...
3
votes
1answer
84 views

Multiplying quantum circuits in cirq using * and computing “expectation values”

I am reading cirq guide about Simulation and there is an example in "Expectation values" paragraph that I don't understand. Everything boils down to the following snippet: ...
3
votes
1answer
95 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 ...
0
votes
1answer
56 views

Single qubit gates (or CNOT) sequence to transform SWAP to Sqrt of SWAP

I'm trying to figure out how to transform the SWAP state gate into the square root of SWAP gate using only CNOTs or single qubit gates. As you might guess, I'm new to this whole concept, but I'm ...
6
votes
2answers
131 views

Computing $e^x$ on a quantum computer

Does anyone know how to make a quantum circuit to compute exponentials where the exponent can be a fraction? To be more precise, I'm looking for a fixed point quantum arithmetic circuit that does the ...
6
votes
2answers
105 views

Exponentiating Pauli matrices using trapped ion native gates (single-qubit rotations + XX, YY, ZZ)

I'm wondering what are the known/good/standard ways of exponentiating Pauli terms (i.e. constructing circuits, which implement $\exp(i\alpha XIIZYI...)$) using gates supported by trapped ion quantum ...
3
votes
1answer
67 views

From mathematical notation to quantum circuit, in general

I am learning the basics of quantum computing using Qiskit and I encountered a problem when I tried to solve some of our course exercises. I feel like I am missing an invisible step, the step from ...
2
votes
1answer
63 views

Conditional Statements on a Quantum Computer

I've been struggling with this for a while now, and whilst I suspect the answer is unknown or very complicated, I thought I'd ask regardless. Suppose I have some states $|\psi_i\rangle = \sum_{j=1}^n ...
2
votes
3answers
122 views

Find unitary such that $U:|i\rangle|0\rangle\rightarrow|i\rangle|A_i\rangle$

Let's assume I have two qubits of state $|A_0\rangle$ and $|A_1\rangle$ correspondingly stored in a quantum memory. How do I find a Unitary $U$ that acts on another register of 2-qubits such that $$U:|...
3
votes
1answer
89 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 ...
1
vote
0answers
53 views

3-qubit phase shift gate/circuit implementation without any Ancilla qubits

Hi, I need help me with figuring out the 3-qubit phase shift circuit without any ancillas similar to the 2-qubit circuit shown in below attached picture....... Please do let me know! Thanks in advance!...
1
vote
1answer
36 views

Implementing a SwapTest for samples with large numbers of features

I am trying to calculate the distance between sets of vectors. To do this I can create a SwapTest circuit (described here on page 34) and encode a feature vector with a U3 gate, then apply H and CSWAP ...
3
votes
1answer
110 views

What is the action of sandwiching an operator with two CNOT gates?

When a gate is sandwiched (or conjugated) by two CNOT gates, what effect does it have on the gate being sandwiched? For example, in the figure below, it is clear what effect the controlled $R_y(\theta)...
1
vote
1answer
58 views

Partial Cyclic Permuation with only Toffoli and CNOT gates?

I have been trying to solve this puzzle of constructing this transformation from CNOT and Toffoli gates as mentioned in NC page 193 (Ex 4.27) Here is what I have done: First observation is it has 8 ...

1
2 3 4 5
9