Questions tagged [circuit-construction]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
41 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
49 views

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

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

Circuit diagram that can produce the state $|\zeta_{ABE}$ in Eve’s laboratory

Consider the entanglement-based protocol that in each round Alice prepares a Bell state $(|\Phi_+\rangle= \frac{1}{\sqrt{2}}(|00\rangle+|11\rangle)=\frac{1}{\sqrt{2}}(|++\rangle+|--\rangle)$ and ...
0
votes
0answers
16 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
40 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
44 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
68 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: ...
2
votes
1answer
71 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
41 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
110 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 ...
4
votes
0answers
59 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
50 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
44 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
110 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:|...
2
votes
1answer
61 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 ...
0
votes
0answers
43 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
35 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
107 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
38 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 ...
3
votes
1answer
64 views

How can I create an ADD gate for two quantum states? [duplicate]

I want to create an ADD gate like this: in qiskit using elementary gates. Can it be done?
4
votes
0answers
68 views

Is there a systematic way how to generate the Hamiltonian from a given circuit?

If I have a designed circuit to solve a particular problem. Is there a systematic way how to generate the Hamiltonian from it?
2
votes
1answer
57 views

Parametric circuit to prepare the most general single-qubit state [closed]

I am highly confused with this statement and spent a lot of time understanding it.
2
votes
1answer
58 views

How can I find a Clifford+T approximation of an arbitrary one qubit gate in Qiskit?

I know the Solovay-Kitaev algorithm can achieve this. Is there an implementation of this or any other algorithm for the same task in Qiskit? Or perhaps some other library that interfaces well with ...
3
votes
1answer
46 views

Circuit that measures PVM

How can I construct a circuit that measures PVM $\{|\psi\rangle\langle\psi|\},|\psi^\perp\rangle\langle\psi^\perp| \}$ where $|\psi\rangle=\cos\frac{\theta}{2}+e^{i\phi}\sin\frac{\theta}{2}|1\rangle$ ...
2
votes
2answers
110 views

Qiskit order of multiplication and tensor product

Section 2.3 of the Qiskit textbook shows us that $$ CNOT|0+\rangle \ = \ \frac{1}{\sqrt2}(|00\rangle + |11\rangle)$$ which I was able to translate to a circuit as such: ...
4
votes
2answers
86 views

Preparing Bell state $(1/\sqrt{2}) (|01\rangle + |10\rangle)$ in Qiskit

I'm working through the Qiskit textbook right now, and wanted to complete part 1 of exercise 3.4, which asks me to use qiskit to produce the Bell state: $$\frac{|01\rangle + |10\rangle}{\sqrt{2}}$$ ...
3
votes
1answer
82 views

Efficient QFT-based QPEA complexity

The HHL algorithm lies on an implementation of the Quantum Phase Estimation algorithm. One popular implementation is based on the Quantum Fourier Transform which can be divided in three steps. Let $U$ ...
3
votes
1answer
126 views

How to construct a controlled-Hadamard gate using single qubit gates and controlled phase-shift?

How can I construct a controlled-Hadamard gate using single qubit gates and controlled phase-shift? I am stuck in this and any help would be appreciated.
0
votes
0answers
27 views
3
votes
1answer
60 views

Cirq: n-qubit GHZ state

I am trying to write $n$ party GHZ state but at the end of the day, it seems like bi partite state. I am missing a detail. Here is my code ...
3
votes
1answer
113 views

How does a rotation about the y-axis on a Bloch sphere affect the state of a qubit?

