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.

32 questions
22
votes
3 answers

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 courses in quantum computation, we were taught…
D-Brc
  • 413
  • 3
  • 6
9
votes
2 answers

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)?
8
votes
3 answers

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^{-iHt}$$ and I've found a way to decompose the…
7
votes
1 answer

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 Craig Gidney's Quirk tool demonstrates rotations…
JavaFXpert
  • 183
  • 4
6
votes
2 answers

Incorrectly Calculating Probability Amplitudes for 3-qbit Circuit

I’m trying to calculate the probability amplitudes for this circuit: My Octave code is: sys = kron([1; 0], [1;0], [1;0]) h = 1/sqrt(2) * [1 1; 1 -1]; c = [1 0 0 0; 0 1 0 0; 0 0 0 1; 0 0 1 0]; op1 = kron(h, eye(2), eye(2)); op2 = kron(c,…
5
votes
0 answers

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 to the $|s\rangle$ vector, defined as the…
5
votes
1 answer

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
5
votes
0 answers

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 Quirk. The relevant circuit in the arXiv pre-print…
Sanchayan Dutta
  • 17,945
  • 8
  • 50
  • 112
4
votes
1 answer

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 does one need to use some third-party software?
Sanchayan Dutta
  • 17,945
  • 8
  • 50
  • 112
4
votes
2 answers

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 four, and we can use two ancillas to temporarily…
Mark Spinelli
  • 15,378
  • 3
  • 26
  • 83
3
votes
0 answers

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?
2
votes
1 answer

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 circuits and simply conditioning some part of the…
Marsl
  • 1,009
  • 7
  • 11
2
votes
1 answer

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(\theta=t)=e^{iXt}$$ but I'd like to construct the same…
Cameron
  • 217
  • 1
  • 8
2
votes
1 answer

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 of the circuit and then multiplying but it never…
2
votes
1 answer

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$ is the following. $$ U = \begin{pmatrix} 0 & i…
1
2 3