Questions tagged [quantum-circuit]

a model in which a computation is a sequence of quantum gates, which are reversible transformations on an n-qubit register (the quantum-mechanical analog of an n-bit register)

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

ModuleNotFoundError when running Qiskit RNG

I'm trying to generate random numbers using IBMQ backends with the following code: ...
1 vote
1 answer
35 views

Is there an alternative algorithm to extract a probability of states of qubit after measuring?

Let a simple quantum circuit consist of one qubit and one classical bit. Initially, a qubit has the $|0\rangle$-state and then goes through some sequence of quantum gates, see the circuit below. The ...
  • 111
1 vote
2 answers
45 views

How to calculate CNOT gate for three-qubit (1-control, 2-target) states as a matrix?

How can I calculate CNOT gate with 1 control and 2 target qubits as matrix?
0 votes
2 answers
25 views

Can I create a quantum circuit from a list of operations in pennylane?

Say, I have a list of operations which are pennylane gates, can I create a circuit from it? I tried: ...
2 votes
2 answers
160 views

Matrix representation of SWAP on two qubit registers?

There is a matrix that can represent a swap gate-- a gate that essentially swaps two qubits. This matrix, $S$, is: $$ \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & ...
1 vote
1 answer
59 views

Steps to build a 3 qubit Quantum circuit based on final statevector

I need to build a Quantum circuit in Qiskit as shown below. Does anyone know the formal steps to approach the design?
1 vote
3 answers
45 views

What is the maximum number of qubits to execute a circuit on real hardware with IBM Quantum Experience and Qiskit?

I can't find anything that says about this. I know that on some simulators there are a limit of 32 qubits (quasi simulator) or more. But on real hardware ?
0 votes
1 answer
36 views

How to implement quantum circuit for this operation

I am wondering how to construct a gate for some operation like $$U = \frac{1}{\sqrt{2}}(I - i \sigma_{x})$$ I don't know how to add two $I$ with $-i\sigma_{x}$ specifically, any help would be ...
0 votes
0 answers
17 views

Confused how Jordan gradient algorithm would work

Jordan's gradient algorithm is a quantum algorithm to find the gradient vector of a function at a point. Here is the paper: https://arxiv.org/pdf/quant-ph/0405146.pdf So in the paper it says To ...
1 vote
1 answer
28 views

How to apply mid-circuit measurement and measurement based conditional operations in `amazon-braket`?

Is there any method to apply mid circuit measurements in amazon-braket? I'm implementing a circuit that has few operations conditioned to measurement. In ...
  • 53
1 vote
2 answers
58 views

How do I draw a multi control cz gate or do I have to make my own gate?

I want to build a diffuser and an oracle so that's why I wanted a multi control cz gate but I looked everywhere I didn't get any
  • 81
2 votes
1 answer
95 views

How to find a circuit for a unitary operator $e^{-i s |v \rangle \langle v| t }$?

Let $|v \rangle$ be an eigenstate of an $n$-qubit and $2$-local Hamiltonian $$H = \sum_{i=1}^n \left (X_i + a_i Z_i \right) + \sum_{(i,j)} b_{i,j} Z_i Z_j,$$ where $\sigma_i = I \otimes \cdots \...
  • 1,161
2 votes
2 answers
81 views

Preparing a superposition state modulo $k$

