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

Tags: , , , , , , , , , , , , , , , , , , , , , , ,


  • jaikumar848 says:

    Is machine learning possible with quantum computer?

  • claudio santos says:

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

  • Daniel Zuñiga says:

    1.5 speed for normal Siraj speed.

  • Zerbberuss Setzu says:

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

  • aakash chaudhary says:

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

  • meena chinmay says:

    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.

  • Noah Lidell says:

    Awesome video Siraj!

  • Rafael Ribeiro Paiva says:

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

  • landlockedviking says:

    You owe me a brain

  • Johl Brown says:

    2:50 is gold

  • Ritoban Roy Chowdhury says:

    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.

  • No'ah says:

    siraj, your're G. I bow to you

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

  • to stupid for a Name says:

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

  • Gabe Hey says:

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

  • روند احمد says:

    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

  • Danny Granger says:

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

  • xerox_04 says:

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

  • Null0 says:

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

  • Jeff Session says:

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

  • i 新 says:

    Don't hack Bitcoin Private Keys please.

  • Bernardo Galvão says:

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

  • Vasu Sharma says:

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

  • keghn feem says:

    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.

  • Dom Carlyle says:

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

  • Shakti Sharma says:

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

  • SapphFire says:

    watch the beginning with 144p lol

  • Annapragada Hema Chandar says:

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

  • Mehul Kumar Nirala says:

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

  • hammad shaikh says:

    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.

  • Lyuboslav Petrov says:

    Great vid Siraj. Thanks!

  • Kabir Shiv% says:

    Jhandu baam

  • Sunny Internet Ride says:

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

  • None of your Business says:

    Coding challenge submission:

    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 🙂

  • Piyas Fernandes says:

    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.

  • Eric Alcaide Aldeano says:

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

  • Richardson Santiago says:

    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?

  • bonnie milian says:

    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?

  • amine jadid says:

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

  • Arjun says:

    Nice video Siraj.Thanks….

  • ashutosh kumar0897 says:

    How to make strong Artificial Intelligence in python

  • Naval Deshbandhu says:

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

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

  • a l says:

    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

  • Param Bhavsar says:

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

  • Scott Gibbard says:

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

  • The Robot That Stole Your Jawb!!! says:

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

  • Suha Hussain says:

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

  • Alberto Blanco Garcés says:

    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 🙂

  • derasor says:

    I'm voting 4 u. Siraj 4 prez!

  • Eric Alcaide Aldeano says:

    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

  • Looking Glass Universe says:

    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.

  • 이정환 says:

    Here is my code challenge. thank you.
    Not easy for understanding Quantum computing totally.
    thank you.

  • Sumeet Gadagkar says:

    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.

  • masoud masoumi moghaddam says:

    That was high quality tutorial. high quality in terms of concepts you covered.
    You're awesome siraj.

  • Guillaume Verdon says:

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

  • sachin pandey says:

    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

  • Tan Moy says:

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

  • LG 64BIT says:

    Awesome video…hope all of this is true!!
    Thank you for a good video…U just earned sub!! 😉

  • krishna kumar Sekar says:

    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)

  • Shweta Pandey says:

    Sir, you are the Richard Feynman of computers!

  • maxwelljun says:

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

  • Peet Rungsima says:

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

  • JamesChawner92 says:

    This is so good!!

  • S X says:

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

  • Nafiz Hamid says:

    You are an amazing teacher. Love you.

  • davit nazarashvili says:

    maybe it is neither phone neither laptop and it is PC

  • arish azmat says:

    On which IDE should I use Quantum Programming.

  • Tim Spears says:

    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.

  • Mohamed Ibrahim says:

    Why the hell some people disliked this video?!

  • rakka1 dude1 says:

    get out of white man territory u molato poofter.

  • Zorn101 says:

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

  • Vignesh S says:

    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

  • Daniel Cannata says:

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

  • RichardJinny says:

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

  • Frank HEUSER says:

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

  • Frank HEUSER says:

    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

  • Sam Kemp says:

    I hate who dislikes your videos

  • leigh pierce says:

    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.

  • Trius says:

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

  • Ovais Kaku says:

    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?

  • Shaun Pritchard says:

    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 chicken says:

    Quantum computers can't work without classical computers….

  • AudacityTunesE.T.C says:

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

  • Lin Peng says:

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

  • Schrodinger's Cat says:

    chetowri khubi?

  • Subhasish Chatterjee says:

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

  • Julian Arnold says:

    Watching this in 2100 on my quantum accelerated neural pc

  • Bhuvanesh s.k says:

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

  • ATIF ADIB says:

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

  • Kānglǐ Guǎnglì says:

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

  • abcd xx says:

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

  • pouya nz says:

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

  • Inquisitour M29 says:

    The guy is more excited than needed!

  • hina sheikh says:


  • poop catapult says:

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

  • basavaraj b says:

    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.

  • Rambo hug hug says:


  • Naimul Haq says:

    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.

  • Matt Coakes says:

    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.

Leave a Reply

Your email address will not be published. Required fields are marked *