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
2 votes
0 answers
52 views

How to use stabilizers to simulate the circuit?

Sorry for this easy questions. That is a simple textbook question but I don't know how to solve it. I have the following circuit: The question was "use stabilizers to simulate the circuit" ...
  • 546
0 votes
1 answer
67 views

How can we represent a CNOT gate using a cascade of rotation gates?

I have been working using qiskit to implement the CNOT decomposition into a cascade of rotation gates from this source. After computing the unitary matrix, the resultant matrix is not the same as the ...
0 votes
0 answers
9 views

Size of output and post selection registers

Let $\mathcal{A} =\{\mathsf{Q}_n\}$ be a quantum circuit, taking $n$ input qubits to $n$ output qubits. It is known that \begin{equation} \mathsf{Post}\mathcal{A} = \mathsf{Post}\mathsf{BQP}, \end{...
1 vote
1 answer
39 views

ModuleNotFoundError when running Qiskit RNG

I'm trying to generate random numbers using IBMQ backends with the following code: ...
1 vote
1 answer
47 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 ...
  • 131
1 vote
2 answers
152 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
125 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
224 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
89 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?
3 votes
3 answers
202 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
46 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
19 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
47 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
104 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
  • 123
2 votes
2 answers
168 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,768
2 votes
2 answers
86 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
60 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
135 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,435
1 vote
1 answer
171 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
1 answer
80 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
3 answers
78 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
205 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
69 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
401 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
73 views

Drawing circuits in Qiskit: Remove numbers from unitary gates

Setup I am drawing this circuit: ...
1 vote
1 answer
51 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
53 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 ...
  • 89
3 votes
2 answers
562 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 ...
  • 89
1 vote
1 answer
60 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
92 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
76 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
58 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 ...
4 votes
1 answer
53 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
85 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,768
4 votes
1 answer
121 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: ...
  • 43
1 vote
1 answer
85 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
55 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
102 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 ...
  • 309
0 votes
1 answer
74 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
129 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
75 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
16 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} ...
  • 309
3 votes
0 answers
49 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
144 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
198 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
527 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
104 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
183 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
148 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

1
2
3 4 5
7