Questions tagged [circuit-construction]

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

Filter by
Sorted by
Tagged with
10
votes
1answer
138 views

Simulating Clifford + few-T circuits

I want to simulate large stabilizer circuits (H/S/CNOT/MEASURE/feedforward) with a small number of T gates mixed in. How can I do this in a way that scales exponentially only in the number of T gates? ...
4
votes
1answer
79 views

Quantum Fourier Transform without SWAPs

The Quantum Fourier Transform from Nielsen and Chuang chapter 5 is pictured here: In the textbook the author refers to "swap gates at the end of the circuit which reverse the order of the qubits". ...
2
votes
3answers
42 views

How to create an Ising coupling gate with Qiskit

I'm trying to apply a time evolution algorithm for a physical system I'm trying to simulate on QISkit, however, in order to do that, I need to use the so-called Ising coupling gate: $I=\begin{pmatrix}...
1
vote
1answer
45 views

Is it possible to simulate any classical algorithm with the same efficiency on quantum computer?

Consider any data structure based on the binary search trees, e.g. set. Classical computers can make queries (insert, remove, test if element present), into this structure in $O(\log n)$ time, where $...
2
votes
1answer
23 views

Hamming with prefix oracle

I'm doing the Q# quantum katas and I'm stuck on an oracle in the Deutsch-Josza algorithm katas. Let $|x\rangle=|x_0x_1\dots x_{n-1}\rangle$ be a qubit array and $r$ be bit string of $k\leq n$. The $...
0
votes
1answer
22 views

How is inner product addition performed?

The Swap test proof on page 8 of https://sites.cs.ucsb.edu/~vandam/teaching/S05_CS290/week9.pdf ends with this derivation: How you add those inner products to get from $\frac{1}{4}(2 + \langle \Psi, \...
2
votes
1answer
59 views

Quantum operation in blocks

I have $n$ states in superposition $|A\rangle=\dfrac{1}{2^{l/2}}\sum_{i=0}^{2^l-1}\sum_{j=0}^{2^l-1}|0\rangle^{\otimes q}|i\rangle^{\otimes l}|j\rangle^{\otimes l}$. Now I have to apply the transform ...
1
vote
0answers
14 views

Ansatz Techniques to Multi-Body Physics Problems

I have been reading this paper: https://arxiv.org/abs/1906.01563v1. I am wondering: is it possible to use the idea behind quantum circuits to build classical Hamiltonians represented in the same way?...
3
votes
2answers
49 views

How do I get out 2 measurements from the same execution on Qiskit?

Here's my circuit, trying to checkout the effect of measurement on the IBM Q circuit. Here you can see I do 2 different measurement at different time, and I hope to be able to see both results. ...
5
votes
0answers
49 views

How many two-qubit gates required for general N-qubit unitary?

Is there a known formula or a scaling behaviour for how many two-qubit gates are required to construct a general N-qubit unitary? I suppose there are several cases to consider: Exact representation ...
4
votes
0answers
43 views

What implementation changes should be done in maxcut code using VQE?

In the paper, "Quantum algorithm implementations for beginners" in the section XVII. QUANTUM SIMULATION OF THE TRANSVERSE ISING MODEL (page 54-58), the authors have plotted energy $E$ vs magnetic ...
1
vote
1answer
43 views

Using Quantum Fourier Transform in adding two 2-bit numbers

I am trying to use Qiskit to write a code that uses QFT to add 2 numbers. I am referring to this paper: https://iopscience.iop.org/article/10.1088/1742-6596/735/1/012083 I have a few questions: 1) Is ...
3
votes
0answers
79 views

Quantum Optimization via Quantum Label Classification in Quantum Circuits

I have been reading Farhi and Neven's paper on quantum neural networks on quantum circuits. I also found an example - albeit not ideal as pointed out by a couple of users - thank you - in here. ...
2
votes
1answer
37 views

Coding an oracle for Simon's algorithm

I am trying to implement Simon's algorithm which calls for a 2-to-1 mapping function that satisfies $f(x) = f(x⊕s)$. I am looking for a simple way to code the oracle (using $H$, $Cx$, and $R$ gates), ...
3
votes
0answers
26 views

How to derive a circuit from given equations?

I was reading a paper on Quantum Neural Networks where the authors discussed a new back propagation algorithm. They shared a schematic of the circuit. However, I am unable to understand how the ...
2
votes
0answers
14 views

There seems to be a problem with the implementation of identity gates on Qiskit as compared to the circuit composer

I have been experimenting with slowing down the decay of qubits, and as a control, I implemented a circuit with just identity gates for comparison. However, when I implement such circuits in Qiskit, ...
3
votes
1answer
69 views

N-Toffoli on Cirq

