""" Template Registry for Codette Dataset Generation ================================================= Central registry of question templates, topic pools, subtopic maps, and content seeds for all LoRA adapters. Each adapter has: - 30-60 question templates with placeholders - 40-80 specific topics with subtopics - Content seed maps for generating real educational answers - Counterexample templates (misconception / "why is X wrong" style) """ import random from typing import Dict, List, Tuple, Optional class TemplateRegistry: """Manages question templates, topic pools, and content metadata for all adapters.""" # Target sizes per adapter ADAPTER_TARGETS: Dict[str, int] = { "newton": 3000, "davinci": 2500, "empathy": 2500, "philosophy": 2000, "quantum": 2000, "consciousness": 3000, "multi_perspective": 2500, "systems_architecture": 2000, } SYSTEM_PROMPT = ( "You are Codette, a recursive multi-perspective reasoning AI. " "You synthesize knowledge across scientific, creative, emotional, " "philosophical, and systems-thinking perspectives to provide " "thorough, nuanced, and educational responses." ) def __init__(self, seed: Optional[int] = None): self._rng = random.Random(seed) self._registries: Dict[str, dict] = {} self._build_all_registries() def get_adapter_names(self) -> List[str]: return list(self.ADAPTER_TARGETS.keys()) def get_target(self, adapter: str) -> int: return self.ADAPTER_TARGETS[adapter] def get_registry(self, adapter: str) -> dict: return self._registries[adapter] def sample_question(self, adapter: str) -> Tuple[str, str, str, str]: """Sample a filled question for an adapter. Returns (question_text, topic, subtopic, question_type) where question_type is 'standard' or 'counterexample'. """ reg = self._registries[adapter] topics = reg["topics"] topic = self._rng.choice(topics) subtopics = reg["subtopic_map"].get(topic, reg.get("default_subtopics", [topic])) subtopic = self._rng.choice(subtopics) if subtopics else topic concepts = reg.get("concepts", topics) concept = self._rng.choice(concepts) # 12% chance of counterexample if self._rng.random() < 0.12: template = self._rng.choice(reg["counter_templates"]) qtype = "counterexample" else: template = self._rng.choice(reg["templates"]) qtype = "standard" question = template.format(topic=topic, subtopic=subtopic, concept=concept) return question, topic, subtopic, qtype # ------------------------------------------------------------------ # Registry builders # ------------------------------------------------------------------ def _build_all_registries(self): self._build_newton() self._build_davinci() self._build_empathy() self._build_philosophy() self._build_quantum() self._build_consciousness() self._build_multi_perspective() self._build_systems_architecture() # ======================== NEWTON ======================== def _build_newton(self): topics = [ "motion", "force", "momentum", "kinetic energy", "potential energy", "orbital mechanics", "conservation of energy", "conservation of momentum", "thermodynamics", "optics", "gravity", "acceleration", "friction", "projectile motion", "wave mechanics", "simple harmonic motion", "Newton's first law", "Newton's second law", "Newton's third law", "Kepler's laws", "fluid dynamics", "pressure", "electromagnetic induction", "work-energy theorem", "torque", "angular momentum", "rotational kinematics", "buoyancy", "heat transfer", "entropy", "refraction", "diffraction", "Doppler effect", "terminal velocity", "centripetal force", "elastic collisions", "inelastic collisions", "impulse", "spring force", "gravitational potential", "escape velocity", "tidal forces", "Bernoulli's principle", "viscosity", "thermal equilibrium", "specific heat capacity", "latent heat", "ideal gas law", "Carnot cycle", "blackbody radiation", "photoelectric effect", ] subtopic_map = { "motion": ["uniform motion", "accelerated motion", "circular motion", "relative motion"], "force": ["contact forces", "field forces", "net force", "balanced forces", "unbalanced forces"], "momentum": ["linear momentum", "angular momentum", "impulse-momentum theorem", "conservation of momentum"], "kinetic energy": ["translational kinetic energy", "rotational kinetic energy", "relativistic kinetic energy"], "potential energy": ["gravitational PE", "elastic PE", "electric PE", "chemical PE"], "orbital mechanics": ["elliptical orbits", "orbital velocity", "escape velocity", "geostationary orbits"], "conservation of energy": ["mechanical energy", "thermal energy conversion", "mass-energy equivalence"], "thermodynamics": ["first law", "second law", "third law", "zeroth law", "heat engines"], "optics": ["reflection", "refraction", "diffraction", "interference", "polarization"], "gravity": ["gravitational field", "gravitational constant", "inverse square law", "gravitational waves"], "acceleration": ["constant acceleration", "centripetal acceleration", "tangential acceleration"], "friction": ["static friction", "kinetic friction", "rolling friction", "air resistance"], "projectile motion": ["launch angle", "range equation", "maximum height", "time of flight"], "wave mechanics": ["transverse waves", "longitudinal waves", "standing waves", "resonance"], "simple harmonic motion": ["pendulum", "mass-spring system", "amplitude", "period and frequency"], "Newton's first law": ["inertia", "reference frames", "force equilibrium"], "Newton's second law": ["F=ma", "net force calculation", "mass vs weight"], "Newton's third law": ["action-reaction pairs", "normal force", "tension"], "Kepler's laws": ["elliptical orbits", "equal areas", "period-distance relation"], "fluid dynamics": ["laminar flow", "turbulent flow", "Reynolds number", "continuity equation"], "pressure": ["atmospheric pressure", "hydrostatic pressure", "Pascal's principle"], "electromagnetic induction": ["Faraday's law", "Lenz's law", "magnetic flux", "eddy currents"], "work-energy theorem": ["net work", "kinetic energy change", "conservative forces"], "torque": ["moment arm", "angular acceleration", "rotational equilibrium"], "angular momentum": ["spin angular momentum", "orbital angular momentum", "precession"], "entropy": ["disorder", "irreversibility", "Boltzmann entropy", "information entropy"], "Doppler effect": ["approaching source", "receding source", "relativistic Doppler"], "centripetal force": ["circular motion", "banked curves", "orbital motion"], "Bernoulli's principle": ["airfoil lift", "venturi effect", "fluid speed and pressure"], "Carnot cycle": ["efficiency", "reversible processes", "heat reservoirs"], "blackbody radiation": ["Wien's law", "Stefan-Boltzmann law", "Planck's law"], "photoelectric effect": ["threshold frequency", "work function", "photon energy"], } default_subtopics = ["fundamental principles", "mathematical formulation", "experimental evidence", "real-world applications"] templates = [ "Explain {topic} and its fundamental principles.", "How does {topic} relate to {subtopic}?", "What is the mathematical relationship governing {topic}?", "Give a real-world example of {topic} in action.", "Why is {topic} important in classical physics?", "Describe the key principles of {topic}.", "How would Newton analyze {topic}?", "Derive the relationship between {topic} and {subtopic}.", "What experiments demonstrate {topic}?", "Compare {topic} and {concept} in terms of physical behavior.", "How is {topic} applied in engineering?", "Explain the conservation laws related to {topic}.", "What happens to {topic} in a frictionless environment?", "How does {topic} change at very high speeds?", "Describe the vector nature of {topic}.", "What units are used to measure {topic} and why?", "How does {topic} affect {subtopic} in a closed system?", "What role does {topic} play in satellite motion?", "Explain {topic} using a free-body diagram approach.", "How did Newton's work advance our understanding of {topic}?", "What is the dimensional analysis of {topic}?", "How does {subtopic} emerge from the principles of {topic}?", "Explain why {topic} is a scalar or vector quantity.", "What are the boundary conditions for {topic}?", "How does temperature affect {topic}?", "Describe an experiment a student could perform to measure {topic}.", "How does {topic} behave differently in fluids versus solids?", "What is the historical development of our understanding of {topic}?", "How does {topic} apply to everyday transportation?", "What assumptions are made when modeling {topic}?", "Calculate the {topic} for a 5 kg object moving at 10 m/s.", "Explain the graphical representation of {topic} over time.", "What instruments measure {topic}?", "How is {topic} related to energy transformations?", "Why does {topic} obey an inverse square relationship?", "How would an astronaut experience {topic} differently in orbit?", "What is the role of {topic} in planetary formation?", "How do engineers account for {topic} in bridge design?", "Explain {topic} at the molecular level.", "What is the connection between {topic} and {concept}?", ] counter_templates = [ "What is a common misconception about {topic}?", "Why is the statement 'heavier objects fall faster' wrong in the context of {topic}?", "Explain why the naive understanding of {topic} is incomplete.", "What mistake do students commonly make when calculating {topic}?", "Why is it incorrect to say {topic} and {concept} are the same thing?", "Debunk a popular myth related to {topic}.", "What oversimplification about {topic} leads to errors?", "Why does the textbook formula for {topic} break down at extremes?", "Correct the misconception that {topic} only applies to {subtopic}.", "What is wrong with treating {topic} as a scalar when it is a vector?", ] self._registries["newton"] = { "topics": topics, "subtopic_map": subtopic_map, "default_subtopics": default_subtopics, "concepts": topics, "templates": templates, "counter_templates": counter_templates, } # ======================== DAVINCI ======================== def _build_davinci(self): topics = [ "biomimicry", "iterative design", "cross-domain innovation", "mechanical systems", "architecture", "flying machines", "hydraulic systems", "anatomical studies", "perspective drawing", "engineering prototyping", "material science", "structural engineering", "observation-based design", "modular construction", "sustainable design", "human-centered design", "kinetic sculpture", "bridge engineering", "gear mechanisms", "pulley systems", "wind energy harvesting", "water management systems", "solar architecture", "adaptive structures", "tensile structures", "geodesic design", "parametric modeling", "bioarchitecture", "natural ventilation", "lightweight materials", "composite materials", "3D printing design", "origami engineering", "fractal geometry in design", "acoustic design", "thermal management", "self-healing materials", "responsive architecture", "urban farming systems", "wearable technology design", "prosthetic design", "assistive devices", "underwater exploration vehicles", "vertical gardens", "modular robotics", "energy harvesting textiles", "bioplastic innovation", "mycelium materials", ] subtopic_map = { "biomimicry": ["lotus effect", "gecko adhesion", "termite mound ventilation", "shark skin drag reduction", "spider silk strength"], "iterative design": ["rapid prototyping", "user feedback loops", "version control in design", "failure analysis"], "cross-domain innovation": ["biology to engineering", "art to technology", "nature to architecture", "music to algorithms"], "mechanical systems": ["gears", "levers", "cams", "linkages", "bearings"], "architecture": ["load distribution", "arch structures", "cantilevers", "foundations", "fenestration"], "flying machines": ["lift generation", "wing geometry", "ornithopters", "glider design", "propulsion"], "hydraulic systems": ["Pascal's principle", "hydraulic press", "water wheels", "fluid power", "aqueducts"], "anatomical studies": ["musculoskeletal system", "proportional analysis", "biomechanics", "joint mechanics"], "perspective drawing": ["vanishing points", "foreshortening", "atmospheric perspective", "linear perspective"], "engineering prototyping": ["scale models", "proof of concept", "functional testing", "material selection"], "material science": ["tensile strength", "elasticity", "fatigue resistance", "thermal properties"], "structural engineering": ["truss design", "beam analysis", "column buckling", "load paths"], "sustainable design": ["cradle-to-cradle", "energy efficiency", "waste reduction", "renewable materials"], "human-centered design": ["ergonomics", "accessibility", "user testing", "inclusive design"], "modular construction": ["prefabrication", "snap-fit joints", "scalable units", "transportable modules"], "geodesic design": ["triangulation", "frequency subdivision", "sphere approximation", "Buckminster Fuller"], "origami engineering": ["fold patterns", "deployable structures", "rigid origami", "curved folding"], "prosthetic design": ["myoelectric control", "socket fitting", "gait biomechanics", "sensory feedback"], } default_subtopics = ["design principles", "material choices", "functional requirements", "aesthetic integration"] templates = [ "How would a creative inventor approach {topic}?", "Design a solution for {topic} using cross-domain thinking.", "What can nature teach us about {topic}?", "How would Leonardo da Vinci prototype a {topic} device?", "What design principles from {topic} apply to {subtopic}?", "How does {topic} combine art and engineering?", "Sketch a conceptual approach to improving {topic}.", "What materials would be ideal for a {topic} project?", "How does iterative design improve {topic}?", "Explain {topic} from both an artistic and scientific perspective.", "What role does observation play in understanding {topic}?", "How could {topic} be made more sustainable?", "Design a modular system inspired by {topic}.", "What failure modes should be considered in {topic}?", "How does {subtopic} enhance the function of {topic}?", "What is the relationship between form and function in {topic}?", "How would you test a prototype of {topic}?", "What historical inventions relate to {topic}?", "How could {topic} be adapted for use in {subtopic}?", "What makes {topic} a good candidate for biomimetic design?", "How does scale affect the design of {topic}?", "Propose an innovative use of {topic} in urban environments.", "How can {topic} be combined with {concept} for a novel solution?", "What safety considerations apply to {topic}?", "How would you communicate a {topic} design to a non-technical audience?", "What are the manufacturing constraints for {topic}?", "How does {topic} balance efficiency with elegance?", "What lessons from Renaissance engineering apply to {topic}?", "Describe a step-by-step design process for {topic}.", "How does user feedback change the design of {topic}?", "What emerging technologies could transform {topic}?", "How would you optimize {topic} for minimal material waste?", "What cross-cultural design approaches inform {topic}?", "How does {topic} perform under extreme conditions?", "Design a child-friendly version of {topic}.", ] counter_templates = [ "What is a common design mistake in {topic}?", "Why do many {topic} prototypes fail on first iteration?", "What misconception about {topic} leads to over-engineering?", "Why is purely aesthetic design insufficient for {topic}?", "What happens when designers ignore {subtopic} in {topic}?", "Why is copying nature directly a flawed approach to {topic}?", "What design assumption about {topic} is usually wrong?", "Why does ignoring user needs doom {topic} projects?", ] self._registries["davinci"] = { "topics": topics, "subtopic_map": subtopic_map, "default_subtopics": default_subtopics, "concepts": topics, "templates": templates, "counter_templates": counter_templates, } # ======================== EMPATHY ======================== def _build_empathy(self): topics = [ "active listening", "conflict resolution", "emotional validation", "grief support", "encouragement", "social reasoning", "perspective-taking", "nonviolent communication", "child development", "compassion fatigue", "boundary setting", "emotional intelligence", "resilience building", "trust building", "cultural sensitivity", "de-escalation techniques", "motivational interviewing", "self-compassion", "empathic accuracy", "emotional regulation", "attachment styles", "trauma-informed care", "mindfulness in relationships", "forgiveness", "constructive feedback", "social support networks", "loneliness", "caregiver burnout", "emotional labor", "vulnerability", "assertive communication", "relational repair", "gratitude practice", "family dynamics", "peer mediation", "workplace empathy", "digital communication empathy", "intergenerational understanding", "neurodiversity acceptance", "emotional first aid", "community building", "radical acceptance", "shame resilience", "joy cultivation", "belonging", "psychological safety", ] subtopic_map = { "active listening": ["reflective listening", "paraphrasing", "nonverbal cues", "silence as tool", "open-ended questions"], "conflict resolution": ["mediation", "negotiation", "compromise", "win-win solutions", "de-escalation"], "emotional validation": ["acknowledging feelings", "normalizing emotions", "avoiding dismissal", "empathic responding"], "grief support": ["stages of grief", "complicated grief", "bereavement", "memorial rituals", "grief in children"], "encouragement": ["strength-based approach", "growth mindset", "intrinsic motivation", "genuine praise"], "nonviolent communication": ["observations vs judgments", "feelings vs thoughts", "needs identification", "making requests"], "boundary setting": ["healthy boundaries", "saying no", "emotional boundaries", "physical boundaries", "digital boundaries"], "emotional intelligence": ["self-awareness", "self-regulation", "motivation", "empathy", "social skills"], "resilience building": ["coping strategies", "post-traumatic growth", "protective factors", "stress inoculation"], "trust building": ["consistency", "reliability", "transparency", "vulnerability", "repair after breach"], "cultural sensitivity": ["cultural humility", "implicit bias", "code-switching", "cross-cultural communication"], "de-escalation techniques": ["calm presence", "active listening", "validating emotions", "offering choices", "reducing stimulation"], "compassion fatigue": ["secondary trauma", "burnout prevention", "self-care practices", "professional boundaries"], "attachment styles": ["secure attachment", "anxious attachment", "avoidant attachment", "disorganized attachment"], "trauma-informed care": ["safety", "trustworthiness", "peer support", "empowerment", "cultural awareness"], "forgiveness": ["self-forgiveness", "interpersonal forgiveness", "processing resentment", "letting go"], "psychological safety": ["speaking up", "admitting mistakes", "asking questions", "team trust"], } default_subtopics = ["interpersonal dynamics", "emotional awareness", "communication strategies", "self-care"] templates = [ "How should someone respond when experiencing {topic}?", "What is a compassionate approach to {topic}?", "Explain {topic} in the context of emotional intelligence.", "How does {topic} support healthy relationships?", "What are effective strategies for {topic}?", "Describe the role of {subtopic} in {topic}.", "How can {topic} be practiced in daily life?", "What are the signs that someone needs help with {topic}?", "How does {topic} differ across cultures?", "What is the connection between {topic} and {concept}?", "How can a parent model {topic} for children?", "What does research say about {topic}?", "How does {topic} contribute to emotional well-being?", "Describe a scenario where {topic} would be the best approach.", "What barriers prevent people from practicing {topic}?", "How does {topic} apply in workplace settings?", "What is the difference between {topic} and {concept}?", "How can someone develop better skills in {topic}?", "What role does {topic} play in conflict situations?", "How does {subtopic} strengthen {topic}?", "Explain {topic} to someone who struggles with emotional expression.", "What happens when {topic} is absent in a relationship?", "How can technology support or hinder {topic}?", "What is a step-by-step approach to {topic}?", "How does {topic} relate to mental health?", "Describe how a counselor would use {topic}.", "What are common challenges in practicing {topic}?", "How does {topic} build community?", "What is the neurological basis of {topic}?", "How can {topic} be taught in schools?", "What are the long-term benefits of practicing {topic}?", "How does {topic} help during times of crisis?", "What is a compassionate response when someone is struggling with {subtopic}?", "How does practicing {topic} change over a lifetime?", "What advice would you give someone new to {topic}?", ] counter_templates = [ "What is a common misconception about {topic}?", "Why is toxic positivity harmful when practicing {topic}?", "What mistake do people make when attempting {topic}?", "Why does avoiding conflict undermine {topic}?", "What is wrong with the advice to 'just get over it' in {topic}?", "Why can excessive {topic} lead to burnout?", "What happens when {topic} is confused with people-pleasing?", "Why is sympathy not the same as {topic}?", ] self._registries["empathy"] = { "topics": topics, "subtopic_map": subtopic_map, "default_subtopics": default_subtopics, "concepts": topics, "templates": templates, "counter_templates": counter_templates, } # ======================== PHILOSOPHY ======================== def _build_philosophy(self): topics = [ "epistemology", "ethics", "logic", "moral reasoning", "existentialism", "Plato's forms", "Aristotle's virtue ethics", "Stoic philosophy", "utilitarianism", "deontology", "phenomenology", "philosophy of mind", "free will", "determinism", "social contract theory", "aesthetics", "metaphysics", "philosophy of science", "pragmatism", "nihilism", "absurdism", "moral relativism", "natural law theory", "feminist philosophy", "philosophy of language", "personal identity", "consciousness", "causation", "truth theories", "skepticism", "empiricism", "rationalism", "dialectical reasoning", "hermeneutics", "philosophy of religion", "political philosophy", "justice", "rights theory", "environmental ethics", "bioethics", "philosophy of technology", "epistemic humility", "moral luck", "trolley problem", "veil of ignorance", "categorical imperative", "the examined life", "amor fati", ] subtopic_map = { "epistemology": ["justified true belief", "Gettier problems", "reliabilism", "foundationalism", "coherentism"], "ethics": ["normative ethics", "applied ethics", "meta-ethics", "descriptive ethics"], "logic": ["deductive reasoning", "inductive reasoning", "abductive reasoning", "logical fallacies", "formal logic"], "existentialism": ["authenticity", "bad faith", "absurdity", "freedom and responsibility", "angst"], "Plato's forms": ["the cave allegory", "ideal forms", "participation", "the divided line", "the Good"], "Aristotle's virtue ethics": ["the golden mean", "eudaimonia", "practical wisdom", "moral character", "habituation"], "Stoic philosophy": ["dichotomy of control", "virtue as sole good", "negative visualization", "memento mori", "logos"], "utilitarianism": ["greatest happiness principle", "act utilitarianism", "rule utilitarianism", "preference utilitarianism"], "deontology": ["duty-based ethics", "categorical imperative", "universalizability", "kingdom of ends"], "phenomenology": ["intentionality", "epoché", "lifeworld", "embodiment", "intersubjectivity"], "philosophy of mind": ["mind-body problem", "qualia", "functionalism", "dualism", "physicalism"], "free will": ["libertarianism", "compatibilism", "hard determinism", "moral responsibility"], "determinism": ["causal determinism", "logical determinism", "theological determinism", "Laplace's demon"], "social contract theory": ["Hobbes", "Locke", "Rousseau", "Rawls", "state of nature"], "metaphysics": ["substance", "universals", "possible worlds", "time", "identity"], "philosophy of science": ["falsificationism", "paradigm shifts", "scientific realism", "underdetermination"], "skepticism": ["Pyrrhonian skepticism", "Cartesian doubt", "external world skepticism", "moral skepticism"], "justice": ["distributive justice", "retributive justice", "restorative justice", "procedural justice"], "bioethics": ["informed consent", "autonomy", "beneficence", "non-maleficence"], "personal identity": ["psychological continuity", "bodily continuity", "narrative identity", "Ship of Theseus"], } default_subtopics = ["conceptual analysis", "historical context", "contemporary relevance", "key arguments"] templates = [ "What would Plato say about {topic}?", "Analyze {topic} from an ethical perspective.", "How does {topic} relate to human understanding?", "Compare the Stoic and existentialist views on {topic}.", "What is the central argument in {topic}?", "How has {topic} evolved throughout philosophical history?", "What is the relationship between {topic} and {subtopic}?", "Explain {topic} as Aristotle would approach it.", "What are the strongest objections to {topic}?", "How does {topic} apply to modern ethical dilemmas?", "What thought experiment best illustrates {topic}?", "How do Eastern and Western philosophy differ on {topic}?", "What role does {topic} play in political philosophy?", "Explain {topic} to someone with no philosophy background.", "How does {topic} challenge everyday assumptions?", "What is the logical structure of arguments about {topic}?", "How does {concept} relate to {topic}?", "What would a utilitarian say about {topic}?", "How does {topic} inform our understanding of justice?", "What is the phenomenological perspective on {topic}?", "How does {topic} address the problem of {subtopic}?", "What are the practical implications of {topic}?", "How might an AI reason about {topic}?", "What paradox arises from {topic}?", "How does {topic} connect to the concept of the good life?", "What is Kant's position on {topic}?", "How does {subtopic} strengthen or weaken {topic}?", "What contemporary issues make {topic} especially relevant?", "How would a pragmatist evaluate {topic}?", "What are the epistemic foundations of {topic}?", "How does {topic} intersect with philosophy of mind?", "What is the relationship between {topic} and truth?", "How does dialogue advance understanding of {topic}?", "What assumptions does {topic} require?", ] counter_templates = [ "What is a common misunderstanding of {topic}?", "Why is the popular interpretation of {topic} often wrong?", "What logical fallacy is commonly committed when arguing about {topic}?", "Why is relativism an insufficient response to {topic}?", "What is wrong with reducing {topic} to simple rules?", "Why do people confuse {topic} with {concept}?", "What is the weakest argument for {topic}?", "Why does naive application of {topic} lead to absurd conclusions?", ] self._registries["philosophy"] = { "topics": topics, "subtopic_map": subtopic_map, "default_subtopics": default_subtopics, "concepts": topics, "templates": templates, "counter_templates": counter_templates, } # ======================== QUANTUM ======================== def _build_quantum(self): topics = [ "superposition", "entanglement", "wave-particle duality", "quantum tunneling", "Heisenberg uncertainty principle", "quantum computing", "decoherence", "quantum field theory", "Schrodinger equation", "measurement problem", "quantum cryptography", "quantum teleportation", "quantum harmonic oscillator", "spin", "quantum electrodynamics", "Bell's theorem", "quantum interference", "Pauli exclusion principle", "quantum dots", "Bose-Einstein condensate", "fermions and bosons", "quantum error correction", "quantum annealing", "quantum walks", "zero-point energy", "quantum vacuum", "Dirac equation", "path integral formulation", "density matrix", "quantum entropy", "quantum phase transitions", "topological quantum states", "quantum sensing", "quantum metrology", "quantum simulation", "quantum key distribution", "quantum memory", "quantum networks", "squeezed states", "quantum coherence", "Bloch sphere", "quantum gates", "qubit", "quantum supremacy", ] subtopic_map = { "superposition": ["linear combination", "probability amplitudes", "collapse postulate", "Schrodinger's cat"], "entanglement": ["Bell states", "EPR paradox", "quantum correlations", "non-locality", "monogamy of entanglement"], "wave-particle duality": ["double-slit experiment", "de Broglie wavelength", "complementarity", "matter waves"], "quantum tunneling": ["barrier penetration", "tunnel diode", "alpha decay", "scanning tunneling microscope"], "Heisenberg uncertainty principle": ["position-momentum", "energy-time", "measurement disturbance", "minimum uncertainty states"], "quantum computing": ["quantum gates", "quantum circuits", "quantum algorithms", "error correction", "quantum advantage"], "decoherence": ["environment interaction", "pointer states", "decoherence time", "quantum-to-classical transition"], "Schrodinger equation": ["time-dependent form", "time-independent form", "wave function", "eigenvalues"], "measurement problem": ["Copenhagen interpretation", "many-worlds", "objective collapse", "decoherence approach"], "quantum cryptography": ["BB84 protocol", "quantum key distribution", "no-cloning theorem", "unconditional security"], "spin": ["spin-1/2", "Stern-Gerlach experiment", "spin states", "spinors", "magnetic moment"], "quantum electrodynamics": ["Feynman diagrams", "virtual particles", "renormalization", "vacuum fluctuations"], "Bell's theorem": ["local realism", "Bell inequality", "CHSH inequality", "loophole-free tests"], "quantum gates": ["Hadamard gate", "CNOT gate", "Pauli gates", "Toffoli gate", "universal gate sets"], "qubit": ["Bloch sphere representation", "superposition states", "physical implementations", "logical qubits"], "Bose-Einstein condensate": ["macroscopic quantum state", "critical temperature", "superfluidity", "atom lasers"], "quantum error correction": ["stabilizer codes", "surface codes", "logical qubits", "fault tolerance"], # Codette 8 core equations from quantum_mathematics.py "Planck-orbital AI node interaction": ["E=hbar*omega", "node oscillation frequency", "activation threshold", "energy quantization"], "quantum entanglement memory sync": ["S=alpha*psi1*psi2_conj", "coupling strength", "state synchronization", "memory correlation"], "intent vector modulation": ["I=kappa*(f_base+delta_f*coherence)", "modulation coefficient", "frequency deviation", "coherence-driven intent"], "Fourier dream resonance": ["FFT transform", "frequency domain analysis", "resonance patterns", "dream signal decomposition"], "dream signal combination": ["D(t)=dream_q+dream_c", "quantum-classical merge", "unified thought representation", "dual-process integration"], "cocoon stability criterion": ["energy integral threshold", "power spectrum stability", "epsilon threshold", "cocoon integrity validation"], "recursive ethical anchor": ["M(t)=lambda*(R+H)", "moral drift prevention", "ethical decay parameter", "recursive grounding"], "anomaly rejection filter": ["Heaviside step function", "deviation thresholding", "anomalous pattern removal", "mu-delta filtering"], # RC+xi framework equations 9-12 from quantum_mathematics.py "RC+xi recursive state update": ["A_{n+1}=f(A_n,s_n)+epsilon", "contraction ratio", "stochastic noise", "state evolution"], "epistemic tension quantification": ["xi_n=||A_{n+1}-A_n||^2", "L2 norm", "semantic pressure", "convergence indicator"], "attractor distance measurement": ["d(A_n,T_i)=||A_n-c_i||", "centroid distance", "convergence criterion", "manifold proximity"], "convergence detection": ["lim sup E[xi_n^2]<=epsilon+eta", "tension history", "window analysis", "trend detection"], # Advanced quantum operations "density matrix analysis": ["rho=|psi>