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
10 views

Composing teleportation circuit in Qiskit Circuit Composer

I'm trying to create the teleportation circuit in IBM Qiskit Circuit Composer. ...
1
vote
1answer
23 views

Which method of executing a multi-control gate is more efficient?

I am interested in executing multi-control gates and I have found two methods to do so as explained below. The first is taken from Nielsen and Chuang (2010) from their Figure 4.10. This method ...
1
vote
2answers
58 views

Optimizations in quantum circuits

In a paper called On quantum circuits employing roots of the Pauli matrices, I found this figure, where I couldn't understand the equality in the circled circuits. I need an explanation of how the ...
0
votes
0answers
28 views

How to build a multicontrolled cnot without auxilary qubits?

How can I build a multicontrolled cnot without auxilary qubits? When I am using multicontrolled cnots, then I always need many auxilary qubits. Can one build a multi controlled cnot without auxilary ...
1
vote
3answers
37 views

How can I obtain transformation matrix of a quantum circuit in the Qiskit?

I need to draw a quantum circuit in Clifford+T library and obtain automatically its transformation matrix. Is there any feature on Qiskit in this case?
0
votes
1answer
46 views

Odd behavior with Qiskit Pauli operators

I was creating a simple implementation of the Hadamard test when I came across the following, what seems like, strange behavior. Consider the following snippet, which is part of the computating the ...
2
votes
0answers
30 views

Preparing arbitrary two- and multi-qubit states with real amplitudes

Is it correct that the following circuit can produce any two-qubit state with real amplitudes? (Meaning that for any set of the four real amplitudes there exists a set of angles...) If so, should I ...
0
votes
0answers
17 views

Issue with running a circuit: Cannot read property 'idCode' of null

I have been trying to run simple circuits from the Circuit Composer, both on a real quantum comp and on a simulator. Every time I get this error message: ...
1
vote
1answer
48 views

Is there any difference between a quantum- and classically-controlled gate if I know my basis?

