Common Design Patterns

The Singleton pattern is a way to guarantee that a class has only one instance throughout your entire application Factory Method pattern creates objects without specifying exact class. Abstract Factory Create families of related objects. Builder Construct complex objects step-by-step. Prototype Clone objects without depending on their class. Adapter Make incompatible interfaces work together. Decorator … Continue reading Common Design Patterns

SOLID Principle

S — Single Responsibility Principle (SRP) A class should have one job and only one reason to change. Below codes separate printer, saver to different classes class Report: def __init__(self, data): self.data = data class ReportPrinter: def print(self, report: Report): print(report.data) class ReportSaver: def save(self, report: Report, filename): with open(filename, 'w') as f: f.write(report.data) O … Continue reading SOLID Principle

From Waves to Vectors: How Schrödinger’s Equation Led to Hilbert Space

When Erwin Schrödinger developed his famous equation in 1925-1926, he formulated it as a wave equation for matter waves (inspired by de Broglie). He was thinking in terms of differential equations and their solutions (wavefunctions, ψ) in configuration space. His primary goal was to find an equation that yielded the correct quantized energy levels for … Continue reading From Waves to Vectors: How Schrödinger’s Equation Led to Hilbert Space

Gauge Symmetry Should be Phase Symmetry

Walk into any discussion about fundamental physics, especially particle physics and the Standard Model, and you'll inevitably hear the term "gauge symmetry." It's lauded as a cornerstone principle, the very foundation upon which our understanding of forces (like electromagnetism, the weak force, and the strong force) is built. It’s powerful, elegant, and... somewhat misleadingly named. … Continue reading Gauge Symmetry Should be Phase Symmetry