# 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)

319 questions
Filter by
Sorted by
Tagged with
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
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 ...
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{...
• 315
1 vote
39 views

### ModuleNotFoundError when running Qiskit RNG

I'm trying to generate random numbers using IBMQ backends with the following code: ...
1 vote
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
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?
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: ...
• 105
224 views

• 315
1 vote
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
171 views

• 407
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
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
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
73 views

### Drawing circuits in Qiskit: Remove numbers from unitary gates

Setup I am drawing this circuit: ...
1 vote
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 ...
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
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
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
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
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 ...
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 ...
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 ...
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
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
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 ...
55 views

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
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 ...