Consider being given the description of a function $f: \{0, 1\}^n \rightarrow \{0, 1\}^m$ and the binary representation of an integer $k$. Is the state \begin{equation} |\psi_{f, k}\rangle = \frac{1}{\...
1 vote
1 answer
49 views

Is a generalized 2D cluster state still a universal resource?

Let $G = (V, E)$ be a $\sqrt{n} \times \sqrt{n}$ grid graph. Consider preparing a 2D cluster state as follows. $$|\psi_{\mathsf{C}}\rangle = \underset{(i, j) \in E}{\Pi} (\mathsf{CZ})_{i, j} | + \...
1 vote
3 answers
90 views

how to apply pauli string depending on multiple control qubits (qiskit or stim)

I read and re-read the documentation for MCMT and MCX and still can't figure out how to do this. For example I have 10 qubits $q_0,\cdots q_9$; I want to apply pauli string $X_2 Y_4 Z_5$ with control ...
  • 1,266
1 vote
1 answer
108 views

What Adding Modulo To Register Means

I was reading about the Jordan gradient algorithm(https://arxiv.org/pdf/quant-ph/0405146.pdf) and I am a bit confused about one of the phrases: Next, use the blackbox to compute f and add it modulo $...
2 votes
0 answers
36 views

How does the c_if instruction work in QISKit?

The c_if instruction can be used to make the result of a measurement saved to a classical register adjust whether a gate is or is not performed. How does the c_if instruction obtain the measurement ...
0 votes
2 answers
44 views

How to design the circuit of VQLS?

I am very confused about how to design the VQLS circuit. For example, I know the A is: X is pauli matrix. And how to add these three X pauli gates into circuit? I know the overall circuit should look ...
21 votes
1 answer
3k views

An impossible quantum adder claimed by a journal article?

In Quantum adder of two states that are themselves superpositions, I asked: I have two states $|a\rangle = \frac{1}{\sqrt N}\sum_{i=0}^{N-1}|i\rangle|a_i\rangle$ and $|b\rangle = \frac{1}{\sqrt N}\...
  • 407
3 votes
1 answer
180 views

Quantum adder of two states that are themselves superpositions

I have two states $|a\rangle = \frac{1}{\sqrt N}\sum_{i=0}^{N-1}|i\rangle|a_i\rangle$ and $|b\rangle = \frac{1}{\sqrt N}\sum_{j=0}^ {N-1} |j\rangle|b_j\rangle$, with $i,j,a_i,b_j \in \mathbb{N}$. I ...
  • 407
0 votes
1 answer
43 views

qiskit-nature accessing circuit

There are some very nice examples on how to handle circuits using qiskit. However, once we get to the qiskit-nature documentation, it feels like a complete new world for the untrained eye. I am ...
1 vote
1 answer
271 views

How to create a quantum circuit with 800+ features using PennyLane

I am new to Quantum ML, and I am currently using PennyLane to do the QML activity. As per this article, total number of features is equal to the total number of qubits. (In the example, they have ...
  • 11
1 vote
1 answer
46 views

Drawing circuits in Qiskit: Remove numbers from unitary gates

Setup I am drawing this circuit: ...
1 vote
1 answer
40 views

How to synthesize function $f(x)$ in amplitude encoding

In computational basis encoding, the way to encode $f(x)$ is known - a classical circuit is converted to a quantum circuit which takes $|x\rangle|0\rangle \to |x\rangle|f(x)\rangle $. I wonder how I ...
0 votes
0 answers
38 views

Circuit gives unexpected phase factor (cirq)

I implemented the following circuit on cirq: For clarity: the circuit consists of X gates, (controlled) Hadamard gates (H), N-toffoli gates, and reset operations (R). The (1,4) qubit is the one I ...
  • 69
3 votes
2 answers
540 views

Building a controlled NOT gate which is controlled by the qubit it is acting on

I have a question, which I have thought about for a while now, and can't seem to figure out. I have a quantum circuit and I would like to construct a unitary gate acting on a qubit $q$ that acts as a ...
  • 69
1 vote
1 answer
51 views

Julia codes for unitary gate decomposition

I am looking for a way to decompose any given operator U into ZYZ rotations. And then plug the values back into ei∗α∗Rz(θ0)∗Ry(θ1)∗Rz(θ2), to 'recompose' the gate and check if the gate decomposed ...
  • 19
0 votes
1 answer
49 views

Computational cost of a circuit in Qiskit

I would like to see, in terms of complexity, the cost of a circuit. For example: I have written two algorithm that does the same thing, but in one of them I initialize data differently, so I would ...
1 vote
1 answer
48 views

Qiskit implementation for projecting a hermitian operator and finding its eigenvalues

I'm brand new to quantum computing and have been learning Qiskit for a few weeks now. I am attempting to find the number of 0 eigenvalues of the following operator: $$ T = PHP$$ where $P$ is a ...
0 votes
2 answers
42 views

Why after breaking the entanglement does the phase disk in the second qbit not match the result?

I am new in IBM composer quantum and I have a doubt. I have the next circuit After reinitializing q0 and reading it. (breaking entanglement) The phase disk for qubit q1 says that 100% is 0, but the ...
3 votes
1 answer
46 views

Given a $q$-qbits unitary $U$ , what is the state of the art approch to create the controlled version $C(U)$ and $C^kU$?

What is the cost of turning a $U$ circuit into a $CU$ circuit? (add a control to it) The circuit operates on a register of length $q$ Suppose the number of quantum gates is $l(U)$ Suppose the depth ...
2 votes
1 answer
69 views

High level implementation of quantum oracles

My question is related to a similar question which did not get a satisfactory answer. Since it was asked in 2020 and was somewhat general, I hope to ask a similar question in 2022 with a concrete ...
  • 1,161
3 votes
1 answer
56 views

Ansatz printing in Qiskit draws a single block

When I try to draw the quantum circuit it is shown in only one block and not the whole circuit. For example using the code: ...
  • 33
1 vote
1 answer
52 views

Using machine learning to determine a good initial mapping for a quantum circuit

I am trying to use a machine learning model to find a good initial mapping for a quantum circuit. I am trying to minimise the number of swap operations i.e. the number of CNOT gates. This is my ...
3 votes
1 answer
47 views

Implementing quantum swap operation such that $|x\rangle|f(x)\rangle$ changes to $|x\rangle|f(x+1)\rangle$

Suppose that a quantum state $|\psi\rangle$ in question is $|\psi\rangle \propto \sum_x |x\rangle|f(x)\rangle$. I want to implement a quantum swap operation such that computational basis $|x\rangle|f(...
  • 33
3 votes
1 answer
55 views

Qiskit: Is there an efficient way to convert custom operator (matrix) to circuits/gates and vice versa?

I'm using qiskit and would like to convert easily between matrix operators and their corresponding circuits. I have 2 types of operators: Permutation matrices (binary entries only) which must be ...
  • 189
0 votes
1 answer
34 views

Generating random circuits with only CNOT gates using qiskit.circuit.random.random_circuit

I am trying to generate a random quantum circuit with 5 qubits using only CNOT gates. I have modified the source code of the qiskit.circuit.random.random_circuit function to only include CNOT gates (...
1 vote
1 answer
79 views

Can you find how many one qubit and 2 qubit gates are in a circuit in Qiskit?

Is there a command in Qiskit that returns the number of one and/or two qubit gates in a circuit? I need to estimate the cost of a job on Quantinuum's H1-1, and the cost is dependent on this ...
  • 89
0 votes
1 answer
59 views

Generalized Diffusion Operator

Consider a variant of the SAT problem when for a given boolean formula, we would like to find an assignment that is also in the support of a given quantum state. Formally let $ A $ be a set of the ...
1 vote
0 answers
12 views

Encode Matrix Elements on register

I am trying to construct a circuit which makes the following encoding $$O_H \left| i \right> \left| j \right> \left| z \right> = \left| i \right> \left| j \right> \left| z \oplus H_{ij} ...
  • 189
3 votes
0 answers
42 views

Help Implementing a 4-qubit super dense coding algorithm

I am new to quantum computation, I have seen examples of super-dense coding; however, I am struggling in my attempts to scale the 2-qubit system to a 4-qubit, here is a visual of the 2-qubit super-...
  • 31
0 votes
1 answer
74 views

How does CircuitQNN in qiskit machine learning calculate output probabiltiies?

This is a question I have based on this previous question on calculating quantum gradients in quantum-classical hybrid circuits. I would like to understand the output of the ...
1 vote
2 answers
126 views

Gradient descent for a quantum-classical hybrid neural network

I am working on implementing a quantum-classical hybrid neural network in qiskit where input data is encoded on a quantum circuit (with say 3 qubits) using a ...
6 votes
4 answers
494 views

Finite subgroup of $U(4)$ containing a non-Clifford gate and all local Cliffords

Background I denote the $n$-qubit Clifford group as $C_n$ and the $n$-qubit group of all `local Clifford' (LC) unitaries as $C_1^{\otimes n}$ where $C_1 = \langle H, S\rangle$. It is well known that $...
0 votes
1 answer
57 views

type object 'Circuit' has no attribute 'from_ops'

I am working on a Cirq notebook and the quantum circuit is created in this way: ...
  • 223
1 vote
3 answers
106 views

How to decompose a multi qubit Clifford unitary into a sequence of clifford gates

What are the algorithms that allow to decompose any given multi qubit Clifford unitary into elementary Clifford operations (e.g. Pauli+CNOT, with no T gate)?
1 vote
1 answer
86 views

Clifford circuit approximation to a random Clifford circuit

Given a random Clifford state on $L$ qubits (defined as an infinite depth Clifford circuit acting on the zero state), what depth Clifford circuit is required to approximate this state to a given ...
  • 330
0 votes
1 answer
33 views

Clarification about QTF proof regarding equality of QFT application and circuit application

I'm self learning quantum computing through IBM's Qiskit's learning section (which I really like), and I've stumbled across an inequality that I don't quite understand fully. This must be really easy, ...
0 votes
0 answers
43 views

Odd-dimensional matrix manipulation on quantum circuit

Just wondering if there is any work on dealing with odd-dimensional matrix, i.e. a matrix of which the dimension is N by N where N is an odd integer, and one could, for instance, solve the ...
3 votes
1 answer
97 views

How to actually send Qiskit code to the que to be ran on an IBM Quantum Computer?

Apologies for what I feel is a very simple question, So I've figured out how to work with simulating a quantum circuit in Qiskit, but now I'm trying to figure out how I would actually send the code to ...

1
2 3 4 5 6