# Jonas Vetterle Personal Page & Blog > Engineering notes on AI/LLMs, quantum computing and general software development. A personal blog featuring in-depth technical articles on quantum computing, large language models, and software engineering. The site includes interactive tools and covers topics ranging from quantum algorithms to LLM scaling laws. ## Main Sections - [About](https://www.jonvet.com/about): Background and professional information - [Blog](https://www.jonvet.com/blog): Technical articles on quantum computing, AI/LLMs, and programming - [Tools](https://www.jonvet.com/tools): Interactive quantum state simulator ## Comprehensive Article Summaries ### Quantum Computing #### [Understanding Quantum Superposition](https://www.jonvet.com/blog/what-is-quantum-superposition) What is quantum superposition? This article explains the concept of basis states, measurement in quantum mechanics, and how superposition differs from classical probability. Learn why a qubit can be in multiple states simultaneously and how this leads to unique quantum phenomena. **Basis States**: Introduces the computational basis (|0⟩ and |1⟩ states) and explains how qubits can exist in linear combinations of these states, represented mathematically as α|0⟩ + β|1⟩ and visualized on the Bloch sphere. **Measurement in Different Bases**: Explores how qubits can be measured in different bases (X, Y, Z) and how the choice of measurement basis affects the outcome probabilities, demonstrating that quantum states contain more information than just the probability of measuring 0 or 1. **How This Differs from Classical Probability**: Clarifies the fundamental difference between quantum superposition and classical probabilistic mixtures, emphasizing how superposition enables interference effects and allows quantum algorithms to explore multiple computational paths simultaneously. **Conclusion**: Summarizes how superposition is the foundation of quantum computing's power, enabling quantum parallelism and setting the stage for more complex phenomena like entanglement. #### [What is Quantum Entanglement](https://www.jonvet.com/blog/what-is-quantum-entanglement) What is quantum entanglement?. This article explains entangled states, Einstein's 'spooky action at a distance', and how Bell's Inequality challenges our classical understanding of reality. **Strange Things Happen on Small Scales**: Sets the stage by explaining how quantum mechanics defies classical intuition, introducing the concept that particles can be fundamentally connected regardless of distance. **How to Create an Entangled State**: Details the process of creating Bell states using quantum gates (Hadamard and CNOT), with circuit diagrams showing how to transform separable states into maximally entangled states. **What Are the Implications? An Experiment**: Presents a thought experiment demonstrating how measurements on entangled qubits show perfect correlations regardless of distance, illustrating the non-local nature of quantum mechanics. **Entanglement is Strange Classically**: Explains why entanglement cannot be explained by classical physics, addressing common misconceptions and highlighting how it differs from classical correlations. **Bell's Inequality Proof**: Demonstrates mathematically how quantum mechanics violates Bell's inequality, proving that no local hidden variable theory can explain quantum correlations and confirming the fundamental non-locality of nature. **Concluding Remarks**: Reflects on the implications of entanglement for our understanding of reality and its practical applications in quantum computing and quantum communication. #### [The Math Behind Deutsch's Algorithm](https://www.jonvet.com/blog/math-behind-deutsch-algorithm) Demonstrating quantum advantage at the example of Deutsch's algorithm. How quantum superposition and interference to can help to solve specific problems faster. **What is Deutsch's Algorithm?**: Introduces Deutsch's algorithm as one of the first quantum algorithms to demonstrate quantum advantage, solving a specific problem with fewer function evaluations than any classical algorithm. **The Problem Deutsch's Algorithm Solves**: Defines the problem of determining whether a binary function is constant (always returns same value) or balanced (returns different values for different inputs). **The Classical Solution Involves 2 Queries**: Shows that classically, you must evaluate the function twice to determine its nature, establishing the baseline for comparison. **The Quantum Solution Involves Just 1 Query**: Demonstrates how quantum superposition and interference allow solving the problem with a single function evaluation. **High Level Overview**: Provides an intuitive explanation of how the algorithm uses superposition to evaluate all inputs simultaneously and interference to extract global properties. **Math Preliminaries**: Covers essential mathematical concepts including quantum gates, phase kickback, and the mathematical representation of quantum states. **Walking Through Step by Step**: Detailed mathematical walkthrough of each step in the algorithm, showing how quantum gates transform the initial state to reveal the function's nature. **Conclusion**: Reflects on how Deutsch's algorithm, while simple, demonstrates fundamental quantum computing principles that scale to more powerful algorithms. #### [Running Deutsch's Algorithm on a Real Quantum Computer](https://www.jonvet.com/blog/running-deutsch-algorithm-on-real-quantum-computer) Learn how to implement Deutsch's algorithm in Qiskit and run it on a real quantum computer in the IBM cloud. **Setting Up Your Environment**: Step-by-step guide to installing Qiskit, setting up IBM Quantum account, and configuring access to real quantum hardware. **Implementing Deutsch's Algorithm**: Code walkthrough showing how to translate the theoretical algorithm into Qiskit quantum circuits. **Implementing the Oracle**: Detailed explanation of how to implement different oracle functions (constant and balanced) using quantum gates. **Simulating in Qiskit**: Shows how to test the implementation using Qiskit's quantum simulator before running on real hardware. **Running on Real Quantum Computer**: Guide to submitting jobs to IBM quantum computers, handling queue times, and interpreting results from noisy quantum hardware. **Congrats!**: Celebrates the achievement of running a quantum algorithm on real hardware and discusses next steps in quantum programming. #### [Using a Real Quantum Computer](https://www.jonvet.com/blog/using-a-real-quantum-computer) Learn how to use Qiskit to run a quantum circuit on a real quantum computer. This guide walks you through setting up your environment, writing a basic quantum circuit, and executing it on IBM's cloud-based quantum machines. Perfect for beginners looking to explore practical quantum computing. **Setting Up Your Environment**: Comprehensive guide to installing necessary tools, creating IBM Quantum account, and understanding the quantum cloud ecosystem. **Creating a Simple Quantum Circuit**: Introduction to basic quantum gates and how to construct circuits in Qiskit, starting with simple single-qubit operations. **Running a More Complex Circuit**: Building on basics to create multi-qubit circuits, including entanglement and measurement operations. **Recap**: Summary of key concepts learned and resources for further exploration in quantum programming. #### [Learning About Quantum Computing](https://www.jonvet.com/blog/learning-about-quantum-computing) Some thought and materials on learning about quantum computing. This article provides a curated collection of resources and a suggested learning path for those interested in quantum computing. #### [Vibe Coding a Quantum State Simulator](https://www.jonvet.com/blog/vibe-coding-a-quantum-state-simulator) I vibe coded a quantum state simulator, which I hope will be a useful resource for some of you learning about quantum computing. **Why I Build a Quantum State Simulator**: Explains the motivation for creating an interactive visualization tool to help understand quantum states and operations. **Who Is This For?**: Identifies the target audience - students and enthusiasts learning quantum computing who benefit from visual representations. **What It Was Like Vibe Coding**: Reflects on the development process, challenges faced, and insights gained from building the simulator. ### AI and Large Language Models #### [Scaling Laws for LLM Pretraining](https://www.jonvet.com/blog/llm-scaling-laws) A comparison of Scaling Laws for LLM Pretraining, from Kaplan, to Chinchilla, the Chinchilla Trap, covering compute-optimal training and inference. **What Are LLM Scaling Laws?**: Defines scaling laws as empirical relationships between model performance and key variables (compute budget, dataset size, model parameters), explaining their importance for efficient resource allocation. **Kaplan Scaling Laws**: Details the 2020 findings showing power-law relationships between loss and model size/compute/data, introducing the concept of compute-optimal frontier and the recommendation to scale models aggressively. **Chinchilla Scaling Laws**: Explains the 2022 revision showing that models were undertrained, introducing new optimal ratios between parameters and training tokens (20 tokens per parameter). **Reconciling Kaplan and Chinchilla**: Analyzes why the two studies reached different conclusions, including differences in methodology, model architectures, and the focus on different aspects of scaling. **The Chinchilla Trap**: Discusses the practical implications of Chinchilla-optimal training when considering inference costs, showing how overtraining smaller models can be more cost-effective for deployment. **Conclusion**: Synthesizes insights about balancing training and inference compute, emphasizing that optimal scaling depends on deployment context. **References**: Comprehensive bibliography of key papers in scaling laws research. #### [LLM Scaling in 2025](https://www.jonvet.com/blog/llm-scaling-in-2025) A brief history of LLM Scaling Laws from compute-optimal training and inference to scaling test-time compute and whether Scaling Laws are coming to an end. **What Are LLM Scaling Laws**: Recaps the fundamental concept of scaling laws and their role in guiding model development. **Compute-Optimal Pre-training**: Reviews the evolution from Kaplan to Chinchilla scaling laws and their impact on model design. **The Chinchilla Trap**: Explores the tension between training-optimal and inference-optimal model configurations. **Scaling Test Time Compute**: Introduces the new frontier of scaling compute during inference rather than just training. **Are Scaling Laws Still Valid?**: Examines recent evidence suggesting potential plateaus in scaling benefits and alternative approaches. **Conclusion**: Reflects on the future of scaling laws and emerging paradigms in LLM development. **References**: Updated bibliography including recent developments in scaling research. #### [LLM Test-Time Compute](https://www.jonvet.com/blog/llm-test-time-compute) An overview of recent research on scaling test-time compute in large language models (LLMs) including CoT, STaR, ReST, RISE, ORMs, PRMs and more. **What Is Test-Time Compute?**: Defines the concept of using additional computation during inference to improve model outputs without retraining. **Reasons to Scale Test-Time Compute**: Explains motivations including handling complex reasoning, improving accuracy on difficult problems, and achieving better performance without larger models. **Categories of Test-Time Compute Scaling**: Taxonomizes approaches into self-refinement, search-based methods, and verifier-guided generation. **LLM Proposal Distribution Optimization**: Details methods like Chain-of-Thought, Self-Consistency, and tree search approaches that generate multiple candidates. **Verifier Models**: Explores Outcome Reward Models (ORMs) and Process Reward Models (PRMs) that evaluate and guide generation. **Compute-Optimal Scaling**: Discusses research on balancing pre-training and test-time compute for optimal performance per unit cost. **Conclusion**: Synthesizes trends and future directions in test-time compute scaling. #### [LLM Synthetic Data](https://www.jonvet.com/blog/llm-synthetic-data) An overview of the motivations and techniques used for generating synthetic data for LLM post-training, as seen in the Llama 3.1, AFM, Qwen2 and Hunyuan-Large papers. **Why Does Training on Synthetic Data Work?**: Explores theoretical justifications for synthetic data effectiveness, including data augmentation and distribution coverage. **Motivations for Generating Synthetic Data**: Details drivers including data scarcity, privacy concerns, and the need for specific task-focused datasets. **Techniques in Synthetic Data Generation**: Covers methods like instruction generation, response refinement, and evolutionary approaches. **Llama 3.1**: Analyzes Meta's approach to synthetic data for instruction tuning and capability enhancement. **AFM**: Examines Apple's methodology for creating synthetic datasets for on-device models. **Qwen2**: Details Alibaba's synthetic data strategies for multilingual and specialized capabilities. **Hunyuan-Large**: Explores Tencent's large-scale synthetic data generation pipeline. **Conclusion**: Reflects on best practices and future directions in synthetic data for LLMs. #### [LLM Induction Circuits](https://www.jonvet.com/blog/llm-induction-circuits) This blog post explores Induction Circuits, an example of a learned mini algorithm of transformer models that runs at inference time. **Recap of Transformer Basics**: Reviews attention mechanism, multi-head attention, and information flow in transformers. **High Level Overview of Induction Circuits**: Introduces the concept of induction heads that implement copy-paste behavior for in-context learning. **The Maths of Induction Circuits**: Detailed mathematical analysis of how attention patterns enable pattern matching and copying. **Decomposing the Attention Mechanism**: Shows how to analyze individual attention heads and their specialized roles. **Identifying Induction Circuits**: Methods for detecting and validating induction heads in trained models. **Conclusion**: Discusses implications for understanding emergent algorithms in neural networks. **References**: Key papers in mechanistic interpretability and circuit analysis. #### [Principles of Agent Design](https://www.jonvet.com/blog/principles-of-agent-design) Practical tips on how to design single and multi-agent systems. A synthesis of emerging principles and patterns as of June 2025. **Brief Overview of the Literature**: Surveys current research and industry practices in agent system design. **Use Multi-Agents for Breadth-First Problems**: Explains when parallel exploration benefits from multiple specialized agents. **Use Single Agents for Depth-First Problems**: Details scenarios where single agents excel at sequential, focused tasks. **Manage Context to Avoid Overflow**: Strategies for handling limited context windows and maintaining coherent agent state. **Prompt Engineering Is Still Important**: Best practices for crafting effective system prompts and instructions. **Write Tool Descriptions That Make Sense**: Guidelines for creating clear, actionable tool interfaces for agents. **Making Proactive Agents**: Techniques for building agents that anticipate needs and take initiative appropriately. **Conclusion**: Synthesizes key principles for effective agent system design. **References**: Comprehensive list of papers and resources on agent design. ### Software Development #### [Simple Web Server in Python](https://www.jonvet.com/blog/simple-webserver-in-python) A simple web server implementation in Python using FastAPI and SQLAlchemy. **Setting Up the API Server with FastAPI**: Introduction to FastAPI, its benefits, and initial server configuration with automatic documentation generation. **Setting Up SQLite Database**: Guide to configuring SQLAlchemy ORM, defining models, and using Alembic for database migrations. **Implementing CRUD Operations**: Detailed code examples for Create, Read, Update, and Delete operations with proper error handling and validation. **Implementing API Endpoints**: Building RESTful endpoints with FastAPI decorators, request/response models, and dependency injection. #### [Simple Web Server in Rust](https://www.jonvet.com/blog/simple-webserver-in-rust) Two simple web server implementations in Rust using Rocket, axum and Diesel. **Setting Up the API Server with Rocket**: Introduction to Rocket framework, its macro-based approach, and initial configuration. **Setting Up SQLite Database with Diesel**: Configuring Diesel ORM, defining schema, and running migrations in Rust. **Implementing CRUD Operations**: Type-safe database operations leveraging Rust's ownership system and error handling. **Implementing API Endpoints**: Creating endpoints with Rocket's procedural macros and request guards. **Setting Up API Server in Axum**: Alternative implementation using Axum, showcasing its tower-based middleware approach. **Differences Between Rocket and Axum**: Comparative analysis of design philosophies, performance characteristics, and use cases. **Route Definitions**: Contrasting routing approaches between the two frameworks. **Next Steps**: Suggestions for extending the server with authentication, WebSockets, and deployment strategies. #### [Benchmarking Python vs Rust Web Servers](https://www.jonvet.com/blog/benchmarking-python-rust-web-servers) Comparing the performance of a simple web server implemented in Python (FastAPI & SQLAlchemy) and Rust (Rocket, Axum and Diesel). **Axum Beats Rocket Beats FastAPI**: High-level performance comparison showing relative throughput and latency differences. **What We Are Benchmarking**: Details the test scenarios including CRUD operations, concurrent connections, and database interactions. **Caveats**: Important considerations about benchmark limitations, hardware dependencies, and real-world applicability. **The Benchmark Script**: Explanation of the benchmarking methodology, tools used, and metrics collected. **Discussion of Results**: In-depth analysis of performance differences, bottlenecks identified, and optimization opportunities for each implementation. #### [Managing Python Virtual Environments with pyenv](https://www.jonvet.com/blog/managing-python-venvs-with-pyenv) Learn how to manage python virtual environments with pyenv on macOS. Optional: create a jupyter notebook kernel for your venv using ipykernel. **Why Use Virtual Environments?**: Explains the importance of isolated Python environments for dependency management and project compatibility. **Setting Up pyenv and pyenv-virtualenv**: Step-by-step installation guide using Homebrew and shell configuration. **Using pyenv**: Commands for installing Python versions, setting global/local versions, and managing multiple Python installations. **Using pyenv-virtualenv**: Creating, activating, and managing virtual environments with automatic activation on directory change. **Optional: Jupyter Notebooks**: Guide to creating Jupyter kernels from virtual environments using ipykernel for notebook compatibility. ## Interactive Tools ### [Quantum State Simulator](https://www.jonvet.com/tools/quantum-state-simulator) An interactive web-based tool for visualizing quantum states in 3D. Features include: - Real-time Bloch sphere visualization showing qubit state vectors - Interactive controls for applying quantum gates (X, Y, Z, Hadamard, S, T) - Live probability distribution display for measurement outcomes - Wave function visualization showing complex amplitudes - State information panel with precise numerical values - Educational resource for understanding quantum state manipulation ## Contact - [GitHub](https://github.com/jonvet) - [Twitter](https://twitter.com/jvetterle) - [LinkedIn](https://www.linkedin.com/in/jonasvetterle)