We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [circuit-construction]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
54 views

How to get a large collection of quantum circuits that are valuable to practitioners? [closed]

I want to get a large collection of quantum circuits that matter to practitioners in quantum computing. I want a get many complete quantum circuits. For example, 1 million QASM files. However, I could ...
-1
votes
0answers
39 views

What is the approach towards building quantum circuit for the following transformation? [closed]

This query is regarding the function used in my previous question. $$ |j\rangle|k\rangle\mapsto|j\rangle|(j+k\,)\text{ mod }m\rangle. $$ How should I realize this using basic gates? Just give me a ...
3
votes
1answer
75 views

Secret sharing though quantum operations

I have a secret say $s$. I have a dealer $D$ and three participants $A, B, C$. I want to share this secret $s$ in such a way that the participation of all $3$ is essential to reconstruct the secret. ...
4
votes
2answers
472 views

Trying to build a circuit for quantum teleportation on IBMQ I get ERROR_RUNNING_JOB error

I am trying to build a circuit for quantum teleportation. On the simulator, everything runs fine and according to expectations, however, I am not able to run the algorithm on the real quantum ...
-2
votes
0answers
44 views

How to generate quantum circuit for the following transformation? [closed]

$$ |j\rangle|k\rangle\mapsto|j\rangle|(j+k+1\,)\text{ mod }m\rangle. $$ How to extend the basic qubit quantum gates to get the above transformation?
0
votes
0answers
81 views

How to generate the following $n$-level $n$-particle singlet state?

