Skip to main content

All Questions

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

Simple successor gate

I want to create a gate that, given a sequence of qbits that encode n, transforms that sequence in n+1, in other words the successor function. I managed to do it in qiskit by writing this: ...
ThePirate42's user avatar
0 votes
0 answers
37 views

How to train QNN on qiskit or ionq simulators

I am trying to train a QNN using qiskit and ionq, the method I use now is to manually feed my input data into quantum circuits: ...
user26416177's user avatar
3 votes
2 answers
119 views

Is there a "control-on-zero" CCNOT?

Is there a gate in Qiskit that inverts the target bit when the control bit is 0? Is such a gate available in any machine?
purin's user avatar
  • 57
0 votes
2 answers
50 views

What is the control state for a Controlled-RY gate?

I am trying to understand Qiskit's control gates. For example, the CRY gate requires an input as the control state (ctrl_state). If I use two qubits in a simple ...
Medulla Oblongata's user avatar
0 votes
0 answers
16 views

Quantum oracle based on MCX gates

I am working on a quantum implementation of a fuzzy inference engine. This system is based on a quantum oracle which fulfills the reconstruction of the rule base. In the current implementation (image ...
Davvvd's user avatar
  • 61
1 vote
1 answer
46 views

QPE implementation with 4 qubits

I'm trying to implement a circuit for QPE, i start with 4 qubits but the results are incorrect (even for 3 or 5 qubits). the used unitary gate is : ...
Coper's user avatar
  • 41
0 votes
1 answer
54 views

Can't qc.reset() be control gate?

Thanks for looking. I am conducting the experiment on a simulator on a classical computer when I run ...
purin's user avatar
  • 57
1 vote
1 answer
29 views

Is there an easier way to predict output of 3-qubit circuit in Qiskit without using matrices?

I'd like to know if there's an easy way to predict what is the output of the following code taken from this resource at question 13: ...
somewhere's user avatar
0 votes
1 answer
48 views

What are expected counts for simple circuit with CNOT gate?

I admit that this should be a simple question, but somehow I'm still struggling with it. I have the following circuit in qiskit: ...
underdog987's user avatar
1 vote
1 answer
86 views

Simple QisKit circuit seems to return incorrect statevector?

I have below a very simple circuit that initializes 2 qubits, and then saves the statevector. I cannot figure out why the simulator returns a vector of all 0's for the statevector. I'm using an older ...
makansij's user avatar
  • 111
1 vote
1 answer
56 views

How would you write $ e^{i \frac{\pi}{4} \text{CNOT}}$ in ZX calculus?

How would you write $ e^{i \frac{\pi}{4} \text{CNOT}}$ operation in ZX calculus? Is there any simple method to write gates of the form $e^{i \frac{\pi}{4} \sigma_z^{(1)} \sigma_x^{(2)}} $?
HypnoticZebra's user avatar
0 votes
1 answer
62 views

Coding a hamiltonian in qiskit

I have a hamiltonian of the form: $H=\sum_{i=1}^N Z_i Z_{i+1}-Z_NZ_1$ And another one as: $H=-\sum_{i=1}^N X_i$ I need it to it for N terms. I am a bit lost can anybody help. I tried looking for ...
Lelouch's user avatar
  • 123
1 vote
0 answers
24 views

Parameterized Gates [duplicate]

I am trying to create my own custom parameterized gate and then transpile it to the AerSimylatorGate. I have been able to create the virtual circuit but in the transpilation to the backend basis set ...
Guillermo's user avatar
0 votes
1 answer
66 views

Custom Quantum Gate equivalence to backend basis gate set

Hello I am using Qiskit and I have defined a custom gate which implements the array shown in the image: This array is unitary and the function R(theta) works by tuning a continious variable into 0 of ...
Guillermo's user avatar
3 votes
0 answers
55 views

Do we really apply both single-qubit and two-qubit gates in the same layer in experiments?

I'm doing experiments using superconducting computers, and my question is as follows: Performing quantum gates requires isolating the coupling between a target qubit and other neighboring qubits. To ...
jtlearner's user avatar
0 votes
0 answers
25 views

Custom pulse with fake backend not running for Cross Resonance Pulse

I am trying to create a cross resonance pulse by driving the control qubit at a non resonant frequency. My code runs but does not stop running. ...
idislikecoding's user avatar
1 vote
0 answers
28 views

Doing Quantum State Tomography on a custom-made gate with Qiskit Pulse

In this simple example I took the Qiskit CX gate, obtained the pulses' schedule and then tried to do Tomography on that. In theory, everything should run smoothly (I think) but I get this "error&...
Samuel Hagh Shenas's user avatar
0 votes
0 answers
42 views

How can I measure qutrits in the X basis using cirq?

I attempted to create a custom measurement class which, in my case, allows us to go from the z basis to x basis using a hadamard gate transformation, and then we measure wrt that new basis. However, ...
Son100's user avatar
  • 33
1 vote
1 answer
60 views

Transpile not working properly for decomposing single qubit gates into Rx Ry and Rz

I used the above code to decompose hadamard gate into RxRyRz but i am getting wrong angles which on multiplying don't match hadamard gate . Interestingly when i am using inbuilt hadamard hate using q....
Anonymous's user avatar
0 votes
1 answer
233 views

Unable to extract the quantum registers information from qiskit quantum circuit data

Consider the following code: ...
Vikram Dorbala's user avatar
2 votes
2 answers
116 views

The result of qiskit calculating T-depth and its calculation method

I have encountered doubts when using qiskit to calculate T-depth. I am not sure whether it is a problem with the way the code is written, or I am still a little vague about T-depth, so I would like to ...
Dona's user avatar
  • 21
0 votes
1 answer
215 views

How to convert states |0011⟩, |1100⟩, |0101⟩ to |1111⟩?

How can I use X gate (quantum not) to convert each of the pure states |0011⟩, |1100⟩, |0101⟩ to |1111⟩ with Qiskit? My programming assignment is Using the idea of a multi-controlled phase gate, now ...
Jettapol's user avatar
0 votes
1 answer
83 views

How to understand the matrix representation of the Toffoli produced by qiskit?

I would like to ask about the results of running the Toffoli gate matrix and circuit diagram on colab Possible reasons for inconsistent results with the following correct matrix results. I would also ...
Dona's user avatar
  • 21
2 votes
1 answer
46 views

How to apply gates on a subspace of a superposition of qubits?

Let us say that I have the state $a|00\rangle + b|01\rangle + c|10\rangle + d|11\rangle$. I wish to apply a one-qubit unitary (a $2\times2$ matrix) U on the subspace spanned by $|01\rangle$ and $|10\...
Soumyadeep sarma's user avatar
1 vote
0 answers
24 views

Are reset gates allowed on IBM quantum computers?

My circuit involves many "reset" gates. After running on the IBM real backend, the experiment status says "Failed" with error message that says: Failed - Unknown operation type ...
Deren  Liu's user avatar
  • 231
2 votes
1 answer
239 views

Relation between Rz gate and Phase gate

As I know, the $Rz(\frac{\pi}{2})$ gate is equivalent to the Phase gate $S$ up to the global phase. However, I found using qiskit, the $Rz(\frac{-\pi}{2})$ is also equivalent to the Phase gate $S$. I ...
Amanli's user avatar
  • 57
1 vote
1 answer
31 views

How is the controlled-n NOT gate represented in Qiskit?

I want to decompose an 8-control qubit gate like the one in the picture on the right using Qiskit, similar to the decomposition shown. To do this, I need a C7XGate for 7 control bits, but it seems ...
junghyunHa's user avatar
1 vote
1 answer
179 views

IBM quantum computer backend cycle time and real gate duration

I am new to dynamical decoupling and is trying to study this from qiskit: https://docs.quantum.ibm.com/api/qiskit/qiskit.transpiler.passes.PadDynamicalDecoupling . There, they are specifying the ...
Tianqi Chen's user avatar
1 vote
1 answer
110 views

Is this quantum circuit design more prone to noise?

I am designing a quantum circuit which uses one qubit as the control of many $\text{CSWAP}$ operations. And then, this qubit will be measured. Will the result be more prone to noise since all the ...
Deren  Liu's user avatar
  • 231
1 vote
0 answers
96 views

Two-level unitary gates are decomposed into single-qubit gates and CNOT gates

I am currently studying the following from the book 'QUANTUM COMPUTING: From Linear Algebra to - Mikio Nakahara' and trying to apply it to Qiskit. But there is one point that I don't quite understand....
junghyunHa's user avatar
1 vote
2 answers
195 views

How to generate the Bell state $\frac{1}{\sqrt{2}}(|01\rangle+|10\rangle)$ from the state $|00\rangle$ using Qiskit?

I want to generate the Bell state $(|01\rangle+|10\rangle)/\sqrt{2}$ from the state $|00\rangle$ in qiskit, applying the Hadamard gate followed by the $\text{CNOT}$ gate. But it generates $(|11\rangle-...
Xilot Xilot's user avatar
0 votes
2 answers
267 views

What goes above this code fragment?

I have given this circuit: The question goes as follows: What is a code of the above circuit if the barrier is removed? Now I have a code fragment, which is this: ...
Ark Rana's user avatar
1 vote
1 answer
230 views

Quantum Circuit evaluation Qiskit vs. AWS Braket SDK

I am examining a simple circuit using both Qiskit and the AWS Braket SDK (Python). The circuit is very simple. ...
badgerduke's user avatar
2 votes
1 answer
372 views

Qiskit Runtime forbids reset gate?

Some parts of my quantum circuit uses initialize to prepare specific amplitudes to the qubits. However, the Qiskit Runtime outputs error: ...
Deren  Liu's user avatar
  • 231
2 votes
0 answers
34 views

How can i label input and output ports of my QuantumCircuit in qiskit?

I made quantum circuits as quantum gates then later used these gates in a larger circuit. Here, the input ports of the block (which is the gate) are labelled by integers but i want to custom label ...
Syed Shahmir Kazmi's user avatar
1 vote
1 answer
95 views

I would like to understand the meaning of applying permutation to a unitary matrix

$$U = \frac{1}{2} \begin{pmatrix} -1 & -1 & 1 & 1 \\\\ 1 & -1 & 1 & -1 \\\\ 1 & -1 & -1 & 1 \\\\ 1 & -1 & 1 & 1 \end{pmatrix}$$ $$P = \frac{1}{...
junghyunHa's user avatar
1 vote
0 answers
64 views

Qiskit bad unitary decomposition

I want to decompose a two-qubit unitary gate $U$, $$U = e^{-i \cdot \frac{t}{2} \cdot Z_1 \cdot Z_2}\,,$$ where $t$ is an angle. I already know the right decomposition but Qiskit gives me an ...
Daniele Trisciani's user avatar
0 votes
1 answer
152 views

MS gate in qiskit

Does anyone know how to use the Mølmer–Sørensen (MS) gate in qiskit? The documentation is highly unintuitive and does not provide examples. If one has to use the generalized version, what is actually ...
user2820579's user avatar
1 vote
1 answer
49 views

Reducing the text content inside a custom quantum gate in Qiskit

I have prepared a parameterized custom quantum gate in qiskit by converting a quantum circuit into a gate through QuantumCircuit.to_gate(). However, the text ...
user9043261's user avatar
1 vote
1 answer
91 views

Implementation of classical control of multi-qubits gates multiple times

I am implementing classical control of gates multiple times. There is no issue if the gate is a local gate, such as an $X$ gate. However, it seems that if I append the control multi-qubits gates more ...
JiQing's user avatar
  • 35
2 votes
1 answer
124 views

Is there an "in place" Toffoli gate?

I am trying to implement the multiplication of a scalar in $\mathbb{Z}_2$ and a polynomial in $GF(2^n)$ in Qiskit. One naive method of implementation that I can think of is: ...
Ash Ketchum's user avatar
2 votes
1 answer
469 views

Multi-control multi-target gate

I'm using qiskit for simulation. Suppose, I have 6 qubits with indices [0, 1, 2, 3, 4, 5] and I have an operator $U$ of size $4 \times 4$, such that it operates on ...
Марина Лисниченко's user avatar
1 vote
1 answer
120 views

Why there's an issue when a quantum gate is controlled in the same time by 0 on a qubit and 1 or 0 with a classical bit on Qiskit?

I'm doing a project for an internship related to quantum computing and I was trying to do this operation on Qiskit lab: ...
Thomas's user avatar
  • 11
4 votes
1 answer
396 views

Qiskit reverse_bits is not equivalent to swapping qubits

For three qubits, I thought swapping the first and third qubit is equivalent to vertically flipping the circuit. However, performing one and then the other in Qiskit returns two different operators, ...
Dylan VanAllen's user avatar
1 vote
0 answers
42 views

How to represent the gates and the quibit states in the 'Hello Quantum' iOS game in IBM Quantum Learning graphical simulator

The Hello Quantum ios game developed by IBM has the X, Z, H and CZ gates manipulating a 2 qubit array (im not sure if array is the right word?). I want to know how I can represent the qubit states in ...
chickenj0's user avatar
0 votes
0 answers
226 views

Qiskit cant run circuit with reset gate with error

In qiskit if i have a reset gate in a circuit. If i want to add noise to the circuit it wont transpile. For example: ...
Narcano's user avatar
  • 31
1 vote
1 answer
109 views

qiskit statevector ordering issue

I am currently studying Qiskit. I don't understand the two pictures below while studying. When I apply circuit.x(1), the X gate should be applied to the second qubit, resulting in the state |01>. ...
junghyunHa's user avatar
0 votes
1 answer
70 views

Frequency of qubits in qiskit simulators

I am trying to study the effect of dynamical decoupling sequences (Hahn Echo and CPMG) using qiskit's qasm_simulator with an added noise model from ...
Neelesh Vij's user avatar
0 votes
1 answer
143 views

Netlist of the transpiled circuit in Qiskit

I am new to running quantum circuits in Qiskit. In the IBM quantum learning lab, I transpiled a simple 4-qubit quantum circuit using a 7-qubit IBM quantum computer. I received a tranpiled circuit ...
mridula's user avatar
1 vote
0 answers
40 views

Adding measurement circuits to the singlet state circuit and want to create single circuit

I am trying to add the measurement of Alice and bob's circuit to the singlet circuit. Actually, I am trying to build the e91 protocol. But it is giving me an error like this. ...
Bloodknofsky's user avatar

1
2 3 4 5
7