Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [quirk]

Quirk is an open-source drag-and-drop quantum circuit simulator for exploring and understanding small quantum circuits. It was developed by Craig Gidney.

Filter by
Sorted by
Tagged with
5 votes
1 answer
515 views

How to read the result of quantum shor circuit for N=15

I found many circuits for the Shor algorithm for N=15, but i don't understand how to read the result 3 or 5. Where can i find the result e.g. for this circuit I found it here
Mathias Pichler's user avatar
0 votes
1 answer
63 views

Multi-qubit rotation using Quirk

I was wondering, how can one perform a multi-qubit rotation in Quirk? For example, if I want to simulate the magic-state distillation protocol, I need e.g. a $(IIZZZ)_{\pi/8}$ rotation of 5 qubits. Is ...
David Dentelski's user avatar
2 votes
1 answer
159 views

Problem with eigenvalue evaluation algorithm application on matrix $U$

Once I get to the end of the algorithm, I can't understand how to calculate the eigenvalue using formulas. Bear in mind that it is an exercise to be carried out with pen and paper. the matrix of $U$ ...
Francescov20's user avatar
1 vote
1 answer
30 views

Exact meaning of "parity control" in quirk

I am trying to understand this distillation circuit (related to this question), but I am confused by the meaning of the "parity control Z" operations represented with this symbol: The ...
Marco Fellous-Asiani's user avatar
2 votes
2 answers
349 views

Why does entanglement of 3 qubits break this?

Another user asked about the Ekert Quantum Key Distribution protocol: Alice and Bob each randomly choose one of three bases separated by $120^{\circ} $ in which to measure, and then later compare the ...
Frank Yellin's user avatar
1 vote
1 answer
439 views

Not understanding gates being generated by MCX in "recursion" mode

I was curious about the various ways of generating code for MCX when there are multiple controls. I saw that qiskit provided multiple algorithms for generating code, depending on the number of ...
Frank Yellin's user avatar
1 vote
1 answer
158 views

How to store error caused by circuit manipulation

Given that is equivalent to I am interested into not performing the last CNOT. Rather, I want to keep track of the error I intentionally introduced by removing it. I am trying to do this by means of ...
Daniele Cuomo's user avatar
1 vote
1 answer
178 views

Manually calculating quantum circuit with custom gate

I am trying to calculate the state of this Quirk circuit by hand: where U is a custom gate with 2x2 matrix: From what I've read, I should be able to calculate the resultant amplitudes as: (U⊗I⊗I).(...
quantumlearning's user avatar
4 votes
2 answers
244 views

What is wrong with my circuit for the fourth-root of $X$?

For learning purposes I would like to hand-craft my own circuit for the fourth-root of $X$, using $S$, $T$, and $\sqrt X$ gates. Note that $\sqrt[4]X$ is of order eight while $\sqrt X$ is of order ...
Mark Spinelli's user avatar
1 vote
1 answer
238 views

How to implement *nested* Grover search (in Quirk)?