I am unsure how exactly it can be inferred that the following sequence of logic gates and rotation operators acting on a three-qubit state $\lvert abc\rangle$ $$ R_{y,c}\left(\frac{\pi}{4}\right)CNOT(...
6
votes
3answers
97 views

How to create the state $\vert 0 \rangle+i \vert 1 \rangle$ using elementary gates?

I am trying to write $|0\rangle+i|1\rangle$ in terms of elementary gates like H, CNOT, Pauli Y, using the IBM QE circuit composer. I was thinking some kind of combination of H and Y since $Y|0\rangle=...
6
votes
1answer
218 views

Distinguishing collapsed and uncertain qubit in a quantum circuit

I have been through the Young's double slit experiment. It's a direct proof or instance of showing that a wave is collapsed via observation or measurement, and shows no interference patterns. I want ...
2
votes
1answer
50 views

What is a complexity of producing arbitrary equally distributed superposition?

In the article An Optimized Quantum Maximum or Minimum Searching Algorithm and its Circuits I found statement (pg. 4): Preparing an initial state takes $\log_2(N)$ steps. In this case the initial ...
-2
votes
1answer
59 views

How to deal with job submission error in IBM? [closed]

I keep on getting this error no matter how many circuits I run in the backend 'ibmq_athens'. It says 'Max retries exceeded with URL'. Can someone explain why I am getting this error message. The main ...
7
votes
0answers
114 views

Is there an efficient circuit implementing the unitary $U|x\rangle|0\rangle=|x\rangle\Big(\sqrt{1 - x/2^n}\,|0\rangle+\sqrt{x/2^n}|1\rangle\Big)?$

Given an $n$-qubit register $|x\rangle$, does there exist an efficient circuit implementing unitary operation $U$ such that $$U |x\rangle|0\rangle = |x\rangle\Big(\sqrt{1 - x/2^n}\, |0\rangle + \sqrt{...
5
votes
1answer
78 views

Are there any algorithms that take measurements in an intermediate step?

As a beginner in quantum computation, I noticed that all quantum algorithms take various gates followed by measuring the qubits in the last step. Is it always the case? Are there any algorithms that ...
3
votes
2answers
82 views

How do you represent one-quibit rotations in two registers as its own 4x4 unitary matrix?

Let's say you have a circuit that performs a Z-rotation in the first register, and a Y-rotation in second register. How can we express this "moment" in terms of a 4x4 matrix, i.e. a two-...
2
votes
1answer
68 views

Decomposition of 2-qubit Hamiltonian into standard gate set for QAOA

I try to decompose ansatz into gate set in order to create a circuit in qiskit for QAOA algorithm. I don't understand how represent parametrized 2 qubit ansatz as circuit. $ H{_B} = \sum_{j=1}^{n} {\...
6
votes
1answer
170 views

Trying to understand this measurement of a simple quantum circuit

It's a newbie question, I know. But I was just wondering if someone could help me understand why this simple circuit results with the measurement shown. I've just didn't get the last step. It's not ...
4
votes
1answer
132 views

How to effectively compute eigenvalue rotation in HHL

In the HHL algorithm, how do you efficiently do the $\lambda-$controlled rotation on the ancillary qubit ? It seems to me after reading around some answers that this can be done in two steps : First, ...
-2
votes
1answer
63 views

How to build a Hilbert space when do we already have concrete quantum logic gates available?

I read here that we use matrices to represent quantum logical gates. But I don't like this 'point of view' because I want to build (or simulate logically with a real quantum processor, not through ...
1
vote
0answers
41 views

Quantum Search/Count on an unknown superposition state

Question: Search a 'known' element in an 'unknown' quantum database Alternatively, show this is fundamentally impossible (somehow related to the Holevo bound or P < NP?) Related yet different: ...
2
votes
2answers
80 views

Conjugate transpose of a U-gate

I want to be able to create the circuit depicted below, but running the code below results in an empty circuit when viewing the job afterwards. ...
1
vote
1answer
78 views

Prepare state $|00\rangle+|1+\rangle$ using Clifford gates and the T-gate

I am looking for a quantum circuit which maps state $|00\rangle$ to $|\psi\rangle=\frac{1}{\sqrt{2}} |00\rangle+\frac{1}{\sqrt{2}}|1+\rangle$. The circuit should only apply quantum gates from the ...
6
votes
3answers
99 views

Decomposing gates resembling exponentiated members of desired gateset

Suppose I have access to a pretty typical gate set, for example $\{\text{CNOT}, \text{SWAP}, \text{R}_{x}, \text{R}_{y}, \text{R}_{z}, \text{CR}_x, \text{CR}_y, \text{CR}_z\}$ where $\text{CR}$ is a ...
0
votes
1answer
41 views

Device Repitition Rate on Melbourne

I've been receiving "Circuit runtime is greater than the device repetition rate [8020]" errors when running a relatively simple circuit on ibmq_16_Melbourne, but have had no issues ...
4
votes
1answer
374 views

Is there a way to create a superposition of all the possible states?

If there're four qubits in my circuit, how can I arrange my gates so that the final output state is a superposition of all the possible states of 4 qubits? (there're 16 of them in total). I've tried ...
3
votes
1answer
45 views

How to change the sign of a phase: sending $\alpha|0\rangle+e^{i\alpha}\beta|1\rangle$ to $\alpha|0\rangle+e^{-i\alpha}\beta|1\rangle$?

Say I have a qubit in the state (ignoring normalization) $$|\phi\rangle = \alpha|0\rangle + e^{i\alpha}\beta|1\rangle.$$ How can I invert the sign of its phase, thus making it $$\alpha|0\rangle + e^{-...

1
2 3 4 5
9