Help with math in a quantum circuit

  • Context: High School 
  • Thread starter Thread starter Joao
  • Start date Start date
  • Tags Tags
    Circuit Quantum
Click For Summary
SUMMARY

This discussion focuses on the mathematical operations involved in quantum circuits, specifically the application of Hadamard and CNOT gates on qubits. The user describes their process of entangling two qubits and seeks clarification on how to apply additional gates and perform measurements after entanglement. Key insights include the necessity of using tensor products for gate applications and maintaining normalization in quantum states. The discussion emphasizes the importance of understanding tensor operations and the Kronecker product in quantum mechanics.

PREREQUISITES
  • Understanding of quantum mechanics fundamentals
  • Familiarity with quantum gates, specifically Hadamard and CNOT gates
  • Knowledge of tensor products and Kronecker products
  • Ability to use LaTeX for mathematical expressions
NEXT STEPS
  • Learn about quantum state normalization and its importance in quantum mechanics
  • Study the application of the Kronecker product in quantum gate operations
  • Explore the concept of measurement in quantum mechanics and its implications
  • Investigate superdense coding circuits and their mathematical foundations
USEFUL FOR

Quantum computing enthusiasts, students of quantum mechanics, and anyone interested in understanding the mathematical framework of quantum circuits.

Joao
Messages
80
Reaction score
8
Hi! Sorry for the bad English!
I'm trying to get a better understanding in quantum mechanics by doing the math of quantum circuits and I'm stuck! So, please, if someone can, help me! =)

I'm trying to the math of this circuit:

q0 ... l 0 ) .... x ... (I)
q1 ... l 0 ) ... H ... l ... H
... i ... ii ... iii ... iv

As seen on:


It can be described as " two qubits are created in state 0, q1 goes to a Hadamart gate, after they are entangled by a cnot gate and after the q1 goes through another hadamart gate"

Here's what I've got so far:
Q0 and q1 are in
[1]
[0]

I applied hadamart in q0, getting q0 to
[0.7]
[0.7]

Now I do a tensor between q0 and q1, to get ready to do the cnot gate, and I got:
[0.7]
[0]
[0.7]
[0]

Now I do a cnot gate and get:
[0.7]
[0]
[0]
[0.7]

Now I would like do a hadamart in the qbit that I already applied a Hadamart, and measure the other qubit

But now I'm lost! =(

In the video, the youtuber applied a tensor between a hadamart and a identity matrix and multiplied it by the matrix he got after the cnot gate... why?I mean... if I want to do a hadamart gate (for example) in a qubit, I just multiply the qubit matrix and the hadamart matrix... how do I apply gates after I got two qubits entangled? And how I measure just one of the qubits, and keep working applying gates to the other qubit?

Thanks!
 
Last edited:
Physics news on Phys.org
Your post is incomprehensible. You'll have to type things in a neater fashion. You should use LaTeX https://www.physicsforums.com/help/latexhelp/

In particular, the use of pmatrix can be useful here, for instance
$$
\begin{pmatrix}
1 & 0 \\
0 & 1
\end{pmatrix}
$$
$$
\begin{pmatrix}
a \\
b
\end{pmatrix}
$$
(If you click "Reply" on my post, you will see the LaTeX code appear in your text box.)
 
  • Like
Likes   Reactions: Joao
  • Like
Likes   Reactions: Joao
Thanks for the replys! Let me try again! =)

So, I want to do the math of a quantum eraser circuit.

We start with 2 qubits at state
q0 = |0>
q1 = |0>

Now we apply a hadamart matrix in q1
## \begin{pmatrix} 0,7 & 0,7 \\ 0,7 & 0,7 \end{pmatrix} ## times ## q1= \begin{pmatrix} 1 \\ 0 \end{pmatrix} ##

Now we have:
q1 = ## \begin{pmatrix} 0,7 \\ 0,7 \end{pmatrix} q0 = \begin{pmatrix} 1\\0 \end{pmatrix}##

Now I want to do a cnot gate in the 2 qubits. I start by doing a tensor product:

q1 ##\otimes## q0

And now we have

## \begin{pmatrix} 0,7 \\ 0 \\ 0,7 \\ 0 \end {pmatrix}##
And now doing a cnot gate:
## \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1\\ 0 & 0 & 1 & 0 \end {pmatrix} times
\begin{pmatrix} 0,7 \\ 0 \\ 0,7 \\ 0 \end {pmatrix} ##

And now we have:

## \begin{pmatrix} 0,7 \\ 0 \\ 0 \\ 0,7 \end {pmatrix}##

Now comes the tricky part!

By now, q0 and q1 are entangled. I want to measure q1, do a hadamart gate in q0 and measure q0, but I have no clue on how to do this math!

In the video, he did this: Hadamart tensor identity gate times the two qubit, like this:

## \begin{pmatrix} 0,7 & 0,7 \\ 0,7 & 0,7 \end{pmatrix} \otimes \begin{pmatrix} 1 & 0\\ 0 & 1\end{pmatrix} times \begin{pmatrix} 0,7 \\ 0 \\ 0 \\ 0,7 \end {pmatrix}##

I can't understand the logic behind "hadamart tensor identity times qubits", why he did it?

I attached the file showing how he did it, I'm lost at step 4.

Why he did a identity gate? Why he did it tensor a hadamart gate? How should I do the math if I wanted to do something different, like measure the q0 and do a x gate to q1?

Thanks again! =)
 

Attachments

  • 20190130_084634.jpg
    20190130_084634.jpg
    26.9 KB · Views: 338
Strilanc said:
You can use the amplitude displays in this simulator to see the state after each gate: http://algassert.com/quirk

Thanks for the reply! I've already learned to play around with the quirk simulator! Now I'm trying learn how to do the math by myself, hoping to get a better understanding of how quantum mechanics works! =)
 
Hi @Joao . First, I have a nitpick: you should keep ##1/\sqrt{2}## instead of 0.7 (and not 0,7). Otherwise, the state will not be normalized to exactly 1.

Now, the reason for tensoring the gate is exactly the same reason that you tensor the two qubits. If you apply gates independently to the first and the second qubit,
$$ (A \otimes B) |a\rangle \otimes |b\rangle = (A|a\rangle) \otimes (B|b\rangle), $$ a special case of which is "doing nothing" to one of the qubit; that's doing the identity gate. The explicit form of a matrix tensor product is given by the Kronecker product.
 
  • Like
Likes   Reactions: Joao
Truecrimson said:
Hi @Joao . First, I have a nitpick: you should keep ##1/\sqrt{2}## instead of 0.7 (and not 0,7). Otherwise, the state will not be normalized to exactly 1.

Now, the reason for tensoring the gate is exactly the same reason that you tensor the two qubits. If you apply gates independently to the first and the second qubit,
$$ (A \otimes B) |a\rangle \otimes |b\rangle = (A|a\rangle) \otimes (B|b\rangle), $$ a special case of which is "doing nothing" to one of the qubit; that's doing the identity gate. The explicit form of a matrix tensor product is given by the Kronecker product.
Thanks a lot! It really helped me to understand it! Now I can do the math of a quantum eraser circuit all by myself! Now I'm going to try to do the math of a superdense coding circuit! Thanks a lot for helping me get a better understanding of the universe we live in! =)
 

Similar threads

  • · Replies 0 ·
Replies
0
Views
1K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K