# Quantum Algorithm – The Math of Intelligence #10

Hello. World is Siraj in quantum computers How do they work and how do they benefit AI let’s talk a little bit about the theory and then we’ll build a very simple Quantum Algorithm by the way the machine that you’re using to watch this video whether it’s a Laptop or a phone is an example of a classical computer, it’s a general-purpose machine we can code up an algorithm give it some quality data and Theoretically it can accomplish pretty much any task. We’d like streaming live video creating immersive three-dimensional environments eliminating existential dread Actually, it doesn’t do that yet But at their core all classical computers do something really basic under the hood behind every software Application is a series of simple math operations any task we want to perform on a computer like booking applies or playing a game is Translate it into a string of Ones and zeros which act as input that is processed by an algorithm Which then outputs a new string of 1 to 0? Algorithms in all their complexity in the end just manipulate strings of bits Where each bit is either a 1 or a 0? We use ones and zeroes because they’re a way of representing information Such that it can only be in one of two different states Computers run on electricity duh when a computer wants to send information from one place to another It sends pulses of electricity over a wire computers use transistors that can either be closed so that a current flows or Open which means there isn’t a current both states are represented Using either a 1 or 0 they’re like light switches either on or off So when these ones and zeros are strength together they can represent any number or letter using binary code computer youth circuits called logic gates that are composed of Transistors Connected together and they compare patterns of bits to turn them into new patterns of bits using simple arithmetic hard drives store one zeros by changing the magnetic poles of small parts of a metal disk Positive and negative charges are represented by ones and zeros respectively so Computers do these two things really well they store numbers in memory And can process these numbers with simple Math operations I’m just like you those four Terrhagen. Let’s make binary grade again in 1965 the Founder of Intel Gordon Moore predicted that the number of transistors Per Square inch on integrated circuits would continue to double every 18 months so far It’s proven to be true, but there is a calming plateau in transistor. Density. We can only make them so small Before the laws of physics stop us the idea of quantum computing is a potential solution And that’s why interest in it has increased in recent years the word Quantum in physics means the minimum amount of any physical entity involved in Interaction so a photon is a single quantum of light for example That’s it’s real scientific definition but it’s also used colloquially sometimes to mean the opposite like quantum leap or by anything Deepak chopra says the Aficionados in the world of quantum physics have somehow hijacked the word for their own use Quantum physics deals with the world of atoms and the subatomic particles inside of them It’s really badass because on the atomic scale the laws of classical physics. No longer apply Richard Fineman put it best when he said things on a very small scale behave like nothing you have any direct experience about or Like anything that you have ever seen tiny particles like electrons and photons can take on several states at the same time that a larger scale would be mutually exclusive they can be in several places at once or exhibit two kinds of Polarization at the same time we’re not able to see this Superposition of different states because it disappears once someone tries to measure it Nobody really knows how that happens But it does we can use this concept of superposition to free computers from Having binary constraints? Quantum computers use particles magnetically suspended in near absolute zero temperatures to represent not bits but Q bits instead of representing either 1 or 0 They can also represent both simultaneously Ok so you might be thinking big deal could you just achieve superposition on a classical computer by just using two ordinary bits at the same time no need for a qubit and Because there’s more to quantum physics than just superposition. There’s also the idea of Entanglement if we have a system of more than one qubit these particles are not Independent of each other they’re Entangled so in a system of two qubits the outcome of one qubit tells you what you will see when you measure the other qubit particles can be entangled even if they are separated in space by huge distances Einstein called entanglement spooky action at a distance that’s my Einstein voice what that means is that you can’t just describe a system of several qubits using descriptions of individual qubits you have to describe the correlations between Qubits and as you increase the number of them the number of correlations grows Exponentially so for a system of just three hundred qubits you need more numbers than there are atoms in visible universe to describe Think about that for a second So because we can’t just write down the info contained in a system of a few hundred qubits using classical bits Maybe a computer running on these qubits can perform tasks that classical computers couldn’t achieve That’s why people think quantum computing holds a lot of promise So let’s build a simple quantum Algorithm in python using Ibm’s quantum api to learn more you can sign up for access to their api Easily on their website then download the sdk to use it in python after we import it We’re going to build a voyage yoga algorithm one of the first quantum. Hall goes to be proposed We are given a quantum computer known as an oracle that implements some function s it takes n Digit binary values as input and produces either a 0 or 1 as output for each value the function is constant 0 on all inputs or 1 on all inputs it could also be balanced So it returns 1 for half of the input domain and 0 for the other half the task is to decide if f is Constant or balanced by using the oracle first we’ll initialize a quantum program object with a quantum and classical Register holding three bits the program lets us manipulate quantum circuits and each circuit has a set of data Registers well apply was called a hadamard gate to every two-bit So now all the possible states are including likely to be observed For every possible state will apply the oracle in our case the oracle is a balanced function Then we’ll apply the h gate to all the qubits once more and that’s it for our algorithm for a constant function We can expect a 100% chance of observing all zeros and for a balanced function We can expect anything else this shows that a Blackbox problem can be solved efficiently By a quantum computer with no error whereas a classical computer would need way more Queries to the Black box to solve the problem I’ve sacrificed relationships for greatness The ten have yet to create their masterpiece intelligence in England, right So there are three takeaways here quantum. Physics is a study of physical phenomena that happen at the atomic or subatomic level quantum computing takes advantage of quantum physics to allow for more efficient algorithms and Cubed not this are the fundamental unit of quantum computing capable of simultaneously Representing both a 1 and a 0 the wizard of the week is no one look down The challenge was to build a q-learning bot and knowing you care offs that train a DQ learner in the carpool Environment until it was able to successfully balance itself love the animation at the end great work and run around is a Jawa You tensorflow to build with Dq end of the game break out with no high-level Rappers nicely done the coding challenge for this week is to try your hand at building a simple quantum algorithm using ibm’s api Details are in the readme poster github link in the comments, and I’ll announce the winner next week I hope you like this video, please subscribe for more like it if you did and for now. I’ve got a quantum teleport So thanks for watching