I am looking for guidance in more generally how to developed n-bit gates in Cirq. I am working on a QNN paper and I need to develop a n-controlled gate to be able to measure the cost function of the ...
2
votes
0answers
39 views

Measuring the expected energy of a quantum circuit

I implemented the following circuit: I am interested in measuring the expected energy of the circuit. I am using Cirq. I am wondering what are the next steps. Sorry if the question seems very basic, ...
2
votes
0answers
21 views

Understanding CNOT gate for indirect measurement

I am trying to write a simple circuit to understand the process of finding the set of parameters such that the cost function of that circuit in question is minimized. For that I understand one has to ...
3
votes
1answer
78 views

Implementing a complex circuit for a Szegedy quantum walk in qiskit

Problem definition I'm implementing a quantum circuit in qiskit for a Szegedy quantum walk, (reference, Fig 21.). It uses two registers of dimension $N$ ($N=3$) each one. The challenges I'm facing ...
8
votes
2answers
148 views

How to program a controlled Hadamard-Hadamard gate?

I'm trying to program a controlled gate as the figure below in Qiskit. Should it be sufficient to separate and control individually the Hadamard gates?
6
votes
1answer
35 views

Simulating a 3-local Hamiltonian Term

This may be a fairly basic question, but in Nielsen & Chuang, the following circuit is given for simulating $\exp\left(-i\Delta t Z_1 \otimes Z_2 \otimes Z_3\right)$: which uses an ancilla qubit ...
3
votes
0answers
30 views

Can anybody explain or suggest a good reference on how to make a modular exponentiation circuit for N=15 with any coprime base?

I have read many papers related to it but in every paper, they just show the circuit of order finding algorithm for N=15, but did not explain what is the procedure to make it. It will be great if ...
6
votes
0answers
36 views

Sequential circuit using quantum gates

Without feedback/loop how can we build a sequential circuit? The basic feature of sequential circuit is that is depends not only on the current inputs but also on the previous inputs/outputs. I've ...
3
votes
1answer
39 views

Primer for learning about quantum circuits simulating systems

I am interested in a couple of books or arXiv links to learn how to develop quantum circuits for the purpose of simulating quantum multi-body systems. Moreover, I am interested in learning how to ...
4
votes
1answer
45 views

Quantum gate teleportation T gate

I am faced with the problem of teleporting certain gates using modified Bell states. For example, I have solved the problem with the $S$ gate, which is defined as following: Alice and Bob share a ...
5
votes
1answer
78 views

Most efficient way for general state generation

Assume we are given an $n$-qubit system and complex numbers $a_0, \ldots, a_{m-1}$ with $m = 2^n$. Assume further we start with the initial state $|0 \ldots 0\rangle$ and want to make the ...
7
votes
0answers
43 views

Summation of amplitudes [duplicate]

I was wondering how to create generalized entangled superpositions of qubits when I came to need of an algorithm to generate the following: Suppose we have two $n$ qubit states, $$|\psi\rangle = \...
1
vote
0answers
21 views

Controlled controlled adder gates involved

Let's say I have a circuit that given in the figure As we can see that this circuit consists of $2$-Toffoli gates and $4$ C-NOT gates, and to construct this entire circuit using only single qubit ...
3
votes
1answer
87 views

2-qubit QFT in IBMQ: controlled phase rotation

I've started getting into quantum computing in the last few days. As part of the learning, I've figured it would be fun to implement some circuits on IBMQ Experience as I learn. So now I'm stuck with ...
2
votes
0answers
46 views

Restoring an initial state after computation

Let me first tell my problem statement. Suppose I have a uniform superposition of states $$|A\rangle=\dfrac{1}{2^{9}}\sum_{i,j,k=0}^{2^6-1}|0\rangle^{\otimes 8}|i\rangle|j\rangle|k\rangle,$$ where $|0\...
2
votes
0answers
51 views

Tensorial notation for this quantum XOR circuit

Suppose I have this quantum XOR circuit; this is a quantum circuit for the classical XOR operation $$\begin{eqnarray*} x_1'= x_1\oplus x_2\oplus x_3\oplus x_4,\\ x_2'=x_2\oplus x_3\oplus x_4\oplus x_5,...
1
vote
0answers
55 views

Quantum operation involving permutation

Suppose I have the state $\frac{1}{2^l/2}\sum_{i=0}^{2^l-1}|0\rangle^{\otimes q}\otimes |i\rangle^{\otimes}|0\rangle_i^{\otimes l}$. I perform some unitary transformation between the registers $|i\...
3
votes
1answer
796 views

Can someone walk us through Nielsen's proof on a circuit for quantum teleportation?

Michael Nielsen posted on Twitter about a proof on a circuit for quantum teleportation. Had some fun this afternoon re-analyzing the circuit for quantum teleportation. Here's a proof I found that ...
2
votes
1answer
158 views

