17
votes
Accepted
Toffoli gate as FANOUT
To simplify the question consider CNOT gate instead of Toffoli gate; CNOT is also fanout because
\begin{align}
|0\rangle|0\rangle \rightarrow |0\rangle|0\rangle\\
|1\rangle|0\rangle \rightarrow |1\...
11
votes
Is there any method of adding two operators in a circuit?
Below is a recent paper by Gilyén et al on doing "quantum matrix arithmetics", allowing to implement linear combinations of unitary operators. They consider the general case where the linear ...
10
votes
Accepted
Is there any method of adding two operators in a circuit?
What you are trying to do is called Hamiltonian Simulation.
If your exponential can be split in a sum of unitary matrices, @smapers' answer guide you to a good algorithm: the Linear Combination of ...
8
votes
Toffoli gate as FANOUT
The no cloning theorem says that there is no circuit which creates independent copies of all quantum states. Mathematically, no cloning states that:
$$\forall C: \exists a,b: C \cdot \Big( (a|0\...
8
votes
Toffoli gate as FANOUT
The answer is that the no-cloning theorem states that you cannot clone an arbitrary unknown state.
This circuit does not violate the no-cloning theorem, because let's look at what it does when the ...
7
votes
Accepted
How to read the result of quantum shor circuit for N=15
The circuit you reference has a control register that is only three qubits long, which is fine as an example, but insufficient if you are to guarantee being able to solve via continued fractions as ...
5
votes
Is there any method of adding two operators in a circuit?
It seems that you need oblivious fixed point amplitude amplification. See Theorem 26-28 in the aforementioned paper: arXiv:1806.01838 [quant-ph].
As a first step, you can implement $\frac{A+B(t)}{2}$ ...
5
votes
Accepted
Topological Circuit Simulator
Those figures were created manually with sketchup, which is a 3d modelling tool. There was no simulation involved, only careful application of known rules.
5
votes
Topological Circuit Simulator
There is QTop which is an open-source project that can simulate but also visualize topological quantum codes.
5
votes
Accepted
Incorrectly Calculating Probability Amplitudes for 3-qbit Circuit
You're getting the same output as Quirk, just with a different bit ordering convention for the kets.
Quirk considers the top qubit to be the "least significant" qubit (i.e. if you count 000, 001, 010,...
4
votes
Accepted
Building a matrix corresponding to the teleportation circuit
Since the quantum teleportation circuit has three qbits, the matrix at each step is 8x8 and thus has 64 elements; this is pretty clunky to type out in its entirety, so I'll just walk you through step ...
4
votes
Accepted
Creating .gifs corresponding to Quirk simulations
I made those GIFs using the screen recorder ScreenToGif.
ScreenToGif is not very good at compressing while maintaing quality, so I found it worked better to disable all optimizations while recording, ...
4
votes
Accepted
What is wrong with my circuit for the fourth-root of $X$?
With the gates you allowed, you can conjugate the $T$ so that it rotates around $X$ instead of $Z$. That gives you $\sqrt[4]X$.
In your circuit I think you got your QFTs backwards, so the phase ...
3
votes
What is wrong with my circuit for the fourth-root of $X$?
I think it's actually far easier than this. You only need one ancilla. The trick is that $X$ has the same eigenvectors as $\sqrt[4]X$. So, you can just do the following
The circuit that you've ...
3
votes
Accepted
Trying to perform Quantum Phase Estimation on T-gate
Your implementation is really close - on the website, here's the diagram that they used:
So, I think you reversed the angles - it should be $-\pi/2, -\pi/4, -\pi/2$. (Also: there's a QFT inverse that ...
3
votes
Accepted
How to implement a $\frac{\theta}{2}$ rotation from $\theta$ rotation?
(This answer is specific to the context of the question, which is about doing this construction out of Quirk's time dependent gates.)
It's not possible to have proper half-speed time-dependent ...
3
votes
Accepted
How to use the input gates in Quirk
The input gates are in the bottom toolbox, near the center:
If you place an input gate in the same column as an arithmetic gate requiring that input, they will link together into a combined operation:...
3
votes
Accepted
How to avoid error when applying certain combinations of degree of freedom rotations using a quantum circuit?
Since you haven't told us how you've tried to do the calculation, I don't know where you're making the mistake. (I'm also unfamiliar with Quirk, which seems to be using an unusual ordering of basis ...
3
votes
Incorrectly Calculating Probability Amplitudes for 3-qbit Circuit
The output you've stated there appears to be correct. The Hadamard produces
$$
|000\rangle\mapsto\frac{1}{\sqrt{2}}(|000\rangle+|100\rangle).
$$
Then, the two controlled-nots give
$$
\mapsto\frac{1}{\...
2
votes
Why are these circuits not producing the same output?
You have to put an extra SWAP-gate after the QFT, see this circuit.
Furthermore, the two controlled-Z gates on the same qubit are not necessary. This can reduce the circuit further to this.
2
votes
Why are these circuits not producing the expected output?
The endian-ness of the qubits is the answer. Both QFT and phase estimation rely on certain endianness of the register, and the representations used in the controlled-unitary part has to match the ...
2
votes
Accepted
Explanation of the function of the circuit
This gate is closely related to the CNOT gate that you've already learnt about. Where the CNOT gate says "apply NOT to the target if the control is in the state $|1\rangle$", this gate says "apply NOT ...
2
votes
Accepted
Question about Grover algorithm implementation in the Quirk simulator
In the second half of the circuit you're mixing up which qubits are your ancillae and which are the ones you want to operate on. You can't use one of your system qubits as an ancilla.
2
votes
Accepted
Find local state and compute Bloch coordinates, like Quirk
Trace out everything except the qubit you are interested in. Do this by computing the outer product of the state of the target qubit, for each possible value of the other qubits, and summing up all ...
2
votes
Accepted
Problem with commutation of $e^{-iH_1t}$ and $e^{-iH_2t}$, where $H_1$ commutes with $H_2$
I agree that $Y$ is not the best notation. Actually, in the paper that I was referring in the answer there was a gate $Y$ that was doing the desired job (it was also not a self-inverse gate). I didn't ...
2
votes
Problem with commutation of $e^{-iH_1t}$ and $e^{-iH_2t}$, where $H_1$ commutes with $H_2$
You reversed the order of $Y^\dagger$ and $Y$ compared to the answer you linked. Instead of using the "$Y^\dagger$" operation that sends the X axis to the Y axis to the Z axis to the X axis, you're ...
2
votes
How to implement *nested* Grover search (in Quirk)?
Well, checking again with the paper it seems I simply forgot a pair of Hadamard gates (Correct Quirk Cicruit).
2
votes
Accepted
How to store error caused by circuit manipulation
If you want to propagate a non-Pauli operator through a stabilizer circuit, a useful conversion is to transform it into a form where all the non-Pauli stuff is hidden away on ancilla qubits.
For ...
2
votes
Accepted
Why does entanglement of 3 qubits break this?
Why wouldn't it break it? Involving Eve requires, for example, putting a CNOT gate from one of the distributed qubits to some outside qubit. That CNOT operation doesn't commute with the controlled Y ...
2
votes
Accepted
Problem with eigenvalue evaluation algorithm application on matrix $U$
TL;DR: Qubit order in the top register is reversed.
QFT qubit order in Quirk
Quirk's QFT gate treats the top qubit as the least significant and the bottom qubit as the most significant. Thus, if you ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
quirk × 31quantum-gate × 14
circuit-construction × 9
quantum-algorithms × 6
simulation × 4
grovers-algorithm × 3
gate-synthesis × 3
quantum-fourier-transform × 3
quantum-phase-estimation × 3
qiskit × 2
quantum-state × 2
quantum-circuit × 2
matrix-representation × 2
cirq × 2
entanglement × 1
error-correction × 1
hamiltonian-simulation × 1
bloch-sphere × 1
shors-algorithm × 1
hhl-algorithm × 1
teleportation × 1
linear-algebra × 1
topological-quantum-computing × 1
qkd × 1
cloning × 1