<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Samay Bhagat on Medium]]></title>
        <description><![CDATA[Stories by Samay Bhagat on Medium]]></description>
        <link>https://medium.com/@samaybhagat?source=rss-fbd0e14b51ac------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*y2i0kivoBocpdMDP</url>
            <title>Stories by Samay Bhagat on Medium</title>
            <link>https://medium.com/@samaybhagat?source=rss-fbd0e14b51ac------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 21:16:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@samaybhagat/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Amplifying Accuracy: The Power of Iterative Amplitude Estimation]]></title>
            <link>https://medium.com/@samaybhagat/amplifying-accuracy-the-power-of-iterative-amplitude-estimation-6a0b68446ab2?source=rss-fbd0e14b51ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a0b68446ab2</guid>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[science]]></category>
            <category><![CDATA[cryptography]]></category>
            <dc:creator><![CDATA[Samay Bhagat]]></dc:creator>
            <pubDate>Tue, 11 Apr 2023 01:20:48 GMT</pubDate>
            <atom:updated>2023-04-11T01:20:48.181Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*BixTH-EKA20lJdBD" /></figure><p>Quantum computing is on the cusp of revolutionizing a plethora of industries, and at the core of many quantum algorithms lies the task of estimating the <em>amplitude of quantum states.</em></p><p>If this sounds confusing or unfamiliar with no context, don’t panic — an explanation is inbound.</p><h3>Quantum States?</h3><p>Quantum states are the fundamental building blocks of quantum systems, and they describe the state of the system at a particular moment in time.</p><p>Knowing the state of a quantum system at a specific moment can provide valuable information about the system’s behavior and evolution over time.</p><p>These same quantum states also determine the probabilities of measuring different outcomes when observing a qubit (since qubits conform to discrete states under analysis), which can then be used to make predictions about the system’s future behavior.</p><p>These <em>quantum states</em> are typically represented as vectors in a high-dimensional Hilbert space, and they are characterized by their amplitudes, which determine the probability of finding the system in a particular state upon measurement.</p><p>Accurate estimation of the amplitudes of quantum states is essential in many quantum applications, such as quantum simulation, quantum chemistry, and optimization problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vA5dFqaAK-wBowV7.jpg" /></figure><p>A more specific example of the importance of quantum amplitude estimation can be seen when one directs their gaze to a field that is often overlooked; <em>quantum cryptography.</em></p><p>In traditional cryptography, encryption keys are generated using mathematical algorithms, which can be vulnerable to attacks by hackers. In contrast, in quantum cryptography, encryption keys are generated using the properties of quantum states, which are inherently secure due to the principles of quantum mechanics.</p><p>To put this into perspective, let’s create a hypothetical with two parties — Bob and Jack.</p><p>The basic idea is that two individuals, Jack and Bob, can create a shared encryption key by exchanging entangled qubits, which are particles that are connected in a way that their states are correlated. By measuring the state of their qubits, Jack and Bob can determine if their qubits are entangled and use this information to generate a shared encryption key that is secure against interception.</p><p>In this example, knowing the state of the quantum system (the entangled qubits) is critical for generating a secure encryption key that can be used for secure communication between Jack and Bob. Without this knowledge, the encryption key could be <strong>compromised</strong>, with the security of the communication sacrificed in the process.</p><p>This then begs the following question: how does the process of measuring a quantum state’s amplitude even work?</p><p>Well, one of the most widely used algorithms for quantum amplitude estimation is, unsurprisingly, the <strong>Quantum Amplitude Estimation (QAE) algorithm </strong><em>(I know; whoever came up with the name wasn’t the most creative…)</em></p><p>However, traditional QAE methods have limitations in terms of their scalability and efficiency, and in recent times, researchers have begun to turn to a more advanced algorithm called <strong>Iterative Amplitude Estimation (IAE).</strong></p><h3>What’s IAE all about?</h3><p>Iterative Amplitude Estimation (IAE), also known as Iterative Quantum Amplitude Estimation (IQAE), is a more efficient and scalable algorithm for quantum amplitude estimation.</p><p>IAE involves iteratively applying controlled rotations to a quantum state and measuring the resulting state to estimate the amplitude. The algorithm is scalable and can estimate the amplitude of a large number of states simultaneously, making it a valuable tool in many quantum applications.</p><p>One of the key advantages of IAE over traditional QAE methods is its ability to estimate the amplitude of a large number of states simultaneously. This makes the algorithm highly efficient and scalable, even for large quantum systems. IAE is also robust to noise and can work with imperfect quantum hardware.</p><p>With that said, however, it’s important to acknowledge that nothing is perfect, and that IAE isn’t an exception to this principle. The number of iterations required for accurate estimations increases exponentially with the number of qubits, making it computationally expensive for large quantum systems.</p><p>Additionally, the algorithm is sensitive to errors in the gate operations and measurement, which can affect the accuracy of the estimation.</p><p><strong><em>However,</em></strong> researchers are actively working to overcome these limitations and improve the performance of IAE. One promising approach is to combine IAE with other quantum algorithms to enhance its scalability and reduce the number of iterations required. However, there are so many different possibilities that have yet to be explored.</p><p>Even though refining IAE is an iterative process, the algorithm has already shown significant promise in a variety of different applications.</p><p>In fact, just before writing this article, I recently <a href="https://github.com/samaybhagat/optionpricing/blob/main/Pricing%20European%20Call%20Options%20with%20IAE.ipynb">published my own project</a> where I used IBM’s Qiskit to build a financial option pricing tool — all thanks to IAE.</p><p>So, although we’re still quite a bit away until quantum’s applications stretch far and wide, in the meantime, I suggest you take matters into your own hands, just like myself. There’s no better time to start building your own projects, and with quantum, the possibilities are quite literally <em>limitless.</em></p><p><em>Hey; my name’s Samay! I’m a high school student interested in exploring the world around me, and in the present moment, I’ve taken an interest in quantum computing and its applications. If you enjoyed reading my article, make sure to join my </em><a href="https://mailchi.mp/38a52102956b/samays-monthly-updates"><em>monthly newsletter</em></a><em> and add me on </em><a href="https://www.linkedin.com/in/samaybhagat/"><em>LinkedIn</em></a><em> to keep up with any new projects and updates! Feel free to also email me at samaybhagat@gmail.com if you’re looking to connect!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a0b68446ab2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Quantum Generative Adversarial Model: What’s It All About?]]></title>
            <link>https://medium.com/@samaybhagat/the-quantum-generative-adversarial-model-whats-it-all-about-3ec324ace851?source=rss-fbd0e14b51ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ec324ace851</guid>
            <category><![CDATA[quantum-machine-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[generative-ai]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <dc:creator><![CDATA[Samay Bhagat]]></dc:creator>
            <pubDate>Sun, 26 Mar 2023 03:24:23 GMT</pubDate>
            <atom:updated>2023-03-26T03:24:23.056Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/729/0*TopM7PTrjeCNFqri" /><figcaption>Ian Goodfellow, one of the many initial founders of GANs</figcaption></figure><p>In June of 2014, Ian Goodfellow and a few of his peers proposed the idea of a <strong><em>generative adversarial network. </em></strong>If you’re at all familiar with machine learning, you’ve likely heard of GANs in the past (or perhaps even qGANs).</p><p>If you haven’t, however, don’t fret; you’ve come to the right place. If you’re interested in learning more, read along for a <em>simple &amp; concise breakdown</em> about quantum generative AI.</p><p>A Generative Adversarial Network (GAN) is a type of machine learning model that can generate new data that is similar to the initially provided training data. Thanks to this class of ML, companies have been able to produce <strong><em>accurate representations of things that don’t even exist — </em></strong>and so much more<strong><em>.</em></strong></p><p>As one can assume through the use of the word ‘<em>adversarial,’</em> GANs are composed of a generator and discriminator; two neural networks that compete against one-another in a zero-sum game.</p><p>The generator of a GAN learns to produce new data that is similar to the data it was trained on, while its counterpart, the discriminator, learns to distinguish between real and generated data. The discriminator then produces a binary output indicating whether it believes the data it analyzed was real or fake, and this is then fed back into the generator for iteration.</p><p>Through this adversarial training process, the generator becomes better at producing realistic data, while the discriminator becomes better at identifying fake data. The ultimate goal, however, is for the GAN to reach a state of <em>convergence, </em>where the generator is so effective that the discriminator’s chance of differentiating fake from real data approaches that of a coin toss — 50/50.</p><p>In this situation, the GAN will successfully be able to produce any type of data based on its initial dataset. If the discriminator can no longer discern between what is real and artificially created, human’s likely won’t be able to either.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/0*Pnq6bRFdzyxlQ-x6.PNG" /><figcaption><a href="https://www.simplilearn.com/tutorials/deep-learning-tutorial/generative-adversarial-networks-gans">Source: BTS of a GAN</a> -&gt; The discriminator is forced to differentiating between the dataset’s real data and the generator’s fake counterparts.</figcaption></figure><h4>Adding Quantum Computation to the Mix</h4><p>GANs, however, aren’t perfect.</p><p>They can be pretty computationally expensive as you try to produce more outputs, and they require a lot of resources. This is because GANs need a large number of iterations to train effectively, and each iteration involves computing the forward and backward pass of both the generator and discriminator.</p><p>By integrating quantum technology into the mix, however, this concern becomes a lot easier to address.</p><p>Quantum Generative Adversarial Networks (qGANs) leverage quantum algorithms and hardware to generate synthetic data. In practice, they integrate parameterized quantum circuits into either the discriminator, generator, dataset (<em>in which case the initial data points are represented through quantum states</em>), or even <em>different combinations of the three</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*smN_ZnRaOJyP3VAemiUI-g.png" /><figcaption><a href="https://learn.qiskit.org/course/machine-learning/quantum-generative-adversarial-networks#quantum-3-0">Source: Qiskit QML Course</a> -&gt; Different Combinations of Classical &amp; Quantum Technology within GANs</figcaption></figure><p>For the sake of simplicity, let’s see what the generative process would look like with the integration of quantum in all components.</p><p>In the beginning of a qGAN’s training, the quantum generator operates similar to that of a classical one. It attempts to mirror data from the real dataset with no aid, and then gives the output <em>(as a quantum state)</em> to the discriminator.</p><p>The two quantum networks then go back-and-forth feeding into one-another, with the generator attempting to create more realistic outputs, and the discriminator attempting to improve its differentiative capabilities.</p><p>In qGANs, however, the discriminator and generator go about optimizing their efficiency differently than their classical counterparts. Instead, they aim to <strong>seek the ideal parameters</strong> to determine the perfect quantum state.</p><p>In this context, the parameters of a quantum neural network are the adjustable values that determine the behavior of the network. These values are set during the training process and can be adjusted to optimize the network’s performance for a specific task.</p><p>So, in practice, this process involves alternating between training the generator and discriminator circuits. Meanwhile, the parameters of one must be held constant while the other is being trained, in order to prevent changes in one circuit from interfering with the training of the other.</p><p>As time progresses, the final intention would be the same as what one would observe in a regular GAN. Ideally, the discriminator would no longer be able to accurately differentiate between real quantum states &amp; those made by the generator. The discriminator’s probability of success would, once again, near that of a coin toss — 50/50.</p><blockquote>So what?</blockquote><p>Well, as mentioned, one of the many key differences between qGANs and GANs is that the former can use quantum states instead of probability distributions to generate data.</p><p>These quantum states, however, are more useful than one may initially realize. They can be used to represent complex data structures such as graphs and molecules, which are difficult to represent using classical probability distributions.</p><p>Additionally, qGANs can potentially take advantage of <a href="https://medium.com/@madali.nabil97/quantum-parallelism-e4b0d2dfa744"><em>quantum parallelism</em></a> to generate data much faster than classical GANs. This is because quantum circuits can perform many operations in parallel, which can be useful for generating large amounts of data.</p><p>As such, it’s not too difficult to come to the realization that the qGAN is quite distinct from its initial derivative, the classical GAN. So, who knows? As quantum technology continues to improve, qGANs might become an increasingly disruptive tool in a variety of industries, from quantum chemistry to modern-day finance.</p><p>The possibilities are endless and the potential is vast, leaving us only to wonder what kind of quantum leaps await us in the future of generative modeling.</p><p><em>Hey; my name’s Samay! I’m a high school student interested in exploring the world around me, and in the present moment, I’ve taken an interest to quantum computing and its applications. If you enjoyed reading my article, make sure to join my </em><a href="https://mailchi.mp/38a52102956b/samays-monthly-updates"><em>monthly newsletter</em></a><em> and add me on </em><a href="https://www.linkedin.com/in/samaybhagat/"><em>LinkedIn</em></a><em> to keep up with any new projects and updates! Feel free to also email me at samaybhagat@gmail.com if you’re looking to connect!</em></p><p><em>This article was made with reference to </em><a href="https://learn.qiskit.org/course/machine-learning/quantum-generative-adversarial-networks#quantum-3-0"><em>Qiskit’s Quantum Machine Learning Course.</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ec324ace851" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Quantum Portfolio Optimizer with IBM’s Qiskit]]></title>
            <link>https://medium.com/@samaybhagat/building-a-quantum-portfolio-optimizer-with-ibms-qiskit-c39f3a8810f4?source=rss-fbd0e14b51ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/c39f3a8810f4</guid>
            <category><![CDATA[quantum-finance]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <dc:creator><![CDATA[Samay Bhagat]]></dc:creator>
            <pubDate>Fri, 03 Feb 2023 18:37:58 GMT</pubDate>
            <atom:updated>2023-02-03T18:37:58.186Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KBz8QOPYFyB-JSeU.jpg" /><figcaption>Monte Carlo; one of Europe’s biggest gambling hubs</figcaption></figure><p>In the late 1940s, John von Neumann and Stanislaw Ulam developed what’s now considered the modern version of the <em>Monte Carlo Method.</em></p><p>Named after a renowned casino in Monaco, the mathematical technique was intended to be used to estimate the possible outcomes of an uncertain event and improve general decision-making.</p><p>Today, however, the method is employed in a variety of different disciplines. These simulations have been intensively used specifically in the field of <em>finance</em>, to help predict stock behavior and aid portfolio managers.</p><p>Here’s the issue though; Monte Carlo, and many other financial simulations have their fair share of drawbacks, and often prohibit financial analysts from establishing holistic conclusions about future asset trends.</p><p>Computational cost, for instance, has proved to be a recurring issue. Monte Carlo simulations can be technologically expensive, especially for complex models or large datasets. This can limit the ability to evaluate many different possibilities or to use high-resolution models. The process of running these simulations can also be time-consuming, thus slowing the speed at which predictions can be made.</p><p>In recent times, however, many technological developments have enabled analysts to understand financial trends with increased flexibility. Quantum computers, for one, allow users to synthesize and analyze large amounts of information at exponentially higher rates than their classical counterparts.</p><p>That sounds pretty neat, no?</p><p>Most quantum researchers would agree. Quantum Finance is becoming an increasingly popular field for exploration, as it has the potential to re-engineer finance as we know it.</p><h4>Building a Portfolio Optimizer with VQEs</h4><p>Using IBM’s Qiskit, I decided to delve into this intersection myself by building a <a href="https://github.com/samaybhagat/portfolio-optimizer">VQE-driven quantum portfolio optimizer.</a> If you’re interested in hearing an auditory explanation of my code, check out the YouTube walkthrough I’ve linked below. If not, feel free to keep reading to learn more about this process!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FfTbyzj8Ny4A%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfTbyzj8Ny4A&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FfTbyzj8Ny4A%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e0097693f2f258c183c3ed58dcdad2ca/href">https://medium.com/media/e0097693f2f258c183c3ed58dcdad2ca/href</a></iframe><h4>1. Importing libraries and modules!</h4><pre># initialization<br><br>import numpy as np<br>import matplotlib.pyplot as plt<br>import datetime <br><br># importing qiskit tools<br><br>from qiskit import Aer<br>from qiskit.algorithms import VQE, NumPyMinimumEigensolver<br>from qiskit.algorithms.optimizers import COBYLA<br>from qiskit.circuit.library import TwoLocal<br>from qiskit.utils import QuantumInstance<br>from qiskit_finance.applications.optimization import PortfolioOptimization<br>from qiskit_finance.data_providers import RandomDataProvider<br>from qiskit_optimization.algorithms import MinimumEigenOptimizer<br>from qiskit_optimization.applications import OptimizationApplication<br>from qiskit_optimization.converters import QuadraticProgramToQubo</pre><p>Before we get into anything technical, we must initialize our algorithm and import the necessary tools. This entire process was made possible thanks to resources from <em>Qiskit Finance, </em>and it’s referenced throughout the entirety of the code.</p><p><em>‘PortfolioOptimization,’ </em>for instance, is imported from the module <em>‘</em><strong><em>qiskit_finance.</em></strong><em>applications.optimization,’</em> and enables users to specify key parameters for randomly generated stocks we’ll reference later on, like the covariance matrix, budget constraint, and more.</p><p><em>Note: In case it isn’t already obvious, these libraries and modules are vital to the code!</em></p><h4>2. Generation of random data for assets (stocks)</h4><pre># establishing the number of assets (same as # of cubits)<br><br>num_assets = 4<br>seed = 987</pre><p>Now, we need to generate the hypothetical financial data that we’re going to play around with. This’ll later be fed into our portfolio optimizer when we’re identifying what the optimal asset selection is.</p><p>The code above establishes our number of assets (which happens to be the same as the number of qubits we’ll use) along with something called a <em>‘seed.’</em></p><p>For some context, think <strong>Minecraft 🧱⛏.</strong></p><p>When you’re making a new world, you have the option to enter a random seed. Your friends can then enter the same seed if they want to play on the same map on their devices, albeit individually.</p><p>In our code, this seed is used to initialize the ‘<em>RandomDataProvider</em>’ below so that every time the number ‘<strong>987</strong>’ are entered, the same financial data will be produced.</p><pre># select randomly generated data through RandomDataProvider<br><br>stocks = [(&quot;TICKER%s&quot; % i) for i in range(num_assets)]<br>data = RandomDataProvider(<br>    tickers=stocks,<br>    start=datetime.datetime(2021, 1, 1),<br>    end=datetime.datetime(2021, 1, 30),<br>    seed=seed,<br>)</pre><p>‘<em>RandomDataProvider</em>’ allows us to use the previously established variables and generate our stocks within a timeframe of 30 days. This same data is then stored under a variable called, ironically enough, <strong><em>data.</em></strong></p><h4>3. Establishing a Portfolio Optimization Problem Instance</h4><p>The production of this <em>data, </em>however, is just a means to an end. Rather, its true purpose is to help develop a portfolio optimization problem instance (which gets us closer to finding our optimal asset selection).</p><pre># calculate expected return and covariance from generated data<br><br>data.run()<br>ER = data.get_period_return_mean_vector()<br>cov = data.get_period_return_covariance_matrix()<br><br># establishing parameters for optimizer<br>rf = 0.5  <br>budget = num_assets // 2   </pre><p>To establish a PO problem instance, however, we need to first identify a couple of other variables. In the first section above, we’re essentially calculating and storing the mean return vector and covariance matrix for the period of our stocks. This, along with the <em>risk factor </em>(rf) and <em>budget, </em>is then fed into the ‘<em>PortfolioOptimization</em>’ command below.</p><pre># establishing a PO problem instance &amp; converting to a quadratic program<br><br>portfolio = PortfolioOptimization(<br>    expected_returns=ER, covariances=cov, risk_factor=rf, budget=budget<br>)<br>qp = portfolio.to_quadratic_program()<br>qp</pre><p>Once the portfolio optimization problem instance is established, it’s then converted to a quadratic program. This is especially important since this conversion enables our information to later be processed with quantum computers.</p><h4>4. Establishing Functions to Print Optimization Results</h4><p>To work ahead, we can now start setting the print result up before running the quantum optimizer itself.</p><p>As seen in the following code, an output is essentially prepared in which the optimal selection, along with its value of the objective function, will be printed.</p><pre># organizing print results<br><br>def print_result(result):<br>    selection = result.x<br>    value = result.fval<br>    print(&quot;Optimal: selection {}, value of obj func {:.4f}&quot;.format(selection, value))</pre><p>The next part below is a little more tricky. When we’re printing our final result (in the form of a chart, since we have a variety of different possible optimal selections), 3 pieces need to be accounted for — the selection itself, the objective function, and the <strong><em>probability</em></strong>.</p><p>This ‘probability’ essentially refers to the chance of each asset allocation being the optimal choice, and the process in which it’s calculated is what the code below is doing.</p><p>Essentially, the first few lines retrieve the <strong><em>eigenstate </em></strong>of our stock data. In this specific case, the eigenstate refers to the optimal solution to the portfolio optimization problem encoded in a <strong><em>quantum state</em>.</strong></p><p>This is really important because if this information isn’t in a quantum state, it can’t be computed with quantum computers.</p><p>Then, the eigenstate goes through a couple of extra steps and is converted to the probability we’ll later see.</p><pre>eigenstate = result.min_eigen_solver_result.eigenstate<br>    eigenvector = eigenstate if isinstance(eigenstate, np.ndarray) else eigenstate.to_matrix()<br>    probabilities = np.abs(eigenvector) ** 2<br>    i_sorted = reversed(np.argsort(probabilities))</pre><p>The last step of the print organization, however, is establishing what our output table will look like.</p><p>In the second line of the code below, we’re establishing the 3 integral parts I referenced earlier as titles. The next lines calculate all the objective values and facilitate the layout of the selections, these same values, and probabilities into the chart.</p><p><em>For a sneak peek of what the final table looks like, scroll to the bottom!</em></p><pre>print(&quot;\n----------------- results ---------------------&quot;)<br>    print(&quot;selection\tvalue\t\tprobability&quot;)<br>    for i in i_sorted:<br>        x = index_to_selection(i, num_assets)<br>        value = QuadraticProgramToQubo().convert(qp).objective.evaluate(x)<br>        probability = probabilities[i]<br>        print(&quot;%10s\t%.4f\t\t%.4f&quot; % (x, value, probability))</pre><h4>5. Calculating the Optimal Asset Selections using VQE</h4><p>Now, since we’ve done the background initialization for the print result, we can run the optimization algorithm.</p><pre># using vqe to find optimal asset choices<br><br>from qiskit.utils import algorithm_globals<br><br>algorithm_globals.random_seed = 9876<br>backend = Aer.get_backend(&quot;statevector_simulator&quot;)</pre><p>The code above uses <em>‘qiskit.utils.algorithm_globals’</em> to set the random seed for the algorithm to 9876. In case you’ve forgotten, the use of a <em>seed </em>enables algorithms and data to be reproducible by anyone (yourself included)!</p><p>Then, it establishes the ‘backend,’ that we’ll use. In quantum computing, the backend refers to the physical quantum processor or simulator that’s employed to execute quantum circuits.</p><p>A backend can be a real quantum computer, such as those provided by IBM, Rigetti, or Google, or it can be a simulator, such as the <em>‘statevector_simulator.’</em> In this situation, it’s the latter.</p><pre>cobyla = COBYLA()<br>cobyla.set_options(maxiter=500)<br>ry = TwoLocal(num_assets, &quot;ry&quot;, &quot;cz&quot;, reps=3, entanglement=&quot;full&quot;)<br>qi_VQE = QuantumInstance(backend=backend, seed_simulator=seed, seed_transpiler=seed)<br>vqe_mes = VQE(ry, optimizer=cobyla, quantum_instance=qi_VQE)<br>vqe = MinimumEigenOptimizer(vqe_mes)</pre><p>Now, we begin employing the <em>‘TwoLocal Variational Form.’</em> In the context of the VQE algorithm, this is used to create a quantum circuit whose output state has the solution to the optimization problem.</p><p>In this same quantum circuit, the ry and cz quantum gates are used in conjunction with a classical optimizer, COBYLA. This gives us our VQE algorithm, since VQEs are quantum-classical hybrid machines.</p><p>Finally, an instance of MinimumEigenOptimizer is created with the VQE algorithm; this allows the quadratic program we converted earlier on to be solved.</p><h4>6. Printing the Results</h4><p>Once the solution is stored in a variable, this can be printed to display the results chart.</p><pre>result = vqe.solve(qp)<br><br># printing optimization results from VQE<br><br>print_result(result)</pre><pre>Optimal: selection [1. 0. 1. 0.], value of obj func -0.0007<br><br>----------------- results ---------------------<br>selection	value		probability<br> [1 0 1 0]	-0.0007		0.8891<br> [1 1 0 0]	0.0385		0.0645<br> [0 1 0 1]	0.0410		0.0405<br> [0 0 1 1]	0.0024		0.0048<br> [1 0 0 1]	0.0050		0.0006<br> [1 1 0 1]	1.0911		0.0002<br> [0 1 1 1]	1.0905		0.0001<br> [0 1 1 0]	0.0377		0.0000<br> [1 0 0 0]	1.0501		0.0000<br> [0 1 0 0]	1.0867		0.0000<br> [0 0 0 1]	1.0532		0.0000<br> [0 0 0 0]	4.1967		0.0000<br> [0 0 1 0]	1.0474		0.0000<br> [1 1 1 1]	4.2391		0.0000<br> [1 1 1 0]	1.0880		0.0000<br> [1 0 1 1]	1.0527		0.0000</pre><p>As we can see above, our optimal asset selection is <em>[1, 0, 1, 0]</em>, with an objective function of -0.0007. The probability of this choice is also displayed in the chart, along with the rest of the possibilities.</p><p>When we compare this with a print result produced using solely classical means (<em>‘NumPyEigensolver’</em>) …</p><pre># printing optimization results NumPyMinimumEigensolver (classical method)<br><br>mes = NumPyMinimumEigensolver()<br>eigensolver = MinimumEigenOptimizer(mes)<br><br>result = eigensolver.solve(qp)<br><br>print_result(result)</pre><pre>Optimal: selection [1. 0. 1. 0.], value of obj func -0.0007<br><br>----------------- results ---------------------<br>selection	value		probability<br> [1 0 1 0]	-0.0007		1.0000<br> [1 1 1 1]	4.2391		0.0000<br> [0 1 1 1]	1.0905		0.0000<br> [1 0 1 1]	1.0527		0.0000<br> [0 0 1 1]	0.0024		0.0000<br> [1 1 0 1]	1.0911		0.0000<br> [0 1 0 1]	0.0410		0.0000<br> [1 0 0 1]	0.0050		0.0000<br> [0 0 0 1]	1.0532		0.0000<br> [1 1 1 0]	1.0880		0.0000<br> [0 1 1 0]	0.0377		0.0000<br> [0 0 1 0]	1.0474		0.0000<br> [1 1 0 0]	0.0385		0.0000<br> [0 1 0 0]	1.0867		0.0000<br> [1 0 0 0]	1.0501		0.0000<br> [0 0 0 0]	4.1967		0.0000</pre><p>… The following data is produced.</p><p>Technically, the optimal selection’s the same. The issue, however, is that the probability distribution is severely lacking. The optimal selection is displayed with a probability of 100%, and the rest with 0%.</p><p>Not exactly ideal. As such, the superiority that VQEs hold over classical means in this situation are pretty clear.</p><h4>Final Thoughts!</h4><p>So what does this mean for you and me?</p><p>As it currently stands, not too much.</p><p>It’s important to understand that this portfolio optimizer used randomly created data with a time frame from 2021. That isn’t very useful for current financial analysts hoping to look into current and future trends.</p><p>However, the potential of quantum computing has yet to be fully actualized, and we still have a long way to go. So, who knows? Soon enough, we may be entirely reliant on quantum to manage our assets.</p><p><strong><em>Only time will tell!</em></strong></p><blockquote>Hey; my name’s Samay! I’m a high school student interested in exploring the world around me, and in the present moment, I’ve taken an interest to quantum computing and its applications. If you enjoyed reading my article, make sure to join my <a href="https://mailchi.mp/38a52102956b/samays-monthly-updates">monthly newsletter</a> and add me on <a href="https://www.linkedin.com/in/samaybhagat/">LinkedIn</a> to keep up with any new projects and updates! Feel free to also email me at samaybhagat@gmail.com if you’re looking to connect!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c39f3a8810f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Rollercoaster of Experiences: TKS Global Virtual Hackathon]]></title>
            <link>https://medium.com/@samaybhagat/a-rollercoaster-of-experiences-2022-tks-global-virtual-hackathon-daf861970f4a?source=rss-fbd0e14b51ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/daf861970f4a</guid>
            <category><![CDATA[clean-water]]></category>
            <category><![CDATA[hackathons]]></category>
            <dc:creator><![CDATA[Samay Bhagat]]></dc:creator>
            <pubDate>Mon, 07 Nov 2022 00:40:52 GMT</pubDate>
            <atom:updated>2022-11-07T00:45:39.312Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*IZ0fNdqy403c0W4JB2WCIg.png" /><figcaption><em>Killify: Using Transgenics to Revolutionize the Clean Water Industry</em></figcaption></figure><p>Meet <em>Killify, </em>the project that my team and I pitched to a panel of judges from a variety of businesses around 24 hours ago. In the end, we ultimately won the <em>Elon Award; </em>indicative of the large impact of our initiative. However, before I jump to some of my takeaways, let’s rewind to Thursday, October 3rd, when it all began with the following problem statement:</p><blockquote>Using an <strong><em>existing technology that has come out in the last 3–5 years</em></strong>: create a solution that solves a problem or creates an interesting future.</blockquote><p>Not the regular hackathon problem statement, unfortunately. On the contrary, our team found that it was immensely vague — so vague in fact that, for the first few hours, we were quite dumbfounded.</p><p>After discussing a bit, we came to terms with the fact that we should probably begin by selecting a pre-existing issue.</p><p><strong>Phase One: Brainstorming</strong></p><p>Unfortunately, this also happened to be the most difficult step in the hackathon process.</p><p>To delve a little more into specific problems, we began to look into the UN’s Sustainable Development Goals. After some further research, all of us agreed that we wanted to look into improving <em>clean water accessibility; </em>aligning with the UN’s goal <strong>#6</strong>.</p><p>So, we’d picked a problem. What next? How do we actually deal with it?</p><p>Once again, the 4 of us were forced to split off into individual spirals of research. However, this wasn’t all in vain. Soon enough, one of our members returned with an exceptionally interesting concept — the same concept we would end up using for our final pitch.</p><p>Across the world, millions of people lack access to clean water. Their homes may be surrounded by rivers and other water bodies, but so many of these have been excessively polluted with industrial waste to the point at which it becomes undrinkable.</p><p>Efforts have been made to revitalize these dead rivers, but most have either been too expensive or have fallen victim to governmental restrictions due to political lobbying.</p><p>So… what if we could use nature itself to bring these water bodies back to life?</p><p>Introducing: Killify. Our concept is all about using plants with filtration capabilities (sugar rush, water mint, etc.) and genetically modifying them to be able to survive in normally inhabitable and toxic environments. We planned to achieve this by injecting such plants with the genetic code of <em>Killifish. </em>Unlike others, these fish have evolved to be able to survive toxicity levels that would normally be considered extremely dangerous.</p><p>By combining the capabilities of Killifish who are <em>super good</em> at surviving in toxic habitats with plants that are <em>super good</em> at cleaning habitats, we could create organisms that are <em>super good</em> at doing both.</p><p>The result? The creation of entirely new water bodies across the globe that can support both aquatic biodiversity and humans who require clean drinking water.</p><p>Although this brainstorming process sounds pretty straightforward when I’m explaining it… it wasn’t. By the time we finally came up with this, <strong>6 and a half hours </strong>had passed from the release of the problem statement. At this point, it was 1 AM in my timezone (EST), so I decided I’d head to bed and connect with my two other team members who could keep working the following morning. Right before I set my alarm for 7 AM, our team decided to take a picture to track our progress.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XDyfl6FXOy5QgOcV.png" /><figcaption>Madhav, Rudransh, Samay, and Timothy (from top left to bottom right)</figcaption></figure><p><strong>Phase Two: Research + Beyond</strong></p><p>The following day (November 4) was spent entirely on research. Without going into specifics, this actually proved to be a <strong>really interesting process</strong>. One of our team members lives right beside the <em>Yamuna River </em>in New Delhi, and told us about his experiences in dealing with its excess pollution. The river once had the potential to be a drinking source for many, but now, all that’s left is a water body that’s been drained of all of its habitability.</p><p>Along with learning about this experience, this day was also especially enjoyable as it allowed the 4 of us to get to know one another significantly better. Before the hackathon, we’d spoken occasionally, but nothing more than the occasional call-out to each other in a Zoom call.</p><p>Soon enough, this changed entirely. Working with my teammates was actually <strong>fun, </strong>and I genuinely didn’t mind putting in the hours toward our project. We cracked jokes to lighten the mood, covered each other with the workload, and all grinded towards the end product. The whole process was grueling, draining, and sleep-exhaustive, but it was all worth it because of these three guys.</p><p>During this time, I also got to learn a lot more about the science behind transgenics (the alternation of genes through the transfer of foreign DNA). Truthfully, I’ve never been big on biology. I always assumed that since my memorization skills are through the dirt, I’d never be fit to look into it anyways.</p><p>I could never have been so wrong.</p><p>Now, I still stand by my point about my memorization skills. I also still stand by the fact that I probably won’t pursue something biologically-related in the future (although this may change)! However, completely refusing to look into the field was probably one of the dumbest decisions I could have ever made.</p><p>Learning more about genomics and the Killifish’s biological capabilities was one of the most interesting things I’ve ever dealt with. During the entire process, the following words wouldn’t stop echoing in the back of my mind:</p><blockquote>“What if?”</blockquote><p>The possibilities of applying the Killifish’s survivability in other contexts were endless. And I’d never thought to look into these possibilities in the past because, well, “my memorization skills are through the dirt!”</p><p>Honestly, I was an idiot.</p><p>This realization was well-needed, and as the day passed, I delved further into the science behind plants with filtration capabilities. Interestingly enough, I learned that the reason Killifish can survive in toxic aquatic environments is because many substances like PAH and PCB can bypass a regular organism’s system to deal with pollutive substances. This system is called the <em>AHR Pathway </em>and produces enzymes to combat toxic material. However, if the pathway is bypassed, excess enzymes are produced, leaving the organism defenseless to its own defense mechanisms. Neat, right?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IPtMc6nYNcAQIrCw" /><figcaption>Image of the Killifish</figcaption></figure><p><strong>Phase Three: Proposal Submission</strong></p><p>Soon enough, the last day had finally arrived. On Saturday, November 5th at 12:12 PM EST, I submitted our team’s 1-minute pitch of our idea. This would be the key that would decide whether we’d progress onto the next stage — the stage where we get to present to industry professionals.</p><p>All of us were stressed, but… there wasn’t anything we could do until 2:30 PM when the top 10 qualifiers would be released.</p><p>So… we started playing Minecraft!</p><p>Personally, I hadn’t played in <strong>years, </strong>so this experience in itself was just crazy. It practically felt like a trip down memory lane, and I got to revisit some super old experiences from so many years ago.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X9DBT2rYIMDt61jmzr6GXg.png" /></figure><p>However, at 1:28 PM, in the middle of a minigame, we received a private message from our TKS Director letting us know that we had <strong>progressed onto the next round! </strong>All those hours grinding had paid off — we’d made it. Although we were super excited, our celebration didn’t last for too long since we realized we still had some fine-tuning left to do.</p><p><strong>Phase Four: Presentation</strong></p><p>For the next few hours, we all joined a call and reviewed everything we’d placed out for our presentation. We also made sure to plan out a variety of hypothetical questions so that we could prepare for the absolute worst. In the end, we all felt pretty good about where we were at and were excited about the final presentation!</p><p>Then, at 4 PM, the time to present to the judges had come.</p><figure><a href="https://docs.google.com/presentation/d/17V5_RbxYAmh80pABTJ5-mYUe_l2gtcCJDAsw8q2H9uQ/edit#slide=id.g18329d68279_7_30"><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p0VsI64bpwC0f7_N" /></a><figcaption>Click the image to be redirected to our slideshow!</figcaption></figure><p>In the end, our team was selected for the <em>Best Impact </em>award. After speaking with our director, we later discovered that we’d actually <strong>tied </strong>the winning team in scores, and the final decision ultimately tipped in their favor. However, it was really interesting to hear some perspectives from all of the judges. One in specific mentioned how she’d grown up in rural Nigeria, and this was a real concern that she’d witnessed during her youth. Although the project was intended to simply be somewhat of an ‘ideathon,’ this really put things into perspective of how dire situations are for many across the globe.</p><p>This also happened to be my first hackathon, but the experience was unforgettable. I’m so grateful that I got to work with the people I did, and in the end, I got to walk away with 3 new super dope friends. The hackathon in itself was undoubtedly a <strong>rollercoaster </strong>of experiences, but like most amusement rides, although you might be terrified during the process itself, once you’re off, you’re starving for more.</p><p>So, although the story of <strong><em>Killify </em></strong>may end here, I’m excited to see what’s in store for the clean water industry moving forward. Maybe the Killifish really will end up being the key to cleaning water bodies — only time can tell!</p><p><strong>Key Takeaways:</strong></p><ul><li><strong>Efficient brainstorming is key.</strong> If your idea isn’t rock-solid from the ground up, it’s just a matter of time until everything comes falling down.</li><li><strong>Rest is important.</strong> It’s definitely difficult to manage your workload at times, but you have to ensure you’re taking care of yourself, or none of it will matter.</li><li><strong>Done &gt; Perfect.</strong> Perfectionism is a difficult flaw to combat, but to truly succeed, you must come to terms with the fact that ultimate perfection <strong>does not exist</strong>.</li></ul><p><em>If my article piqued your curiosity, make sure to connect with me on </em><a href="https://www.linkedin.com/in/samay-bhagat-198236219/"><em>LinkedIn</em></a><em>! To keep up to date with everything else I’m doing, you can also sign up for my monthly </em><a href="https://mailchi.mp/38a52102956b/samays-monthly-updates"><em>newsletter</em></a><em>! Thanks for reading!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=daf861970f4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Portfolio Optimization: Is Quantum Computing the Key to Quickly Becoming Rich?]]></title>
            <link>https://medium.com/@samaybhagat/portfolio-optimization-is-quantum-computing-the-key-to-quickly-becoming-rich-e7c5941a05c4?source=rss-fbd0e14b51ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7c5941a05c4</guid>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[money]]></category>
            <category><![CDATA[quantum-finance]]></category>
            <category><![CDATA[portfolio-management]]></category>
            <dc:creator><![CDATA[Samay Bhagat]]></dc:creator>
            <pubDate>Thu, 03 Nov 2022 04:47:05 GMT</pubDate>
            <atom:updated>2022-11-03T04:48:43.154Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VMPL5roZEBH6osDS.jpeg" /><figcaption>Image Credit: SmartBrief</figcaption></figure><p>Picture this: You’re running low on money, and one of your friends has recently told you about huge profits they’ve made in their portfolio. You’re interested in delving into the field yourself, but… where do you even start? From what you’ve heard from your friend, the entire process seems to require extensive research and time commitments. So, with little knowledge, how are you expected to differentiate between desirable investments and those that are destined to fail?</p><p>What if I told you the key to maximizing your investment returns lies in a new and emerging technology — quantum computing?</p><p>The intersection between quantum computation and finance isn’t discussed often, but does exist. Let’s break down the basics.</p><h4><strong>Quantum Computation: What’s it all about?</strong></h4><p>What does the word quantum mean to you? When I hear the term, the first thing that comes to mind is the Ant-Man franchise (patiently waiting for the next movie). Although it is undoubtedly much more, this connection isn’t necessarily wrong. ‘Quantum’ essentially deals with the exceptionally small, or anything on a subatomic scale. To comprehend how this concept ties into computers, we must understand more about the history of computation — beginning with the <em>microchip</em>.</p><p>Microchips are employed in almost all pieces of technology that we utilize on a regular basis. These chips contain smaller components called <em>transistors</em>, which facilitate the flow of the current (thus allowing devices to operate).</p><p>In 1965, American engineer Gordon Moore made the observation that every two years, the average number of transistors on a microchip would double, due to developments in computational science. This eventually came to be known as <em>Moore’s Law</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*jroBapU2LwEnXNbf.png" /><figcaption>Graphical Illustration of <em>Moore’s Law</em></figcaption></figure><p>Here’s where the issue lies. As time has passed, engineers have found that Moore’s Law is becoming obsolete; transistors can only get so small! In the last 10 years, the rate at which transistors are found in microchips has begun to largely decrease.</p><p>That’s where quantum physics comes into the picture.</p><p>When matter becomes exceptionally small, it doesn’t operate in the same manner that regular objects do. As things significantly reduce in size, they abide by completely different rules — rules that are outlined in <em>quantum theory</em>.</p><p>Quantum Computation is all about taking advantage of these new rules to enable humans to reach new technological advancements. Classical computers (the devices we use on a day-to-day basis) are useful in specific contexts, but in situations where we must simulate many possibilities, they lose applicability quite fast. So, what makes quantum computers more competent in dealing with these situations? In order to comprehend this, we must first understand how quantum tech operates, beginning with the Boolean system.</p><h4>Dismantling the Binary</h4><p>Classical computers employ <em>bits </em>in order to operate and process information. These bits manifest through 0s and 1s and allow computers to send and receive information.</p><p>Quantum computers, on the other hand, don’t use this binary system. Instead, they use <em>qubits </em>(short for <em>quantum bits</em>)<em>,</em> which can exist in a superimposed state between 0 and 1. In simple terms, this essentially means that qubits can be both 0 and 1 at the exact same time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*jzoFR8iUr88Vqn68" /></figure><p>Ever heard of Schrodinger’s cat? It’s a thought experiment that conceptualizes this idea quite well and makes the functioning process of qubits easier to digest. In simplified terms, as Erwin Schrodinger explained, if you place a cat in a box and expose it to a mechanism that has a 50% chance of killing it in an hour, what happens once the clock runs out? Simple logic would suggest that the cat is either dead or alive. Schrodinger, on the other hand, proposed that the instant before the box is opened, the cat exists in a state of both life and death. It’s only when the box is opened, that we’re forced to see one of these states. Until then, it’s just a blur of probability.</p><p>Quantum objects exude this exact behavior, through a principle called <em>superposition</em>. They exist in two states at once, until they are observed, in which case they conform to one. Like the cat experiment, before being observed, qubits exist in sets of probabilities. When observed, the qubit will represent itself based on the probabilities of its superposition.</p><p>You’re probably wondering, <strong>how is any of this information useful?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*sjZNNmfFX2NRlLqwbEDf7Q.png" /></figure><p>Interestingly enough, processing power is where the answer lies. Using superposition, an <em>n </em>number of qubits can express the same information as a 2^<em>n</em> number of regular bits would. As <em>n </em>increases in value, the computational power that quantum devices can operate at increases exponentially relative to their classical counterparts. For example, a mechanism using 300 qubits can reflect <strong>more states than there are atoms in the observable universe! </strong>This allows computers to combat issues that would normally be quite computationally taxing (like large-scale optimization) since more states allow more operations to be completed at once.</p><p>As it currently stands, D-Wave (a Canadian-based quantum computing company) holds the throne with its quantum annealer (type of quantum computer) based in Germany, employing more than <em>5000 </em>qubits at once.</p><p>You’re probably curious — <strong>so what?</strong> Well, as we’re able to create more qubits, reaching <em>quantum supremacy </em>in a variety of industries becomes less of a possibility and more of a reality. Increasing the accessibility of quantum will enable corporations to revitalize their business models and provide services to their customers with better scalability, speed, and efficiency.</p><p>As the idea garners more popularity, a variety of companies have begun to realize the potential of quantum computing. Many corporations are investing in the technology in the hopes that they will be able to reach quantum supremacy themselves and apply the technology in a variety of real-life contexts. Although the industry is currently spearheaded by giants like IBM and Google, competition is intensifying as more learn about quantum computation.</p><h4>How does this tie into Portfolio Optimization?</h4><p>With that said, as one can probably assume, quantum computing has dozens of applications in the real world. Portfolio Optimization, an up-and-rising example, essentially refers to the process of selecting the best assets and investments from a larger pool being considered. The goal of this process is to essentially ensure that one can acquire the highest amount of profits with reasonable risk tolerance. After all, who wants to bare losses?</p><p>With that said, there are many factors to be considered in a portfolio. Liquidity, time to maturity, respective risk, and prospective returns are just a couple that comes to mind. As such, all assets (stocks, bonds, etc.) within the pool are assigned a <em>weight </em>in order to reflect these factors.</p><p>The issue, however, lies in how, as the number of these factors begins to grow, the variables controlling how much the portfolio should invest in different assets also grows. This makes it quite easy for things to spiral out of control. Moreover, Monte Carlo simulations — the most popular classical technique to understand risk and uncertainty in financial models — have large scalability issues as well. As such, the concern of optimizing this process becomes increasingly important.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/0*-qeO4VEWjb6NXrH2.png" /><figcaption>Visualization of a VQE circuit</figcaption></figure><p><em>Variational Quantum Eigensolvers </em>(VQEs) can make this process significantly easier. They are essentially quantum algorithms that have many applications in simulations, and, big surprise, optimization problems!</p><p>A VQE is a hybrid algorithm that uses both classical and quantum computers with the intention of finding the <em>ground state </em>of a specific system. Although this term overarchingly refers to the state of lowest cost/energy, in the context of portfolio optimization, this would connect with identifying the assets with the best returns and lowest risk (in simplified terms).</p><p>Here’s the thing; as mentioned earlier, there are a lot more parameters to consider when evaluating a portfolio (liquidity, etc.). In the regular optimization problem, you’d essentially want to <em>minimize your cost function </em>(the chance of error in your model). This is simple when you’re examining how one parameter (ex. interest rates) may correlate with cost since the relationship exists on a 2D plane.</p><p>However, things get very complicated as more parameters are introduced into the picture. Optimizing for the lowest cost when you have 10 or even 20 different parameters to evaluate becomes very chaotic. How could you even plot a twenty-dimensional level graph? (hint: it’s not possible)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*QasT_B7hfQ1xUCNA.png" /><figcaption>Image Credit: Frank Zickert</figcaption></figure><p>VQEs can get around this issue entirely. In simplified terms, with its initial context, the VQE begins by producing an <em>ansatz </em>(German for <em>approach; </em>essentially means educated guess) of the optimal cost. Then, the quantum optimizer in the VQE evaluates the lowest cost by referencing the <em>Hamiltonian </em>and the previously generated ansatz<em>.</em></p><p>The Hamiltonian, in this context, essentially refers to the problem at hand (with all financial parameters considered) summarized in the form of a mathematical matrix. Instead of trying to generate a multi-dimensional graph, and, well, creating that <em>cataclysm </em>shown in the image above, a matrix can do the trick and be easily processed by quantum technology.</p><p>The findings from the quantum optimizer are then fed into the classical optimizer to improve the guess (since VQEs are composed of both). This cycle repeats until the optimal state of the cost function is found, or, in our situation, the best investments are identified.</p><h4>Optimizing the Optimization Process</h4><p>So, VQEs allow the process of portfolio optimization to operate a lot smoother. As the number of parameters increases, classical computers become less competent to deal with these types of problems. Is that the extent of the difference between quantum and classical finance<strong>?</strong></p><p>Simply put, <strong>no</strong>. There are quite a few more ways that VQE processes can be further optimized that has already been tested!</p><p>For example, <em>standard mean optimization</em> is a process that allows us to optimize the weighted average of the portfolio function. This process is used in most classical optimizers, but it isn’t all that useful. If anything, there is more value in optimizing the lowest-found portfolio function value. By replacing standard mean optimization with CVaR optimization (conditional value at risk: another optimization process), we can achieve exactly that.</p><p>Here’s the twist; regular classical computers can’t handle CVaR optimization. However, as we previously mentioned, VQEs are hybrid algorithms that use both classical and quantum technology, allowing them to benefit from this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/0*eEJgHapIhZSDmKyP.png" /><figcaption>VQE refers to a regular VQE algorithm employing standard mean optimization (blue line); α-VQE refers to VQE algorithms using CVaR optimization (red line)</figcaption></figure><p>As can be seen in the illustration above, the optimal solution weight drops significantly for a regular VQE algorithm as the number of assets in the portfolio increase. For α-VQE, on the other hand, efficiency remains quite consistent.</p><p>Keep in mind that this is while comparing two different algorithms that leverage quantum technology to different extents. Imagine what the gap would be if we were to compare this to the performance of a classical computer!</p><h4>What does this mean for financial institutions?</h4><p>As it currently stands, quantum computing is just beginning to be commercialized. It is undoubtedly true that the technology is still in somewhat of a developmental phase, but real-time applications in financial institutions aren’t as far as one may initially assume. JP Morgan, a US-based investment bank, has already begun to explore how to use quantum computers to streamline investments and optimize their returns. They’ve also begun to expand career opportunities internally, creating entirely new roles dedicated to exploring quantum in-depth.</p><p>One issue that many financial institutions are currently facing is that the cost to hold quantum computers in-house and have them run solely for their companies is <strong>very expensive</strong>. This makes it especially difficult for smaller businesses to remain competitive with these new initiatives and implement quantum methodologies into their own business models.</p><p>However, many experts have begun to predict that in the next few years, as demand grows, the production costs for these computers will decrease. The commercialization of quantum tech is also expected to become more prevalent, so holding in-house quantum computers won’t even be necessary! Not only that, but there are also open-source tools like IBM’s <em>Qiskit </em>that allow businesses to play around with quantum technology first-hand, and further understand its applications within their own business models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BFGFitbUO8LyQmtc" /><figcaption>Image Credit: Financial Times</figcaption></figure><h4>Quantum Computing and Finance: How far does this intersection stretch?</h4><p>Although quantum portfolio optimization is very likely to help investment banks and trading institutions grow, quantum technology can apply within many other contexts in the world of finance.</p><p>For example, the data modeling capabilities of quantum computers far exceed that of their classical counterparts. According to IBM, more than 25% of small to medium-sized financial institutions lose customers simply because their goods and services aren’t catered towards prioritizing the customer experience.</p><p>The worst part is, there’s not much these businesses can do either. It’s resource-draining to make analytical models that can sift through behavioral data quickly — quickly enough to predict what’s needed by customers in real-time. Businesses on the smaller end simply don’t have the means to achieve goals like these.</p><p>However, when quantum computing enters the picture, the possibilities suddenly become endless. For predictive modeling and customer targeting, this technology can be employed to allow businesses of all sizes to learn more about their customers in a matter of seconds. That’s a <strong>game-changer</strong>!</p><h4>What’s next for the consumer?</h4><p>With all things considered, as previously discussed, quantum computation is still very much in a developmental phase.</p><p>However, advancements are rapidly taking place, and we’re much further along than we were 10 years ago. Many financial corporations and banks have already begun to realize the potential of quantum technology, and the rest will likely follow. Soon enough, the allocation of your money may be entirely reliant on the capabilities of qubits!</p><p>Until then, however, it seems that we may need to investigate other ways if we hope to ‘quickly become rich.’ If you’re curious about learning more, IBM’s <em>Qiskit </em>is a great place to start. In fact, there are <a href="https://qiskit.org/documentation/finance/tutorials/index.html">entire tutorials</a> made for people interested in delving into the coding behind quantum finance.</p><p>So, even if the commercialization of quantum computing hasn’t begun on a grand scale, what’s to stop the consumer from learning more about it individually? After all, who doesn’t like the idea of making more money?</p><p>Key Takeaways:</p><ul><li>Quantum Computers abide by very different laws than regular devices, allowing them to approach complex problems completely differently</li><li>The capabilities of quantum computers in terms of large scalability far exceed that of their classical counterparts, especially when dealing with optimization problems</li><li>VQEs are prime examples of how quantum technology has the potential to disrupt the world of finance and change how financial institutions offer their services</li><li>Quantum technology is still in its early phases, and one can only imagine what things will look like on a grander scale</li></ul><p><em>Hey, my name’s Samay! I’m currently a high school student interested in learning more about the unknown and the world around me. At the moment, I’ve taken an interest in quantum computing and its real-life applications. If my article piqued your curiosity, I’d love to have you sign up for my </em><a href="https://mailchi.mp/38a52102956b/samays-monthly-updates"><em>newsletter</em></a><em> to keep up to date with everything I’m doing! Thanks for reading!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7c5941a05c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>