Is machine learning possible with quantum computer?

Very good video! A suggestion: how about a video talking about deep learning for image detection/segmentation like R-CNN, YOLO or SSD?

1.5 speed for normal Siraj speed.

Its way easier to understand everything … thank you for slowing it down for the noobs like me xD

You are awesome can you tell me how did you learn so many things?

Siraj I really appreciate your work but your videos are not so easy to learn or understand if we are beginners… And there is also nothing on Internet to learn some good stuff so we are following you but your videos are too typical to making it happen.

Awesome video Siraj!

Hey man I follow your videos since (almost) the beginning and, like someone already said, your videos are only getting better. Keep going

You owe me a brain

2:50 is gold

Siraj, love the videos, but I would really like to see you run the code. I only have access to a shit machine right now (I'm in India! :D), so I can't run the code. I'd like to see what results your programs have. I know training takes huge amounts of time, but I feel like seeing the results would be really helpful. Thanks.

siraj, your're G. I bow to you

hey! Siraj! I've done something check it out: https://github.com/erayon/WhatsappBotX

i feel like these would be a lot better if they were a bit faster

So…. When am I gonna have a quantum computer, mate???

hi Siraj Raval and every one here ;; i'm following your channel continuously, it's so much nice and benefit as well .. but also i want to consult you that i'm PHD student and i want to work with twitter streaming . so what kind of ideas can i work with .. i'm confused .. every thing is done in that side ,, thanks in advance

I watched this vid with a Quantum computer shhhhhhhhhhhhhh……………..

Siraj you rock man!! Great video as always..don't even read to those bullshit comments…you know what they say…haters gonna hate..

Did you drink vodka today?:) You talk slowly than usually :)))

This video caused me existential dread. Should be shorter 4 sur

Don't hack Bitcoin Private Keys please.

how do you research and learn so much for a single topic? I am facing a problem of learning lots of things.

Siraj I am biggest fan of yours, Thanks a ton for your videos 🙂 🙂

Are eyes are antennas that absorb energy. When are eye see a small particle the

antenna absorbs a lot of its energy, photons, of that small particles.

Your are always so inspirational…thank you for making me want to learn more…

awesome man… i have currently 4 years of experience in Small scale IT, but still makes me harder to grasp all the things … you are the real inspiration, Keep up the good work… I always watch your video… i am not able to find words for you…. awesome !!!

I also love your tensor flow episodes. Great work !!!

watch the beginning with 144p lol

Hi, Siraj how are you.Make one video please ,clearly about installing Tensor flow GPU support. (WINDOWS 10)…….thank you

