320 likes | 539 Views
Physics-inspired computer algorithms. Liliana Teodorescu. Physics vs Computer Science/Engineering. P hysics and Computer Science/Engineering have long established mutually beneficial links Computer Science/Engineering to Physics
E N D
Physics-inspired computer algorithms Liliana Teodorescu
Physics vs Computer Science/Engineering • Physicsand Computer Science/Engineering have long established mutually beneficial links • Computer Science/Engineering to Physics • Tools to support progress in physics (and science, in general) research • Physics to Computer Science/Engineering • development of semiconductor-based computer technology based on solid-state physics • challenging environments/data – (extreme) test beds for hardware/software pushing up their developments (e.g. CERN OpenLabactivities) • advanced algorithmsbenefit from mathematical models of physical phenomena -topic of this lecture
Outline • Basics of combinatorial optimisation • Examples of algorithms inspired by physics • - fundamental physics concepts used in the algorithm • - the basics of the algorithm • - some applications • Concluding remarks on the benefits and concerns related to these algorithms
Optimisation problem • Combinatorial optimisation – finding min or max value of a function of many independent variables • This function is a quantitative measure of the “quality” of the system • cost function or objective function • Cost function • - depends of the configuration of the many parts of the system • - exact solution can be found only for systems with relatively small number of components • - for practical solutions – use heuristic methods (provide satisfactory solution, no guarantee to be perfect or optimal)
Heuristics • Heuristic methods • - find near-optimal solutions • - are problem-specific – no guarantee that a heuristics procedure that gives good results for one problem will do the same for another problem • - iterative methods (mostly) • Common first approaches – hill climbing • Starts with system in a known configuration • Apply change to the system => new configuration • Calculate cost function of new configuration • Continue until new configuration has lower cost • New configuration becomes starting configuration • Repeat 2-5 until no improvement in cost
Difficulties • Search procedure can be stuck in local minima • Common solution – process carried a few times with randomly generated initial solutions and retain the best result • Not satisfactorily for large optimisation problems • What to do? – look to physics for inspiration • Physical systems with large number of components - domain of statistical mechanics. • Kirkpatrick, S., Gelatt, C.D., and Vecchi, M.P., “Optimization by Simulated Annealing,” Science, Volume 220, Number 4598, 13 May 1983, pp. 671-680.
Statistical mechanics • Statistical mechanics • A set of methods that describe the behaviour of a physical system with many components • ( atoms in a mole of substance – Avogadro number) • Provides a connection between • - the macroscopic properties of a material (e.g. temperature and pressure), and • - the microscopic behaviour (states) of the systems’ components (e.g. atoms’ motion) • Example - System in equilibrium at a give temperature • Equilibrium - steady state – state in which the system as a whole (the ensemble of atoms) does not evolve anymore; but the atoms themselves can still evolve/move • Observe experimentally - only the most probable behaviour of the system (not the individual states of the atoms) characterised by • - the average behaviour of the atoms, and fluctuations around this average • The average is taken over the ensemble of atoms (ensemble of identical systems introduced by mathematical physicist, Willard Gibbs)
Boltzmann/Gibbs distribution • - set of atomic positions of the system- define a configuration in the ensemble • - energy of the configuration • Probability the system is in thermal equilibrium at temperature is : • Boltzmann/Gibbs distribution • Boltzmann factor • - Boltzmann constant • - normalization factor • As T decreases, the Boltzmann distribution concentrates on states with the lowest energy, as high energy states become increasingly unlikely. Lower T
Annealing • In practice – finding the ground state requires annealing (not just lowering the temperature) • first melt the substance • then lower the temperature slowly • at each temperature the system is allowed to reach thermal equilibrium • spend a long time at temperatures close to the freezing point • Without annealing, the substance will go • into a metastable state • Example for a crystal • lowering the temperature without annealing => a crystal with many defects
Statistical mechanics vs Combinatorial optimisation • Statistical mechanics • Describe the behaviour of a physical system • with many components • Describes the process of reaching the lowest • energy level • Annealing process generates stable ground • states • System state • Energy • Temperature • Change of state • Ground state • Combinatorial optimisation • Describes the search for the optimal solution • of a function with many variables • Describes the algorithm to search for the • minimum of the cost function • Algorithm that simulates the annealing • process likely to find an optimal minimum • Simulated Annealing Algorithm • Candidate solution • Cost function value • Control parameter (same units as cost function) • Neighbouring solution • Optimal solution
Metropolis algorithm • From early days of scientific computing - a simple algorithm to simulation a collection of atoms in equilibrium at a given temperature • Metropolis,N., A. Rosenbluth, M. Rosenbluth, A. Teller, E. Teller, "Equation of State Calculations by Fast Computing Machines", J. Chem. Phys.,21, 6, 1087-1092, 1953. • Metropolis algorithm • - based on statistical mechanics • - generalization of the iterative improvement of the solution by incorporating uphill steps in the search process => better solutions
Metropolis algorithm (cont.) • in each step of the algorithm an atom is given a small random displacement => new configuration • displacement of atoms => change in the energy of the system • if , the new configuration is accepted as the starting point of the next step • if the new configuration is accepted with the probability • P • => the system evolves in a Boltzmann/Gibbs distribution => • - at high T, all states have equal probability of occurring • - as T → 0, only states with minimum energy have a non-zero probability of occurrence. • Novelty of the approach – algorithm accepts states with higher energy • In optimisation terms – solutions with higher function costs are accepted with some probability => allows going out of a local minimum • This ideas was incorporated in Simulated Annealing for the first time
Annealing simulation • Annealing • use initially high temperatures • reduce temperatures in slow stages until there are no further changes in the system • at each temperature the simulation proceed long enough for the system to reach a steady state • Annealing schedule – the sequence of temperatures and the number of rearrangements of the configurations at each temperature • T = αT, where α is aconstant slightly less than 1 (e.g 0.8 - 0.99) • High T => the algorithm discover the gross features of the search space • Low T => the algorithm discover the fine details of the search space
Simulated Annealing Algorithm • 1. Choose a random configuration , select the initial temperature , and specify the annealing schedule (choose α) • 2. Evaluate • 3. Perturb } to obtain a neighbouring configuration • 4. Evaluate • 5. If , is the new configuration • 6. If , accept as the new configuration with probability • P, where - • 7. Repeat 3-6 until termination criteria met • 8. Reduce the system temperature according to the cooling schedule, • 9. Repeat 3-8 until termination criteria met • Many versions of the algorithm available, with different procedures for each step proposed
Applications • Some applications in particle physics • A software implementation available in TMVA • Measurement of |V_ub| using inclusive B -> X_u l nu decays with a novel X_u-reconstruction method, • H. Kakuno, Belle Coll., arXiv:hep-ex/0311048 and H. Kakuno’s Ph.D. thesis • X_ureconstraction – inspired by Simulated Annealing • Supersymmetry Parameter Analysis with Fittino • P. Bechtle, K. Desch, W. Porod, P. Wienemann, arXiv:hep-ph/0506244 • Simulated annealing for generalized Skyrmemodels, • J.-P. Longpre, L. Marleau, arXiv:hep-ph/0502253
Other way of describing the world – quantum physics • Can it help?
Quantum Annealing • inspired by Simulated Annealing • based on quantum mechanics’ formalism • also used to solve optimisation problems • first version proposed in • KadowakiT, Nishimori H. Quantum annealing in the transverse Ising model. Phys. Rev. E 1998;58(5):5355-5363.
Quantum system State vector – state of the system at time t • Schrödinger equation – describe the evolution in time of the system • - Hamiltonian(operator) generates the time evolution of quantum states • Given the state at an initial time (t = 0), we obtain the state at any subsequent time by solving this equation. • If Hamiltonian is independent of time time evolution operator, or propagator of the quantum system
Quantum mechanics vs optimisation problem An optimisation problem can be treated as a quantum system Candidate solution – the analogue of the quantum state vector The candidate solution evolves in time in agreement with the Schrodinger equation Transition from one candidate solution to another is made with the operator U
Hamiltonian • Hamiltonian – operator corresponding to the total energy of the system (sum of the kinetic and potential energy) • Free particle • The particle is not bound by any potential energy, so the potential energy is zero For one dimension: • Particle in a region of constant potential (no dependence of space or time) • For one dimension
Ising model • Mathematical model of ferromagnetism (magnets) in statistical mechanics. • Spins of the atoms arranged in a lattice • Each spin interacts with its nearest neighbours • and with an external magnetic field Hamiltonian Pauli matrices External magnetic field Magnetic moment Parameter describing the interaction between spins
Quantum Annealing • - Hamiltonian that encodes the function to be optimised • (cost/objective function) • - another Hamiltonian that introduces an external transverse field • Г - transverse field coefficient that is used to control the intensity of • the external field • Different Hamiltonians mean different versions of the algorithm • Commonly used – version based on Ising model
Quantum Annealing • - is a function of time => the intensity of the external field will change in time • is intense at the beginning and gradually decrease as the algorithm • is executed Г • If the system evolves very slowly, it will eventually reach a final ground state that, with a certain probability, will correspond to the optimal value of the function encoded(cost/objective function) Quantum Computers - computer systems that implement a quantum annealing algorithm in hardware not discussed in this lecture
Simulated Quantum Annealing • Exact implementation of a quantum annealing process on a digital computer is costly. • Use simulations instead => Simulated quantum annealing (SQA) • SQA - classical algorithm that uses Quantum Monte Carlo methods to simulate quantum annealing Hamiltonians (to perform calculations necessary for solving the Schrödinger equation) • SQA can be exponentially faster than SA for some problems
Quantum tunneling • Schrödinger equation predicts • a quantum system can penetrate a potential barrier, even if system's energy is lower than the height of the barrier • tunneling effect • small probability effect but important https://commons.wikimedia.org/wiki/File:Quantum_Tunnelling_animation.gif
Quantum tunneling • Schrodinger equation predicts • a quantum system can penetrate a potential barrier, even if system's energy is lower than the height of the barrier • tunneling effect • small probability effect but important https://commons.wikimedia.org/wiki/File:Quantum_Tunnelling_animation.gif • QA designed with intense quantum tunnelling at the beginning and then decreased as the algorithm runs
SQA vs SA • SQA can be exponentially faster than SA for some problems Theor. Int. Appl,., 45 (2011) 99-119 SQA outperforms SA when the cost function landscape has very high but thin barriers surrounded by shallow local minima SA - thermal transition probabilities depend only on the height of the barriers -> proportional to => difficult to get the system out of local minima when there are very high barriers SQA- quantum tunneling probability depends on the height and width of the barrier -> approximately given by - if very thin barriers, system can go out of local minima through tunneling
Applications • A few very recent applications in particle physics • Charged particle tracking with quantum annealing-inspired optimization, A. Zlokapa et. al., arXiv:1908.04475 • Unfolding as Quantum Annealing , • K. Cormier,R. Di Sipio, P. Wittek, arXiv:1908.08519 • Quantum Algorithms for Jet Clustering, • A. Y. Wei, P. Naik, A. W. Harrow, J. Thaler, arXiv:1908.08949
Other algorithms - Many… too many A. Biswas, K.K. Mishra, S. Tiwari, A.K. Misra, “Physics-Inspired Optimization Algorithms: A Survey” Journal of Optimisation, Vol. 2013, article ID 438152
Conclusions • Physics • - is a source of inspiration for computer science algorithms for a long time • - has generated very competitive algorithms • Simulated Annealing – one of the most studied algorithms • Quantum Annealing – at the origin of a different computing paradigm, Quantum Computing • Other interesting (and some not that interesting !) algorithms • Be inspired to explore some of these algorithms and • …why not … develop your own (a good one!)