Talking to Elsa

Nov 15, 2024

 

Before diving in, if you haven't already, I would highly recommend reading my earlier blog on Quantum Computing. In that piece, we cover a lot of ground on the fundamentals of quantum theory and hardware, and now we're picking up where we left off!

So, you did it. You convinced the stockholders that this was actually way cool, and totally worth the exorbitant buy-in. Right there in front of you, you behold this monstrous contraption - behind a substantial partition of course - to safeguard you should Satan's freezer escape the center of it. The mile-wide grin fades. Crap... how do we talk to this thing?  Welcome back to the rabbit hole.

 

Say Something

Talking to a quantum machine, coming from your trusty PC, is like trying to talk to a Martian based on how you know to communicate with your dog. Tracing back to the origins of quantum communication, as scientists began building these remarkable machines, they faced a similar dilemma when the time came to actually communicate with this apparatus they'd created. The inherently foreign attributes and customs of quantum mechanics require thorough understanding to bridge the gap between these worlds-apart entities, and traverse this issue. This inspired the innovation of quantum programming languages, which are still in their earliest stages of development. The only way we may currently communicate with quantum machines given these languages is through a surrogacy process of sorts. The developing languages act as translators, bridging the gap between classical and quantum computers, as direct quantum communication is not yet possible. Similar to the way we must currently settle to measure the qubit like a bit, a paradigm it was never meant for, we also speak to the quantum machine to the best ability of the classical machine for the time being. We are compulsively playing telephone with a 3-D entity, with no other option but a 2-D middleman. In appearances, this effectively poses quantum capabilities as an extension of the classical machine's might, feeding the "super-powered computer" fallacy, and obscuring its true nature as the Martian in the room.

First, it would be helpful to render a clear image of the arena out there which these languages have to work with. Sadly, that's rather difficult at this time in the quantum space. No one seems to know how many (arguably) operational quantum machines are currently in existence. Some sources suggest 150-200, some suggest "several hundred," some swear 10,000 (morons). According to McKinsey, reported by MIT Sloan, there will be approximately 5,000 operational quantum machines in the world by 2030. The most credible sources refuse to even offer a suggestive answer as to how many are currently out there, as we really don't know. Assuming the ethos of the peer-supported 2030 estimation, the guestimates (not the morons), and understanding that a lot of acceleration can occur in a flash in this globalized age - lets agree to estimate that there's somewhere between a few hundred to several hundreds of at least semi-operational quantum computers in the world today.

 

Matchmaker, Matchmaker

To even suggest there was a prevalent quantum language would be misleading. If the AI/ML space is infantile, then quantum is hardly even fetal. In its waking genesis, there are two veins of quantum programming languages we see arising: Imperative and Functional. Imperative languages cater to processing statements that alter a program's states, and enforce a procedural paradigm on the quantum machine's approach to computing. Because quantum machines just love that. Nonetheless, the classical machine can only interpret procedurally, and capitulation to that restriction is still a necessary pill to swallow - if you want to be able to send orders to the quantum computer at all. Functional languages, on the other hand, offer a higher innate level of abstraction, and are therefore capable of approaching quantum machines in a more relatable way, possessing a higher level of complexity - but are albeit not as complex as the quantum system itself. A functional language empowers the user to define, you guessed it, functions which lay out raw inputs, communicate the desired output, and then proceeds to get out of the Martian's way. To clarify: the imperative approach focuses on how, whereas the functional focuses on what.

Based on these options, especially considering quantum's inherent nature - the functional approach would appear far superior. So - why apply an imperative, therefore inherently iterative, paradigm at all - to an unruly baby who clearly does not want to eat the peas? In a word: stability. The emancipation of the quantum machine demands more organized chaos than we are presently adequately prepared to dive into. Yes, the functional approach makes far more of an effort to meet the abstraction of quantum where it actually is - but the tradeoff is control, legibility, and consistency. It doesn't matter if you match someone's freak if you hit traffic, you're both in the passenger seat, and no one's driving! In fact, highly complex functions have even managed to outdo quantum hardware's freak in the past. Functions can rapidly and significantly scale in their demands of quantum hardware, given that they're challenging the machine the way it ought to be, and have proven capable of overwhelming Elsa's blasters in the time being. Contrariwise, the imperative approach is able to assure a granular level of control and tuning, traceable and interpretable progress, and offers the ability to debug and review at all. Now, could one debug a convoluted functional process? Theoretically, sure, but then you'd just find yourself playing telephone with two Martians and no applicable dictionary!

 