Circuit construction and Dirac notation of the following operation

I have a state $$ |\tilde{\Phi_2}\rangle =\dfrac{1}{2^{3l/2}}\sum_{x=0}^{2^l-1}\sum_{y=0}^{2^l-1}\sum_{z=0}^{2^l-1}|0\rangle^{\otimes q}\otimes |x\rangle^{\otimes l}\otimes |y\rangle^{\otimes l}\...
5
votes
1answer
67 views

How to encode MNIST data set on a quantum circuit to study supervised learning with QNN?

I am trying to implement arXiv:1802.06002†. I do not understand how to take the data set from MNIST and apply it to a quantum circuit. [†]: Classification with Quantum Neural Networks on Near Term ...
0
votes
1answer
131 views

How do I translate a quantum circuit for computing x + y mod 8 into a program?

I have made the above quantum circuit that gives the mod $8=2^3$ operation between $|x\rangle$ and $|y\rangle$. Now I want to write its corresponding program using some language. Where can I do that i....
4
votes
1answer
84 views

Circuit construction for execution of conditional statements using least significant bit

Suppose I have integers and encode them as binary strings for example: $$|0\rangle=|00\rangle,|1\rangle= |01\rangle,|2\rangle=|10\rangle,|3\rangle=|11\rangle.$$ Now an $n$ bit integer, say $x$, is ...
1
vote
1answer
57 views

Implementing a controlled sum operation

I want to implement a controlled operation that involves the following: we have the following qubits: $|x_0\rangle,|x_1\rangle,|0\rangle,|1\rangle,|z_0\rangle,|z_1\rangle$. I want to add the first ...
4
votes
1answer
225 views

How to complete this teleportation circuit? How to create a copy of $|\psi〉$?

This is a quantum circuit. M represents the act of making a measurement on the first two qubits. The circuit is supposed to transfer the state $|\psi\rangle = a |0\rangle + b |1\rangle$ ($a, b \in \...
25
votes
2answers
1k views

How is the oracle in Grover's search algorithm implemented?

Grover's search algorithm provides a provable quadratic speed-up for unsorted database search. The algorithm is usually expressed by the following quantum circuit: In most representations, a crucial ...
3
votes
2answers
357 views

Can the SWAP test only compare registers with the same number of qubits?

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\...
1
vote
0answers
25 views

Implementing conditional operators in a quantum circuit

I have 4 states say $|00\rangle, |01\rangle,|10\rangle, |11\rangle$. I want to add the states in a manner such that $|a\rangle=|00\rangle\otimes|01\rangle\to |00\rangle\otimes|01\rangle$ and $|b\...
5
votes
1answer
167 views

Implementation of quantum adder

I'm looking at this paper and try to implement the Quantum adders they define myself. Suppose we have a number $b=b_{n-1}\dots b_1b_0$ and they want to add a constant number $a=a_{n-1}\dots a_1a_0$. ...
1
vote
1answer
49 views

Implementing piecewise functions on a quantum computer

I am curious about how to do implement functions like $$f(x)=\begin{cases} 2x &\text{if} &0\leq x <0.5 \\ x/2 &\text{if} &0.5\leq x<1 \end{cases}$$ Do we implement this like ...
1
vote
1answer
169 views

How to construct a quantum circuit for the following state transformation?

                       I have a certain transformations that goes as follows: Given $A=|...
3
votes
1answer
66 views

Cost of implementing Boolean function quantumly?

Say, I wanted to implement a unitary $U_f$ to compute a Boolean function $f:B_n \to B_n$. This is done by the unitary $$U_f|x\rangle | y \rangle = |x\rangle|y\oplus f(x)\rangle$$ which one can ...
14
votes
3answers
2k views

How can I build a circuit to generate an equal superposition of 3 outcomes for 2 qubits?

Given a $2$ qubit-system and thus $4$ possible measurements results in the basis $\{|00\rangle$, $|01\rangle$, $|10\rangle$, $|11\rangle\}$, how can I prepare the state, where: only $3$ of these $4$ ...
3
votes
0answers
63 views

How to implement the mixed quantum state fidelity in a quantum circuit?

Suppose we use Uhlmann-Josza fidelity $F(\rho, \sigma):=(\mathrm{tr}\sqrt{\sqrt{\rho}\sigma\sqrt{\rho}})^2$, can we construct a quantum circuit that help us to calculate the fidelity of two mixed ...
2
votes
2answers
74 views

Tips and tricks for constructing circuits to generate arbitrary quantum states

I see a question quite a lot in past exam papers that goes like propose a quantum circuit that generates the state $|\psi \rangle$ given the initial state $|\phi\rangle$ Here's an example: Given the ...