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
0
votes
1
answer
58
views
How does modular arithmetic work in quirk?
From the "How to use Quirk" document, the equation for the $+A$ function is given by $|A⟩|E⟩ \mapsto |A⟩|E+A \; (\text{mod} \;2^{\text{len}(E)})⟩$. However, I am specifically interested in ...
5
votes
1
answer
620
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
0
votes
1
answer
93
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 ...
2
votes
1
answer
163
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$ ...
1
vote
1
answer
37
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 ...
2
votes
2
answers
388
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 ...
2
votes
1
answer
688
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 ...
1
vote
1
answer
159
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 ...
1
vote
1
answer
205
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).(...
4
votes
2
answers
261
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 ...
1
vote
1
answer
263
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 \...
1
vote
1
answer
339
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\...
1
vote
1
answer
513
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'...
1
vote
1
answer
391
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 ...
0
votes
1
answer
143
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 ...
2
votes
2
answers
548
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 $\...
5
votes
0
answers
162
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 ...
2
votes
1
answer
647
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 ...
1
vote
1
answer
105
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 ...
3
votes
0
answers
210
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?
4
votes
1
answer
112
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 ...
2
votes
1
answer
275
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(\...
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^{-...
1
vote
1
answer
290
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 ...
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 ...
1
vote
1
answer
105
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 ...
1
vote
1
answer
127
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 ...
6
votes
2
answers
679
views
Incorrectly Calculating Probability Amplitudes for 3-qbit Circuit
I’m trying to calculate the probability amplitudes for this circuit:
My Octave code is:
...
9
votes
2
answers
286
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)?
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 ...
5
votes
0
answers
577
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 ...
7
votes
1
answer
86
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 ...