Beep Boop Bop, Snowcone!

The most referenced  - as "utilized" would feel too presumptive given our admittedly limited data - arising imperative quantum language is Microsoft's Q#. It is an open-source, hardware agnostic language meant to spearhead the age of quantum commands and classical/quantum convergence. For those familiar with the world-dominating classical machine language C#, Q# aims to offer a familiar and secure launching pad for programmers already well-versed in the C# paradigm - making adoption a far more practical pursuit. However, Q# is still practically in the womb, and like the quantum computers it controls, has its limitations. We cannot anytime soon expect to compose complex quantum algorithms with a level of ease and flexibility comparable to that we've found for classical programming. Q# is a launching pad for the programming community to embrace quantum more than anything in this regard: "Maybe the Martian barely understands us, but at least something's happening! If we don't talk to it at all, we'll never learn its language." - in a nutshell. While Q# is staking its place in the imperative quantum league, a rising star in its own right in the functional camp is PennyLane.

PennyLane is a Python-based library which leans heavily on the power of differentiable programming, a key advantage for quantum ML, and aims to spearhead AI/quantum convergence. Differentiable programming is a bit complex in concept, so to explain we'll employ an analogy: Imagine you're blindfolded on a hill. You'd like to get to the bottom of it, but can't see where you're going. A differentiable language is the walking stick you can use to feel out the slope. You identify the curve (it extracts the derivatives), and accordingly step toward the lower ground. Though unaided by direct sight, you will still succeed in your quest for the lower ground given this approach, and it is a foundational practice to AI/ML as a whole. PennyLane's functional approach prioritizes clear and composable code, allowing researchers to build and modify complex quantum algorithms with ease. Its ability to use automatic differentiation for optimization and its integration of classical and quantum computations make it a powerful tool for exploring the frontier of quantum ML. However, like any young quantum language, PennyLane faces challenges in mapping to the constraints of current hardware - the aforementioned Achilles heel of functional languages outdoing Elsa's freak, and also presents a steeper learning curve for programmers unfamiliar with functional programming. As the field of quantum computing matures, the debate between imperative and functional approaches will likely continue, with both playing crucial roles in driving progress. It's likely that hybrid approaches, combining the best of both worlds, will ultimately emerge as the dominant paradigm. To truly harness the power of quantum computers, we need to journey deeper than the languages themselves, and develop a firm understanding of quantum algorithms, the building blocks of quantum programs.

 

Never Too Far

The real magic, the place where the interactions occur and things are created, happens on the level of quantum algorithms. These serve as the blueprints of quantum computing, dictating how the Martian may confront issues deemed overwhelming for the classical machine. Whereas the classical algorithm is tailored to work on bits, quantum algorithms work on qubits, and in doing so utilize the alien properties of superpositioning and entanglement. As we addressed superpositioning in the prior blog, we will hone in on the concept of entanglement. Picture two coins, flipped simultaneously and perfectly correlated. If one lands on heads, you know the other must land on tails – they're entangled. In the quantum world, it's not just about coins - it's about particles.

Two entangled particles, no matter how far apart they are, can be linked in such a way that measuring one instantly affects the state of the other. This unique link opens the door to creating powerful correlations between qubits, and this is where things get interesting quickly. Distance has zero effect on a quantum entanglement, the bond is totally non-local. The two particles could be further apart than science could measure, and still confidently so - if one is on heads, the other is on tails. Additionally, the relationships formed between entangled qubits unlocks abstract collaborative capabilities in a quantum system impossible to achieve in a classical paradigm with bits. Consider trying to find a specific piece of information within a massive database. In the familiar classical paradigm, we have to search each entry one by one, typically taking a significant amount of time even with powerful resources. But - using a quantum algorithm, leveraging the crux of entanglement and superpositioning, we are enabled to explore multiple entries simultaneously, speeding up the search process exponentially. For further discovery, we'll hone in on the innerworkings of one of the most important algorithms - in general - in history.

 

