Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
26 views
ubuntu2404
Kernel: Julia 1.11

Modern Thermodynamics with Julia in CoCalc

Part 4: Quantum and Nanoscale Thermodynamics

This notebook contains Part 4 from the main Modern Thermodynamics with Julia in CoCalc notebook.

For the complete course, please refer to the main notebook: Modern Thermodynamics with Julia in CoCalc

import Pkg; Pkg.add("PlotThemes") using Plots, Printf, Statistics, LinearAlgebra using PlotThemes theme(:bright) # Physical constants (SI) const k_B = 1.380649e-23 # Boltzmann constant (J/K) const h = 6.62607015e-34 # Planck constant (J·s) println("⚛️ MODERN THERMODYNAMICS: QUANTUM & NANOSCALE") println(repeat("=", 55)) println("Exploring thermodynamics at quantum and molecular scales") println() println("Quantum Constants:") println("• Boltzmann constant: k_B = $(k_B) J/K") println("• Planck constant: h = $(h) J·s")

Quantum and Nanoscale Thermodynamics

Quantum Thermodynamics

At the quantum scale, thermodynamics takes on new features:

Quantum Heat Engines:

  • Working medium consists of quantum states

  • Coherence effects can enhance efficiency

  • Quantum correlations play thermodynamic roles

Landauer's Principle: Emin=kBTln2E_{min} = k_B T \ln 2

Minimum energy to erase one bit of information.

Maxwell's Demon:

  • Information has thermodynamic cost

  • Measurement and memory erasure require energy

  • Connects information theory to thermodynamics

Nanoscale Thermodynamics

Brownian Motion:

  • Thermal fluctuations dominate at small scales

  • Random walk behavior

  • Einstein-Smoluchowski relation

Molecular Motors:

  • Convert chemical energy to mechanical work

  • Operate in high-friction, low-Reynolds-number environment

  • Examples: ATP synthase, kinesin, myosin

Fluctuation Theorems:

  • Jarzynski equality

  • Crooks fluctuation theorem

  • Non-equilibrium work relations

using Printf # Physical constants (SI) const k_B = 1.380649e-23 # Boltzmann constant (J/K) const h = 6.62607015e-34 # Planck constant (J·s) println("=== QUANTUM AND NANOSCALE THERMODYNAMICS ===") # Landauer's principle function landauer_energy(T) # minimum energy to erase one bit return k_B * T * log(2) end # Thermal de Broglie wavelength: λ = h/√(2π m k_B T) function thermal_de_broglie(T, mass) return h / sqrt(2π * mass * k_B * T) end # Einstein relation: D = k_B T / (6π η r) for spherical particle function diffusion_coefficient(T, radius, viscosity) return k_B * T / (6π * viscosity * radius) end println("=== INFORMATION THERMODYNAMICS ===") println("Landauer's Principle: Energy Cost of Information Processing") println() temperatures = [4, 77, 300, 373] # K (liquid helium, liquid N₂, room temp, boiling water) temp_names = ["Liquid He", "Liquid N₂", "Room temp", "Boiling H₂O"] println("Minimum Energy to Erase One Bit (Landauer Limit):") println(repeat("-", 60)) @printf "%-15s %8s %15s %15s\n" "Temperature" "T (K)" "Energy (J)" "Energy (eV)" println(repeat("-", 60)) for (i, T) in enumerate(temperatures) E_landauer = landauer_energy(T) E_eV = E_landauer / 1.602176634e-19 # Convert to eV @printf "%-15s %8.0f %15.2e %15.2e\n" temp_names[i] T E_landauer E_eV end println() println("Information Processing Insights:") println("• Colder computers are more energy-efficient") println("• Quantum computers cooled to millikelvin temperatures") println("• Modern processors dissipate ~10⁶ times Landauer limit") println("• Room for dramatic improvement in reversible computing") println() # Quantum vs classical regimes println("=== QUANTUM VS CLASSICAL REGIMES ===") println("Thermal de Broglie Wavelength") println() particles = [ ("Electron", 9.109e-31), ("Proton", 1.673e-27), ("H₂ molecule", 3.3e-27), ("Virus (100 nm)", 1e-15), ("Dust (1 μm)", 1e-12) ] T_room = 300 # K println("Thermal de Broglie wavelengths at T = $T_room K:") println(repeat("-", 70)) @printf "%-15s %12s %15s %15s\n" "Particle" "Mass (kg)" "λ_thermal (m)" "Quantum?" println(repeat("-", 70)) for (particle, mass) in particles λ_th = thermal_de_broglie(T_room, mass) quantum_regime = λ_th > 1e-10 ? "Yes" : "No" # Rough criterion @printf "%-15s %12.2e %15.2e %15s\n" particle mass λ_th quantum_regime end println() println("Quantum Regime Criteria:") println("• Thermal wavelength comparable to system size") println("• Light particles more likely to show quantum effects") println("• Lower temperatures enhance quantum behavior") println("• Macroscopic objects are classical") println() # Nanoscale Brownian motion println("=== NANOSCALE BROWNIAN MOTION ===") η_water = 1e-3 # Pa⋅s (water viscosity) T_body = 310 # K (body temperature) nano_objects = [ ("Small molecule", 1e-9), ("Protein", 5e-9), ("Virus", 50e-9), ("Bacterium", 1e-6), ("Cell", 10e-6) ] println("Diffusion in Water at Body Temperature:") println(repeat("-", 70)) @printf "%-15s %12s %15s %15s\n" "Object" "Radius (m)" "D (m²/s)" "Distance/s (μm)" println(repeat("-", 70)) for (object, radius) in nano_objects D = diffusion_coefficient(T_body, radius, η_water) distance_per_sec = sqrt(2 * D * 1) * 1e6 # RMS distance in 1 second, in μm @printf "%-15s %12.2e %15.2e %15.1f\n" object radius D distance_per_sec end println() println("Nanoscale Transport Insights:") println("• Smaller objects diffuse faster") println("• Thermal motion dominates at nanoscale") println("• Molecular motors work against Brownian motion") println("• Diffusion-limited reaction rates") println("• No Reynolds number effects (Stokes flow)") println()