$\newcommand{\ket}[1]{|#1 \rangle}$ $\newcommand{\bra}[1]{\langle #1 |}$ PS: I suppose this question could also ask "How to implement $2 \ket{s}\bra{s} - I$ for any (identifiable) $\ket{s} \in \...
Fleeep's user avatar
  • 374
1 vote
1 answer
291 views

Implementation of quantum phase estimation in Quirk

after reading the chapter of QPE (Quantum phase estimation) in Nielsen, I wanted to try an implementation in Quirk. My idea was to apply the T-gate, from which I know the following relation $T|1\...
P_Gate's user avatar
  • 678
1 vote
1 answer
461 views

Trying to perform Quantum Phase Estimation on T-gate

I'm trying to perform QPE on the T-gate in Quirk but I'm not getting the correct result. For the T-gate, I should be measuring (001) with 100% probability, but instead, I'm getting the following: I'...
ryanhill1's user avatar
  • 2,503
1 vote
1 answer
313 views

Question about Grover algorithm implementation in the Quirk simulator

I want to implement the Grover iteration instead of the multi-control qubit implemented as in this picture: I want to implement them like in this example of five qubits: I mean how can I decompose ...
walid's user avatar
  • 335
0 votes
1 answer
139 views

Find local state and compute Bloch coordinates, like Quirk

In a multi-qubit system I can find the amplitudes of a state and compute probabilities, $\theta$, and $\varphi$. This falls out from simulation with simple numpy arrays. For example, after application ...
rhundt's user avatar
  • 1,018
2 votes
2 answers
505 views

Problem with commutation of $e^{-iH_1t}$ and $e^{-iH_2t}$, where $H_1$ commutes with $H_2$

I'm given with a Hamiltonian, $H=H_1+H_2$, where $H_1=\sigma_x\otimes\sigma_z$ and $H_2=\sigma_y\otimes\sigma_y$, and want to built a circuit which will implement $e^{-iHt},t=\pi/6$. We see that as $\...
Omkar 's user avatar
  • 331
5 votes
0 answers
158 views

Exact functions of a single-iteration Grover Search Algorithm's operators

I'm doing a practice assignment where I'm asked to identify specific features of the Grover Search Algorithm's second operator (picture in post, further on "$Us$"), which mirrors the system relative ...
Andre R.'s user avatar
2 votes
1 answer
547 views

How to use the input gates in Quirk

Strolling around I came across Craig Gidney's Blog and his awesome tool Quirk. I proceeded to read this interesting post of his where he alludes to the difference between actually measuring qubits in ...
Marsl's user avatar
  • 929
1 vote
1 answer
87 views

Explanation of the function of the circuit

I once experimented with the tool "quirk" and came to a gate, whose function I can not properly tap into. I'm working in the circuit with 4 bits, the last bit is negated, so from 0 to 1. On all 4 bits ...
user avatar
3 votes
0 answers
195 views

How to simulate a simple circuit to add two numbers in Quirk?

I am new and I don't understand where I should give the input and where I should get the output. Please explain with an example of a circuit run on the Quirk simulator. How to add two numbers?
subhajit pal's user avatar
4 votes
1 answer
104 views

Creating .gifs corresponding to Quirk simulations

Craig Gidney's blog has some .gifs which directly link to the corresponding simulation on Quirk. For example: Grover Search Delayed Eraser Is it possible to create these .gifs from within Quirk? Or ...
Sanchayan Dutta's user avatar
2 votes
1 answer
263 views

How to implement a $\frac{\theta}{2}$ rotation from $\theta$ rotation?

Is there a way to create a rotation gate which has half the angle of some implementable gate? I am looking to implement a gate on Quirk which allows for standard time-dependent rotations $$R_x(\...
Cameron's user avatar
  • 217
8 votes
3 answers
2k views

Is there any method of adding two operators in a circuit?

I am trying to reconstruct the time evolution of a Hamiltonian on the quantum computing simulator, quirk. Ideally I would like to generalise this to any simulator. The unitary matrix is $$U(t)=e^{-...
Cameron's user avatar
  • 217
1 vote
1 answer
267 views

Creating a time dependent custom gate in Quirk

I have created a $16\times 16$ unitary operator using a Hamiltonian by finding its exponential $$U=\exp(-iH\delta t)$$ If I set $\delta t=1$ then I can take this matrix and input it into quirk using ...
Cameron's user avatar
  • 217
2 votes
1 answer
1k views

Building a matrix corresponding to the teleportation circuit

I'm trying to build the matrix that corresponds to this quantum teleportation circuit, but it never works when I test it in the quirk simulator, I tried finding the matrix corresponding to every part ...
Nillmer's user avatar
  • 755
1 vote
1 answer
100 views

Why are these circuits not producing the same output?

I am simulating the phase shift algorithm on the Quirk platform. Even when the endian-ness of the built-in inverse QFT gate is corrected for, the circuits still output different results. Shouldn't the ...
Jack Ceroni's user avatar
1 vote
1 answer
126 views

Why are these circuits not producing the expected output?

This circuit was created on the Quirk platform. I'm trying to implement a basic case of phase estimation. For some reason, I'm getting this strange result. When the Inverse QFT is broken down, it ...
Jack Ceroni's user avatar
6 votes
2 answers
663 views

Incorrectly Calculating Probability Amplitudes for 3-qbit Circuit

I’m trying to calculate the probability amplitudes for this circuit: My Octave code is: ...
Sam Kennedy's user avatar
9 votes
2 answers
280 views

Topological Circuit Simulator

Does something like Quirk exist for topological (eg. braided) circuits? Alternatively, any ideas on how @CraigGidney is getting these circuits (or something similar)?
user820789's user avatar
  • 3,312
22 votes
3 answers
4k views

Toffoli gate as FANOUT

I was searching for examples of quantum circuits to exercise with Q# programming and I stumbled on this circuit: From: Examples of Quantum Circuit Diagrams - Michal Charemza During my introductory ...
D-Brc's user avatar
  • 413
5 votes
0 answers
560 views

Error: Simulation of "Quantum algorithm for linear systems of equations" for $4\times 4$ systems on Quirk (without SWAP) - Global phase

Following @DaftWullie's answer I tried to simulate the circuit given in Fig. 4 of the paper (arXiv pre-print): Quantum circuit design for solving linear systems of equations (Cao et al, 2012), on ...
Sanchayan Dutta's user avatar
7 votes
1 answer
85 views

How to avoid error when applying certain combinations of degree of freedom rotations using a quantum circuit?

When applying each of the six degree of freedom rotations (or certain combinations of them) in an SO(4) using quantum gates, the results I expected are produced. For example, the following circuit in ...
JavaFXpert's user avatar