Questions tagged [circuit-construction]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
14 views

How can I build up an arbitrary quantum circuit given a certain unitary matrix operation?

Suppose I want to put a qubit whose initial state is $|0\rangle$ to the final state $\frac{1}{\sqrt{3}}|0\rangle + \sqrt{\frac{2}{3}}|1\rangle$. Well, in that case, the unitary matrix that performs ...
2
votes
0answers
22 views

Stabilizer circuit synthesis via Clifford gates

I have been working with stabilizer codes and I understand the mathematical way that they are described and how to simulate such in a classical computer in order to check their performance. However, ...
2
votes
0answers
47 views

Simulation for the [5,1,3] stabilizer code in Qiskit

Sorry that I keep asking questions for the same subject. It is driving me crazy. I have followed the [5,1,3] stabilizer code circuit designed by Gottesman in page 35 in his paper (also illustrated in ...
2
votes
1answer
106 views

Why is implementation of controlled Hadamard on IBM Q so complex?

With reference to question how to implement CCH gate I easily realized that CH gate can be implemented with $\mathrm{Ry}$ gates and $\mathrm{CNOT}$ followingly: Note $\theta = \frac{\pi}{4}$ for ...
4
votes
2answers
85 views

How to implement the CCH gate in quantum computers available in clouds?

How to implement CCH gate in quantum computers available in clouds? If there is not any gate directly available for it, what are the possible ways to represent CCH?
5
votes
1answer
136 views

Uncomputation in quantum implementation of a classical algorithm

In Nielsens and Chuangs book, they present a way to implement a reversible version of any classical algorithm (section 3.2.5). In short, they use Fredkin and other simple reversible gates to ...
6
votes
1answer
106 views

Decomposing a $(w+1)$-qubit permutation gate into $w$-qubit permutation gates, SWAPs and NOTs

Say I have a quantum circuit of $w+1$ qubits with a permutation gate (mapping computational basis states to computational basis states) that does the permutation $(i, i+1)(i+4, i+5)$ on $w+1$ qubits ...
2
votes
1answer
59 views

How to implement a Fredkin gate using Toffoli and CNOTs?

Inspired by a question Toffoli using Fredkin, I tried to do "inverse" task, i.e. to implement Fredkin gate (or controlled swap). In the end I implemented it with three Toffoli gates. Firstly, I ...
5
votes
1answer
113 views

Can a Toffoli gate be implemented using Fredkin gates?

Even though this seems to be a much asked basic question, I couldn't find a reputed answer to this: Implement a 3-qubit Toffoli gate using 3-qubit Fredkin gates. The best I could do was using 4 ...
1
vote
1answer
57 views

Computing circuit depth in Cirq

I ran into a problem of how to extract circuit depth from Cirq circuit object. In Cirq circuits consist of a list of Moments. Number of moments is not equal to the circuit depth in general case. I ...
1
vote
3answers
82 views

Compiling the Pauli-Z operator to the Rz operator for Hamiltonian simulation

I saw a tutorial on this long ago, but lost it. I know that the Pauli-Z operator compiles to Rz, but how? Here are the steps I remember: First, we have to solve for $U(t)$ in the Schrodinger equation ...
5
votes
2answers
104 views

How to transform e.g., a 4 by 4 unitary matrix into a quantum circuit

I am new to Quantum Computing. I would really appreciate if some one could offer me some ideas, suggestions and/or useful references to solve the following problem about realizing an arbitrary ...
1
vote
0answers
20 views

Methods for encoding non-linear probabilities as data

I am working on translating a computing method I developed to model complex non-linear systems with classical computational methods into a form that is natural to quantum computing. The technique ...
3
votes
2answers
52 views

Quantum circuit for a three-qubit bit-flip code

I know a three-qubit bit-flip code has a common encoding circuit as follows, Further, as in page 35 in Gottesman's paper, the encoding circuit can also be constructed through stabilizer generators. ...
3
votes
1answer
64 views

How are physical quantum chips made?

So this might be a dumb question, but I have trouble finding any information on the physical aspect of quantum computers. Online you can find only pictures of big bulky things said to be quantum ...
1
vote
1answer
36 views

Minimum number of ancilla qubits to unitarily simulate a measurement?

Let's say I have a ket which is a momentum eigenket $| p \rangle$ and then I measure the position and obtain $|x' \rangle$. $$ | p \rangle = \int | x \rangle \langle x | p \rangle dx \to | x' \...
3
votes
2answers
71 views

Minimum number of ancilla qubits required to make a transformation unitary?

Background The counterpart of a NOT gate is the CNOT gate. They make use of ancilla qubits to achieve this. Question Given an arbitrary non-unitary transformation what are the minimum number of ...
4
votes
2answers
91 views

How to construct the unitary representation of the function $f(x, y, z) = (x \oplus y, y \oplus z)$?

Consider the function $f:\{0, 1\}^3\to\{0, 1\}^2$ with $f(x, y, z) = (x \oplus y, y \oplus z)$. How would you construct its standard unitary representation?
2
votes
0answers
41 views

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

Could you please give a direction/reference towards realising the following using any set of realisable quantum gates $$\boxed{|S_{n}\rangle = \frac{1} {\sqrt{n!}} \sum_{S\in P_n^{n}} ( \,-1) \,^{\...
0
votes
1answer
48 views

Is this interpretation of quantum circuits right?

Just need some clarification: Results derived as the output of "running" a "quantum circuit" constructed from "quantum gates" are distributed in a certain way, based on the design, and the multiple ...
3
votes
2answers
141 views

How to decompose this two-qubit unitary matrix to the standard gate set?

I have read some of the other decomposition questions here however still don't understand how to do it manually. The matrix I wish to decompose is the following for 2 qubits: $M=\frac{1}{\sqrt2}\...
0
votes
1answer
59 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 ...
3
votes
1answer
79 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
549 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 ...
3
votes
2answers
279 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
380 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
97 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
90 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 ...
4
votes
1answer
531 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
45 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
73 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
116 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
182 views

How to get amplitudes only for chosen qubits?

For computation, I use N working qubits and M ancilla qubits. ...
2
votes
2answers
60 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
66 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
30 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....
3
votes
1answer
40 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
124 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
46 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
84 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
50 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
174 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
242 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
466 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
145 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
59 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
42 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
34 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
99 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. ...