Can you please make a video tutorial on distributed training using tensorflow?

Congratz to all who finished this video series, awesome work overall Siraj. I am curious to know what direction your planning on taking next, a new video series?

In terms of this video on quantum computing, I am seeing this stuff for the first time so I appreciate that you chose to slow down a bit for this video. I think this speed should be a good lower bound. The only thing I felt that was missing was applications to quantum computing in machine learning that we have already seen in this series.

Great vid Siraj. Thanks!

Jhandu baam

Siraj, great video! Neil DeGrasse Tyson explains very well on a podcast of Joe Rogan why some quantum prioriteties dissappear while observed. If I understood correctly it's actually due to the tools we use to measure them and they actually don't disappear..he used a good analogy but I forgot..😕

Coding challenge submission:

https://github.com/ZachisGit/QuantumComputationEngine

You inspired me to start this project, it does not quite meet the challenge requirements but i thought it is close enough to at least submit the idea 🙂

i like your video its wonderful quantum computers are the future of computing i am interested in your videos how do i subscribe to them.

What does he say as the quote of the course? Something like: "I've sacrificed relationships for greatness… These hands, have yet to create their masterpiece… INTELLIGENCE, is in a grasp." ??

hey guys, if someone could help me i would be thankful…So I'm familiar with some programing languages such as c++ and JS, I would like to start in the world of IA. Can someone help me with where to start?

Hi Siraj :)! You are my favorite DL teacher 🙂 Thanks for all the effort you do 🙂 Which Universities you consider as the better ones to study a Master Degree on DL?

Hello, can you do a video about how you learn new things ? And how you organize your time to do it. Thanks !

Nice video Siraj.Thanks….

How to make strong Artificial Intelligence in python

Siraj Dude ,,, How do you produce such high-quality content !!!

Respect Respect Respect …

And by the way, you have an extraordinary voice … excellent diction.

Here's my submission. I didn't come up with anything cool on qbits themselves, just a "hello world", but I did create a Docker Image – "avloss qiskit" – so others can start more quickly!

Docker Image – https://hub.docker.com/r/avloss/qiskit

Jupyter on GitHub – https://github.com/avloss/qiskit/blob/master/hello_quantum_world.ipynb

siraj, What is the unit info in the IBM Q account?

Could you make a video going into depth on how to make Siri/JARVIS using Python (if possible, using deep learning)?

this is the type of video that lets yourself know that your iq is not over 100

Coding Challenge Submission: https://github.com/suha-hussain2002/quantum-search

Submission here: https://github.com/alberduris/The_Math_of_Intelligence/tree/master/Week10

I struggled because my lack of Quantum Computing knowledge and because of the credits, but is still well documented so here it is. I learned a lot, I hope you too 🙂

I'm voting 4 u. Siraj 4 prez!

Hey Siraj! I've got two submissions for this week!

– Grover's Algorithm: Reduces complexity from AVG(N/2) O(N) to O(N^1/2)

when searching for an item in a list: https://github.com/EricAlcaide/Math_of_Intelligence/blob/master/Quantum_Computing/grovers_algo.py

– Quantum Phase Estimation: one of the most important subroutines in quantum computation: https://github.com/EricAlcaide/Math_of_Intelligence/blob/master/Quantum_Computing/quantum_phase.py

Really entertaining and well explained 🙂 I'm doing a PhD in QC and there's not many videos on line about it that I like- so really well done! This is the first one of your videos I've watched and I'm subscribed now.

Here is my code challenge. thank you.

https://github.com/jhGitHub009/Quantum_Computing/tree/master

Not easy for understanding Quantum computing totally.

thank you.

Hey,

I am working on deep learning and I have already trained my neural net. I use python3 and tensorflow. It's a binary classifier. I now have no clue how to implement it in the real world. I would like to run it on a device like a microcontroller, any help is appreciated! For example the input can be the temperature that is sampled every 10 seconds and the output lables is one of hot cold or normal. And the result can be displayed on an LCD connected to this controller. Any help would be appreciated.

That was high quality tutorial. high quality in terms of concepts you covered.

You're awesome siraj.

If I ever meet you some day, we should talk about Quantum Machine Learning!

Hello siraj

I'm actually a college drop out student, but I love coding can u guide me how to start and is there still any scope for me to get a job as a developer.

