vasjain
  • Member for 2 years, 3 months
  • Last seen more than 1 year ago
  • Delhi, India
Quantum Circuit To Compute Any Inner Product
Accepted answer
8 votes

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
How to measure the sign of quantum amplitudes
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
How can we implement controlled-T gate using CNOT and H, S and T gates?
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
Calcuate $\langle x | D | y \rangle$ for arbitrary $x,y \in \{0,1\}^n$
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
Finding phase angle in Q#
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
Graph coloring - Q# -
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
Changing qubits coefficients to trigonometric functions in Grover Algorithm
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
How to apply QFT to a quantum state in superposition?
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 =...

View answer
Quantum Circuit explaination
Accepted answer
2 votes

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
In the three-qubit bit flip code, why can the first bit flip without impacting the entanglement with the other qubits?
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
How to make Toffoli gate using matrix form in multi qubits system?
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
Quantum operations as sparse matrices
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
How can I create an n-dimensional Hadamard transform in Q#?
1 votes

The higher order analog of Hadamard Transform is the Quantum Fourier Transform. You can learn more about it on Wikipedia.

View answer
Are Bell states distinguishable through LOCC?
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}{\...

View answer
How can I print out a state vector of a specific wire?
0 votes

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 ...

View answer
Is it possible to create a gate in Q# that is dictated by a matrix?
Accepted answer
0 votes

There is currently an Issue (#291) raised on the Microsoft QuantumLibraries GitHub regarding an operation called ApplyUnitaryOperation(unitary: Complex[][], qubits : LittleEndian) which aims to do ...

View answer