This One'll Hurt

The most famous quantum algorithm yet is Shor's algorithm. It was designed for the sake of efficiently factoring large integers - not "large" like billions and trillions - large as in the numbers you require equations and exponents simply to write out. This is an invaluable tool to the tech world, as classical algorithms are infamously terrible at handling gargantuan figures. Even the best classical factoring algorithms fall victim to exponential time. This means that for every single digit introduced to the mega-number, the wait time for the factoring doubles. You could spend longer than the age of the known universe waiting on a single factoring! Shor's algorithm, as opposed to the classical factoring algorithms, runs in polynomial time - and that's really the whole ball game. While it's assumed that polynomial time does still pose increases in wait time when the number's size increases, as it's science not magic, it effectively anchors the time it takes from scaling exponentially and unreasonably with the figure. This is more of a reaction/summation than it is an actionable thing, and speaks to the conflicting search methodologies: the classical system will compulsively check every single available option, to a coinciding predictably glacial wait time - but the quantum system will only take as long as... it does.

That's the thing. There is no approximate wait time to be offered with quantum factoring methodologies, which is why when you Google "Schor's algorithm polynomial time," you will find decidedly vague descriptors and a lot of fluff to read past. Lots of "examples," zero substance. That's because - there is no "factor" by what your wait time will grow, no constant to be rendered - at least given what we are able to comprehend. That's because of what's already been said - as far as we know, the qubits just... find it when they find it. And typically scary fast. This ties directly into our inability to actually read a qubit - without altering its state - and see it as it is. We know that the glue of the quantum operation, where the qubits get busy, is in the Quantum Fourier Transformation (QFT) Schor's employs. This operation manually disperses the superpositions of the qubits throughout the closed loop of the dilution refrigerator at will. This rapidly breaks down complex chunks into smaller and simpler ingredients, without at all affecting or altering the qubits in their habitat. This successful dispersion is the fulcrum of the entire algorithm, and the direct source of its supernatural speed. With the figures dispersed now, Schor's has preemptively crafted a mathematical function related to the number we're seeking to factor - and within that function is a subtle repeating pattern - the period. When our qubits find it - game over. The period is retained and then acts as a key, and there is your number! This algorithm is, in fact, the very reason in our prior blog that we pointed to quantum computing as the ultimate lock-breaker. Encryptions as we know them cater specifically to the classical machine's weakness - large number factoring - but now there's a Martian picking your lock, not a calculator. All an encryption ever was, anyway, was a figure too big for a classical machine to factor. In a growing world of qubits, cybersecurity has a lot to be scared of.

 

You Made It!

If you're still here, you're a trooper. I did my best to make the Schor section digestible - but GOD was that dense. We've journeyed through a landscape of bizarre, perplexing, and oddly charming technology. The journey hasn't been easy. But through this adventure, we've glimpsed a future where quantum computers can revolutionize our world, tackling problems that are beyond the reach of traditional computers. The future ahead is bright, and by what we currently understand and accept as possible, nothing short of magical. But here's the catch: the "magic" isn't just a plot device. It's real science. The mind-bending science of quantum mechanics, which governs the world itself at its core, has never been this near our reach. This science is not a fairytale - it's a new frontier demanding to be explored!


 

Cobi_Tadros

Cobi Tadros is a Business Analyst & Azure Certified Administrator with The Training Boss. Cobi possesses his Masters in Business Administration from the University of Central Florida, and his Bachelors in Music from the New England Conservatory of Music.  Cobi is certified on Microsoft Power BI and Microsoft SQL Server, with ongoing training on Python and cloud database tools. Cobi is also a passionate, professionally-trained opera singer, and occasionally engages in musical events with the local Orlando community.  His passion for writing and the humanities brings an artistic flair with him to all his work!

 

Tags:

Playlist for Sitefinity on YouTube

 

Playlist for Microsoft Fabric on YouTube

 

Playlist for AI on YouTube

Copyright © 2024 The Training Boss LLC

  Developed with Sitefinity 15.1.8321 on ASP.NET 8