We can use the SWAP test to determine the inner product of 2 states $|\phi\rangle$ and $|\psi\rangle$. The circuit is shown below The state of the system at the beginning of the protocol is $|0\... View answer 5 votes An empirical solution could be to use the Grover's Diffusion Operator$D$. Lets say the qubits are in an initial state$|\psi\rangle = \sum_{0}^{2^n-1}\alpha_i|i\rangle$. Since global phase/sign is ... View answer 3 votes We can implement$CT$using the following circuit: This solutions uses an extra gate which isn't available above$R_I(\pi/8) = \sqrt{T}$Explanation: We know that$T = \sqrt{S} = Z^{\frac{1}{4}}$. ... View answer Accepted answer 3 votes Grover's Diffusion Operator$D$can be written as$H^{\otimes n}U_0H^{\otimes n}$where$U_0$is the following matrix $$\begin{bmatrix}-1 & 0 & 0 &... & 0 \\ 0 & 1 & 0 & ...... View answer Accepted answer 3 votes If this is part of a debugging effort then you can use the DumpRegister function. If you have a qubit q which is in the general state \alpha|0\rangle + \beta|1\rangle where \alpha and \beta are ... View answer Accepted answer 3 votes This is part of the Graph Coloring Kata. The InitializeColor is an operation that you must implement. The code above is part of the checker code to confirm the working of the implementation. The code ... View answer 2 votes We know that the Initial state |\psi\rangle can be represented as \sin\frac{\theta}{2}|\chi\rangle + \cos\frac{\theta}{2}|\xi\rangle. We can prove the result G^R|\psi\rangle = \sin\frac{(2R+1)\... View answer Accepted answer 2 votes QFT on any Superposition (Linear Combination of Basis States) can be applied using Linearity.$$QFT_n|\psi\rangle = \sum_{k=0}^{2^n-1}a_kQFT_n|k\rangle$$Hence$QFT_4|\psi\rangle$where$|\psi\rangle =...

We need to go throught the gates one by one to understand what's happening. We have to keep a few things in mind. $H|0\rangle=\frac{1}{\sqrt2}(|0\rangle + |1\rangle) = |+\rangle$ and $H|1\rangle=\... View answer 1 votes I would like to add to keisuke.akira answer. The Noise Model in which only a Single Qubit Flips is correct. However we can assume a more general Noise Model which may be more realistic and still see ... View answer 1 votes My understanding of the OP's question is that there is some restriction imposed that a gates can only act on Adjacent Qubits. While this isn't necessary, we can still work with this restriction using ... View answer 1 votes Quantum Operations are visualized as Unitary matrices. This puts a limit to their sparseness. A Quantum Operation acting on$n$qubits can be represented by Unitary Matrix of size$2^n \times 2^n$. ... View answer 1 votes The higher order analog of Hadamard Transform is the Quantum Fourier Transform. You can learn more about it on Wikipedia. View answer 1 votes We can distinguish these states using SingleQubit Unitaries and Measurements. Lets the 2 states be$|\psi^{00}\rangle = \frac{1}{\sqrt2}(|00\rangle + |11\rangle)$and$|\psi^{01}\rangle = \frac{1}{\...

This task can be done using Microsoft Q# If you have two qubits which after quantum operations are in the state $|\psi\rangle$, and you wish to find the state of the qubit q0 before/without ...