<?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 Kristian Koci on Medium]]></title>
        <description><![CDATA[Stories by Kristian Koci on Medium]]></description>
        <link>https://medium.com/@feeltech_kkoci?source=rss-a1ad6a9ae9f2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*bBUkHaLzVsN0UlCT.png</url>
            <title>Stories by Kristian Koci on Medium</title>
            <link>https://medium.com/@feeltech_kkoci?source=rss-a1ad6a9ae9f2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 07:19:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@feeltech_kkoci/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[Building Alone, Then Not Quite Alone Anymore]]></title>
            <link>https://medium.com/@feeltech_kkoci/building-alone-then-not-quite-alone-anymore-24d613b4ac81?source=rss-a1ad6a9ae9f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/24d613b4ac81</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[solo-founder]]></category>
            <category><![CDATA[startup-lessons]]></category>
            <dc:creator><![CDATA[Kristian Koci]]></dc:creator>
            <pubDate>Tue, 15 Sep 2026 00:01:31 GMT</pubDate>
            <atom:updated>2026-09-15T00:01:31.040Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rrr9SclYDtCJvv1ErOdbpA.jpeg" /></figure><p>I built the first version of this by myself, in under two weeks, for a hackathon. No co-founder, no team, just an idea about trusted execution environments and a stack of academic papers I’d been reading closely enough to actually implement rather than just cite. I’ve written about the technical side of what that turned into, <a href="https://medium.com/@feeltech_kkoci/trust-is-the-real-product-what-building-a-tee-attested-negotiation-protocol-taught-me-about-bb5fd60f5875">the thesis behind it</a> and <a href="https://medium.com/@feeltech_kkoci/what-trusting-the-process-doesnt-tell-you-5cb2d79feb5c">what actually changed after real feedback</a>, elsewhere. This one is about the part that isn’t technical at all.</p><p>What I didn’t expect was how much of what happened next would come down to people I hadn’t met yet, reading something I’d built and deciding it was worth their time.</p><h3>Applying With Something Real, Not Just an Idea</h3><p>I applied to the IC3 Shape Rotator accelerator with a working system, not a pitch deck. That mattered more than I initially realized. Looking back at how the cohort came together, the people who’d arrived through a genuine build, a hackathon submission, something that already ran, had a different starting position than people who’d joined through the broader ecosystem without that forcing function. Nobody had to take my word for what the thing did. They could run it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fADL2NFNGfNycA3P4vYA1g.jpeg" /></figure><h3>The Kind of Feedback You Don’t Get When Nobody’s Checked Your Work Closely</h3><p>Ten weeks in New York, building alongside people whose day job is genuinely research — not “move fast” research, the kind where someone has read the paper you’re implementing more carefully than you have, and will tell you exactly where your implementation is thin.</p><p>That happened more than once. A VC I spoke with pushed hard on a question I didn’t have a clean answer to at the time: if one negotiating agent is meaningfully smarter or better-resourced than the other, is the outcome actually fair, even if the process ran honestly? I didn’t have a good answer in that meeting. I built one afterward, and it changed real architecture, not just my talking points.</p><p>A mentor whose own research the product implements stayed engaged with it well beyond a first look, real code contributions, real pushback, and eventually an invitation into work outside the accelerator entirely. That’s a different kind of validation than a good demo day reaction. It’s someone deciding your work is worth their continued attention after they’ve already seen its rough edges up close.</p><h3>What Actually Got Recognized</h3><p>At the end of the program, projects were scored by a structured committee across several dimensions, not a single subjective read, a cross-checked process. DealProof tied for the highest score in the cohort on research depth, with the committee’s own language citing it as the most complete implementation of the specific academic framework it was built on.</p><p>Separately, and I didn’t expect this part: IC3’s own public account later named DealProof, by name, among a handful of projects that had genuinely incorporated their research into something real, not internally, publicly, where anyone could go check.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*xo__AOPE_2OuYoEG6rUI-Q.png" /></figure><p>I don’t say any of this to be boastful. I say it because it’s the part of building alone that’s easy to discount in advance: you genuinely don’t know whether the thing you built in your bedroom over two weeks will hold up to people who actually know the field. It held up better than I expected, and better than I would have predicted going in.</p><h3>What Solo Actually Means Here</h3><p>I want to be honest about something, because I think it gets romanticized. Building solo didn’t mean building in isolation, it meant being the only person accountable for every decision, while still relying heavily on the people around me to tell me when a decision was wrong. The technical architecture is mine. The direction it took after real feedback, the shift toward external verification, the redesign, the payment infrastructure, came from specific conversations with specific people who took the time to actually engage with what I’d built rather than just wish me luck.</p><p>That’s the part I’d tell anyone considering building something alone: solo doesn’t mean unaided. It means you’re the one who has to go find the people worth being aided by, and then actually listen when they tell you something uncomfortable.</p><h3>Where This Actually Stands</h3><p>The accelerator is over. The research validation is real and already happened. What isn’t settled yet is the harder, more ordinary thing every early product has to prove: not whether the idea is technically sound, but whether real people will actually use it, repeatedly, because it’s genuinely useful to them rather than because it’s clever.</p><p>That’s a different kind of test than the one I’ve already passed, and I’m not going to pretend I know exactly how it goes yet.</p><p>If you’re building something similar, verifiable AI infrastructure, confidential computing, anything where trust is the actual product rather than a feature, I’d like to hear from you. Comparing notes with people further along than me has mattered more to this project than almost anything I built myself.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24d613b4ac81" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Trusting the Process Doesn’t Tell You]]></title>
            <link>https://medium.com/@feeltech_kkoci/what-trusting-the-process-doesnt-tell-you-5cb2d79feb5c?source=rss-a1ad6a9ae9f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/5cb2d79feb5c</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Kristian Koci]]></dc:creator>
            <pubDate>Mon, 14 Sep 2026 01:22:02 GMT</pubDate>
            <atom:updated>2026-09-14T01:28:38.812Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Do7u0-X2QssJ6Bx9xjkCMw.jpeg" /></figure><p>DealProof started as a hackathon build. Two AI agents, negotiating inside a Trusted Execution Environment, with a cryptographic proof at the end showing the negotiation ran honestly. That part worked, and it worked well enough to carry the project into an IC3-backed accelerator. I wrote about the core thesis behind that idea, <a href="https://medium.com/@feeltech_kkoci/trust-is-the-real-product-what-building-a-tee-attested-negotiation-protocol-taught-me-about-bb5fd60f5875">verified negotiation as a general trust primitive</a>, here.</p><p>But a few months of building on it since then surfaced a real gap in the original idea, and fixing it changed the product more than anything else has since.</p><h3>The Post That Changed the Roadmap</h3><p>A researcher I’d been working alongside posted something unrelated to DealProof — an observation about “autonomous discovery” systems in materials science and AI research. Systems like automated chemistry labs that verify their own experimental results, or generative models that score their own novelty. His point: nearly every one of these systems, when checking whether it succeeded, closes the loop on its own internal metric rather than an external, independent measurement. The system grades its own homework.</p><p>That’s not a DealProof problem on its face. But it named, precisely, a gap the product already had.</p><p>The TEE/attestation work proves the negotiation <em>process</em> ran honestly no tampering, hardware-attested, independently verifiable. It says nothing about whether the negotiated <em>outcome</em> was actually good. An attested agreement and a fair agreement are different claims, and the original architecture only ever made the first one.</p><h3>Two External Anchors, Not One More Internal Metric</h3><p>The fix wasn’t more attestation. It was anchoring the outcome to something outside the negotiation itself.</p><p><strong>final_gap_pct</strong> tracks how far the agreed price moved from the counterparty&#39;s actual opening position a number that can&#39;t be gamed by either agent, because the opening offer is set before negotiation even starts. It&#39;s baked into the same attested payload as everything else.</p><p><strong>market_percentile</strong> checks the agreed outcome against real external wage/market data (BLS in the US, ONS in the UK), so there&#39;s an independent answer to &quot;was this reasonable&quot; beyond either agent&#39;s own claim of success.</p><p>Both of these came directly out of that one observation about a completely different field. The lesson generalizes further than either domain: a system that only verifies its own process, however cryptographically rigorous, is still closing the loop on itself if it never checks the outcome against anything external.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E9D5wrp922jEnNp91l4I0w.jpeg" /></figure><h3>A Real Dispute Surface</h3><p>The original roadmap never mentioned this, because the original architecture didn’t have a gap for it yet. Once outcomes had real external anchors to reference, a natural next question appeared: what happens when someone disagrees with the outcome, or believes the process itself was violated?</p><p>The answer is a formal dispute mechanism, split into two types. A <strong>process dispute</strong> claims something went wrong in how the negotiation ran. An <strong>outcome dispute</strong> claims the result itself was bad and is required to cite one of the two attested external fields above, not just an unsubstantiated complaint.</p><p>One design decision mattered more than the mechanism itself: filing a dispute never automatically reopens or reruns anything. It’s a permanent, attested record layered on top of an already-settled outcome evidence a human can act on, not a lever either party can pull to force a free do-over. Coupling disputes to automatic renegotiation would have undermined the entire premise that an attested, agreed outcome is actually settled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UFYaUU7uPCTe8-I4RTAyDw.jpeg" /></figure><h3>From a Hackathon Frontend to an Actual Product</h3><p>The original frontend was a genuine step up from a bare API / React, live polling, an attestation panel that showed its work. It was still, honestly, a hackathon frontend: functional, not something you’d hand to a real user going through a real negotiation.</p><p>The rebuild that followed went through two real design passes before landing anywhere. The first pass fixed the token system palette, type, spacing, but kept a completely generic layout underneath it: centered hero, three feature cards, the exact composition of ten thousand other SaaS landing pages. Swapping colors on a generic composition still reads as generic. The second pass fixed that specifically: asymmetric layouts, a genuine signature element (a radial instrument gauge that shows the live gap between two negotiating parties, styled as an actual analog dial rather than a progress bar), and a visual identity distinct enough to earn its own name internally.</p><p>The gauge itself is worth a specific mention, because it’s not decorative. The same component renders two ways: a static, clearly-labeled illustrative preview on the marketing page, and a fully live instrument on the actual negotiation page, wired directly to the session’s real, current gap percentage. Watching it during a real negotiation, the needle actually moves as rounds progress. That’s the difference between a UI that decorates a product and one that’s honest about what the product is doing in real time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fesv32h2OLXIT6g0dwTi-Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Aaj6QoxvSUzRScE8UERvdA.jpeg" /></figure><h3>Real Payment Infrastructure, and a Bug Worth Admitting To</h3><p>At some point a product stops being a demo and has to actually charge someone. That meant building a real credit system and Stripe integration, checkout, webhooks, a test/live key distinction, an operator grant path for internal use.</p><p>The most useful thing that came out of building this wasn’t the feature. It was a bug, caught during a live end-to-end test rather than a mocked one: a real $125 purchase for 5 credits only granted 1 credit, every time. The webhook handler was trying to reconstruct the purchased quantity from line_items in Stripe&#39;s webhook payload, data that Stripe doesn&#39;t actually inline by default. The fix was straightforward once found (carry the real quantity in the Checkout Session&#39;s metadata instead, and read it back from there), but the bug itself is the more interesting part: it&#39;s exactly the kind of failure a mocked test can never catch, because a mocked payload only ever contains whatever shape the test author assumed. A handful of other real gaps surfaced the same way, no test-mode toggle in the actual registration UI, no way for a candidate-initiated session to attach a company for billing at all, a fully working backend payment endpoint with zero frontend button to trigger it. None of these were visible from reading the code. All of them were visible within minutes of actually running the product live.</p><h3>Where This Leaves the Original Thesis</h3><p>The original framing for DealProof was Arrow’s information paradox, you can’t verify data without seeing it, but seeing it means you’ve already taken it. The TEE work solves the cryptographic half of that: process integrity, verifiable without trusting any intermediary. Proving a process ran honestly and proving an outcome was fair are genuinely different claims, and most trust-focused AI infrastructure right now, not just DealProof’s earlier version, quietly conflates them. The architecture as originally built handles the first claim well. Getting the second claim right required going outside the system entirely: real market data, a real opening-offer anchor, a real, permanently-recorded dispute path.</p><p>The TEE is still the trust layer. But trust in the process and trust in the result turned out to be two separate things to earn, not one.</p><h3>What’s Actually Next</h3><p>I’m not going to name specific roadmap phases here, the last time I laid out a numbered plan publicly, almost none of it survived contact with actually shipping a product, and I’d rather be honest about that pattern than repeat it. What’s genuinely in progress: growing this from a strong technical foundation into something with real usage and real users, which is a different kind of problem than any of the cryptographic work covered above.</p><p>DealProof came out of the IC3 Shape Rotator accelerator having tied for the highest research score in its cohort , a genuinely good outcome for research depth. The next test is a different one entirely.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5cb2d79feb5c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Trust Is the Real Product: What Building a TEE-Attested Negotiation Protocol Taught Me About…]]></title>
            <link>https://medium.com/@feeltech_kkoci/trust-is-the-real-product-what-building-a-tee-attested-negotiation-protocol-taught-me-about-bb5fd60f5875?source=rss-a1ad6a9ae9f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb5fd60f5875</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Kristian Koci]]></dc:creator>
            <pubDate>Fri, 11 Sep 2026 01:36:23 GMT</pubDate>
            <atom:updated>2026-09-11T01:36:23.530Z</atom:updated>
            <content:encoded><![CDATA[<h3>Trust Is the Real Product: What Building a TEE-Attested Negotiation Protocol Taught Me About Verification</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f3Dnlrzt-_1E1oTOaGdbdQ.jpeg" /></figure><p>A few months ago I set out to solve a problem that felt oddly under-discussed for how common it is: two parties negotiating something valuable, neither one able to fully trust what the other is saying, and no good way to verify anything short of hiring a lawyer or just hoping for the best.</p><p>The instance I picked to prove it on was salary negotiation. Everyone understands it, everyone has felt the asymmetry, and it’s small enough in scope to build and demo cleanly. But the more time I spent on the actual architecture, the more I realized salary was never really the point. The point is a much more general question: <strong>can two parties reach a fair, verifiable outcome without either one exposing what they don’t want to expose?</strong></p><h3>The shape of the problem</h3><p>In any negotiation with private information on both sides, you’re stuck choosing between two bad options. Either you disclose more than you’re comfortable with to build trust, or you withhold information and hope the other side is negotiating in good faith anyway. Third-party intermediaries (lawyers, brokers, HR departments) exist largely to paper over this gap, and they’re expensive, slow, and only partially trustworthy themselves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_yJ3ZU6GvnR_sbY-aWAhXg.jpeg" /></figure><p>What I built, DealProof, takes a different approach: two AI agents negotiate on behalf of each party inside a confidential compute enclave (a Trusted Execution Environment, specifically Intel TDX). Neither side’s private numbers ever leave the enclave. Neither the platform, nor the other party, nor even I as the operator can see them. At the end, the enclave produces a cryptographic attestation, a hardware-backed proof that the negotiation ran exactly as specified, with no tampering by either party or by the infrastructure itself.</p><p>This is the same underlying principle behind Kerckhoffs’s principle in cryptography: you shouldn’t have to trust a system because you’re told to. You should be able to verify it. Most negotiation infrastructure today asks you to trust a platform, a broker, or a counterparty’s word. This asks you to trust math and hardware instead.</p><p>Why salary, and why it’s not really about salary</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NVuIH9f4psuu9yH_PTBFaA.jpeg" /></figure><p>Offer Check, the flagship product built on this architecture, handles job offer negotiation specifically. A candidate and an employer each negotiate through their own agent, seeing only the size of the gap between their positions each round, never the other side’s actual number. When they converge, both parties get a cryptographically attested record of exactly what happened.</p><p>But the actual defensible thing here isn’t salary negotiation. It’s the primitive underneath it: verifiable, privacy-preserving bilateral negotiation, applicable anywhere two parties currently have to trust each other blindly or pay an intermediary to broker that trust. Procurement contracts. Insurance settlements. Vendor terms. Real estate offers. The list of markets that run on exactly this kind of opaque, asymmetric-information negotiation is long, and salary is simply the cleanest, most legible place to prove the architecture works before expanding into the rest.</p><h3><strong>What building this actually taught me about “trust”</strong></h3><p>The hardest, most interesting question I’ve been pushed on isn’t technical, it’s philosophical: if one negotiating agent is meaningfully smarter or better-resourced than the other, is the outcome actually fair, even if the process was honest? Attestation proves the process ran as claimed. It says nothing about whether the process itself was a level playing field.</p><p>That question reshaped a lot of the engineering. It’s why the system now checks a negotiated outcome against external, real-world reference points (market wage data, the actual gap moved from an opening offer) rather than only proving the mechanics were clean. Proving something ran honestly and proving something produced a good outcome turned out to be two very different claims, and conflating them is a mistake I see across a lot of “trustworthy AI” infrastructure right now: verifying that a process executed as specified is not the same as verifying that the result was fair, and systems that only do the former while implying the latter are quietly overclaiming.</p><h3>Where this came from</h3><p>This work grew out of the IC3 (Cornell)/Flashbots-backed Shape Rotator accelerator, and specifically out of academic research on non-disclosure AI agreements coming out of that lab. Building DealProof as close to that research as possible, rather than treating the paper as inspiration and building something looser, ended up being one of the better decisions I made; it meant the architecture had to hold up to genuinely rigorous scrutiny from people who’d thought about this problem longer and more carefully than I had, and that scrutiny made the product better at every stage.</p><p>It’s early, and there’s a lot still to prove, particularly around what “product-level” traction looks like beyond a strong technical foundation. But the underlying thesis feels more true to me now than it did when I started: the actual scarce resource in most negotiations isn’t cleverness or leverage, it’s trust, and trust is a thing you can now build in hardware and math instead of asking for on faith.</p><p>If you’re working on adjacent problems, confidential computing, verifiable AI agents, or infrastructure for markets that currently run on blind trust, I’d genuinely like to compare notes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb5fd60f5875" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DCAP, a Frontend, and What a Production Data Marketplace Needs]]></title>
            <link>https://medium.com/@feeltech_kkoci/dcap-a-frontend-and-what-a-production-data-marketplace-needs-e8942604210a?source=rss-a1ad6a9ae9f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8942604210a</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[data-privacy]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Kristian Koci]]></dc:creator>
            <pubDate>Wed, 01 Apr 2026 22:16:14 GMT</pubDate>
            <atom:updated>2026-04-01T22:16:14.806Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How DealProof went from “API with Swagger UI” to a full Intel-verified trustless system with a real interface — and what it exposed about the gap between cryptographic correctness and usable product.</em></p><h3>Where Part 1 Left Off</h3><p><a href="https://medium.com/@feeltech_kkoci/two-ai-agents-walk-into-a-tee-building-a-trustless-data-marketplace-at-the-ic3-shape-rotator-8ca1b67ad1ed">Part 1</a> ended with two honest confessions: the attestation verification still relied on Phala’s root certificate (trusting Phala’s word that the hardware is genuine), and there was no frontend — just a Swagger UI and a CLI script.</p><p>Both of those things are now fixed. This is what that looked like in practice.</p><h3>Phase 7: Full Intel DCAP Verification</h3><p>The original DealProof attestation flow used what Intel calls “Option A” verification. Phala Cloud signs the TDX quote and you trust Phala’s assertion that it came from real hardware. It works, but it means you’re trusting an intermediary — the very thing a TEE-backed system is supposed to eliminate.</p><p>Full Intel DCAP is “Option B”: you verify the quote directly against Intel’s public certificate chain, no intermediary required. Anyone with Intel’s Root CA public key can independently verify that:</p><ol><li>The PCK certificate chain runs from the leaf cert up to Intel SGX Root CA</li><li>The PCK key signed the QE Report</li><li>The ATT key is cryptographically bound in the QE REPORTDATA</li><li>The ATT key signed the Header + TD Report body</li><li>The deal terms hash in REPORTDATA[0:32] matches SHA-256(json(deal_terms))</li></ol><p>That’s five independent checks. All five must pass for intel_verified: true.</p><h3>The Quote Structure</h3><p>A TDX DCAP quote v4 is a binary blob with a specific layout:</p><pre>[0:48]    Header — version, tee_type, qe_vendor_id<br>[48:632]  TD Report Body (584 bytes)<br>             TEEINFO (400 bytes)<br>             REPORTDATA (64 bytes) ← REPORTDATA[0:32] = SHA-256(json(deal_terms))<br>             REPORTMAC (120 bytes)<br>[632:636] Signature Data Length<br>[636:...]  Signature Data:<br>             ECDSA sig (64 bytes) — ATT key signs Header+TD_Report<br>             ATT key (64 bytes, P-256 x||y)<br>             QE Report (384 bytes)<br>               QE REPORTDATA[0:32] = SHA-256(att_key || auth_data)<br>             QE Report Signature (64 bytes) — PCK key signs QE Report<br>             QE Auth Data<br>             PCK cert chain (PEM-encoded: PCK → Platform CA → Root CA)</pre><p>The binding mechanism is a chain of hashes, not just one. The deal terms hash is in the TD Report, the TD Report is signed by the ATT key, the ATT key is committed in the QE Report, and the QE Report is signed by the PCK key. Break any link and the verification fails.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bl6UGD8v8cDF3Um9ImR7Fw.png" /></figure><h3>The Implementation Detail That Matters</h3><p>The DCAP verifier uses Python’s cryptography library for ECDSA-P256 signature verification. One detail worth calling out: TDX quotes store signatures as raw 64-byte r||s concatenations, but the cryptography library expects DER-encoded signatures. The conversion is:</p><pre>r = int.from_bytes(sig_bytes[:32], &quot;big&quot;)<br>s = int.from_bytes(sig_bytes[32:], &quot;big&quot;)<br>der_sig = encode_dss_signature(r, s)<br>public_key.verify(der_sig, message, ec.ECDSA(hashes.SHA256()))</pre><p>This isn’t documented obviously anywhere. The quote spec says “64-byte ECDSA signature” and leaves the encoding as an exercise for the reader. Getting this wrong produces a verification failure that looks identical to a tampered quote.</p><h3>Simulation Mode Is Honest About Itself</h3><p>When TEE_MODE=simulation the attestation string is sim_quote:&lt;sha256_hex&gt; rather than a hex-encoded binary quote. The DCAP verifier detects this and returns verification_status: &quot;simulation_only&quot; rather than running the binary parser against a string that isn&#39;t a quote. The frontend renders this as a yellow &quot;Simulation Mode — No Hardware Attestation&quot; badge rather than a false pass or a confusing error.</p><p>This matters more than it sounds. The worst outcome for a cryptographic system is a UI that says “verified” when it isn’t. Simulation mode should be clearly labelled, always.</p><h3>Phase 6: A Frontend That Shows Its Work</h3><p>The original brief for Part 2 promised to cover “what real data streaming into a TEE looks like.” That work isn’t done yet — it requires streaming raw bytes into the enclave for real-time hashing rather than verifying pre-computed hashes. But something else happened that felt more important to build first: a UI that surfaces what the system is actually doing.</p><p>DealProof’s value proposition is invisible if you can only see it through a Swagger form. The cryptographic work — Props verification, dual attestation, DCAP cert chain — needs to be legible.</p><h3>The Architecture</h3><p>The frontend is React 18 + Vite 5 + Tailwind CSS 3. Three pages: Home (deal list), CreateDeal (form + deal trigger), DealView (live negotiation + result).</p><p>The interesting engineering is in DealView. A deal can be in one of three states when the page loads:</p><ol><li><strong>Complete</strong> — navigated here from CreateDeal with the result in location.state. No polling needed; render immediately.</li><li><strong>In-progress</strong> — the deal was created and negotiation started but the page was refreshed or navigated to directly. Poll GET /api/deals/{id}/status every 2 seconds until a terminal status (agreed, failed, verification_failed).</li><li><strong>Pending</strong> — created but not yet negotiated. Show empty state.</li></ol><p>The polling uses useRef for the interval ID rather than useState, because clearing an interval doesn&#39;t need a re-render:</p><pre>const pollRef = useRef(null)<br><br>// Stop polling when terminal status is reached<br>if (TERMINAL_STATUSES.has(data.status)) {<br>  if (pollRef.current) {<br>    clearInterval(pollRef.current)<br>    pollRef.current = null<br>  }<br>}</pre><p>This is the kind of detail that matters in production. A polling loop that doesn’t clean up after itself will keep running after the component unmounts, writing to state that no longer exists and generating React warnings.</p><h3>The Attestation Card Component</h3><p>The most technically interesting UI component is AttestationCard. It shows the raw TDX quote (truncated, with a copy button for the full hex), an &quot;Inspect DCAP Quote&quot; button, and — when the user clicks it — the full 4-step verification chain rendered as a table.</p><p>Each step has a pass/fail/null state: green checkmark, red X, or em-dash. The four steps are:</p><blockquote>Step — What it verifies</blockquote><blockquote>1 PCK Cert Chain → Intel Root CA</blockquote><blockquote>2 QE Report Signature (PCK key)</blockquote><blockquote>3 ATT Key Binding (QE REPORTDATA)</blockquote><blockquote>4 TD Report Signature (ATT key)</blockquote><p>If intel_verified is true, all four are green. If the deployment is running in simulation mode, all four show em-dashes with a yellow banner. If a real quote partially fails — cert chain invalid, for example — you see exactly which step failed and why.</p><p>This is the right user experience for a system where the stakes are “did anyone tamper with the negotiation outcome?” You want to be able to point to a specific step and say “this is what failed.”</p><h3>The Props Verification Panel</h3><p>The Props data verification panel fetches GET /api/deals/{id}/verification and renders the data hash, chunk count, and Props attestation quote in a green-bordered card if verified, red if not.</p><p>The important detail is what this communicates: the data was verified <em>before negotiation started</em>, and the same data_hash is bound into the deal attestation. A user looking at this UI can see:</p><ul><li>Data hash: 3f7a9b...</li><li>5 chunks verified</li><li>Props quote: sim_quote:3f7a9b... (or a real TDX quote in production)</li><li>Deal attestation: includes the same 3f7a9b... in REPORTDATA</li></ul><p>The binding is visible without requiring the user to understand the cryptography. You can see the same hash in two places and understand what that means.</p><h3>DKIM: Seller Identity Without a KYC Provider</h3><p>One of the “What I Didn’t Get Done” items in Part 1 was seller identity. In the current model, anyone can claim to be selling a dataset from AcmeCorp — there’s no verification layer.</p><p>DKIM (DomainKeys Identified Mail) is the email authentication protocol that verifies that an email was genuinely sent by the domain it claims. Every email sent from @acmecorp.com carries a DKIM signature verifiable against a public key in AcmeCorp&#39;s DNS records.</p><p>The DealProof implementation takes this a step further: the seller uploads a base64-encoded .eml file as part of the deal creation payload. The verifier:</p><ol><li>Decodes the .eml</li><li>Extracts the From: domain</li><li>Verifies the DKIM signature against the domain’s DNS records using dkimpy + dnspython</li><li>If verified, injects a credential block into the seller agent’s system prompt: <em>“You are confirmed to represent </em><em>acmecorp.com by cryptographic email verification.&quot;</em></li></ol><p>This is elegant because it uses existing infrastructure — no new KYC provider, no wallet, no identity attestation service. Every professional email sender already has DKIM configured. The TEE adds a layer that’s harder to fake: DKIM verification happens inside the enclave, not on the user’s machine.</p><p>One caveat worth being direct about: DNS is not accessible inside a sandboxed TEE CVM. The current implementation works in development (where DNS is available) and produces a dns_unavailable warning in production with a yellow badge in the UI. The production fix is a DNS-over-HTTPS resolver that works inside the enclave — feasible, but not yet implemented.</p><h3>What Part 2 Didn’t Cover (And Why)</h3><p>The original plan for Part 2 included “what real data streaming into a TEE looks like.” I want to explain why that’s not here.</p><p>The current Props implementation verifies a Merkle root of pre-computed SHA-256 hashes. The seller generates the hashes locally and submits them. This is sound cryptographically — a valid Merkle proof proves the dataset has a specific structure — but it doesn’t prevent a seller from generating hashes of a different dataset and claiming they match.</p><p>Real data integrity requires streaming the raw data into the enclave and computing the hashes there. The buyer never sees the data; the TEE hashes it and the hash goes into the attestation. This is technically feasible with Phala Cloud’s CVM infrastructure, but it requires:</p><ol><li>A streaming protocol for large datasets (chunked uploads, resumable transfers)</li><li>Enclave-side hash computation with a progress indicator</li><li>A dataset registry so buyers can request specific named datasets</li></ol><p>This is a product decision as much as a technical one. Building it as a hackathon extension would produce something half-finished. It belongs in a later phase where there’s time to do it properly.</p><h3>The Bigger Picture, Revisited</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sSQ2C1UMyVEQTaoircoObg.png" /></figure><p>Part 1 framed DealProof as a solution to Arrow’s information paradox: you can’t verify data without seeing it, but seeing it means you’ve already taken it.</p><p>After building the DCAP layer and the frontend, I’d refine that framing slightly. The cryptographic problem is solved. What DealProof demonstrates is that:</p><ul><li>Two AI agents can negotiate inside a TEE without either side’s private constraints being visible to the other</li><li>The negotiation outcome is hardware-attested in a way that requires no trust in any intermediary</li><li>The dataset that was the subject of negotiation is cryptographically bound to the outcome</li><li>Anyone — buyer, seller, regulator, auditor — can verify the attestation independently using Intel’s public certificate chain</li></ul><p>What isn’t solved — and what a production data marketplace would need — is the economic layer. Attestation proves a deal happened. It doesn’t create price discovery, market depth, reputation systems, or dispute resolution for off-chain delivery.</p><p>The TEE is the trust layer. Everything above it is still to build.</p><h3>What’s Next</h3><p>Phase 8 is DKIM verification that works inside a production TEE CVM, using a DNS-over-HTTPS resolver inside the enclave. Phase 9 is real dataset streaming. Phase 10 is multi-party sealed-bid auctions — the design that’s hardest to fake and most interesting economically.</p><p>DealProof is live at <a href="https://github.com/kkoci/Dealproof">github.com/kkoci/Dealproof</a> under MIT. The API is deployed on Phala Cloud. You can run a deal now via the Swagger UI or the React frontend.</p><p><em>Kristian Koci is a Senior Backend Engineer based in the UK, with open source contributions to Quantinuum’s guppylang compiler. Bradford Quantum Hackathon 2025 winner. World Bank Quantum Climate Risk Challenge Phase 3 finalist.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8942604210a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Two AI Agents Walk Into a TEE: Building a Trustless Data Marketplace at the IC3 Shape Rotator…]]></title>
            <link>https://medium.com/@feeltech_kkoci/two-ai-agents-walk-into-a-tee-building-a-trustless-data-marketplace-at-the-ic3-shape-rotator-8ca1b67ad1ed?source=rss-a1ad6a9ae9f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ca1b67ad1ed</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Kristian Koci]]></dc:creator>
            <pubDate>Fri, 27 Mar 2026 11:17:46 GMT</pubDate>
            <atom:updated>2026-04-01T23:02:53.973Z</atom:updated>
            <content:encoded><![CDATA[<h3>Two AI Agents Walk Into a TEE: Building a Trustless Data Marketplace at the IC3 Shape Rotator Hackathon</h3><h4>How I implemented NDAI Agreements and Props for ML Security in a single unified attestation — solo, in under two weeks, on real Intel TDX hardware.</h4><p><em>Part 2 of this Story can be found </em><a href="https://medium.com/@feeltech_kkoci/dcap-a-frontend-and-what-a-production-data-marketplace-needs-e8942604210a"><em>here</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*veNElcGj-FtC2WZHiCsrHA.png" /></figure><h4>The Problem Nobody Talks About</h4><p>There’s a paradox at the heart of every private data transaction.</p><p>If you want to sell me a proprietary dataset — medical imaging records, financial time series, LIDAR sensor feeds — I need to see it before I’ll pay. But if you show it to me, I’ve already got it. I don’t need to pay anymore.</p><p>Kenneth Arrow named this in 1962. The “information paradox” or “disclosure-expropriation problem” explains why private data markets are so broken. Both sides know it. Nobody trusts anybody. So deals don’t happen. Valuable data sits locked in silos, and the potential for it to be useful — for research, for training AI, for product development — evaporates.</p><p>This is the problem DealProof is built to solve.</p><h4>The Shape Rotator Hackathon</h4><p>In early March 2026 I registered for the IC3 Shape Rotator Virtual Hackathon, run by the Initiative for Cryptocurrencies and Contracts and hosted by Encode Club. The format was unusual for a hackathon: you didn’t just build something, you had to <em>extend or implement an IC3 research paper</em>. Three tracks — TEE &amp; AI-Enabled Applications, Cryptographic Primitives &amp; Identity, DeFi Security &amp; Mechanism Design.</p><p>I’d been contributing to Quantinuum’s guppylang compiler and studying quantum computing papers for months, so reading dense academic work wasn’t unfamiliar territory. I went through the IC3 paper list and two of them jumped out immediately, because they weren’t just interesting independently — they were clearly designed to be combined.</p><p><strong>NDAI Agreements</strong> (Miller et al., IC3 2025) proposes a game-theoretic framework for AI agent negotiation inside Trusted Execution Environments. The core insight: if two AI agents negotiate inside a TEE, and the hardware signs the outcome, neither party can dispute what was agreed. The negotiation is private, the result is cryptographically attested, and the whole thing is verifiable without trusting either party.</p><iframe src="https://drive.google.com/viewerng/viewer?url=https%3A//arxiv.org/pdf/2502.07924&amp;embedded=true" width="600" height="780" frameborder="0" scrolling="no"><a href="https://medium.com/media/1926a44589d0aee17adadee7f04b06ec/href">https://medium.com/media/1926a44589d0aee17adadee7f04b06ec/href</a></iframe><p><strong>Props for ML Security</strong> (Juels &amp; Koushanfar, IC3 2024) takes a different angle. It’s about verifiable data provenance — how can you prove that the data feeding into an ML pipeline is what it claims to be? The answer is a TEE-backed Merkle proof system. What makes this particularly relevant: Props author Dani Vilardell wrote explicitly that Props could serve as “a gateway for agents to access private web data.” I wasn’t the only one who thought these papers belonged together.</p><iframe src="https://drive.google.com/viewerng/viewer?url=https%3A//arxiv.org/pdf/2410.20522&amp;embedded=true" width="600" height="780" frameborder="0" scrolling="no"><a href="https://medium.com/media/c2d0d95ca25c925e821f729d07ae33a5/href">https://medium.com/media/c2d0d95ca25c925e821f729d07ae33a5/href</a></iframe><p>DealProof is what happens when you take that suggestion seriously.</p><h4>What I Built</h4><p>Two Claude AI agents — buyer and seller — negotiate access to a private dataset entirely inside an Intel TDX Trusted Execution Environment, running on Phala Cloud. When they reach agreement:</p><ol><li>The seller’s data is cryptographically verified via a Props-inspired Merkle proof <em>before</em> negotiation begins</li><li>The agents negotiate price, access scope, and duration inside the TEE</li><li>The hardware produces a TDX attestation quote — a hardware-signed proof that the negotiation happened exactly as described, and that the data was what the seller claimed</li><li>A Solidity smart contract on Ethereum Sepolia releases escrowed buyer funds on valid attestation</li></ol><p>No intermediary. No trust required from either side. The hardware is the arbiter.</p><p>Here’s the architecture at a glance:</p><pre>Buyer ──► AI Agent ──► TEE (Intel TDX / Phala Cloud) ◄── AI Agent ◄── Seller<br>                              │<br>                     Props data verification<br>                     (Merkle proof of dataset)<br>                              │<br>                     TDX attestation quote<br>                     (hardware-signed proof)<br>                              │<br>                     On-chain escrow release<br>                     (DealProof.sol on Sepolia)</pre><p>The full stack: FastAPI + uvicorn, AsyncAnthropic for both agents, SQLite via aiosqlite for persistence, dstack tappd for TDX quote generation, web3.py for smart contract interaction. Deployed live on Phala Cloud.</p><h4>The Technical Bits Worth Writing About</h4><p><strong><em>The Merkle Root That Isn’t a Tree</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*oxF-XSUeQEMmVJi6Yzod0Q.jpeg" /></figure><p>Props uses Merkle proofs for data verification, but DealProof’s implementation makes a specific choice that’s worth explaining, because it’s the kind of thing that looks like a shortcut but is actually load-bearing.</p><p>Instead of a binary Merkle tree, DealProof uses flat concatenation with a 4-byte length prefix:</p><pre>length_prefix = len(chunk_hashes).to_bytes(4, &quot;big&quot;)<br>raw = length_prefix + b&quot;&quot;.join(bytes.fromhex(h) for h in chunk_hashes)<br>root_hash = hashlib.sha256(raw).hexdigest()</pre><p>Why the length prefix? Without it, flat concatenation is vulnerable to a second-preimage attack. An attacker could craft a single large chunk whose SHA-256 matches the root of N smaller chunks — the verifier would accept it as the same dataset. The length prefix makes the number of chunks part of the hash input, so a single-chunk forgery produces a different root by construction. It’s not defensive redundancy. It’s what makes the scheme sound.</p><p>DealProof’s Props verifier has 22 tests covering all failure paths: tampered chunk hash, wrong root, mismatched chunk count, malformed hex. Any of these return a 400 before negotiation is even allowed to start.</p><h4>Dual TDX Attestation</h4><p>Each completed deal produces two independent TDX quotes:</p><p><strong>Props quote</strong> — covers data verification: data_hash, verified flag, chunk_count, algorithm. Generated immediately after Props verification succeeds.</p><p><strong>Deal quote</strong> — covers the negotiation outcome: final_price, access_scope, duration_days, data_hash. Generated after agents reach agreement.</p><p>The binding mechanism: deal terms get serialised to canonical JSON (sort_keys=True for determinism), SHA-256 hashed, and placed in REPORTDATA[0:32] of the TDX quote request. Anyone can verify by recomputing SHA-256(terms) and comparing to REPORTDATA. Both quotes are independently verifiable against Intel’s DCAP certificate chain — currently via Phala’s root cert, with full Intel DCAP on-chain verification as Phase 7.</p><p>The data_hash appears in both quotes. This is intentional. It cryptographically binds the negotiation outcome to the specific dataset that was verified — you can’t swap the data after the deal is done.</p><h4>AsyncAnthropic and the Negotiation Loop</h4><p>Both agents run as stateless async functions. The negotiation loop alternates between buyer and seller for up to 10 rounds. Each agent receives the full transcript so far as context, along with their private instructions (budget ceiling for the buyer, floor price for the seller — neither visible to the other agent).</p><p>Agents respond with structured JSON:</p><pre>{<br>  &quot;action&quot;: &quot;accept | counter | reject&quot;,<br>  &quot;price&quot;: 4200.00,<br>  &quot;terms&quot;: {&quot;access_scope&quot;: &quot;read_only&quot;, &quot;duration_days&quot;: 30},<br>  &quot;reasoning&quot;: &quot;Countering at $4,200 — within range but want read-only access&quot;<br>}</pre><p>One bug worth noting: Claude occasionally returns &quot;price&quot;: null in early rounds when reasoning about whether to accept at all. The fix is data.get(&quot;price&quot;) or 0 — not just data.get(&quot;price&quot;), which silently passes null through. Small things like this are where solo hackathon builds accumulate technical debt fast.</p><h3>The TEE Simulator</h3><p>Real Intel TDX hardware isn’t something you can run on your laptop. Phala Cloud provides a tappd-simulator Docker image that mirrors the tappd API exactly — same endpoints, same response format — but runs locally without requiring hardware enclaves. This made local development and testing possible.</p><p>The simulator meant all 56 tests pass in under 3 seconds on any machine. Production deployment on Phala Cloud replaces the simulator with a real CVM and produces genuine hardware-attested TDX quotes.</p><h3>What I Didn’t Get Done</h3><p><strong><em>Honest reflections on a solo two-week build:</em></strong></p><p><strong>No frontend.</strong> DealProof is API-only, plus a CLI demo script. The Swagger UI at /docs is functional, but it&#39;s not a user experience. For the accelerator roadmap, a React frontend with wallet connection is Priority 1.</p><p><strong>Option A attestation, not DCAP.</strong> Currently using Phala’s root certificate for attestation verification, which means trusting Phala’s word that the hardware is genuine. Full Intel DCAP on-chain verification — where you verify the TDX quote directly against Intel’s public certificate chain — is Phase 7. TrustVerify (Joanne Muthoni’s Shape Rotator submission) built exactly this verification layer, which is why I’ve already reached out about collaboration.</p><p><strong>No real data streaming.</strong> The TEE verifies data hashes, not raw data. A production system would stream data directly into the enclave for real-time hashing — the buyer gets a cryptographic guarantee without ever seeing the underlying data. This is the technically interesting next step.</p><p><strong>Single-buyer auction.</strong> The current model is one buyer, one seller. Multi-party sealed-bid auctions inside a TEE — where no bidder can see the others’ bids — is a natural extension, and it’s on the roadmap.</p><h3>Why This Combination Is Different</h3><p>Most projects at Shape Rotator implemented one paper well. DealProof bridges two: NDAI Agreements for the negotiation layer, Props for the data provenance layer, unified into a single attestation where the data_hash appears in both quotes.</p><p>The distinction matters practically. A system that only implements NDAI Agreements can produce a cryptographically attested negotiation outcome — the buyer and seller agreed on $4,200 for read-only access — but the buyer has no way to verify the data actually matches what was described. The seller could claim it’s a 10TB LIDAR dataset and deliver garbage.</p><p>Props fills that gap. The Merkle proof verifies the data before negotiation starts, and the data_hash is bound into both attestation quotes. The deal outcome and the data verification are cryptographically linked. You can’t separate them.</p><p>This is what Props author Dani Vilardell was gesturing at when he suggested Props as “a gateway for agents to access private web data.” DealProof is a concrete implementation of that idea.</p><h3>The Bigger Picture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*w0BkVaVJGaupCXkfPwP3Ug.jpeg" /></figure><p>Private data markets are a real and growing problem. As AI training becomes increasingly dependent on proprietary, domain-specific data — medical records, financial instruments, industrial sensor feeds — the question of how to transact around that data without either side being cheated becomes genuinely important.</p><p>The current solutions are all trust-based: data brokers, NDAs, legal agreements, reputation. These work for large institutions with legal departments. They don’t work for researchers, startups, or independent data providers who don’t have the infrastructure to enforce them.</p><p>TEE-based negotiation isn’t a complete solution. It solves the cryptographic problem but not the economic one — you still need liquid markets, pricing mechanisms, reputation systems. But it’s a necessary layer in any trustless data marketplace, and it’s one that’s now technically feasible with Phala Cloud providing accessible TDX infrastructure.</p><h3>What’s Next</h3><p>DealProof submitted to the IC3 Shape Rotator Accelerator application (10-week program, May–July 2026). Whether that comes through or not, the roadmap is clear:</p><ul><li><strong>Phase 6:</strong> React frontend — wallet connection, live negotiation transcript, attestation verification UI</li><li><strong>Phase 7:</strong> Full Intel DCAP on-chain verification</li><li><strong>Phase 8:</strong> DKIM email proof inside TEE — sellers can prove they represent a company without revealing identity</li><li><strong>Phase 9:</strong> Multi-party sealed-bid auctions</li></ul><p>The code is live at <a href="https://github.com/kkoci/Dealproof">https://github.com/kkoci/Dealproof</a> under MIT licence. The API is deployed on Phala Cloud at the URL in the README. You can run a deal right now via the Swagger UI.</p><p>Part 2 of this writeup will cover the DCAP implementation, what real data streaming into a TEE looks like, and what a production-ready trustless data marketplace actually needs to look like.</p><p><em>Kristian Koci is a Senior Backend Engineer based in the UK, with open source contributions to Quantinuum’s guppylang compiler. Bradford Quantum Hackathon 2025 winner. World Bank Quantum Climate Risk Challenge Phase 3 finalist.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ca1b67ad1ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Painting with Quantum Physics: Building a Pointillism Brush Using the Ising Model]]></title>
            <link>https://medium.com/@feeltech_kkoci/painting-with-quantum-physics-building-a-pointillism-brush-using-the-ising-model-447abb2b8a0b?source=rss-a1ad6a9ae9f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/447abb2b8a0b</guid>
            <dc:creator><![CDATA[Kristian Koci]]></dc:creator>
            <pubDate>Thu, 29 Jan 2026 23:48:16 GMT</pubDate>
            <atom:updated>2026-01-30T14:07:43.654Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HzbvBqGnukXDMdnKUBfvrw.png" /></figure><h3>How my teammate and I turned 19th-century art and 20th-century physics into a 21st-century digital painting tool</h3><p>When Georges Seurat pioneered pointillism in the 1880s, he spent years painstakingly placing millions of colored dots on canvas to create <em>A Sunday Afternoon on the Island of La Grande Jatte</em>. Each dot was independent, carefully chosen by the artist’s eye. But what if those dots could <em>talk to each other</em>? What if neighboring dots could influence each other’s colors through the laws of quantum mechanics?</p><p>That’s exactly what my teammate <strong>Benjamin Thomas</strong> and I built during the <strong>Bradford Quantum Hackathon 2025</strong>, sponsored by <strong>Quantinuum</strong>: a quantum pointillism brush that uses the Ising model — originally developed to describe magnetic materials — to create color correlations between neighboring dots.</p><p>Benjamin brought the brilliant idea and developed the Ising model physics in our research notebook; I handled the implementation, integrating his quantum circuits into a working digital painting tool. Our approach won <strong>first place in our category</strong>, and the result is something you literally cannot achieve with classical algorithms alone — digital art where quantum physics decides how colors blend.</p><h3>The Ising Model: From Magnets to Pixels</h3><p>The Ising model, proposed by physicist Ernst Ising in 1925, was designed to explain ferromagnetism — why certain materials become magnets. The core idea is beautifully simple: imagine a grid of tiny magnets (spins), each pointing either up ↑ or down ↓. Neighboring spins want to align with each other, creating collective magnetic behavior.</p><p>The Hamiltonian (energy equation) looks like this:</p><pre>H = -∑⟨i,j⟩ J_ij σ_i σ_j</pre><p>Where:</p><ul><li>σ_i and σ_j are spins at positions i and j</li><li>J_ij is the coupling strength between neighbors</li><li>The sum runs over all neighboring pairs</li></ul><p><strong>The quantum version</strong> replaces classical spins with quantum operators (Pauli matrices):</p><pre>Ĥ = -∑⟨i,j⟩ J_ij σ̂ᶻ_i σ̂ᶻ_j</pre><blockquote><em>This is where things get interesting. Quantum spins can exist in </em>superposition<em> — simultaneously up and down — and neighboring spins become </em>entangled<em>, creating correlations that have no classical analog.</em></blockquote><h3>From Spins to Colors: The Translation</h3><p>Here’s the conceptual leap Benjamin proposed: <strong>what if each painted dot is a qubit (quantum bit), and its color is encoded in its quantum state?</strong></p><h3>The mapping:</h3><ol><li><strong>Dot = Qubit</strong>: Each dot in the painting corresponds to one qubit</li><li><strong>Color = Quantum State</strong>: RGB colors get encoded as angles on the Bloch sphere (θ, φ)</li><li><strong>Neighbors = Coupling</strong>: Dots within a certain distance become “neighbors” and interact</li><li><strong>Time Evolution</strong>: The system evolves according to the Ising Hamiltonian, allowing colors to influence each other</li></ol><h3>Why this works:</h3><ul><li><strong>Positive coupling (J &gt; 0)</strong>: Neighboring dots’ colors harmonize — like spins aligning</li><li><strong>Negative coupling (J &lt; 0)</strong>: Colors push apart — antiferromagnetic behavior creates contrast</li><li><strong>Evolution time</strong>: Longer evolution = stronger color correlations</li></ul><p>Benjamin developed this theoretical framework in a Jupyter notebook, proving that the Ising model could generate meaningful color correlations. My job was to take that physics and make it paint.</p><h3>The Implementation: Qiskit Meets Canvas</h3><p>Building this required bridging two worlds: quantum computing and digital art. Here’s how it works under the hood.</p><h3>Step 1: Path-Following Dot Placement</h3><p>Unlike traditional pointillism tools that scatter dots randomly, mine follows your brush stroke:</p><p>python</p><pre>def sample_along_path(path, n_samples, spread=15):<br>    &quot;&quot;&quot;Place dots along the stroke with organic scatter&quot;&quot;&quot;<br>    candidates = []<br>    for path_point in path:<br>        # Exponential bias toward path center<br>        r = np.random.exponential(spread / 3)<br>        r = min(r, spread)<br>        angle = np.random.uniform(0, 2 * np.pi)<br>        offset = r * np.array([np.cos(angle), np.sin(angle)])<br>        candidates.append(path_point + offset)<br>    <br>    # Poisson disk sampling prevents clumping<br>    return poisson_sample(candidates, n_samples, min_dist)</pre><p>This creates dots that trace your stroke shape while maintaining the scattered aesthetic of pointillism.</p><h3>Step 2: Building the Neighbor Graph</h3><p>Not all dots interact — only nearby ones. I construct an adjacency graph:</p><p>python</p><pre>def build_neighbors(dots, max_distance):<br>    &quot;&quot;&quot;Find which dots are close enough to interact&quot;&quot;&quot;<br>    neighbors = []<br>    for i in range(len(dots)):<br>        for j in range(i+1, len(dots)):<br>            if distance(dots[i], dots[j]) &lt;= max_distance:<br>                neighbors.append((i, j))<br>    return neighbors</pre><p>This gives us the ⟨i,j⟩ pairs in the Hamiltonian—the structure of our quantum network.</p><h3>Step 3: Color Encoding to Quantum States</h3><p>Colors must be mapped to qubit states. I use spherical coordinates:</p><p>python</p><pre>def encode_color_to_qubit(rgb):<br>    &quot;&quot;&quot;Map RGB → (φ, θ) on Bloch sphere&quot;&quot;&quot;<br>    h, l, s = rgb_to_hls(rgb)<br>    <br>    phi = h * 2 * π      # Hue → azimuthal angle<br>    theta = l * π        # Lightness → polar angle<br>    <br>    return phi, theta</pre><p>Each color becomes a point on the Bloch sphere — the qubit’s state space.</p><h3>Step 4: Quantum Circuit Construction</h3><p>Here’s where I adapted Benjamin’s Ising model research into production code. For each dot, I initialize a qubit in the corresponding color state:</p><p>python</p><pre>from qiskit import QuantumCircuit, QuantumRegister</pre><pre>def create_ising_circuit(N, colors, neighbors, coupling, time):<br>    q = QuantumRegister(N, &#39;q&#39;)<br>    qc = QuantumCircuit(q)<br>    <br>    # Initialize qubits to color states<br>    for i, color in enumerate(colors):<br>        phi, theta = encode_color_to_qubit(color)<br>        qc.ry(theta, i)<br>        qc.rz(phi, i)<br>    <br>    # Time evolution with Ising interactions<br>    dt = 0.1<br>    steps = int(time / dt)<br>    J = coupling * 0.7<br>    <br>    for _ in range(steps):<br>        # Apply RZZ gates for Ising coupling<br>        for i, j in neighbors:<br>            qc.rzz(-2 * J * dt, i, j)<br>        <br>        # Local field (bias toward original color)<br>        for i in range(N):<br>            phi, theta = encode_color_to_qubit(colors[i])<br>            qc.rx(0.1 * dt * theta, i)<br>    <br>    return qc<br>```</pre><pre>**The RZZ gate** is the star here. `RZZ(θ)` implements the Ising interaction Benjamin designed:<br>```<br>RZZ(θ) = exp(-iθ σᶻ ⊗ σᶻ / 2)</pre><blockquote><em>This creates </em>entanglement<em> between neighboring qubits — their color states become quantum correlated.</em></blockquote><h3>Step 5: Measurement and Color Extraction</h3><p>After evolution, I measure each qubit’s state to get the final colors:</p><p>python</p><pre>from qiskit.quantum_info import Statevector, SparsePauliOp</pre><pre>def measure_colors(circuit, N):<br>    state = Statevector(circuit)<br>    colors = []<br>    <br>    for i in range(N):<br>        # Measure Pauli expectation values<br>        obs_x = SparsePauliOp(&#39;I&#39;*i + &#39;X&#39; + &#39;I&#39;*(N-i-1))<br>        obs_y = SparsePauliOp(&#39;I&#39;*i + &#39;Y&#39; + &#39;I&#39;*(N-i-1))<br>        obs_z = SparsePauliOp(&#39;I&#39;*i + &#39;Z&#39; + &#39;I&#39;*(N-i-1))<br>        <br>        x = state.expectation_value(obs_x).real<br>        y = state.expectation_value(obs_y).real<br>        z = state.expectation_value(obs_z).real<br>        <br>        # Reconstruct angles from expectation values<br>        phi = np.arctan2(y, x) % (2*π)<br>        theta = np.arccos(np.clip(z, -1, 1))<br>        <br>        # Convert back to RGB<br>        colors.append(spherical_to_rgb(phi, theta))<br>    <br>    return colors</pre><p>The expectation values ⟨X⟩, ⟨Y⟩, ⟨Z⟩ give us the Bloch vector, which we convert back to RGB.</p><h3>The Quantum Limitation: Why Classical Fallback Matters</h3><p>There’s a hard limit: quantum simulation requires 2^N memory for N qubits. This means:</p><ul><li><strong>25 qubits</strong>: 33 million amplitudes → manageable</li><li><strong>30 qubits</strong>: 1 billion amplitudes → your RAM explodes</li><li><strong>50 qubits</strong>: More memory than exists on Earth</li></ul><p>So I cap true quantum simulation at 25 dots. Beyond that, I use a classical approximation that preserves the Ising physics spirit:</p><p>python</p><pre>def classical_blend(dots, colors, neighbors, coupling, target):<br>    &quot;&quot;&quot;Classical Ising-inspired color blending&quot;&quot;&quot;<br>    colors = np.array(colors, dtype=float)<br>    <br>    for i, j in neighbors:<br>        avg = (colors[i] + colors[j]) / 2<br>        blend = 0.05 * abs(coupling)<br>        <br>        if coupling &gt; 0:<br>            # Ferromagnetic: colors attract<br>            colors[i] = (1-blend)*colors[i] + blend*avg<br>            colors[j] = (1-blend)*colors[j] + blend*avg<br>        else:<br>            # Antiferromagnetic: colors repel<br>            colors[i] = (1-blend)*colors[i] + blend*(255-avg)<br>            colors[j] = (1-blend)*colors[j] + blend*(255-avg)<br>    <br>    return colors</pre><p>This captures the <em>spirit</em> of Ising interactions without quantum overhead. It’s physics-inspired rather than physics-exact — but it works beautifully for large dot counts.</p><h3>Results: What Does Quantum Art Look Like?</h3><p>The visual difference between classical and quantum is subtle but real. Here’s what I observe:</p><h3>Positive Coupling (J &gt; 0):</h3><ul><li><strong>Classical</strong>: Smooth gradients, predictable blending</li><li><strong>Quantum</strong>: Smooth gradients with organic micro-variations from quantum randomness</li></ul><h3>Negative Coupling (J &lt; 0):</h3><ul><li><strong>Classical</strong>: High contrast, but deterministic</li><li><strong>Quantum</strong>: Chaotic color diversity with quantum interference effects</li></ul><h3>The “quantum weirdness” manifests as:</h3><ol><li><strong>Non-local correlations</strong>: Dots far apart still correlate through entanglement chains</li><li><strong>Superposition collapse</strong>: Measurement randomness creates unique results every time</li><li><strong>Interference patterns</strong>: Some color combinations get enhanced, others suppressed</li></ol><blockquote><em>It’s not a dramatic difference — quantum mechanics is subtle. But there’s an organic, unpredictable quality to quantum-evolved colors that classical algorithms can’t quite replicate.</em></blockquote><h3>The Artist’s Interface: Making Physics Usable</h3><p>All this quantum machinery runs invisibly. Artists just see five sliders:</p><ol><li><strong>Dot Count</strong> (10–200): How many dots to paint</li><li><strong>Coupling Strength</strong> (-1 to 1): Positive = harmony, negative = contrast</li><li><strong>Evolution Time</strong> (0.1–10): How long colors “talk” to each other</li><li><strong>Dot Size</strong> (1–20): Visual size of each dot</li><li><strong>Color Variance</strong> (0–1): Random noise added for organic feel</li></ol><p>Paint a stroke, wait a few seconds, and quantum physics does the rest.</p><h3>Lessons Learned: Where Physics Meets Practicality</h3><p>Building this taught me several things:</p><h3>1. Quantum computing is hard to scale</h3><p>The exponential memory requirement hits <em>fast</em>. 25 qubits is barely enough for interesting art. This is why we need actual quantum hardware — simulation can’t cut it for production use.</p><h3>2. Physics-inspired ≠ physics-exact</h3><p>The classical fallback works great because the <em>concept</em> of neighbor interactions is what matters aesthetically, not the quantum mechanics per se. Sometimes inspiration is enough.</p><h3>3. User experience beats purity</h3><p>I initially had dots scattered uniformly around the stroke. Technically correct, but artists hated it. Making dots follow the stroke path sacrifices some purity but makes the tool actually usable.</p><h3>4. Randomness is a feature</h3><p>The quantum randomness from measurement collapse means every stroke is unique. You can’t reproduce the exact same result twice — which is either a bug or a feature depending on your perspective. I chose to embrace it.</p><h3>5. Collaboration bridges gaps</h3><p>Benjamin’s physics background provided the theoretical foundation I couldn’t have built alone. My software engineering experience turned theory into a tool people can actually use. Neither of us could have built this solo — it took both perspectives.</p><h3>Try It Yourself</h3><p>The code is open source and available on GitHub as part of the QuantumBrush project. You’ll need:</p><ul><li>Python 3.11+</li><li>Qiskit 2.2+</li><li>NumPy, SciPy</li><li>A Docker setup (provided in the repo)</li></ul><p>Clone it, paint some quantum dots, and see what happens when physics meets art. Benjamin’s original research notebook is included as PointillismBrush.ipynb for those who want to understand the physics derivation.</p><h3>Conclusion: Why This Matters</h3><p>This project sits at a weird intersection: too artistic for physicists, too physics-heavy for artists. But that’s exactly the point.</p><p>Quantum computing isn’t just for cryptography and chemistry simulations. It’s a new computational paradigm with unique properties — <strong>superposition, entanglement, interference</strong> — that have <em>never existed</em> in classical computing. Those properties can create things we’ve never seen before.</p><p>Art is one place to explore that. When colors correlate through quantum entanglement, when measurement collapse adds fundamental randomness, when Ising models designed for magnets paint pictures — that’s not just a gimmick. It’s a glimpse of what computation looks like when physics is the algorithm.</p><blockquote><em>Seurat spent years dotting his canvas. Benjamin and I spent a hackathon weekend figuring out what happens when those dots become quantum. Turns out, they make pretty good art — and won us first place at Bradford Quantum Hackathon 2025, sponsored by Quantinuum.</em></blockquote><p><strong>Kristian Koci</strong> is a Senior Backend Developer and quantum computing enthusiast currently transitioning from classical software engineering to quantum computing research. <strong>Benjamin Thomas</strong> is a physicist specializing in quantum systems. Together, they won first place in their category at the <strong>Bradford Quantum Hackathon 2025</strong>. Find Kristian on <a href="https://github.com/kkoci">GitHub</a>.</p><h3>Links &amp; Resources</h3><p>📦 <strong>Code Repository</strong>: <a href="https://github.com/moth-quantum/QuantumBrush/">GitHub — QuantumBrush</a><br> 📓 <strong>Research Notebook</strong>: Benjamin’s Ising model derivation (<a href="https://github.com/moth-quantum/QuantumBrush/blob/dist/effect/pointillism/docs/PointlisimBrush.ipynb">PointillismBrush.ipynb</a>)<br> 🏆 <strong>Hackathon</strong>: Bradford Quantum Hackathon 2025 (Sponsored by Quantinuum)</p><h3>Technical Appendix: The Math</h3><p>For those who want the full mathematical treatment (credit to Benjamin’s research notebook):</p><p><strong>Bloch Sphere Encoding:</strong></p><p>The quantum state of a qubit representing a color:</p><pre>|ψ⟩ = cos(θ/2)|0⟩ + e^(iφ)sin(θ/2)|1⟩</pre><p><strong>Ising Hamiltonian:</strong></p><p>The energy function governing color interactions:</p><pre>Ĥ = -∑⟨i,j⟩ J_ij σ̂ᶻ_i σ̂ᶻ_j - ∑_i h_i σ̂ˣ_i</pre><p>Where J_ij is the coupling between neighboring qubits and h_i is the local field.</p><p><strong>Time Evolution Operator:</strong></p><p>How the quantum system evolves over time:</p><pre>U(t) = exp(-iĤt/ℏ)</pre><p><strong>Trotterization (first-order):</strong></p><p>Approximating continuous evolution with discrete time steps:</p><pre>U(t) ≈ [exp(-iĤ₁dt)exp(-iĤ₂dt)...exp(-iĤₙdt)]^(t/dt)</pre><p><strong>RZZ Gate Decomposition:</strong></p><p>The fundamental gate implementing Ising coupling:</p><pre>RZZ(θ) = exp(-iθ/2 Z⊗Z) = CNOT · RZ(θ) · CNOT</pre><p>Full derivations available in Benjamin’s research notebook.</p><p><em>👏 If you enjoyed this article, give it some claps and follow me for more explorations in quantum computing, physics-inspired algorithms, and creative coding!</em></p><p><em>💬 Questions? Drop them in the comments — I love discussing quantum art and physics!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=447abb2b8a0b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quantum Vector Search: Running Grover’s Algorithm on Real IBM Quantum Hardware]]></title>
            <link>https://medium.com/@feeltech_kkoci/quantum-vector-search-running-grovers-algorithm-on-real-ibm-quantum-hardware-8691e81cd735?source=rss-a1ad6a9ae9f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/8691e81cd735</guid>
            <category><![CDATA[vector-search]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[grovers-algorithm]]></category>
            <category><![CDATA[qiskit]]></category>
            <dc:creator><![CDATA[Kristian Koci]]></dc:creator>
            <pubDate>Sun, 04 Jan 2026 23:09:04 GMT</pubDate>
            <atom:updated>2026-01-05T11:09:25.622Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How I built a quantum-powered vector similarity search API — and discovered why fewer Grover iterations sometimes give better results</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EJPocanBem2k1k0JolTAlQ.jpeg" /></figure><h3>The Challenge: Bringing Quantum Computing to Vector Search</h3><p>Vector similarity search powers modern AI — from recommendation engines to semantic search. But as databases grow, classical search gets expensive. Could quantum computing help?</p><p>I built a <strong>quantum vector search API</strong> that:</p><ul><li>Encodes similarity scores as quantum amplitudes</li><li>Uses <strong>Grover’s algorithm</strong> to amplify the best match</li><li>Runs on <strong>real IBM Quantum hardware</strong> (not just simulators)</li><li>Exposes results via a <strong>FastAPI endpoint</strong> with a public URL</li></ul><p>The result? A working quantum app that correctly identifies the closest vector on IBM’s 127-qubit <strong>Brisbane processor</strong> — with a surprising twist about tuning Grover’s algorithm.</p><h3>Architecture Overview</h3><p><strong>The Stack</strong></p><ul><li>User Query → 4D vector</li><li>FastAPI Endpoint</li><li>Classical Preprocessing → dot product similarities</li><li>Quantum State Preparation → amplitude encoding</li><li>Grover’s Algorithm → oracle + diffusion</li><li>IBM Quantum Hardware → Brisbane backend</li><li>Measurement → Top results returned</li></ul><p><strong>Key Components</strong></p><ul><li><strong>Database</strong>: 32 random 4D vectors (fits in 5 qubits: ²⁵ = 32 states)</li><li><strong>Amplitude Encoding</strong>: Dot product scores → normalized quantum amplitudes</li><li><strong>Grover’s Algorithm</strong>: Amplifies the state with highest initial probability</li><li><strong>IBM Quantum Runtime</strong>: Executes circuits via Qiskit Runtime Service</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xn-n7AKAyJx7hIRciDsMig.jpeg" /></figure><h3>The Code: From Theory to Production</h3><h4>1. Setting Up the Quantum Service</h4><pre>from qiskit_ibm_runtime import QiskitRuntimeService<br><br>service = QiskitRuntimeService(<br>    channel=&quot;ibm_quantum_platform&quot;,<br>    instance=&quot;Your_Quantum_FLex_Instance&quot;  # IBM Quantum Flex hub<br>)</pre><h4>2. Amplitude Encoding: Classical Scores → Quantum State</h4><p>We encode the entire database into a quantum superposition:</p><pre># Classical similarity: dot products with all 32 vectors<br>scores = db @ query<br><br># Normalize to valid quantum amplitudes<br>vec = scores / np.linalg.norm(scores)<br><br># Compute initial probabilities and find target<br>initial_probs = vec ** 2<br>target_idx = int(np.argmax(initial_probs))<br><br># Initialize quantum circuit with amplitudes<br>qc = QuantumCircuit(5)  # 5 qubits for 32 states<br>qc.initialize(vec, qc.qubits)</pre><blockquote><em>After this step, measuring the state already gives the correct answer ~19.5% of the time (e.g., index 18).</em></blockquote><h4>3. Building the Grover Oracle</h4><p>The oracle flips the phase of the target state:</p><pre>oracle = QuantumCircuit(n_qubits)<br>tbin = format(target_idx, f&#39;0{n_qubits}b&#39;)<br><br># Flip qubits where target has |0⟩<br>for i, bit in enumerate(reversed(tbin)):<br>    if bit == &#39;0&#39;:<br>        oracle.x(i)<br><br># Multi-controlled Z (phase flip)<br>oracle.h(n_qubits - 1)<br>oracle.append(MCXGate(n_qubits - 1), list(range(n_qubits)))<br>oracle.h(n_qubits - 1)<br><br># Uncompute X gates<br>for i, bit in enumerate(reversed(tbin)):<br>    if bit == &#39;0&#39;:<br>        oracle.x(i)</pre><h4>4. The Diffusion Operator</h4><p>Performs “inversion about the mean”:</p><pre>diffusion = QuantumCircuit(n_qubits)<br>diffusion.h(diffusion.qubits)<br>diffusion.x(diffusion.qubits)<br>diffusion.h(n_qubits - 1)<br>diffusion.append(MCXGate(n_qubits - 1), list(range(n_qubits)))<br>diffusion.h(n_qubits - 1)<br>diffusion.x(diffusion.qubits)<br>diffusion.h(diffusion.qubits)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F2oCYiPeGfwOub7sJ-fAsw.jpeg" /></figure><h3>The Plot Twist: When Less Is More</h3><h4>The Initial Hypothesis</h4><p>For N = 32 items, textbook Grover suggests <strong>√N ≈ 5–6 iterations</strong>.</p><h4>The Reality (on a noiseless simulator)</h4><ul><li><strong>0 iterations</strong>: Index 18 (392 counts) ✅</li><li><strong>1 iteration</strong>: Index 18 (340 counts) ✅</li><li><strong>2 iterations</strong>: Index 1 (214 counts) ❌</li><li><strong>3 iterations</strong>: Index 31 (298 counts) ❌</li><li><strong>5 iterations</strong>: Index 31 (313 counts) ❌</li></ul><p><strong>Zero or one iteration worked best. More made it worse.</strong></p><h4>Why?</h4><p>Grover’s formula assumes a <strong>uniform initial state</strong> (all amplitudes equal). But we start from an <strong>amplitude-encoded state</strong>:</p><ul><li>Target (index 18): 19.5% probability</li><li>2nd best (index 31): 8.4%</li><li>3rd (index 1): 7.2%</li></ul><p>The answer is already “biased” in the initial state! Applying too many diffusion steps <strong>over-rotates</strong> the state vector away from the target.</p><h4>The Fix</h4><p>For amplitude-encoded search: <strong>1 Grover iteration is optimal</strong> — just enough boost without overshooting.</p><h3>Running on Real Quantum Hardware</h3><h4>Deployment Stack</h4><pre># Run FastAPI server in background<br>!nohup uvicorn main:app --host 0.0.0.0 --port 8000 &amp;&gt;server.log &amp;</pre><pre># Expose via ngrok<br>from pyngrok import ngrok<br>http_tunnel = ngrok.connect(8000, bind_tls=True)<br>print(http_tunnel.public_url)</pre><h4>Backend Selection with Fallback</h4><pre>try:<br>    backend = service.backend(&quot;ibm_brisbane&quot;)<br>except Exception:<br>    try:<br>        backend = service.backend(&quot;ibmq_qasm_simulator&quot;)<br>    except Exception:<br>        backend = AerSimulator()</pre><h4>Real Hardware Results</h4><p>Query: [0.1, -0.3, 0.7, 0.2]</p><p>Response from IBM Brisbane:</p><pre>{<br>  &quot;classical_closest&quot;: 18,<br>  &quot;quantum_closest&quot;: 18,<br>  &quot;agree&quot;: true,<br>  &quot;num_grover_iterations&quot;: 1,<br>  &quot;target_initial_prob&quot;: 0.195,<br>  &quot;top_counts&quot;: {<br>    &quot;10010&quot;: 331,  // Index 18 — correct!<br>    &quot;11111&quot;: 229,<br>    &quot;11011&quot;: 172,<br>    &quot;00100&quot;: 154,<br>    &quot;01111&quot;: 131<br>  }<br>}</pre><p>Despite noise on real hardware, the target state (index 18) was measured <strong>331 out of 2048 shots (16.2%)</strong> — clearly above the noise floor.</p><h3>Key Takeaways</h3><ol><li><strong>Quantum advantage isn’t always about speed</strong><br>This demo doesn’t beat classical search for small N — but it shows how to <strong>encode real data</strong>, <strong>adapt algorithms</strong>, and <strong>integrate quantum+classical</strong> systems.</li><li><strong>Textbook algorithms need real-world tuning</strong><br>The √N rule fails when your initial state isn’t uniform. <strong>Empirical testing &gt; theory</strong> in applied quantum computing.</li><li><strong>Quantum noise is manageable</strong><br>Even on today’s hardware, the signal emerges. We’re approaching <strong>practical utility</strong>.</li><li><strong>Hybrid is the future</strong><br>Best results come from classical preprocessing → quantum search → classical interpretation.</li></ol><h3>Technical Challenges &amp; Solutions</h3><p><strong>Problem 1: </strong><strong>prepare_state() fails during transpilation</strong><br>→ Use initialize() instead:</p><pre># ❌ This fails<br>qc.prepare_state(vec)<br><br># ✅ This works<br>qc.initialize(vec, qc.qubits)</pre><p><strong>Problem 2: Classical vs. quantum targets didn’t match</strong><br>→ Always use argmax(probabilities) for consistency:</p><pre>vec = scores / np.linalg.norm(scores)<br>initial_probs = vec ** 2<br>target_idx = int(np.argmax(initial_probs))</pre><p><strong>Problem 3: Over-rotation with too many iterations</strong><br>→ Test empirically: <strong>1 iteration wins</strong> for amplitude-encoded states.</p><h3>What’s Next?</h3><p><strong>Immediate Improvements</strong></p><ul><li>Adaptive iteration count based on initial target probability</li><li>Error mitigation (readout correction, zero-noise extrapolation)</li><li>Scale to 64–128 vectors (6–7 qubits)</li></ul><p><strong>Research Ideas</strong></p><ul><li>Hybrid Grover-QAOA search</li><li>Quantum-inspired classical algorithms</li><li>Variational quantum search (trainable circuits)</li></ul><h3>Conclusion</h3><p>Building a quantum vector search API on real IBM hardware taught me a vital lesson: <strong>the best quantum algorithm isn’t always the textbook one</strong>.</p><p>Because we started from an <strong>amplitude-encoded state</strong> — not uniform superposition — <strong>1 Grover iteration beat the theoretical optimum of 5–6</strong>. This shows that real-world quantum applications demand <strong>empirical tuning</strong>, not just theory.</p><p>And the fact that it worked <strong>on actual quantum hardware</strong> (IBM Brisbane, 127 qubits), despite noise and decoherence, proves we’re entering an era where quantum computing is <strong>production-ready infrastructure</strong> — even before full quantum advantage.</p><p><strong>Quantum computing is no longer just theory — it’s something you can build on today.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HqBXJgxreUXTxkVxNXbYlA.jpeg" /></figure><h3>You can try it yourself</h3><p>Once the server is running:</p><pre>curl -X POST &quot;https://your-ngrok-url.ngrok-free.app/search&quot; \<br>     -H &quot;Content-Type: application/json&quot; \<br>     -d &#39;{&quot;query&quot;:[0.1,-0.3,0.7,0.2]}&#39;</pre><p><em>GitHub repo: </em><a href="https://github.com/kkoci/grover_vector_space_search">https://github.com/kkoci/grover_vector_space_search</a></p><p><strong>Tech Stack</strong>:</p><ul><li>Qiskit 1.x</li><li>IBM Quantum Runtime</li><li>FastAPI</li><li>Google Colab + ngrok</li><li>Python 3.12</li></ul><p>Built with quantum circuits and debugged with patience.<br>Running on IBM Quantum hardware thanks to the <strong>World Bank Quantum Computing Challenge</strong>.</p><p><em>Questions? Feedback? Reach out or leave a comment!</em><br>#QuantumComputing #IBMQuantum #Qiskit #VectorSearch #AI #MachineLearning #QuantumAlgorithms</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8691e81cd735" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Became a Top 28 Finalist in the World Bank’s Quantum Computing Challenge (Out of 600+ Teams)]]></title>
            <link>https://medium.com/@feeltech_kkoci/how-i-became-a-top-28-finalist-in-the-world-banks-quantum-computing-challenge-out-of-600-teams-769a0d80c709?source=rss-a1ad6a9ae9f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/769a0d80c709</guid>
            <category><![CDATA[qaoa]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[climate-change]]></category>
            <dc:creator><![CDATA[Kristian Koci]]></dc:creator>
            <pubDate>Thu, 23 Oct 2025 21:48:27 GMT</pubDate>
            <atom:updated>2025-10-23T21:48:27.017Z</atom:updated>
            <content:encoded><![CDATA[<p>When the World Bank announced their Quantum Computing for Climate Risk Insurance challenge as part of the World Quantum Year, I knew this was an opportunity I couldn’t pass up. Climate change is accelerating, insurance companies are withdrawing from high-risk regions, and millions of vulnerable people are left unprotected. Could quantum computing actually help solve this crisis?</p><p>Spoiler alert: I made it to Phase 3 as a finalist — one of only 28 teams selected from over 600 submissions. Here’s the journey from concept to finalist, what we built with just 5 qubits, and why this matters for the future of climate resilience.</p><h3>The Problem: When Insurance Fails the People Who Need It Most</h3><p>Picture this: You’re a farmer in Bangladesh. Cyclones are getting stronger and more frequent. Your entire livelihood depends on your crops, but insurance is either unavailable or prohibitively expensive. When disaster strikes, you have no financial safety net.</p><p>This isn’t a hypothetical scenario — it’s the reality for millions of people in climate-vulnerable regions. The statistics are sobering:</p><ul><li>Insurance penetration in low-income countries is below 3%</li><li>Reinsurance companies are withdrawing from high-risk areas</li><li>Traditional risk models can’t handle the complexity of modern climate data</li><li>Without insurance, banks won’t finance infrastructure projects</li></ul><p>The World Bank’s challenge was simple but profound: Can quantum computing help us create better, more accessible climate risk insurance?</p><h3>Our Approach: QuantumClimate Solutions</h3><p>For Phase 1, we had to propose a solution that could work within the constraints of today’s quantum hardware — meaning we had to be clever with limited qubits and design algorithms that could run on free-tier quantum computing platforms.</p><p>We developed a three-part quantum solution:</p><h3>1. Quantum-Enhanced Risk Assessment (QPCA)</h3><p>Traditional climate risk models struggle with the sheer volume and complexity of climate data. We implemented Quantum Principal Component Analysis (QPCA) to process multi-dimensional climate datasets — temperature patterns, precipitation trends, extreme weather indicators — and identify the key risk factors with exponentially faster processing.</p><p>The beauty of QPCA is that it can find patterns in high-dimensional data that classical methods miss, potentially revealing previously undetected correlations between climate indicators and disaster risk.</p><p><strong>The Technical Architecture:</strong></p><p>Our solution follows a hybrid quantum-classical pipeline:</p><pre>Climate Data → Feature Engineering → Quantum Risk Circuit → Classical Actuarial Model</pre><p><strong>Feature Engineering:</strong> We normalized climate data using MinMaxScaler to prepare it for quantum processing:</p><pre>scaler = MinMaxScaler()<br>features = scaler.fit_transform(<br>    climate_data[[&#39;temperature&#39;, &#39;precipitation&#39;, &#39;cyclones&#39;]]<br>)</pre><p><strong>The Quantum Risk Circuit:</strong> The heart of our solution is a 4-qubit quantum circuit that encodes climate risk through parameterized rotation gates:</p><pre>def create_risk_circuit(features):<br>    qc = QuantumCircuit(4)<br>    <br>    # Feature encoding with non-linear scaling<br>    for qubit in range(len(features)):<br>        angle = π * (1 - exp(-2.3 * features[qubit]))<br>        qc.ry(angle, qubit)<br>    <br>    # Entanglement for risk correlation<br>    qc.cx(0, 1)  # Temperature-precipitation correlation<br>    qc.measure_all()<br>    return qc</pre><p>The key innovation is the <strong>non-linear risk scaling</strong> through the exponential transformation: π * (1 - e^(-2.3x)). This captures threshold effects common in flood scenarios—small increases in rainfall don&#39;t matter much until you cross a critical threshold, then risk explodes.</p><p>The 2.3 scaling factor was optimized specifically for Bangladesh’s climate patterns based on historical flood data.</p><p><strong>Circuit Visualization:</strong></p><pre>Qubit 0 (Temp):      ─── RY(θ₀) ───●─── M<br>                                   │<br>Qubit 1 (Precip):    ─── RY(θ₁) ───X─── M<br>                                         <br>Qubit 2 (Cyclones):  ─── RY(θ₂) ─────── M</pre><pre>Qubit 3 (Ancilla):   ─── H ───────────── M</pre><pre>Where:<br>θᵢ = π(1 - e^(-2.3·xᵢ))   // Non-linear feature encoding<br>●─X = CNOT gate          // Creates entanglement<br>M = Measurement          // Collapses to risk state</pre><p><strong>Risk State Interpretation:</strong></p><p>Quantum State Binary Risk Level Premium Multiplier |0000⟩ 0000 0% (Low) 1.0x (baseline) |0111⟩ 0111 43% 1.4x |1111⟩ 1111 100% (High) 2.3x</p><p>The quantum circuit outputs probability distributions over all 16 possible states (²⁴), allowing us to capture nuanced risk profiles rather than binary “high/low” classifications.</p><h3>2. Quantum Portfolio Optimization (QAOA)</h3><p>Insurance is fundamentally a portfolio problem: How do you balance risk across different regions, events, and policy types? We used the Quantum Approximate Optimization Algorithm (QAOA) to solve this multi-constraint optimization problem.</p><p><strong>The Mathematical Framework:</strong></p><p>QAOA works by encoding the portfolio optimization problem as a Quadratic Unconstrained Binary Optimization (QUBO) problem:</p><pre>Minimize: x^T Q x</pre><pre>Where:<br>- x = binary decision vector (invest in region i: yes/no)<br>- Q = matrix encoding:<br>  • Portfolio variance (original objective)<br>  • Constraint penalties (budget, ESG, diversity)<br>  • Asset correlations (covariance structure)</pre><p><strong>The QUBO Transformation:</strong></p><pre>f_total(x) = f_risk(x) + λ₁·penalty_budget(x) + λ₂·penalty_ESG(x)</pre><pre>Where:<br>- f_risk(x): Portfolio variance to minimize<br>- penalty terms: Violations of constraints<br>- λ values: Penalty weights tuned for problem structure</pre><p><strong>The QAOA Circuit:</strong></p><pre>|ψ(θ)⟩ = U_mixer(β_p) U_cost(γ_p) ... U_mixer(β_1) U_cost(γ_1) |+⟩^⊗n</pre><pre>Where:<br>- U_cost(γ): exp(-iγH_cost) encodes the portfolio objective<br>- U_mixer(β): exp(-iβH_mixer) explores the solution space<br>- (γ, β): Classical parameters optimized via gradient descent</pre><p>With QAOA, we could simultaneously optimize across multiple dimensions — geographic diversification, risk correlation, capital requirements, and expected claims — something that becomes computationally intensive for classical algorithms at scale.</p><h3>3. Parametric Insurance Design (QSVM)</h3><p>For vulnerable communities, waiting months for claim assessments isn’t viable. Parametric insurance pays out automatically when predefined triggers are met (like wind speed exceeding 150 km/h). We used Quantum Support Vector Machines (QSVM) to identify optimal trigger thresholds that balance false positives with adequate protection.</p><h3>The Reality Check: Working with 5–7 Qubits</h3><p>Here’s where things got interesting. Free-tier quantum computing platforms typically offer 5–7 qubits. For context, that’s like being asked to write a novel using only 7 letters of the alphabet.</p><p>Our final implementation used just <strong>4 qubits</strong> with the following specifications:</p><p><strong>Quantum Circuit Specifications:</strong></p><ul><li><strong>Qubits:</strong> 4 physical qubits</li><li><strong>Circuit Depth:</strong> 5 gates</li><li><strong>Measurement Shots:</strong> 1,000 per execution</li><li><strong>Backend:</strong> IBM Eagle r3 (128-qubit system, using 4)</li><li><strong>Error Mitigation:</strong> Dynamic decoupling for noise reduction</li></ul><p>This meant encoding three critical climate variables (temperature, precipitation, cyclone frequency) plus one ancillary qubit for entanglement operations — all within a circuit shallow enough to run on noisy near-term quantum hardware.</p><p><strong>Performance Results:</strong></p><p>The quantum-enhanced approach achieved measurable improvements:</p><ul><li><strong>23% improvement in premium accuracy</strong> compared to classical linear models</li><li><strong>40% faster portfolio rebalancing</strong> for insurers managing multiple regions</li><li><strong>Risk scoring range:</strong> Binary states |0000⟩ → 0% risk to |1111⟩ → 100% risk</li></ul><p>The quantum circuit produced probability distributions that captured risk correlations missed by classical models, particularly in identifying compound risk scenarios (e.g., high temperature + high precipitation = exponentially higher flood risk).</p><p>We had to get creative with the limited hardware:</p><p><strong>Modular Architecture</strong>: We broke our algorithms into smaller quantum circuits that could run on limited hardware, then combined results classically.</p><p><strong>Hybrid Quantum-Classical Systems</strong>: We used quantum algorithms for the computationally hard parts (optimization, pattern recognition) and classical computing for data preprocessing and post-processing.</p><p><strong>Circuit Compression</strong>: We applied advanced techniques to reduce circuit depth and gate count, making our algorithms feasible on noisy, near-term quantum devices.</p><p>This constraint actually made our solution more realistic and deployable — it’s easy to design quantum algorithms that need 1,000 qubits and perfect error correction, but building something that works today is the real challenge.</p><h3>Phase 2: From Theory to Proof-of-Concept</h3><p>Making it to Phase 2 was validation that our approach had merit, but now came the hard part: actually building it.</p><p>Phase 2 requirements were significantly more demanding:</p><ul><li>Develop a working proof-of-concept with quantum algorithms</li><li>Use real publicly available climate datasets</li><li>Select and justify quantum platform choices</li><li>Demonstrate measurable quantum advantage</li><li>Create a detailed implementation roadmap</li></ul><p><strong>Data Integration:</strong></p><p>We integrated with the World Bank Climate Change Knowledge Portal (CCKP) API to access real climate data:</p><pre># World Bank ERA5 Climate Reanalysis Data<br>endpoint = &quot;https://cckpapi.worldbank.org/cckp/v1/download/era5&quot;<br>params = {<br>    &quot;variables&quot;: &quot;temperature,precipitation,cyclones&quot;,<br>    &quot;countries&quot;: &quot;BGD&quot;,  # Bangladesh<br>    &quot;period&quot;: &quot;2000-2024&quot;<br>}</pre><p><strong>Data Sources:</strong></p><ul><li><strong>Primary:</strong> World Bank ERA5 reanalysis (24 years of climate data)</li><li><strong>Validation:</strong> Bangladesh Flood Forecasting and Warning Centre (FFWC) reports</li><li><strong>Target Region:</strong> Bangladesh Ganges-Brahmaputra-Meghna delta (60M people at risk)</li></ul><p><strong>Key Assumptions:</strong></p><ul><li>4-qubit representation captures primary climate risk correlations</li><li>Historical patterns (2000–2024) provide sufficient statistical basis for 1–3 year predictions</li><li>Temperature-precipitation entanglement models compound risk effects</li></ul><p>This meant working with actual temperature anomalies, precipitation patterns, and extreme weather indices rather than toy datasets. The technical challenges multiplied — API integration, data normalization, quantum circuit optimization, noise mitigation, and validation against classical benchmarks.</p><h3>Phase 3: Becoming a Finalist (Top 28 of 600+)</h3><p>Out of over 600 submissions from teams around the world, only 28 were selected as finalists for Phase 3. Making this cut felt surreal.</p><p>The competition was fierce — teams from leading universities, quantum computing companies, and insurance tech startups. What set our QuantumClimate Solutions apart? I believe it was the combination of:</p><p><strong>Practical feasibility</strong>: We designed for today’s hardware constraints, not future quantum computers. Our 5-qubit solution could actually run on free-tier platforms.</p><p><strong>Real data integration</strong>: Using actual World Bank climate data from Bangladesh showed we understood the domain, not just the algorithms.</p><p><strong>Clear impact pathway</strong>: We connected quantum advantage directly to stakeholder benefits — 23% more accurate premiums for farmers, 40% faster portfolio rebalancing for insurers.</p><p><strong>Hybrid approach</strong>: We acknowledged that quantum + classical was the path forward, not quantum replacing everything.</p><p>Being recognized among the top 28 validated not just the technical approach, but the belief that quantum computing can have real social impact today, not just in some distant future.</p><h3>The Numbers: Quantifying Quantum Impact</h3><p>Here’s what our quantum-enhanced solution delivered:</p><p><strong>Technical Performance:</strong></p><ul><li><strong>Quantum Circuit:</strong> 4 qubits, 5-gate depth, 1,000 shots</li><li><strong>Backend:</strong> IBM Eagle r3 quantum processor</li><li><strong>Processing Time:</strong> Real-time risk scoring (&lt; 5 seconds per assessment)</li><li><strong>Accuracy Improvement:</strong> 23% over classical linear models</li></ul><p><strong>Stakeholder Impact:</strong></p><ul><li><strong>Farmers:</strong> More accurate premiums reduce overpricing by ~20–30%</li><li><strong>Insurers:</strong> Portfolio rebalancing 40% faster, enabling dynamic risk management</li><li><strong>Government:</strong> Real-time disaster budgeting based on quantum risk forecasts</li><li><strong>Coverage Gap:</strong> Solution targets 60M at-risk people in Bangladesh delta region</li></ul><p><strong>Key Technical Innovation:</strong> The non-linear risk scaling formula θ = π(1 - e^(-2.3x)) captured threshold effects in climate risk that traditional linear models missed. This is the quantum advantage—not just speed, but the ability to model non-linear correlations through quantum superposition and entanglement.</p><p><strong>Validation Results:</strong> Testing against historical flood events (2000–2024) showed our quantum model correctly identified 87% of high-risk periods, compared to 71% for classical methods — a 16 percentage point improvement in predictive accuracy.</p><h3>What We Learned: The Gap Between Quantum Hype and Reality</h3><p>Working on this challenge taught me several crucial lessons about the current state of quantum computing:</p><p><strong>Quantum advantage is narrow and specific</strong>: Quantum computers aren’t universally faster. They excel at specific problem structures — optimization, sampling, certain machine learning tasks. Finding the right problem fit is critical.</p><p><strong>Noise is the enemy</strong>: Real quantum hardware is noisy. Gates aren’t perfect, qubits decohere quickly, and results need statistical aggregation. Noise mitigation strategies are as important as the algorithms themselves.</p><p><strong>Hybrid approaches are the path forward</strong>: The near-term future isn’t “quantum vs. classical” but rather “quantum + classical.” The winning solutions will intelligently partition problems between quantum and classical resources.</p><p><strong>Domain expertise matters</strong>: Understanding insurance, climate science, and risk modeling was just as important as understanding quantum algorithms. Technology is only valuable when it solves real problems.</p><h3>Why This Matters</h3><p>Climate change isn’t slowing down. By 2050, climate-related disasters could displace 200 million people. Without financial resilience mechanisms like insurance, vulnerable communities will bear the full brunt of these impacts.</p><p>Quantum computing won’t solve climate change — but it might help us build the financial infrastructure to protect people from its worst impacts. If quantum algorithms can make climate risk insurance more accurate, more affordable, and more accessible, that’s a genuine contribution to global resilience.</p><h3>The Road Ahead</h3><p>We’re still in the early days of quantum computing. Today’s quantum computers are like the room-sized classical computers of the 1960s — promising but limited. Yet those early computers eventually revolutionized the world.</p><p>The World Bank’s challenge represents something important: major institutions taking quantum computing seriously and asking “What can we actually build today that helps real people?”</p><p>That’s the right question to ask.</p><p>Being selected as one of 28 finalists from 600+ teams has been an incredible validation. But more importantly, it’s confirmed my belief that quantum computing has a role to play in climate resilience. The technical challenges are significant, the timeline uncertain, but the potential impact is too important to ignore.</p><p>If you’re interested in quantum computing, climate tech, or the intersection of emerging technology and social impact, I encourage you to explore these challenges. The barriers to entry are lower than you think — free quantum computing platforms are available, educational resources abound, and problems worth solving are everywhere.</p><p>Sometimes the best way to understand a technology’s potential is to try building something real with it. And sometimes, if you’re lucky and work hard, you make it to the finals.</p><p><em>Are you working on quantum computing applications or climate tech? I’d love to hear about your experiences in the comments. And if you’re interested in following the journey of a World Bank Quantum Challenge finalist, feel free to connect.</em></p><p><em>Full disclosure: This article describes work that achieved finalist status (top 28 of 600+ teams) in the World Bank Quantum Computing Challenge on the aqora.io platform. The views and approaches described are my own and don’t represent the World Bank’s official positions.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=769a0d80c709" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I combined quantum algorithms with Modern Portfolio Theory to solve real-world investment…]]></title>
            <link>https://medium.com/@feeltech_kkoci/how-i-combined-quantum-algorithms-with-modern-portfolio-theory-to-solve-real-world-investment-d37ab979bd97?source=rss-a1ad6a9ae9f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/d37ab979bd97</guid>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[financial-technology]]></category>
            <category><![CDATA[portfolio-optimization]]></category>
            <dc:creator><![CDATA[Kristian Koci]]></dc:creator>
            <pubDate>Wed, 13 Aug 2025 15:56:53 GMT</pubDate>
            <atom:updated>2025-08-13T16:18:10.471Z</atom:updated>
            <content:encoded><![CDATA[<h3>How I combined quantum algorithms with Modern Portfolio Theory to solve real-world investment challenges</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cCQxg3b6tX17j6QOLwcweQ.png" /><figcaption>Reference Circuit</figcaption></figure><p><em>How I combined quantum algorithms with Modern Portfolio Theory to solve real-world investment challenges</em></p><p><strong>From Theory to Practice: The WISER Quantum Challenge</strong></p><p>When I joined the <strong>Womanium &amp; WISER Global Quantum Program 2025</strong>, I never imagined I’d end up building a quantum-powered investment system that could compete with classical optimization tools. But that’s exactly what happened during our intensive <strong>Quantum for Finance</strong> project track.</p><p>Working alongside brilliant teammates <strong>Unique Dhakal</strong> and <strong>Dilek Isik Akcakaya, PhD</strong> (Senior Process &amp; Materials Engineer specializing in next-gen semiconductor devices), we tackled one of the most compelling applications of quantum computing: <strong>portfolio optimization</strong>.</p><p><strong>The Challenge: Making Quantum Computing Financially Relevant</strong></p><p>Portfolio optimization is a cornerstone of modern finance. Given a universe of assets, how do you allocate capital to maximize returns while minimizing risk? Sounds simple, but with <em>n</em> assets, there are <strong>2^n possible portfolios</strong> to evaluate — a problem that quickly becomes impossible for classical computers as the number of assets grows.</p><p>This is where quantum computing promises a revolutionary advantage.</p><p><strong>Our Approach: VQE Meets Modern Portfolio Theory</strong></p><p>We implemented a <strong>Variational Quantum Eigensolver (VQE)</strong> system specifically designed for portfolio optimization. But here’s where it gets interesting — instead of using the standard Hamiltonian encoding approach, we developed a <strong>direct optimization method</strong> that’s more practical for financial applications.</p><p><strong>Technical Innovation: Quantum Constraint Handling</strong></p><p>In classical optimization (like Gurobi), constraints are handled directly in the model. But in quantum optimization — especially when using VQE — we often need to embed constraints into the cost function using penalty terms.</p><p>Our system handles complex portfolio constraints like:</p><ul><li><strong>Budget allocation</strong> (fully invested requirement)</li><li><strong>ESG scoring</strong> (sustainable investing criteria)</li><li><strong>Risk limits</strong> (maximum volatility thresholds)</li><li><strong>Sector exposure</strong> (diversification requirements)</li></ul><p>By encoding these as penalty terms in our quantum objective function, we allow the quantum circuit to explore all possible portfolio combinations while naturally favoring feasible solutions.</p><p><strong>Results That Surprised Even Us</strong></p><p>After weeks of development and testing, our quantum system achieved something remarkable:</p><p>🎯 <strong>0.25% performance gap</strong> vs classical GUROBI optimization 📊 <strong>31-asset portfolio</strong> successfully optimized (2.1 billion possible combinations) ⚡ <strong>Near-optimal convergence</strong> in quantum-classical hybrid loop 🔧 <strong>8 different portfolio types</strong> including ESG-constrained and index-tracking strategies</p><p><strong>The Complete System: Beyond Just Algorithms</strong></p><p>What I’m most proud of isn’t just the quantum algorithm — it’s the <strong>complete end-to-end system</strong> we built:</p><h3>🔬 Portfolio Problem Generator</h3><p>Created 8 realistic investment scenarios covering:</p><ul><li>Mean-variance optimization under different market conditions</li><li>ESG-constrained portfolios for sustainable investing</li><li>Index tracking for passive management strategies</li></ul><h3>📊 Real-Time Monitoring Dashboard</h3><p>Built professional visualization tools showing:</p><ul><li>Quantum optimization convergence in real-time</li><li>Parameter evolution across optimization epochs</li><li>Classical vs quantum performance comparison</li><li>Risk-return profile analysis</li></ul><h3>🔧 Format Integration Tools</h3><p>Developed converters to bridge industry-standard optimization tools (GUROBI/CPLEX) with quantum computing frameworks (Qiskit), making quantum portfolio optimization accessible to finance professionals.</p><p><strong>Lessons Learned: The Reality of Near-Term Quantum</strong></p><p>Our project revealed both the <strong>promise and current limitations</strong> of quantum computing for finance:</p><h3>✅ What Works Today:</h3><ul><li><strong>Excellent solution quality</strong> for medium-scale problems (31 assets)</li><li><strong>Novel constraint handling</strong> through penalty methods</li><li><strong>Hybrid classical-quantum</strong> approaches show real promise</li><li><strong>Framework scalability</strong> ready for future quantum hardware</li></ul><h3>🔧 Current Challenges:</h3><ul><li><strong>Runtime performance</strong>: Quantum approach ~200x slower (expected for current hardware)</li><li><strong>Scaling limitations</strong>: Current ansatz designs struggle beyond ~31 qubits</li><li><strong>Hardware constraints</strong>: NISQ-era devices limit problem complexity</li></ul><p>But here’s the key insight: <strong>we’re not trying to replace classical computing tomorrow</strong> — we’re building the foundation for quantum advantage as hardware improves.</p><h3>Why This Matters for the Financial Industry</h3><p>Portfolio optimization is just the beginning. The techniques we developed apply to:</p><ul><li><strong>Risk management</strong> (VaR calculations, stress testing)</li><li><strong>Algorithmic trading</strong> (order execution optimization)</li><li><strong>Credit scoring</strong> (non-linear risk assessment)</li><li><strong>Fraud detection</strong> (pattern recognition in transaction data)</li></ul><p>As quantum hardware scales to 100+ qubits with lower error rates, these applications will become game-changers for financial institutions.</p><h3>Gratitude and Looking Forward</h3><p>Huge thanks to the <strong>Womanium &amp; WISER</strong> team for creating such an intensive, hands-on learning experience. Special appreciation to my teammates <strong>Unique Dhakal</strong> and <strong>Dilek Isik Akcakaya, PhD</strong> — working with brilliant minds from different technical backgrounds (semiconductor engineering meets quantum finance!) made this project possible.</p><p>To <strong>@WISER</strong> and the entire <strong>Womanium &amp; WISER Global Quantum Program 2025</strong>: you’re not just teaching quantum computing — you’re building the workforce that will define the quantum economy.</p><h3>What’s Next?</h3><p>The quantum revolution in finance isn’t coming — <strong>it’s already here</strong>. Companies like Goldman Sachs, JPMorgan, and Wells Fargo are actively exploring quantum applications. Our project proves that with the right approach, quantum algorithms can solve real-world financial problems today.</p><p>Want to see the technical details? The complete system architecture and results are documented in our project repository. And if you’re interested in quantum computing applications, I encourage you to check out next year’s Womanium &amp; WISER programs — this field is moving fast, and the opportunities are incredible.</p><p><strong>The future of finance is quantum. The question isn’t whether you’ll be part of it — it’s when you’ll start preparing.</strong></p><p><em>#QuantumComputing #QuantumFinance #PortfolioOptimization #VQE #WISER #Womanium #QuantumTech #FinTech #ModernPortfolioTheory #STEM</em></p><p><strong>The Team:</strong></p><ul><li><strong>Kristian Koci</strong> — Quantum Algorithm Development &amp; Project Lead</li><li><strong>Unique Dhakal</strong> — Quantum Algorithm Development</li><li><strong>Dilek Isik Akcakaya, PhD</strong> — Process Engineering &amp; Quantum Applications</li><li>Follow <a href="https://www.youtube.com/channel/UC1X58IMD7ZfDjIaEssezezg"><strong>@WISER</strong></a> for more quantum computing opportunities</li></ul><p><em>What quantum applications excite you most? Share your thoughts in the comments!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d37ab979bd97" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>