<?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 Pankaj Negi on Medium]]></title>
        <description><![CDATA[Stories by Pankaj Negi on Medium]]></description>
        <link>https://medium.com/@pankajads?source=rss-482b484b4635------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*g7HrQMWyitOhTZrc</url>
            <title>Stories by Pankaj Negi on Medium</title>
            <link>https://medium.com/@pankajads?source=rss-482b484b4635------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 10:08:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pankajads/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[Show Me the Query: What an AI Ops Agent Owes You Before You Trust Its Root Cause]]></title>
            <link>https://pankajads.medium.com/show-me-the-query-what-an-ai-ops-agent-owes-you-before-you-trust-its-root-cause-110405e35784?source=rss-482b484b4635------2</link>
            <guid isPermaLink="false">https://medium.com/p/110405e35784</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[incident-response]]></category>
            <category><![CDATA[aiops]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[sre]]></category>
            <dc:creator><![CDATA[Pankaj Negi]]></dc:creator>
            <pubDate>Mon, 30 Nov 2026 04:56:42 GMT</pubDate>
            <atom:updated>2026-11-30T04:56:42.373Z</atom:updated>
            <content:encoded><![CDATA[<h3><em>More telemetry is going into AI incident agents. Very little of the reasoning is coming back out.</em></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DFMgM6uU4B1qzQuByW6_dQ.png" /></figure><p>Another observability vendor this week added a new data source, eBPF network maps, straight into its AI ops agent. It’s a sensible move. Kernel-level network data fills a real blind spot. When latency spikes, you can finally tell slow DNS, handshake delays and retransmits apart from slow code.</p><p>But look at the pattern across the industry. Every release adds more telemetry, and the agent hands back a cleaner, more confident “likely cause.” The inputs keep growing while the output stays a single sentence.</p><p>At 3 a.m., that sentence is tempting. You’re tired and the pager won’t stop. Someone in the incident channel is asking for an ETA. An agent saying <em>“Likely cause: connection pool exhaustion in payments-api after deploy #4812”</em> feels like a gift.</p><p>It’s only a gift if you can check it in under a minute. If you can’t, it’s a guess you’ll be tempted to act on.</p><h3>The problem isn’t accuracy. It’s that you can’t check the answer.</h3><p>Root-cause agents will be wrong sometimes, and so are humans. The difference is that when a senior SRE says “I think it’s the pool,” you can ask “what are you looking at?” and get an answer. Most agent findings today don’t let you ask that. You get a conclusion and maybe a confidence score, and the reasoning stays hidden.</p><p>A confidence score isn’t evidence. “87% likely” tells you nothing about what the 87% rests on. It could be three correlated signals. It could be one lucky timestamp match.</p><h3>What I’d need to see before trusting an AI-suggested root cause</h3><p><strong>1. Every claim links to the artifact behind it.</strong> Not a summary of a query, but the query itself: the exact PromQL, LogQL or SQL, plus the trace ID, the graph and the time window. One click should take me to the raw data the agent saw, so I can rerun it, change it, or widen the window myself.</p><p><strong>2. What it ruled out, and how.</strong> This matters more than links. Real diagnosis works by elimination. If the agent says “it’s the connection pool,” I want to see that it checked the database, the recent deploy, upstream DNS and the network path, and why each one was dismissed. A finding that lists no rejected alternatives hasn’t done a diagnosis. It has matched a pattern.</p><p><strong>3. What it couldn’t see.</strong> Every agent works within its data. If a service has no traces, if logs are sampled at 1%, or if the eBPF agent isn’t running on half the nodes, the finding should say so up front. “No anomalies found in X” means nothing if X wasn’t instrumented. Blind spots belong in the finding itself, not in a docs page.</p><p><strong>4. Timing that makes sense.</strong> The suspected cause has to start before the symptom. That sounds obvious, but correlation engines regularly flag something that began <em>after</em> users were already affected. Show me both timelines side by side.</p><p><strong>5. A test I can run to confirm or refute it.</strong> A good hypothesis predicts something. “If it’s pool exhaustion, active connections should sit at the max of 50 and wait time should climb.” Give me the check that would prove the agent wrong. If it can’t name one, it doesn’t have a hypothesis yet.</p><p><strong>6. What changed since the last finding.</strong> Incidents move. If the agent revises its view at 3:14 a.m., I need to know what new evidence changed it, not just see a different answer in the sidebar.</p><h3>And the line that matters most: what it can do on its own</h3><p>Diagnosis is one thing and action is another. The moment an agent can restart pods, roll back deploys or scale clusters, being explainable stops being nice to have. It becomes a safety requirement.</p><p>Every agent finding should come with an explicit, visible line:</p><ul><li><strong>Will do on its own:</strong> gather more data, run read-only queries, open a ticket, page the owner.</li><li><strong>Will propose, needs a human yes:</strong> rollback, restart, scale, feature-flag change.</li><li><strong>Will never do:</strong> delete data, change security settings, touch anything outside the named service.</li></ul><p>That boundary should be set by the team, visible on every finding, and recorded in an audit log the agent can’t edit. “The agent decided” is not an acceptable line in a postmortem.</p><h3>Why this matters more as telemetry grows</h3><p>It’s tempting to think more data makes the agent more trustworthy. It mostly makes it more <em>convincing</em>. With eBPF network maps, traces, logs, metrics and deploy events all feeding one model, there are more ways to find a plausible-looking correlation. More inputs without more transparency means stronger-sounding answers that are harder to audit.</p><p>The vendors that earn trust won’t be the ones with the most data sources. They’ll be the ones whose agent can answer the question every good on-call engineer asks: <em>“How do you know?”</em></p><h3>A simple test for your next demo</h3><p>Next time a vendor shows you an AI root-cause demo, ask three things:</p><ol><li>Click on the conclusion. Where does it take me?</li><li>What did the agent rule out, and can I see why?</li><li>What is it allowed to change without asking me?</li></ol><p>If those answers are vague, the agent may still be useful, but treat its finding as a suggestion and not as a diagnosis.</p><p><em>What would you need to see before trusting an AI-suggested root cause during a live incident? I’d like to hear from people who’ve actually acted on one, or been burned by one.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=110405e35784" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Same cloud, wrong playbook: rethinking AWS-to-AWS acquisitions]]></title>
            <link>https://pankajads.medium.com/same-cloud-wrong-playbook-rethinking-aws-to-aws-acquisitions-85cbfba7243b?source=rss-482b484b4635------2</link>
            <guid isPermaLink="false">https://medium.com/p/85cbfba7243b</guid>
            <category><![CDATA[integration]]></category>
            <category><![CDATA[mergers-and-acquisitions]]></category>
            <category><![CDATA[cloud-migration]]></category>
            <dc:creator><![CDATA[Pankaj Negi]]></dc:creator>
            <pubDate>Sat, 03 Oct 2026 02:24:16 GMT</pubDate>
            <atom:updated>2026-10-03T02:31:16.393Z</atom:updated>
            <content:encoded><![CDATA[<p>Lift-and-shift, re-platform and re-architect are the usual migration choices. They’re the wrong place to start when the acquirer and the target (the company being bought) both already run on AWS. The first question isn’t how to move each workload; it’s whether you need to move it at all, or just its account.</p><h4>The usual migration options assume you are changing clouds</h4><p>The familiar migration vocabulary (rehost, re-platform, re-architect, and the rest of the “Rs”) was built for moving from a data centre to the cloud. In that world, every workload has to move, so the only question is how much to change it on the way.</p><p>AWS’s own list, the 7 Rs, does include Relocate, Retire and Retain. But Relocate there mostly means moving VMware environments onto AWS. In a same-cloud acquisition it means something simpler: moving the target’s AWS account, as it is, into your AWS Organization. That should be the first option you check for every workload, not one of seven.</p><p>An acquisition where both companies already run on AWS is a different problem. The target’s workloads already run on the same platform, often in the same regions, built from the same services. “Lift-and-shift” here means rebuilding a working architecture in a new AWS account and copying the data across, which costs effort and adds risk for no technical gain.</p><p>Yet integration plans routinely start from that list, because it’s the one everybody knows. The result is weeks of effort estimated, staffed and scheduled for moves that didn’t need to happen.</p><h4>What actually has to change</h4><p>If the platform isn’t changing, what is? Mostly the control plane around the workloads:</p><ul><li><strong>Ownership and billing.</strong> The target’s accounts sit in their own AWS Organization, under their own payer, support plan and agreements.</li><li><strong>Guardrails.</strong> Your service control policies, region restrictions, encryption and logging baselines don’t apply to their accounts yet, and their workloads may not survive them.</li><li><strong>Networks.</strong> Their VPC address ranges may overlap yours. That one fact can block connectivity between the two estates until someone re-addresses a network.</li><li><strong>Identity.</strong> Their people sign in through their identity provider, their roles trust their accounts, and some of those trusts point at accounts you have never heard of.</li><li><strong>Delivery.</strong> Their pipelines, Terraform modules and deployment roles follow their conventions, not your platform team’s.</li></ul><p>None of that requires rebuilding a workload. All of it needs a decision, and some of it needs real engineering.</p><h4>A better option set</h4><p>For a same-cloud acquisition, every workload deserves six options compared side by side, not three:</p><ol><li><strong>Relocate.</strong> Move the AWS account, as it is, into your Organization, and fix only what breaks your guardrails. Often the fastest path by a wide margin.</li><li><strong>Lift-and-shift.</strong> Rebuild the same architecture in an account vended by your landing zone. Worth it when the source account is a tangle of unrelated workloads, or when its network can’t be reconciled with yours.</li><li><strong>Re-platform onto your paved road.</strong> Swap components for your standard equivalents (container platform, managed database standard, pipeline templates) without a redesign.</li><li><strong>Modernize.</strong> Re-architect toward best practice and full alignment with your standards. Highest effort, best long-term fit; justified for strategic workloads with time to spare.</li><li><strong>Retire.</strong> Decommission what is idle, or what duplicates something you already run.</li><li><strong>Retain.</strong> Leave it where it is for now, under a transition services agreement, with a date to revisit.</li></ol><p>The point isn’t that relocation always wins. It’s that relocation has to be on the table, with an honest effort and risk next to every other option, before anyone commits a team to rebuilding something that already works.</p><h4>Relocation is fast, not free</h4><p>Moving an account between AWS Organizations is an administrative operation. Making the workloads inside it survive the move is engineering. Before you choose relocation, find out:</p><ul><li><strong>Which of your guardrails the account violates today.</strong> A region it uses that you deny, unencrypted storage, public endpoints, missing logging. Attaching your policies to a running production account without knowing this is how relocations cause outages. Land it in a quarantine organizational unit first.</li><li><strong>Whether its network overlaps yours.</strong> Relocation doesn’t fix overlapping address ranges; it just moves the problem into your Organization.</li><li><strong>Whether the account is clean.</strong> One account hosting five unrelated workloads can’t be relocated for one of them. It goes as a block, or the workloads get split out.</li><li><strong>What it depends on outside itself.</strong> Cross-account trusts, VPN connections, peering, DNS zones, certificates, and third-party integrations allow-listed by IP or account.</li><li><strong>What the commercial side says.</strong> Reserved capacity, savings plans, Marketplace subscriptions and support arrangements don’t always move cleanly.</li></ul><p>Each of those can be discovered from the target’s own accounts, before anyone commits to a path.</p><h4>The real destination is your paved road</h4><p>If the cloud isn’t changing, “migrated” has to mean something else: the acquired workloads run the way your teams run things. Your landing zone, your container platform, your pipeline templates, your Terraform, CDK modules, your observability and identity.</p><p>That makes the useful question per workload: how far is each component from your paved road? Each one falls into one of three buckets:</p><ul><li><strong>Aligned.</strong> It already matches your standard.</li><li><strong>Mappable.</strong> Your standard has an equivalent, at a known cost: a self-managed Postgres on EC2 that maps to your managed database standard, or ad-hoc deploy scripts that map to your pipeline template.</li><li><strong>Gap.</strong> You have no equivalent. That means an exception, or a new capability for your platform team.</li></ul><p>This view changes the conversation with engineering leadership. “Re-platform” stops being a vague middle option and becomes a list of specific swaps with specific costs. And the gaps show where your paved road itself needs to grow.</p><h4>What this means for your plan</h4><p>A same-cloud integration plan that holds up has three properties:</p><ol><li><strong>Every workload shows all its options</strong>, with effort ranges and risk, so leadership can see what relocation would save and what modernization would buy.</li><li><strong>Guardrail and compliance problems are hard flags, not effort points.</strong> A workload holding personal data in a region you don’t allow is a conflict someone must resolve, not a cost to average away.</li><li><strong>People choose, and the choice is recorded.</strong> The tool recommends; the integration team decides, with the reasoning visible to whoever reviews it later.</li></ol><p>We are building an open-source tool around exactly this approach: <strong>Sherpa</strong> discovers the target’s AWS accounts, GitHub repositories and pipelines; assesses each workload against your guardrails, compliance rules and paved road; and lays out these options with effort for your team to decide. It’s early, and starting with AWS to AWS.</p><p>If you have run, or are about to run, an AWS-to-AWS integration, I’d like to hear where this matches your experience and where it doesn’t. The project, its philosophy and roadmap are at <a href="https://github.com/pankajads/sherpa"><strong>github.com/pankajads/sherpa</strong></a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85cbfba7243b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Got Fed Up and Built My Own Portfolio Advisor. Here’s What It Found.]]></title>
            <link>https://pankajads.medium.com/i-got-fed-up-and-built-my-own-portfolio-advisor-heres-what-it-found-13becc59a9ef?source=rss-482b484b4635------2</link>
            <guid isPermaLink="false">https://medium.com/p/13becc59a9ef</guid>
            <category><![CDATA[portfolio]]></category>
            <category><![CDATA[financial-freedom]]></category>
            <category><![CDATA[financial-advisor]]></category>
            <dc:creator><![CDATA[Pankaj Negi]]></dc:creator>
            <pubDate>Sat, 22 Aug 2026 13:17:57 GMT</pubDate>
            <atom:updated>2026-08-22T13:17:57.832Z</atom:updated>
            <content:encoded><![CDATA[<p><em>I’m a developer and an Indian investor. I got frustrated enough to build the tool I wished existed. Here’s what I learned.</em></p><p>There’s a particular kind of anxiety that hits every Indian investor around 11 PM.</p><p>You’re lying in bed, phone in hand, staring at your portfolio. Paytm Money says you’re up 12%. Smallcase is nudging you to rebalance. Your WhatsApp group is screaming about some mid-cap that’s “100% going to 3x.” And your mutual fund app is quietly suggesting you “upgrade to advisory” for ₹999/month.</p><p>You have data everywhere. You have opinions everywhere. What you don’t have — and what I never had — is a <strong>reason you can actually verify</strong>.</p><p>So I built one.</p><h3>Why I Built FactFolio</h3><p>I am both a developer and a retail investor. That combination makes you unusually difficult to fool — and unusually frustrated by the tools that exist.</p><p>I tried three different robo-advisory platforms. All of them gave me confident buy/sell signals. None of them could tell me what <em>exact data point</em> triggered the call. Was it the P/E ratio? The moving average crossover? The analyst consensus? They didn’t say — because saying it would mean being wrong about it specifically, and vague is safer.</p><p>Then there was the data problem. Every holding I uploaded, every quantity I revealed, every cost basis I shared — it left my device the moment I hit “analyze.” I was trusting not just the model, but the company, their security team, their data retention policy, and every breach that might happen three years from now.</p><p>For a developer, this is an itch you can’t un-feel. So about six months ago, I started building <a href="https://github.com/pankajads/factfolio">FactFolio</a> — a free, local, open-source portfolio advisory system for Indian investors.</p><p>The tagline I wrote for myself before writing a single line of code:</p><blockquote><strong><em>“Every number, traced. No black box, no guesswork, no fees.”</em></strong></blockquote><p>I’m open-sourcing it now because I think other investors deserve the same thing I built for myself.</p><h3>What I Built and Why Each Decision Matters</h3><h3>1. Your Data Never Leaves Your Machine</h3><p>This was the non-negotiable first principle. FactFolio sends <strong>only ticker symbols</strong> to external data providers — never quantities, never valuations, never cost bases. The math happens entirely on your laptop.</p><p>NSE sends a price feed. Screener.in sends ratios. Your actual financial picture — how much you own, what you paid, what it’s worth — stays locked in your machine.</p><p>I didn’t want to build another “trust us” product. This was the foundation.</p><h3>2. Seven Specialist Agents, One Adversary</h3><p>The architecture I’m most proud of: instead of one AI trying to do everything, FactFolio runs <strong>seven specialist agents</strong>, each assigned a specific lens:</p><ul><li>🔍 <strong>Market Analyst</strong> — price trends, moving averages, momentum</li><li>📋 <strong>Portfolio Auditor</strong> — concentration, overlap, drift from target allocation</li><li>📈 <strong>Stock Researcher</strong> — analyst consensus, PE/PB ratios, screener data</li><li>💹 <strong>MF Analyst</strong> — mutual fund holdings specifically</li><li>🧾 <strong>Tax Strategist</strong> — STCG and LTCG impact under Indian tax rules <em>before</em> recommending a sell</li><li>⚠️ <strong>Risk Officer</strong> — HHI concentration scores, correlation analysis across your entire book</li><li>😈 <strong>Devil’s Advocate</strong> — tries to poke holes in every recommendation before it reaches you</li></ul><p>That last agent is the one I’m most glad I built. Most AI systems are optimized to sound confident and helpful. The devil’s advocate is specifically designed to argue against the other six — to surface the scenario where the recommendation is wrong. It’s adversarial review baked into the architecture.</p><h3>3. The Audit Gate — The Heart of the Whole Thing</h3><p>This is the feature that makes FactFolio actually earn its name.</p><p>After all seven agents complete their work, a separate <strong>audit validator</strong> reviews the full report. Its job is simple: <em>reject any claim that cannot be traced back to an actual tool call in the log.</em></p><p>If an agent writes “this stock shows strong institutional buying,” the auditor asks: “Show me the tool call where you retrieved that data.” If the call isn’t in the log, the claim gets cut.</p><p>This is “fact-folio” literally — a portfolio of facts. Every recommendation is cited. Every number has a source. You can read the audit log yourself and check my work.</p><h3>4. Python Does the Math, Claude Does the Thinking</h3><p>LLMs are notoriously bad at arithmetic. They hallucinate numbers. They confidently state that 47% + 31% = 83%. I sidestepped this entirely: <strong>all calculations run in Python</strong>. Weights, returns, tax estimates, correlations, risk scores — deterministic code, every time.</p><p>Claude (the underlying AI) is only used for reasoning and calling tools. It decides <em>what</em> to analyze and <em>how</em> to interpret results. It never touches the arithmetic.</p><p>Your portfolio math is reproducible and consistent — not “approximately right most of the time.”</p><h3>Getting Started in Under 5 Minutes</h3><p>bash</p><pre>uvx factfolio init<br>cd factfolio<br>uvx factfolio report</pre><p>The init command creates a project folder. Drop your broker export into holdings_inbox/ — Zerodha CSV, CAS statement PDF, XLSX from any other broker — and report kicks off the full multi-agent review.</p><p>No Python installation needed if you use uvx. There&#39;s also a standalone ~130MB binary for macOS, Windows, and Linux on the GitHub releases page.</p><h3>Commands Worth Knowing</h3><p>bash</p><pre>factfolio status        # Instant portfolio snapshot — no AI, no tokens, just your numbers<br>factfolio report        # Full 7-agent review with recommendations → saved to reports/<br>factfolio chat          # Ask it questions directly in your terminal<br>factfolio cron          # Grade past recommendations automatically<br>factfolio mcp           # Run as an MCP server for Claude Desktop or VS Code</pre><p>The status command is underrated — weights, returns, and concentration scores with zero LLM cost. I use it every morning.</p><h3>What My Own Report Told Me</h3><p>When I ran my portfolio through the full report, here’s what came back:</p><p><strong>Concentration Risk</strong> — HHI score flagged that my top three holdings made up 61% of equity exposure. The risk officer recommended trimming one position and named the specific metric that triggered it.</p><p><strong>Overlap Detection</strong> — Two of my mutual funds held the same top-5 stocks. The portfolio auditor identified the overlap and suggested consolidation with the exact tickers listed.</p><p><strong>Tax-Aware Sell Timing</strong> — The tax strategist calculated that selling a particular stock <em>now</em> (short-term) vs. waiting 47 days (long-term) would save a meaningful amount in capital gains tax. The math was in the report. I verified it line by line.</p><p><strong>Devil’s Advocate Win</strong> — For one BUY recommendation the other agents agreed on, the devil’s advocate flagged that the analyst consensus was based on only three analysts — two of whom had recently downgraded their targets. The recommendation was revised to HOLD. That one flag alone made the whole project worth building.</p><h3>Who This Is For</h3><p><strong>Use FactFolio if:</strong></p><ul><li>You’re an Indian retail investor with equity + MF holdings</li><li>You’re tired of recommendations you can’t verify</li><li>You want your financial data to stay on your machine</li><li>You want tax-aware analysis <em>before</em> you decide to sell</li><li>You’re comfortable running a command in a terminal</li></ul><p><strong>Skip it if:</strong></p><ul><li>You want price predictions (FactFolio explicitly refuses to forecast)</li><li>You need a mobile app</li><li>You want a bot that acts without your review</li></ul><p>This is a <em>thinking tool</em>, not a trading bot. It surfaces evidence and structured reasoning. You make the final call — with actual facts in front of you.</p><h3>Why I’m Open-Sourcing It</h3><p>I could have kept this for myself. For six months, I did.</p><p>But the more I used it, the more I realized the problem I solved was not mine alone. Every Indian investor I know is dealing with the same combination: opaque advice, privacy concerns, and tools that weren’t designed for our tax rules or our brokers.</p><p>MIT license. Free. No account. No subscription. Fork it, break it, improve it.</p><p>The last two years have seen an explosion of AI financial tools. Most of them are wrappers — they take your data, send it somewhere, return text that sounds authoritative, and charge you for the privilege. The analysis is unverifiable. The privacy is illusory. The confidence is theatrical.</p><p>FactFolio is the opposite. It won’t predict the market. It won’t tell you which stock is going to 10x. What it will do is give you an honest, structured, evidence-backed view of your portfolio — and show you exactly where every number came from.</p><p>For Indian investors who’ve been told to “trust the algorithm” for too long, that’s not a small thing.</p><h3>Try It</h3><ul><li><strong>GitHub</strong>: <a href="https://github.com/pankajads/factfolio">github.com/pankajads/factfolio</a></li><li><strong>Install</strong>: uvx factfolio init</li><li><strong>License</strong>: MIT — free, open, forkable</li></ul><p>Drop your Zerodha CSV in. Run the report. Read the audit log. Then decide what to do with your money.</p><p><em>FactFolio is not a SEBI-registered advisor. All output is for educational and personal use only. Verify independently before acting on any recommendation.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13becc59a9ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quantum Phase Kickback]]></title>
            <link>https://pankajads.medium.com/quantum-phase-kickback-040f3f1668b3?source=rss-482b484b4635------2</link>
            <guid isPermaLink="false">https://medium.com/p/040f3f1668b3</guid>
            <category><![CDATA[grovers-algorithm]]></category>
            <category><![CDATA[quantum-phase-estimation]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <dc:creator><![CDATA[Pankaj Negi]]></dc:creator>
            <pubDate>Wed, 29 Jul 2026 02:14:15 GMT</pubDate>
            <atom:updated>2026-07-29T02:14:15.464Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>What is Phase Kickback?</strong></h3><p>Phase kickback is a quantum trick where a phase (a complex number e^iφ) that ‘should’ appear on the <strong>target qubit</strong> ends up on the <strong>control qubit</strong> instead. It sounds like a bug — but it is a feature. Almost every major quantum algorithm exploits it.</p><p>This is the engine behind <strong>Deutsch-Jozsa</strong>, <strong>Grover’s diffusion</strong>, and <strong>Quantum Phase Estimation</strong>.</p><h3>How it works?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v5_AevrwyEVbb9t_AcJ1VQ.png" /></figure><p><strong>The setup.</strong> You have two qubits: a <em>control</em> (starts as |0⟩) and a <em>target</em> (prepared as a special state |ψ⟩ — an eigenstate of U, meaning U just multiplies it by a phase e^iφ, doesn’t change its shape).</p><p><strong>Step 1→2.</strong> Put the control in superposition with a Hadamard gate: it becomes “half |0⟩, half |1⟩” — superposition state. Target stays |ψ⟩.</p><p><strong>Step 3 — the surprise.</strong> Apply the Controlled-U gate (CU). You’d expect the phase e^iφ to appear on the <em>target</em>, since U acts on it. But because the target is already an eigenstate, U just scales it — and quantum mechanics “charges” that scale factor back to the <em>control</em> qubit instead. The target pops right back to |ψ⟩ unchanged.</p><p><strong>Step 4.</strong> The control is now (|0⟩ + e^iφ|1⟩)/√2. The phase φ is now encoded as a <em>relative phase</em> between its two branches. Apply another H + measure, and you can extract φ.</p><p><strong>The uncomfortable truth:</strong> the kickback only works because the target is an <em>eigenstate</em> of U. If it’s not, the phase doesn’t cleanly separate — you get entanglement instead and the trick fails. This condition is what makes Quantum Phase Estimation hard in practice (preparing the right eigenstate is non-trivial).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=040f3f1668b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quantum Teleportation & Superdense]]></title>
            <link>https://pankajads.medium.com/quantum-teleportation-superdense-0985f3fa2798?source=rss-482b484b4635------2</link>
            <guid isPermaLink="false">https://medium.com/p/0985f3fa2798</guid>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[bell-state]]></category>
            <category><![CDATA[quantum-teleportation]]></category>
            <dc:creator><![CDATA[Pankaj Negi]]></dc:creator>
            <pubDate>Sun, 19 Jul 2026 06:33:03 GMT</pubDate>
            <atom:updated>2026-07-19T06:33:03.434Z</atom:updated>
            <content:encoded><![CDATA[<p>It Sounds Stranger than fiction — and already demostrated in lab</p><h3><strong>TL;DR</strong></h3><p>Quantum teleportation moves a quantum state from one place to another using entanglement and 2 classical bits — but the original is always destroyed. Superdense coding does the reverse: sends 2 classical bits of information using just 1 qubit. Both are real, proven protocols with deep implications for quantum networks.</p><h3><strong>Quantum Teleportation: Not What You Think</strong></h3><p>Quantum teleportation does NOT transport matter or energy. It does NOT move a physical particle from A to B. What it transports is the quantum STATE — the complete description of a qubit — from one location to another, destroying the original in the process. This is remarkable for a key reason: because of the No-Cloning Theorem, you cannot simply copy a qubit and send the copy. Teleportation is the quantum-legal workaround — it transfers the state without copying it.</p><h3><strong>ANALOGY — The Teleporting Piece of Paper</strong></h3><p>Imagine you want to send a friend a very specific piece of origami that cannot be photographed or scanned (quantum no-cloning). The only way is to: (1) share a pre-arranged ‘magic link’ with your friend — your entangled pair. (2) Unfold your origami and compare it to your half of the magic link. (3) Tell your friend 2 numbers over the phone (2 classical bits). (4) Your friend uses those 2 numbers to fold their half of the magic link into the exact same shape. Crucially, YOUR origami is destroyed in step 2. The state, not the paper, has been teleported.</p><h3><strong>The Teleportation Protocol</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-R0pMX3spJJak6Ly" /></figure><ol><li>Share entanglement — Alice and Bob share one Bell pair (entangled qubit pair) in advance</li><li>Alice performs Bell measurement — Alice measures her qubit (to be teleported) together with her half of the Bell pair — producing 2 classical bits</li><li>Alice sends 2 classical bits — Alice sends the 2-bit result to Bob over a regular (classical) channel</li><li>Bob qubit corrects his qubit — Bob applies one of 4 correction operations to his Bell pair, depending on Alice’s 2-bit message</li><li>Bob original state — Bob’s qubit is now in the exact state, Alice’s original qubit was — Alice’s original is gone</li></ol><h3><strong>Superdense Coding: The Reverse Magic</strong></h3><p>Superdense coding is teleportation’s dual. Where teleportation uses 1 Bell pair + 2 classical bits to move 1 qubit, superdense coding uses 1 Bell pair to send 2 CLASSICAL bits using only 1 qubit of quantum communication.</p><p>Protocol: Alice and Bob share a Bell pair. Alice wants to send one of four messages (00, 01, 10, 11). She applies zero, one, or two gates to her half of the Bell pair (just 1 qubit operation!). She sends that 1 qubit to Bob. Bob performs a Bell measurement on the pair — and reads out both classical bits of Alice’s message.</p><h3><strong>ANALOGY — The Quantum Postcard</strong></h3><p>Classical postcard = 1 postcard, 1 message. Superdense coding: you and a friend pre-share a special ‘quantum coupon book’. Alice writes a symbol in her copy (1 qubit operation), tears out one coupon, and sends it to Bob. Bob combines the coupon with his copy and reads out a 2-page message. One coupon = two pages of information. The pre-shared entanglement is what makes this possible.</p><h3><strong>KEY Notes</strong></h3><ol><li>Quantum teleportation transfers a quantum state using 1 Bell pair + 2 classical bits — the original is destroyed.</li><li>Superdense coding sends 2 classical bits using 1 qubit + 1 pre-shared Bell pair — dual of teleportation.</li><li>Neither breaks the laws of physics: teleportation requires classical communication; superdense coding requires pre-shared entanglement.</li><li>Both are foundational protocols for future quantum internet and quantum secure communications.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0985f3fa2798" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Entanglement — Einstein’s Spooky Action at Distance]]></title>
            <link>https://pankajads.medium.com/entanglement-einsteins-spooky-action-at-distance-5b629713d431?source=rss-482b484b4635------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b629713d431</guid>
            <category><![CDATA[quantum-physics]]></category>
            <category><![CDATA[quantum-entanglement]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <dc:creator><![CDATA[Pankaj Negi]]></dc:creator>
            <pubDate>Sun, 12 Jul 2026 09:34:21 GMT</pubDate>
            <atom:updated>2026-07-12T09:34:21.670Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>TL;DR</strong></h3><p>Entanglement links two qubits so that measuring one instantly tells you about the other, no matter how far apart they are. No information travels between them — and yet they are perfectly correlated. This is the foundation of quantum networking, quantum teleportation, and ultimately quantum-secured communications.</p><h3><strong>The Strangest Fact in Physics</strong></h3><p>In 1935, Albert Einstein, Boris Podolsky, and Nathan Rosen described what they considered a paradox in quantum mechanics — two particles that, once interacted, remain correlated no matter how far apart you separate them. Measuring one particle instantly determines the state of the other. Einstein dismissed it as ‘spooky action at a distance’ and thought it proved quantum mechanics was incomplete.</p><p>Decades of experiments have proved Einstein wrong. Entanglement is real, has been verified over distances exceeding 1,200 km (China’s Micius satellite), and is now the cornerstone of quantum communication and quantum computing.</p><h4><strong>ANALOGY — The Magic Dice</strong></h4><p>Imagine two perfectly correlated magic dice. You give one to a colleague in Sydney, and you keep one in London. Each die, on its own, is completely random. But every time you roll yours, the Sydney die shows the exact same number — instantly, without any signal travelling between them. That’s entanglement. The correlations are real and verified. No cheating, no hidden pre-agreement — quantum physics just works this way.</p><h3><strong>How Entanglement is Created</strong></h3><p>Entanglement is created by quantum gates — specifically by applying a Hadamard gate to one qubit followed by a CNOT gate between two qubits. The result is a Bell state, the simplest entangled system. In a Bell state, the two qubits are perfectly correlated: if you measure one and get 0, the other will always give 0. If you get 1, the other will always give 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n1H-PBFXi2kXdjVP7B3-Ew.png" /></figure><h3><strong>What Entanglement Is NOT</strong></h3><p>This is critical for IT professionals to understand: entanglement does NOT allow faster-than-light communication. You cannot use it to send a message instantly, because the measurement result is random. Only when you compare notes classically (through normal channels) do you see the correlation. The ‘spooky’ part is that the correlation exists before any communication — but you can’t exploit it to transmit information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D5KC7vbhDsyMwrZYzD_13A.png" /></figure><h3><strong>Why Entanglement Matters for IT</strong></h3><p>Entanglement is the foundation for three important quantum technologies that will directly impact enterprise IT:</p><ol><li>Quantum Key Distribution (QKD): Entangled particles create cryptographic keys that are physically impossible to intercept without detection.</li><li>Quantum Teleportation: Transmitting quantum states (not physical matter) between locations using entanglement + classical bits.</li><li>Quantum Networking: Building quantum repeaters and quantum internet infrastructure using entanglement as the connecting resource.</li></ol><p><strong>KEY TAKEAWAYS</strong></p><ul><li>Entanglement links qubits so that measuring one instantly determines the other — at any distance.</li><li>It does NOT allow faster-than-light communication — results are random until compared classically.</li><li>Entanglement is the foundation of quantum cryptography, quantum networking, and teleportation.</li><li>Any attempt to eavesdrop on an entangled quantum channel disturbs the entanglement — it’s detectable.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b629713d431" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Interference — The secret weapon that makes quantum algorithm actually work]]></title>
            <link>https://pankajads.medium.com/interference-the-secret-weapon-that-makes-quantum-algorithm-actually-work-78f7f17b2dec?source=rss-482b484b4635------2</link>
            <guid isPermaLink="false">https://medium.com/p/78f7f17b2dec</guid>
            <category><![CDATA[simple-math]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[quantum-interference]]></category>
            <dc:creator><![CDATA[Pankaj Negi]]></dc:creator>
            <pubDate>Wed, 08 Jul 2026 02:55:32 GMT</pubDate>
            <atom:updated>2026-07-08T02:55:32.359Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>TL;DR</strong></h3><p>Interference is the mechanism that lets a quantum computer take all those parallel paths from superposition and steer toward the right answer. Without interference, quantum computing is just noisy randomness. With it, you can make correct answers more probable and wrong answers disappear.</p><h3><strong>What is Interference?</strong></h3><p>Interference is a wave phenomenon — and qubits are described by wave-like mathematics. When two waves overlap, they can either reinforce each other (constructive interference, making the combined wave bigger) or cancel each other out (destructive interference, making the combined wave smaller or zero). Quantum algorithms deliberately engineer both types.</p><blockquote><strong>ANALOGY — Noise-Cancelling Headphones</strong></blockquote><blockquote><em>Your noise-cancelling headphones work by listening to ambient noise, then generating an anti-noise waveform that is the exact mirror image. When the noise wave and the anti-noise wave overlap, they cancel out perfectly — destructive interference. Quantum algorithms do the same thing: they generate ‘anti-probability waves’ for wrong answers, making those answers vanish. Meanwhile, the correct answer’s wave is reinforced constructively.</em></blockquote><h3><strong>Constructive vs Destructive Interference</strong></h3><p>In a quantum computation, probability amplitudes (the mathematical descriptions of each possible outcome) can be positive or negative (technically, complex). When paths with the same sign overlap, their amplitudes ADD — the outcome becomes more probable. When paths with opposite signs overlap, their amplitudes SUBTRACT — the outcome becomes less probable, potentially reaching zero (vanishing entirely).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XUnEedq5_RN_LNEbrJAgcg.png" /></figure><p><strong>A Concrete Example: H-Z-H</strong></p><p>Let me try my best to explain this without much of maths. You may please refer my previous post in case below section looks complex.</p><p>Consider a simple 3-gate circuit: Hadamard (H), then Z gate, then Hadamard again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*Xhm8m33-SDbCF49Bi6RhwA.png" /></figure><ol><li>Start: qubit in state |0&gt; (definite zero).</li><li>After H: qubit is in superposition — equal blend of |0&gt; and |1&gt;.</li><li>After Z: the phase of the |1&gt; component is flipped (made negative) — invisible from the outside, but the maths has changed.</li><li>After H again: the interference between the two paths causes the |0&gt; and |1&gt; amplitudes to combine. The |1&gt; paths destructively interfere and cancel out; the |0&gt; paths constructively reinforce.</li></ol><p>Result: the qubit is back to definite |1&gt; (in this specific circuit). The Z gate’s invisible phase change was translated back into a visible probability change by the final H.</p><blockquote><strong>ANALOGY — The Phase Twist</strong></blockquote><blockquote><em>Think of the Z gate as secretly rotating the face of a clock by 180 degrees — the clock hands look the same, but something internal has changed. The second Hadamard is like a ‘revealer’ that makes that hidden rotation visible by translating it into a measurable difference. This is how phase information — invisible at any single step — drives the entire computation.</em></blockquote><h3>Mathamatical Explanation</h3><p><strong>State 0: Initialization</strong></p><p>The qubit starts in the definite state |0&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/230/1*Oel4D0fz_fzttVqaSqZIJQ.png" /></figure><p><strong>State 1: First Hadamard Gate (\(H\))</strong></p><p>The Hadamard gate puts the qubit into an equal superposition of |0&gt; &amp; |1&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*ymKkUt90G82FaLFL3nw80g.png" /></figure><p><strong>State 2: Phase-Flip Gate Z</strong></p><p>The Z gate leaves |0&gt; unchanged but flips the sign (phase) of the |1&gt; component to negative Z|1&gt; = -|1&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*gqR2Ch3sldYjUAfze1-sTQ.png" /></figure><p><strong>State 3: Second Hadamard Gate (H)</strong></p><p>We apply the Hadamard gate to the entire superposition state. Because the quantum operation is linear, it acts on both components individually</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*nxyswUyLJ0_jm1MIZFbAow.png" /></figure><p>To calculate this, we substitute the definition of what \(H\) does to each state:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*5iqXB0hJ6W7iXJStTcZBvA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mOGybB-tioI8KKsDUkF4dg.png" /></figure><p><strong>The Interference (Cancellation and Reinforcement)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a2iVHICJZdM0TBq1XVocHQ.png" /></figure><p><strong>Final Result</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*Ja4OgvrsXGJh1OUMvlOvHA.png" /></figure><p>The math shows that the |0&gt; component vanishes due to <strong>destructive interference</strong>, while the |1&gt; component reaches full probability amplitude due to <strong>constructive reinforcement</strong>.</p><h3><strong>Why Interference is the Heart of Quantum Algorithms</strong></h3><p>Without interference, a quantum computer with N qubits would just sample a random answer from its 2^N possibilities. That’s no better than guessing. Interference is what transforms the raw parallelism of superposition into a directed search for the correct answer. Shor’s algorithm (factoring), Grover’s algorithm (search), and virtually every quantum algorithm fundamentally rely on carefully engineered interference.</p><h3><strong>KEY TAKEAWAYS</strong></h3><ol><li>Interference is the mechanism that makes quantum algorithms useful — not just random.</li><li>Constructive interference boosts the probability of correct answers.</li><li>Destructive interference eliminates wrong answers.</li><li>Phase (the mathematical sign of an amplitude) is invisible to measurement but drives all interference effects.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78f7f17b2dec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Burning Tokens in Claude Code: 10 Proven Practices That Can Cut Your AI Token Usage by 50%]]></title>
            <link>https://pankajads.medium.com/stop-burning-tokens-in-claude-code-10-proven-practices-that-can-cut-your-ai-token-usage-by-50-e9035cb54c28?source=rss-482b484b4635------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9035cb54c28</guid>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[ai-token-optimization]]></category>
            <category><![CDATA[context-engineering]]></category>
            <dc:creator><![CDATA[Pankaj Negi]]></dc:creator>
            <pubDate>Wed, 08 Jul 2026 02:31:06 GMT</pubDate>
            <atom:updated>2026-07-08T02:31:06.496Z</atom:updated>
            <content:encoded><![CDATA[<p>AI has fundamentally changed software development. Tools like Claude Code, Codex, Copilot can review codebases, implement features, refactor legacy systems, and even troubleshoot production issues with remarkable accuracy.</p><p>Yet many developers encounter the same frustration: <strong>Why did my token usage explode after only a few hours or days?</strong></p><p>The answer is simple: it’s usually not the model all the time – it’s the context.</p><p>Even when using Sonnet, the majority of token consumption comes from continuously expanding conversation history, repeated file reads, verbose reasoning, and unnecessary exploration of your repository.</p><p>After working extensively with AI-assisted development, I’ve found that a few disciplined habits dramatically reduce token usage while improving the quality of Claude’s responses.</p><h4>Here are ten practices that every Claude Code user should adopt.</h4><h4>1. Treat Every Feature as a New Session</h4><p>One of the biggest mistakes is trying to accomplish an entire sprint within a single conversation. As the conversation grows, Claude must repeatedly process previous prompts, earlier code, debugging attempts, command outputs, and architectural discussions.</p><p>Instead, think in terms of one task, one session.</p><blockquote><strong>Session 1</strong></blockquote><blockquote>✓ Fix authentication bug</blockquote><blockquote>/clear</blockquote><blockquote><strong>Session 2</strong></blockquote><blockquote>✓ Implement caching</blockquote><blockquote>/clear</blockquote><blockquote><strong>Session 3</strong></blockquote><blockquote>✓ Write unit tests</blockquote><p>A fresh context is often more valuable than a long memory.</p><h4>2. Use /compact Before the Context Gets Too Large</h4><p>Long conversations accumulate a surprising amount of unnecessary information. Before the session becomes bloated, ask Claude to preserve only the essentials.</p><p>/compact</p><p><strong>Keep</strong>:</p><ul><li>architecture decisions</li><li>modified files</li><li>pending TODOs</li></ul><p><strong>Discard</strong>:</p><ul><li>failed debugging attempts</li><li>intermediate reasoning</li><li>obsolete discussions</li></ul><p>This keeps the conversation focused without losing important progress.</p><h4>3. Stop Copy-Pasting Large Files</h4><p>Many developers paste thousands of lines directly into the chat. Instead, ask Claude to inspect only the relevant file and function.</p><p><strong>Instead of</strong>:</p><blockquote>&lt;2,000 lines of source code&gt;</blockquote><p><strong>Try</strong>:</p><blockquote>Analyze: src/payment/PaymentService.ts</blockquote><blockquote>Focus only on:</blockquote><blockquote>processPayment()</blockquote><blockquote>validateRequest()</blockquote><p>Targeted analysis saves both input and output tokens. Narrow the Scope of Every Request. Broad requests cause Claude to inspect far more files than necessary.</p><blockquote><strong>Avoid</strong>: Review my backend.</blockquote><p><strong>Prefer</strong>:</p><blockquote>Review only:</blockquote><blockquote>- JWT validation</blockquote><blockquote>- Authentication middleware</blockquote><blockquote>- Security vulnerabilities</blockquote><blockquote>Ignore:</blockquote><blockquote>- tests</blockquote><blockquote>- frontend</blockquote><blockquote>- deployment</blockquote><p>The smaller the scope, the lower the cost.</p><h4>5. Plan Before You Code</h4><p>One of the easiest ways to waste tokens is allowing Claude to immediately start editing files. Instead, ask for a plan first. Don’t edit anything.</p><p>First:</p><ol><li>Identify affected files.</li><li>Explain the approach.</li><li>Wait for approval.</li></ol><p>This prevents unnecessary exploration and often reveals a simpler solution before any code is written.</p><h4>6. Keep CLAUDE.md Small and Intentional</h4><p>CLAUDE.md is powerful – but only when it’s concise.</p><p>A good file includes:</p><ul><li>coding standards</li><li>build commands</li><li>architecture overview</li><li>naming conventions</li><li>testing commands</li></ul><p>Avoid storing lengthy documentation, API references, or design documents that are repeatedly loaded into context.</p><p>Every unnecessary paragraph costs tokens.</p><h4>7. Ask for Concise Explanations</h4><p>Verbose explanations are expensive.</p><blockquote><strong>Instead of requesting:</strong></blockquote><blockquote>Explain every change in detail and discuss all alternatives.</blockquote><blockquote><strong>Try:</strong></blockquote><blockquote>Fix the issue.</blockquote><p>Explain your changes in no more than five concise bullet points. You’ll receive the same value with far fewer tokens.</p><h4>8. Restrict Repository Searches</h4><p>Large monorepos can cause Claude to inspect dozens – or even hundreds – of files unnecessarily.</p><p>Instead of:</p><blockquote>Find authentication.</blockquote><p>Be explicit:</p><blockquote>Search only:</blockquote><blockquote>1. src/auth</blockquote><blockquote>2. middleware</blockquote><blockquote>3. security</blockquote><p>Precise search boundaries dramatically reduce unnecessary context.</p><h4>9. Create Checkpoints</h4><p>After completing a feature, don’t continue indefinitely. Ask Claude to summarize the current state.</p><p>Summarize:</p><ul><li>completed work</li><li>pending tasks</li><li>modified files</li></ul><p>Maximum: 10 bullet points.</p><p>Save the summary, clear the conversation, and begin the next task with only that summary. It’s one of the simplest ways to maintain productivity while keeping token usage under control.</p><h4>10. Use the Right Model for the Right Job</h4><p>Not every task requires the most capable – and expensive – model.</p><p>A practical strategy is:</p><ol><li>Haiku — Quick lookups, simple edits, boilerplate</li><li>Sonnet — Daily development, debugging, refactoring</li><li>Opus — Architecture, complex reasoning, deep investigations</li></ol><p>For the vast majority of development work, Sonnet provides the best balance of quality, speed, and cost.</p><h3>Tips for Large Enterprise Repositories</h3><p>If you work on large systems – microservices, AWS platforms, Kubernetes environments, or SRE tooling – the savings become even more significant.</p><p>A few additional habits:</p><ul><li>Maintain a concise architecture summary instead of rediscovering the system every session.</li><li>Limit searches to specific services or directories.</li><li>Separate infrastructure, application code, and tests into different conversations.</li><li>Review plans before implementation.</li><li>Start fresh sessions after completing major milestones.</li></ul><p>These practices help Claude spend time solving problems – not rediscovering your repository.</p><p>A Workflow That Consistently Saves Tokens</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_sKz-Ai-d1Kd6UotbDlbkQ.png" /></figure><p>This simple workflow often reduces token consumption by 40 – 60%, while also producing cleaner, more focused interactions.</p><h3>Final Thoughts</h3><p>AI coding assistants are most effective when treated like experienced teammates rather than infinite chat windows. Clear goals, focused sessions, and disciplined context management lead to better code, faster iterations, and significantly lower costs.</p><p>The biggest optimization isn’t switching models – it’s managing context wisely. Once you adopt these habits, you’ll likely notice not only fewer tokens consumed, but also more accurate, relevant, and maintainable results from Claude Code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9035cb54c28" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quantum Gates & Circuits]]></title>
            <link>https://pankajads.medium.com/quantum-gates-circuits-31425cd859e6?source=rss-482b484b4635------2</link>
            <guid isPermaLink="false">https://medium.com/p/31425cd859e6</guid>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[basic-quantum]]></category>
            <dc:creator><![CDATA[Pankaj Negi]]></dc:creator>
            <pubDate>Mon, 06 Jul 2026 17:46:01 GMT</pubDate>
            <atom:updated>2026-07-06T17:46:01.031Z</atom:updated>
            <content:encoded><![CDATA[<p>The Logic layer of quantum comuting — quantum’s equivalent of AND, OR and NOT</p><h3><strong>TL;DR</strong></h3><p>Classical computers use logic gates (AND, OR, NOT) to process bits. Quantum computers use quantum gates to manipulate qubits. The one of the key difference: quantum gates are always reversible.</p><h3><strong>Classical Gates: A Quick Reminder</strong></h3><p>A classical logic gate takes one or more bits as input and produces a bit as output. AND (both inputs must be 1 to output 1), OR (at least one input must be 1), NOT (flips the input). These are the building blocks of every CPU, every server, every smartphone on earth.</p><h3><strong>Quantum Gates: The Quantum Equivalent</strong></h3><p>Quantum gates are operations applied to qubits. They are represented by mathematical matrices, but you don’t need to know the maths — you just need to understand what each one does conceptually.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UenreSPjZg-0F4qLhU2gGA.png" /></figure><h3><strong>A Key Difference: Reversibility</strong></h3><p>Classical gates are often NOT reversible. If an AND gate outputs 0, you can’t determine if the inputs were (0,0), (0,1), or (1,0). Quantum gates, by contrast, are ALWAYS reversible. Every quantum operation can be ‘undone’. This is a fundamental property of quantum mechanics — and it means quantum circuits preserve all information throughout computation.</p><h3><strong>Quantum Circuits: Gates in Action</strong></h3><p>A quantum circuit is a sequence of quantum gates applied to qubits — like a recipe for a quantum computation. Reading left to right, each gate modifies the qubit state. The final step is measurement, which extracts the classical result.</p><h4><strong>ANALOGY — The Quantum Circuit as a Recipe</strong></h4><p><em>Think of a quantum circuit like a cooking recipe. The qubits are your ingredients. Each gate is a cooking step: chop (H gate), combine (CNOT gate), season (Z gate). The final dish — your measurement result — depends on following the recipe precisely. Unlike classical recipes, every quantum step can be reversed: you can ‘uncook’ at any point.</em></p><h3><strong>The Hadamard Gate: The Superpower Creator</strong></h3><p>The Hadamard gate (H) deserves special attention. Applied to a qubit in state |0&gt;, it creates a perfect superposition: equal probability of 0 or 1. Applied twice, it UNDOES itself — the qubit returns to |0&gt;. This reversibility is crucial. H-Z-H (Hadamard, then Z, then Hadamard again) is a common pattern used in interference to flip the phase and then translate that back into a probability change.</p><h3><strong>Notes</strong></h3><ol><li>Quantum gates manipulate qubits using reversible operations.</li><li>The X gate flips qubits; the H gate creates superposition; CNOT creates entanglement.</li><li>All quantum operations are reversible — no information is ever lost mid-computation.</li><li>A quantum circuit is a sequence of gates applied to qubits, ending in measurement.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31425cd859e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Qubit — The Atom of Quantum Information]]></title>
            <link>https://pankajads.medium.com/the-qubit-the-atom-of-quantum-information-b6f9d896f9fa?source=rss-482b484b4635------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6f9d896f9fa</guid>
            <category><![CDATA[qubit]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <dc:creator><![CDATA[Pankaj Negi]]></dc:creator>
            <pubDate>Fri, 03 Jul 2026 01:20:10 GMT</pubDate>
            <atom:updated>2026-07-03T01:20:10.694Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*JoHsh_vwoDZm9rBuiiz2zQ.png" /></figure><h3><strong>TL;DR</strong></h3><p>A classical bit is a light switch — always on or off. A qubit is a dimmer switch in motion — it can be anywhere between on and off until the moment you look at it. That ‘in-between’ state is superposition, and it’s the source of quantum computing’s power.</p><h3><strong>A Quick Recap: Classical Bits</strong></h3><p>Everything your computer does — storing a file, sending an email, running a calculation — ultimately reduces to billions of tiny switches called transistors. Each transistor is either ON (1) or OFF (0). Nothing in between. That’s a bit. This binary model is reliable, predictable, and has scaled beautifully for 70 years. But it has a ceiling. Some problems require exploring so many combinations that even the world’s fastest classical supercomputer would need millions of years.</p><h3><strong>What Makes a Qubit Different?</strong></h3><p>A qubit is a physical system that obeys the laws of quantum mechanics. It can be realised using a single electron’s spin, a photon’s polarisation, or a superconducting circuit cooled to near absolute zero. What all qubits share is a remarkable property: before you measure them, they exist in a superposition — a blend of 0 and 1 simultaneously.</p><p>For example — Flip a coin and let it spin on the table. While it’s spinning, it isn’t heads OR tails — it’s both at once (or rather, neither). The moment you slam your hand down to stop it, it ‘collapses’ to one definite side. A qubit behaves the same way. Before measurement: superposition (both). After measurement: one definite answer (0 or1).</p><h3>The State of a Qubit</h3><p>Unlike a classical bit, which can exist only in one of two definite states ((0) or (1)), a <strong>qubit</strong> can exist in a <strong>superposition</strong> of both states simultaneously. The term <em>qubit</em> refers to a quantum system whose classical state set is {0,1}.{0,1}. That is, a qubit is really just a bit — but by using this name we explicitly recognize that this bit can be in a quantum state.</p><p>These are examples of quantum states of a qubit:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*saD0yEnS3s8Oi0wS9uMlIg.png" /></figure><p>The first two examples, ∣0⟩ and ∣1⟩, illustrate that standard basis elements are valid quantum state vectors: their entries are complex numbers, where the imaginary part of these numbers all happen to be 0, and computing the sum of the absolute values squared of the entries yields</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*Vv0HTR9YQVHFcNgZ0doPIQ.png" /></figure><p>as required. Similar to the classical setting, we associate the quantum state vectors ∣0⟩and ∣1⟩ with a qubit being in the classical state 0 and 1 respectively.</p><p>For the other two examples, we again have complex number entries, and computing the sum of the absolute value squared of the entries yields</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*GOdJwlR4vW-C-oTpS1e8hQ.png" /></figure><h3><strong>The Power of Many Qubits</strong></h3><p>Here’s where it gets remarkable. Two classical bits can hold ONE of four values at a time: 00, 01,10, or 11. Two qubits in superposition hold ALL FOUR values simultaneously. Ten qubits hold 1,024 states at once. Fifty qubits hold more than a quadrillion states simultaneously. One hundred qubits hold more states at once than there are atoms in the observable universe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XXY-k_QmHS3t6Q0l9LKvqg.png" /></figure><h3><strong>The No-Cloning Rule</strong></h3><p>One crucial quantum rule IT professionals should know: you CANNOT copy a qubit. Classical computers copy bits constantly — that’s how memory, caching, and backups work. In quantum mechanics, the No-Cloning Theorem proves it is physically impossible to make an identical copy of an unknown quantum state. This has profound implications for quantum networking and quantum cryptography — but also means quantum computers can’t work the same way as classical ones.</p><p>For example — Imagine a sealed envelope with a message inside. Classical copying is like photocopying the envelope (you can make perfect copies). Quantum ‘copying’ is forbidden — reading the state destroys the original. This is actually GREAT for security: you can’t intercept a quantum key without leaving a detectable trace.</p><h3>What Next?</h3><p>What is superposition? And how Quantum computers try all possible paths at once? And why that is game changer?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6f9d896f9fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>