Consider an unrealistic 2-qubit plus 1 ancilla bit-flip error correction code (images generated by quirk), where I know by some means or other that an error may have happen on qubit0 (represented by ...
4
votes
2answers
156 views

Is there a circuit to compare two quantum states?

Lets have two quantum states (single qubits ones for simplicity) $|\psi\rangle$ and $|\phi\rangle$: $$ |\psi\rangle = \alpha_\psi|0\rangle+\mathrm{e^{i\varphi_\psi}}\beta_\psi|1\rangle $$ $$ |\phi\...
0
votes
1answer
31 views

Converting 'string' to a function/gate in QisKit

I want to give a list of Quantum gates in a .txt file from user an apply them to a Quantum circuit but the gates in notepad .txt file have 'string' type while in Qiskit I need functions/methods. For ...
2
votes
2answers
82 views

Generate a 3-qubit SWAP unitary in terms of elementary gates

I wish to generate the following unitary ...
4
votes
0answers
26 views

Reducing the depth of quantum circuits with ancilla qubits

This question is two-fold and considers general $n$-qubit operations on a quantum computer. First, can a general $n$-qubit operation be implemented on a quantum computer without the use of ancilla ...
-1
votes
1answer
28 views

Implementing Cirq Coding Gates

Can someone please help me making these gates on CIRQ programming: Decrement Gate (-1) Splitter Gate (If possible) I was having trouble implementing these and was not sure if it's possible either. ...
2
votes
1answer
52 views

How can I convert the unitary matrix $e^\frac{i\pi}{2}$ into a quantum circuit in Qiskit?

How can I put the unitary matrix $$e^\frac{i\pi}{2}I$$ to the quantum circuit? I don't know if it is belong to $$U3(\theta, \phi, \lambda), U2(\phi, \lambda), U1(\lambda)$$ Thanks a lot.
3
votes
0answers
64 views

What is the thought process for circuit making after seeing input and output of a matrix?

Here is an exercise (4.27) from Nielsen and Chuang and I found the answer (given in the figure below) online without any explanation. The question was to construct a circuit by seeing a matrix (given ...
1
vote
1answer
54 views

Quantum Circuit Optimization with Machine Learning [closed]

I read some paper about Quantum Circuit Optimization but I am on a low level. And have some experience in ML. But what I don't understand is it possible that ML can help to optimize Quantum Circuits ...
3
votes
1answer
106 views

How to implement linear combination of two unitary gates in a quantum circuit?

I wanted to implement a non-unitary operation. I came to know that I can do it as a linear combination of unitaries from this paper (published version). Let us say I want to implement an operation ...
-1
votes
1answer
131 views

Implementing a circuit that returns $|01\rangle$ and $|10\rangle$ with equal probability

Using Python how can I implement a quantum circuit that returns $|01\rangle$ or $|10\rangle$ using only $CX$, $RX$ and $RY$ gates, starting with random parametric gates as parameters and optimizing it ...
0
votes
0answers
97 views

Can one use a quantum circuit as a pathfinding algorithm?

I've been learning about quantum computing, and I noticed that another way to describe the state vector is as a path in a binary tree where each level of tree represents another qubit, each node ...
-1
votes
3answers
211 views

Google Colab - ImportError: The class MatplotlibDrawer needs pylatexenc

When I run the following command qc.draw(output='mpl') for my circuit qc, I get this error: ...
2
votes
1answer
73 views

Test equivalence of circuits exactly on qiskit

I have two circuits that I believe are equivalent. How can one check this on qiskit? Currently, I am executing both circuits and verifying that the counts are close (which they are) but I would like ...
1
vote
1answer
32 views

Is there a way to generate random circuits in qiskit with only certain allowed gates?

It seems like I can use https://qiskit.org/documentation/stubs/qiskit.circuit.random.random_circuit.html but I would like to control the gates that are allowed. What is an efficient way to make random ...
1
vote
0answers
39 views

qiskit - MCMT - base gate acting on only one qubit

I want to reduce the depth of a ucrz gate acting on multiple qubits with ancilla qubits in qiskit. One way to do this could be the mcmt implementation with ...
0
votes
2answers
36 views

How to remove last n layers of Quantum Circuit in Qiskit?

Let's say I have a QuantumCircuit with depth $d$ layers. How can I generate a new ...
1
vote
1answer
37 views

How to split a Quantum Circuit on a barrier in Qiskit?

Let's say I have a QuantumCircuit with multiple barriers as shown in the visual below: How would I split up the ...
2
votes
1answer
196 views

How to measure in another basis

I am new to qiskit and I have to simulate a quantum circuit. I read this documentation https://qiskit.org/textbook/ch-states/single-qubit-gates.html where it is left as an exercise to the reader to ...
2
votes
1answer
80 views

What is the best way to handle parametric circuits in Qiskit?

What is the best way to handle parametric circuits in Qiskit? When I create a variational form like TwoLocal and then do ...
1
vote
0answers
25 views

Difference between a Non-Gaussian Circuit and Gaussian Circuit

I am fairly new to this topic and I couldn't find resources that were beginner-friendly. So basically what are the differences between these two?
2
votes
0answers
19 views

Can low-rank factorizations approximate quantum circuits?

Quantum circuits can be expressed as the matrix product of each gate in the circuit, where each gate is a unitary matrix (say) $G_i$. So, the whole circuit is $S = G_n G_{n-1} \cdots G_1$. Since $S$ ...
0
votes
0answers
32 views

Why QuantumCircuit.diagonal does not provide global phase when it is used in a controlling circuit

When it is used in a controlling circuit, QuantumCircuit.diagonal() decomposition in Qiskit does not provide global phase (as a relative phase), but instead only identity operator is used. Here the ...
2
votes
1answer
41 views

Circuit of quantum error correction code

I read an interesting paper of QEC with only two extra qubits. In the paper, there is a circuit. Note that . Here are some contexts of the paper: "The stablizer is $XZZXI$. If the second gate ...
1
vote
0answers
26 views

Gate definitions for quantum random access codes

I would like to know how the gates are defined in quantum random access codes? Consider the $2 \to 1$ code described in Lemma 3.1 of this paper. The section defines the encoding and decoding circuits. ...
0
votes
1answer
42 views

What is the analysis of the Bell Inequality protocol in Cirq's 'examples'?

This question is taken from https://github.com/quantumlib/Cirq/issues/3032. The "standard" protocol measures Alice's and Bob's qubits in different bases, while the one in Cirq measures in ...
3
votes
1answer
40 views

Can you take infinitely many square roots of Pauli-X?

I am trying to find the cost for a n-bit Toffoli gate based on the recurrent circuit presented on Barenco's Work in Lemma 7.5 (Elementary gates for quantum computation) The construction requires that ...
7
votes
1answer
205 views

Consequences of $MIP^\ast=RE$ Regarding Quantum Algorithms

The (pending-peer review) proof of $MIP^\ast=RE$ in this pre-print has been hailed as a significant breakthrough. The significance of this result is addressed by Henry Yuen (one of the authors) in ...
5
votes
1answer
531 views

Can anyone provide me with an example of the for Grover's algorithm on one qubit?

I'm having trouble understanding Grover's Algorithm, so I'd like to start with the case with 1 qubit. But I don't see anyone build it for 1 qubit, only 2 is the minimum. Is it because that's ...
4
votes
1answer
51 views

Defining a custom parametric gate in Qiskit in terms of standard gates?

Here it is explained how to define a custom non-parametric gate in Qiskit. How do I define a new parametric gate? For example, I want to have the $CCR_y$ gate defined as in order to use it as ...
7
votes
1answer
84 views

Preparing any superposition of fixed Hamming weight states

There exists a nice way of preparing any superposition (with real amplitudes — this is the case I'm interested in) of states $\{\ldots0001\rangle,\,|\ldots0010\rangle,\,|\ldots0100\rangle,\ldots\}$, ...
4
votes
3answers
117 views

How can we implement controlled-T gate using CNOT and H, S and T gates?

In general, is there any way to implement a controlled version of an arbitrary gate U if we are given only CNOT and U gate?
1
vote
0answers
31 views

What is the maximum circuit depth for Qiskit Aer Simulator?

I'm running some simulator circuit on my computer, and I see that (using 3 qubits, and thousands of classical registers), the max cap seems to be about qc.depth() ...
2
votes
2answers
58 views

How can I load a probability distribution using a quantum circuit in Qiskit?

Can someone suggest me a way to load a distribution (for example a discretized Gaussian distribution) into a quantum computer using a quantum circuit? I tried to implement the code using Qiskit.
1
vote
0answers
47 views

Generalized construction of W basis

Although this question deals with the construction of a W-state, I was looking for a general way to find all the orthogonal W-states, given a number of qubits. For example, for three qubits, the first ...
3
votes
0answers
64 views

Preparation of states that correspond to efficiently integrable probability distributions

I have been trying to implement methods from paper Creating superpositions that correspond to efficiently integrable probability distributions by Grover and Rudolph. It is stated that there exists an ...
0
votes
0answers
224 views

The analogous IBM circuit representation for the quantum scheme

I am trying to implement a quantum scheme of sharing a secret via EPR states. Here is my initial state of 6 qubits \begin{equation} |\psi\rangle=\left(\dfrac{|0\rangle_1|0\rangle_2+ |1\rangle_1|1\...
4
votes
1answer
79 views

How to implement an Oracle

Often when reading about QC algorithms the Authors assume the existence of an Oracle. I understand this is so that they can focus on the overall structure of the algorithm, and an Oracle can be seen ...
4
votes
1answer
61 views

How to transform a state with amplitude squared or to any power?

Suppose I have an unknown state $|\psi\rangle = \sum_i \alpha_i|{\lambda_i}\rangle$, is it possible that I can transform it into $|\psi\rangle = \frac{1}{\sqrt{\sum_i|\alpha_i|^{2r}}} \sum_i \alpha_i^...
4
votes
0answers
34 views

Equivalence checking of quantum circuits up to error

Suppose you are given two circuit descriptions $A$ and $B$ where by a circuit description I mean a sequence of gates (in the order they are applied) and the qubits they are applied on. (For the sake ...
1
vote
1answer
57 views

Is there a tool to get the quantum circuit corresponding to a sparse matrix?

If I know a sparse matrix, is there any tool that allows me to get the corresponding quantum circuit directly? If not what should I do? For example,I want to try hamilton simulation and I have the ...
1
vote
1answer
72 views

How to construct quantum circuit to count number of 0-qubits and 1-qubits

Suppose we have a 3-qubit input; each bit is either 0 or 1. How to decide if there are more 1's than 0's? Only 1 extra qubit may be used for the output. (Yes I know this can be achieved using 3 ...

1
2 3 4 5
7