$$\boxed{|S_{n}\rangle = \frac{1} {\sqrt{n!}} \sum_{S\in P_n^{n}} ( \,-1) \,^{\Gamma(S)}|s_{0}\rangle |s_{1}\rangle ....|s_{n-1}\rangle}$$ Here $P_n^{n}$ is the set of all permutations of $Z_n := \{0,...
3
votes
2answers
217 views

How to build a CNOT out of universal CCNOT gates?

By the classic theory of computation, every classic gate can be build with NAND operation, for example XOR ("the classic CNOT") is build by net of NANDs, I saw that the quantum analogue for NAND can ...
1
vote
2answers
370 views

How to generate a superposition of m-level n-particle states $|j_{0} ,j_{1}, …,j_{n-1}\rangle$ with $\sum_{k=0}^{n-1} j_k \mathrm{mod}\ m \ = \ 0$?

The m level n-particle state $|X_{N}\rangle$ is defined as $$\boxed{|X_{N}\rangle = \frac{1} {m^\frac{n-1}{2}}\sum_{\sum_{k=0}^{n-1} j_k \mathrm{mod}\ m \ = \ 0}|j_{0}\rangle |j_{1}\rangle ....|j_{...
2
votes
1answer
35 views

Decomposing a controlled phase gate into CNOTs

I'm trying to understand the following derivation of decomposing a controlled $R_k$ (phase) gate into a combination of CNOTs and single qubit gates, but there's one main thing about the process that ...
4
votes
1answer
82 views

Developing quantum circuits for specific quantum chemistry configurations

I am interested in learning more about the following: would it be possible for me to simulate a molecule consisting of copper ions through a quantum circuit? And if so, can that circuit allow me to ...
3
votes
1answer
199 views

What is a “barrier” in Qiskit circuits?

I just started studying IBM Qiskit, and cannot find details about the barrier method on the QuantumCircuit class. It is shown in the circuit drawing, but I never heard about it after reading quantum ...
2
votes
1answer
43 views

n-qubit circuit run with > n qubits?

I was reading the Qiskit tutorial on circuit properties and there is a section (Unitary Factors) which states that even though an example circuit is made of 12 qubits, it may not need 12 qubits to run....
1
vote
1answer
51 views

Variational Quantum Eigensolver (VQE) - Question about finding the imaginary part of measurement

I've been reading this article in order to understand how to implement a VQE on a quantum computer. Equation 38 involves the imaginary part of $ \langle\psi_0 |V_k^{j\dagger}(t)O_iU(t)|\psi_0\rangle ...
2
votes
1answer
83 views

How to implement the controlled square root of NOT gate on the IBM Q composer?

I already know how to do that for Z, Y, and H gates. How can I make a controlled sqrt-of-NOT gate? I mean the controlled version of the gate described here.
1
vote
2answers
143 views

How to get amplitudes only for chosen qubits?

For computation, I use N working qubits and M ancilla qubits. ...
1
vote
2answers
55 views

Why qiskit changed the order of gated applied to a circuit

Below I created a circuit and applied several gates to it: ...
2
votes
1answer
60 views

Understanding how control gates are written in tensor notation

I'm very confused about the tensor representation of Control gates. I had thought that all control gates were of the form $P_0 \otimes I+P_1\otimes \hat{A}$, where this does nothing to the first qubit ...
1
vote
1answer
24 views

Performing a measurement in the standard computational basis of a three qubit system on two qubits

I often see written "and then we perform measurement in the standard computational basis" but I'm a little fuzzy on what this means as it's never stated what type of measurement we're supposed to take....
2
votes
1answer
38 views

Circuit for controlled rotations conditioned on a $d$ bit precision estimate of $\theta$ for $O(d)$ gates

Suppose I have a $d$-bit estimate of $\theta \in (0, 2 \pi]$, say a register of qubits $|\tilde{\theta} \rangle = |z_1 \rangle \ldots |z_d \rangle$ for $|z_i \rangle \in \{|0 \rangle, |1 \rangle \}$ ...
3
votes
1answer
95 views

Reversible Circuit Simulation (for classical tests of quantum subroutines)

Problem: trying to implement and test quantum subroutines on quantum simulators I run into multiple challenges: Quantum simulation is a very hard problem: a very low number of simulated qubits is ...
5
votes
1answer
43 views

Implementation of filter operation

If I want to implement the measurement operation corresponding to filtering, i.e. $$ M_1=\left(\begin{array}{cc}1 & 0 \\ 0 & \alpha \end{array}\right)\qquad M_2=\left(\begin{array}{cc}0 & ...
5
votes
1answer
76 views

A basic question on circuits and matrix representation

I have several (rather basic) questions on matrix representation of circuits and I would be very grateful to anyone that could clear up my confusion, thank you in advance. 1) When reading circuit ...
2
votes
1answer
46 views

quantum circuit with feasible gates for state preparation

I have a classical vector of size $2^{n}$ (normalized) and I want to use this value as amplitude for my $n$ qbits, in the canonical basis $|00000\rangle$, $|00001\rangle$ etc. I want to use real ...
5
votes
2answers
123 views

Is there a simple, formulaic way to construct a modular exponentiation circuit?

I'm a newcomer to quantum computing and circuit construction, and I've been struggling to understand how to make a modular exponentiation circuit. From what I know, there are several papers on the ...
0
votes
1answer
145 views

Measurements in Qiskit

What is the difference between 2 types of measurements depicted below? At the end of unitary evolution, qubits are in superposition of states, and after measurement I get a set of probabilites ...
9
votes
2answers
362 views

How to create quantum circuits from scratch

I am doing self-study at the moment using primarily the book: Quantum Computing a Gentle Introduction by Eleanor Rieffel and Wolfgang Polak. Getting through the earlier chapters and exercises went ...
4
votes
3answers
102 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
54 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
35 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
27 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, \...
1
vote
0answers
15 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
81 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. ...
4
votes
0answers
76 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 ...
3
votes
0answers
98 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
87 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 ...
2
votes
1answer
68 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
33 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
32 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, ...
2
votes
0answers
50 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, ...
3
votes
1answer
106 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
27 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 ...
8
votes
0answers
117 views

How many two-qubit gates are required to implement a 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 ...
3
votes
1answer
138 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 ...
6
votes
1answer
46 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 ...
8
votes
2answers
218 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?
4
votes
0answers
41 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
49 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 ...
4
votes
1answer
115 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". ...
4
votes
1answer
66 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 ...
1
vote
0answers
27 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 ...