I'm waiting for your response

It was nice but I think I recognised some animations from Kurzgesagt – In a Nutshell . You should at least credit them.

Awesome video…hope all of this is true!!

Thank you for a good video…U just earned sub!! 😉

I expected something on quantum AI. Anyway its really nice. IBM QASM , QISKit don't have that much support for Quantum AI right now via API. Something like Rigetti Forest kind of framework they have to prepare. As Quantum Computing is a very old concept and its not best suited for all applications. Google and NASA started working on Hybrid Computers using Quantum Annealing ,Tunneling , knots concepts etc. For plenty of Quantum AI and Quantum Machine Learning Information please check one page (https://github.com/krishnakumarsekar/awesome-quantum-machine-learning)

Sir, you are the Richard Feynman of computers!

your videos are very well explained and sort of annoying. but i keep coming back to them 😀

Siraj, you're superb! Is it possible for you to make your slides & transcripts for download? Love you bro! 🤓😊

This is so good!!

4:40 haha, right side is not opposite polarized 🙂

You are an amazing teacher. Love you.

maybe it is neither phone neither laptop and it is PC

On which IDE should I use Quantum Programming.

Thanks Siraj. I like your explanation but the spand a long time on the intro, so clearly targeted at newcomers. However you then fly through the quantum example and circuits in about 5 seconds. I’m left knowing really no more than I did when I started.

Why the hell some people disliked this video?!

get out of white man territory u molato poofter.

I should be able to give this video, a thumbs up, a thumbs down and a thumbs up and down at the same time.

Microsoft has released a Quantum computing SDK that will can help us simulate quantum computing on a classical computer using the system RAM and then we can later run that on Azure cloud Quantum computers

Veritasium from the Middle East 😎 you two need to collab one day. Great video bro

You talk like a chutia but I gave you thumbs up.

I want my phone to prove P=NP ; and it has to be a proof of less than 0 symbols long

I am the first and i am the last ; i am the superposition of all possible universes and impossible universes ; i am the singularity ; i am and that is my name for ever

I hate who dislikes your videos

My understanding is that Qubits can not be 1 and 0 at the same time, they are a combination of probability's of one and zero. The addition of vectors 1 and 0 gives you the state of a qubit.

Spin up or spin down correspond to a zero or one in a qubit.

So are the 300 qbits he mentioned @6:24 analogous to transistors or ones and zeros?

don't know whether should I ask this type of question but do I need a degree in Quantum physics to excel in Quantum Machine learning?

Dude I love you videos Where do you get the crazy animations from Though I have scoured the web to find simple little animations for my videos. Also, When is you blockchain course going to open I'm ready to pay you some $$ for those courses. keep up the awesome videos!!!

Quantum computers can't work without classical computers….

…YOU , drop your speed on the video and enjoy a drunk siraj explain this stuff…i swear to GOD HILARIOUS

….how are you always at or ahead of the popoular trend …

chetowri khubi?

Next challenge, find ant-man and wasp in quantum realms using quantum algorithm.

Watching this in 2100 on my quantum accelerated neural pc

8:40

wtf

If I wanna implement quantum algorithm and learn more which is better Microsoft LIQUI|> or IBM API gor quantum computing…?

Just realised you just took Kurtsegat's Content on quantum computers 😛

This video completes me. Grazie mille, Siraj Raval 🙏🙇♂️. I would be eternally grateful if you do more videos on quantum algorithms.

Why haven't we found out a new way to represent information ??????

just finished the series. thank you soooo much for the dope content. love you Siraj, you're awesome

The guy is more excited than needed!

SIR MAY I KNOW HOW TO DESIGN QUANTUM CRYPTOGRAPHY OB THIS SIMULATOR …QISKIT

Quantum leap refers to the huge leap in technology that was made possible with quantum physics, not an excitation in a physical system.

Hello siraj i regularly follow all your videos and also i am great fan of you. My question is how can i learn quantum computing. Where can I find course & study resources for that pls suggest me.

Bravo

Expecting to obtain the algorithm of quantum computers is like finding out how the parameter space is fine tune. We have no clue how FT occurred and may never know.

So with these techniques we can build a model of a quantum computer on a classical computer and use it to develop quauntum algorithms that would could in theory be used on quantum computers in practice? Am i understanding that correctly? I'm a bit tired.