From 5a2d9e3e433914ebbf0ba0cdda0997da94923b44 Mon Sep 17 00:00:00 2001 From: Mark Dewing Date: Mon, 7 May 2018 09:50:53 -0500 Subject: [PATCH 1/2] Introduction to Sympy notebook. A guide to Sympy as used in the notebooks in this repository. First version. Still incomplete. --- Intro to Sympy.ipynb | 474 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 474 insertions(+) create mode 100644 Intro to Sympy.ipynb diff --git a/Intro to Sympy.ipynb b/Intro to Sympy.ipynb new file mode 100644 index 0000000..bfd540b --- /dev/null +++ b/Intro to Sympy.ipynb @@ -0,0 +1,474 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Introduction to Sympy\n", + "Sympy (http://www.sympy.org/en/index.html) is a symbolic mathematics package in Python. It is used in this repository for deriving and explaning algorithms. It is also used in QMCPACK to generate values for unit testing, and generating code in a few places.\n", + "\n", + "This is not a general introduction to Sympy. For that, see the [Tutorial](http://docs.sympy.org/latest/tutorial/index.html#tutorial). This document is focused on the ways Sympy is used in this repository and in QMCPACK." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "from sympy import *\n", + "# Call the following so expressions are rendered nicely in Jupyter Notebooks\n", + "init_printing()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Symbols\n", + "\n", + "There are several way to create symbols. The the most basic is 'Symbol'." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAAsAAAAJBAMAAAAWSsseAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAIquJdjLdEETvu2aZ\nVM0GsGrEAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAR0lEQVQIHWNgYFR2TWdgYOgU4PrAwMA+m4Fn\nAQMDz3cGNgcGBs4FDPUBDAz1Bgz3GQoY6i8wrOMVYOBz4E5iBqpUMRXyYAAAgLMMA5qDwz8AAAAA\nSUVORK5CYII=\n", + "text/latex": [ + "$$a$$" + ], + "text/plain": [ + "a" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "a = Symbol('a')\n", + "a" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAAcAAAAOBAMAAAARcxsoAAAAKlBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADmU0mKAAAADXRSTlMAq7tmEImZdkTvIlTNIET/KQAA\nAAlwSFlzAAAOxAAADsQBlSsOGwAAADxJREFUCB1jYGAQYgACYRCBAljCChgYWDkmMDCsZjvAwODA\nC+Qy7HUAEgdZGBhYbrMyMHBcWAzkqhcwAADCSQhz4a11bAAAAABJRU5ErkJggg==\n", + "text/latex": [ + "$$i$$" + ], + "text/plain": [ + "i" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "i = Symbol('i',integer=True)\n", + "i" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAGUAAAAVBAMAAACtcD09AAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAMmYiu80QdonvRN2Z\nVKvu110NAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABYklEQVQ4EZ2Rq04DQRSGv96GbUu7PMISBLai\nBkMIBFFXA4qQDQ61VEFQBVMBQRAUqgmKINoXKCwKBfQNIBgwJISkDYaEM2ybbGdXLPzqzH+ZnAv8\nBynnT6lZ7a6iat2EsULNL8+Idx1yzwkz2H3qMNVEVwnRcdmDfAWkSogj2IYrcUuVEBsySJ9jcW/u\n3kcyVqthcpm3xjdYPsugBq4tHU4g02NtgpDHZSU7hHSdHpSG2E3DkG/yblDqlGlZWqnLObryzMyj\nayTENqQottSHzuR8Oua2zyIR8kt47d+M9GY7mN+qr2hGennCpdDVO7Db0qqBT2ncoLw+q6WK3sEJ\nlJ2sjyfjhfCAulWDECEj7KSvLRnL1zdVdy9QlDWGYB3Ow40bYlCvB4v7Em1THF/mIqwHdWGshaUF\nOZE/IpywENTpKAUtIVcCQTlRw1aUQum5q4EQ96cTk8nqfjNxSox5RM3BD7QHRuAu8W3KAAAAAElF\nTkSuQmCC\n", + "text/latex": [ + "$$\\left ( b, \\quad c, \\quad d\\right )$$" + ], + "text/plain": [ + "(b, c, d)" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Create multiple symbols - input is string with symbol names separated by spaces\n", + "b,c,d = symbols('b c d')\n", + "b,c,d" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAABMAAAAMBAMAAABy/puxAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAIquJdjLdEETvu2aZ\nVM0GsGrEAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAeklEQVQIHWNgYFR2TWeAgE4Brg8MzKeOMzCw\nz2bgWcBgyKDHwMDznYHNgSGRIV6AgXMBQ30AwwwG+QaGegOG+wwFDAz3CxjqLzCs4xVgYEhhYOBz\n4E5iZmBgPgA0QcVUyIOBYQ/UaAYGDgOOACgn7u4toFYwmP//PwMAZNsY4aMgWMcAAAAASUVORK5C\nYII=\n", + "text/latex": [ + "$$a_{2}$$" + ], + "text/plain": [ + "a₂" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Some special characters in symbols are recognized as TeX and rendered as such\n", + "a2 = Symbol('a_2')\n", + "a2" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Symbols can be combined into expressions" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAGsAAAAWBAMAAAA1LX8gAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAIpm7MhCriUTv3c12\nVGZoascqAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABsklEQVQ4EZ2Rvy8DYRjHv7269rSVayQ1dHFR\n3YgmYjA5RgbH0MTkFgsNZdAEQ/8CjRj8GLRGicTFwFAJm8VQrERjIyIkGuJHzvte3ze9k4ukfZb3\neT7P9/u8v4C6wx+L1+0hhnnMNGLbxWi4Ad8m2rMN2IA7rSHbPuDp6FXdvCfaUFbsL7i1/AqQhP/D\nrZc3v4Gg7ta6J3AK2LL3xlhxnCLPJZdYxSktpbSkYhuYU1mTLjcs1+ma43fnlMKR22sNp9o/tiUq\no2G35U3TYgca2laG2WAumH3qBI4uui1FzZa5UKsE0jukNQywitv6yKeKX5pMbkiC02gpaDBhIIGJ\nMmKs4gLAW2ipQE5bnNMN+EpMSAw9GsgXOgSA8CoYmHTYhApTASEdWIf4RsFysbhXLB6SzGeQ/wwq\nyJHhNdqcoCorruCJvKPlRayW7DjNBoSKXKbnoMEo25uAJgWhyA+8xqXV5wIBCBhyVtxxUDIHZHsS\n0czCNE7wqKetkts8Ch7CvrJXcVBBx7hqkVPT/ETyfDCVdQjQuhiH2DVbhXwYMs9njPxZ+FM7sTu1\naVZteS39S38BQNpzfFWhzmkAAAAASUVORK5CYII=\n", + "text/latex": [ + "$$2 a + 5 b + c^{2}$$" + ], + "text/plain": [ + " 2\n", + "2⋅a + 5⋅b + c " + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "e = 2*a + 5*b + c*c\n", + "e" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Expression evaluation\n", + "Expressions are evaluated through substition. This is done with the `subs` method. There are three ways to specific the substitutions\n", + "1. Single value - pass the old value and the new value to subs\n", + "2. A list of old value, new value pairs\n", + "3. A dictionary where the old values is the key, and the new value is the value" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAGIAAAAWBAMAAADJOFTqAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAzXYQMplE74mrIma7\n3VSKKnSYAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABfklEQVQ4EX2SPUjDQBiG36hN/0QN0kFwKEoH\nnYJQFBEaB2cVQRyEdndyEZGKcasiqAWH0qWLk4guTl1cHAV1EcQhuAmig1BFxXiX+0kkl95w9+V5\nvjdHLgdEj8TyQrRUml0cKnk0fMBsI9qqzBrOSirejr2Z7azK3amgNty1iKlNlUJiLoRngLjrZoGB\nkKLgIkwfAW1nlPBf4SZFQVbd1i32KGlHGUhSpr8zAzyJgqzTry/8yyU9GeSJxI1olI6ALdflWFKb\nJpo5C1o15zApXWXIYoTOgqYbJNFtploo9OOLeeFOHa0vnBgDSZBxDfKnPpkXiXUkHUboLKjNE8XG\nPDr/J2LyKLwYT/RYNEGu534pA52e77Zh3BtGhlTxS6/Tm3w6AZpYBYrmN8RL+dsKtp8gFafPtdpH\nFeQi3KKF8XPWwl0veXT8EKcElIFjpDdQxxXX3MUOkLdUiR8gtXRkIj/CtxD7o9LM+gFJsefWA9gr\n/f2DRk1Zx0qwUdZB+gdH9Vu8IeXvhAAAAABJRU5ErkJggg==\n", + "text/latex": [ + "$$5 b + c^{2} + 4$$" + ], + "text/plain": [ + " 2 \n", + "5⋅b + c + 4" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "e.subs(a,2)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAABMAAAAPBAMAAAD0aukfAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAzRAiu5mrdu/dZolE\nVDLjuNgcAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAeklEQVQIHWNgYBBiYGAq33qAgYHB5BMDAysD\nQy4Dg0oYkHmLgcEQKMoOZG5hYNCEMs87MeyCMtn+r14AZTLEf1SAMrni5HugzGUMXD+AwiATmhgY\n3l8AM5k+MDCwLYCINjMwsBhAmAcVGJYDrc/4mcXAlwp2DtAQCAAASJ4i3e599ZEAAAAASUVORK5C\nYII=\n", + "text/latex": [ + "$$18$$" + ], + "text/plain": [ + "18" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# List of old value, new value pairs\n", + "subslist = [(a,2),(b,1),(c,3)]\n", + "e.subs(subslist)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAABMAAAAPBAMAAAD0aukfAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAzRAiu5mrdu/dZolE\nVDLjuNgcAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAeklEQVQIHWNgYBBiYGAq33qAgYHB5BMDAysD\nQy4Dg0oYkHmLgcEQKMoOZG5hYNCEMs87MeyCMtn+r14AZTLEf1SAMrni5HugzGUMXD+AwiATmhgY\n3l8AM5k+MDCwLYCINjMwsBhAmAcVGJYDrc/4mcXAlwp2DtAQCAAASJ4i3e599ZEAAAAASUVORK5C\nYII=\n", + "text/latex": [ + "$$18$$" + ], + "text/plain": [ + "18" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Dictionary of old value and new values\n", + "subsdict = {a:2, b:1, c:3}\n", + "e.subs(subsdict)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Arrays and Matrices\n", + "There are several ways to represent indexed values\n", + "1. Indexed types (in the tensor module)\n", + "2. Concrete matrices. These have a fixed size and store all the elements.\n", + "3. Symbolic matrices. These represent a matrix more generically. The size is specified, but could be a variable. Individual elements are not stored." + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAABEAAAAMBAMAAAB2C0uMAAAALVBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAOrOgAAAADnRSTlMAiXYyIt1Uze+rmRC7ZntL\nWAUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAABmSURBVAgdY2BgEFQyYAAD1wT2AkbF2UB2IwNnwlqG\nNQwMXK+BvIUM9xgYOA6A1SxnYNgnAGJxNzMw8F1gYEjgVlcAqpvAsAtoClAHg+BdIJ/BLgFIgFX5\nARWBQAjDjQ0QlqHiFAYAjZ0TmXLfdNsAAAAASUVORK5CYII=\n", + "text/latex": [ + "$$c_{3}$$" + ], + "text/plain": [ + "c[3]" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "c = IndexedBase('c')\n", + "c[3]" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAADYAAAAyBAMAAADl+jX4AAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMA74lUMhDNIruZq3bd\nZkRVk0nZAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABOUlEQVQ4EWOQ//+JARvQ//+RQdjFFZsUQ4iL\nIYMIVhmQoCNEji0AWQX7zA4HuBx7P4pcFAPTP5gca+d6FLmlDAyCMDkGhv0ocjIMDOuBhkLtQ5XL\nD8AtBzTvPNAgrPoYGPhA4YFDjqcBt9wMoBQOfdwLcMtZMrAX4NDHMoGBG5dcjZLmGrh9s+RPXQDZ\nAAX5////ATKhfoCJotCjcijBAefgCBdgTOAMT+Q0ATcHytjYgFMf+zXcckxsCDn2RVuOAg2Bg+tI\ncg8LOD7AJRgYWDcg5FhlGTgbkOSYGBBynF8ZeDYgyZkgyTE2MMQ7IORYFZDk4hUY7BkC4JLMq1at\nlwKaAw6zeAOGNuYCuByQATQJKse2gfcUE7IUAz9cjnW1StU+ZDmm/l8XcIY1WCGOOBogOXxlJJ6y\nFQDaLVfyJcebDgAAAABJRU5ErkJggg==\n", + "text/latex": [ + "$$\\left[\\begin{matrix}1 & 2\\\\a & 4\\end{matrix}\\right]$$" + ], + "text/plain": [ + "⎡1 2⎤\n", + "⎢ ⎥\n", + "⎣a 4⎦" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Concrete matrix\n", + "A = Matrix( [[1,2],[a,4]])\n", + "A" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAOBAMAAADUAYG5AAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAZqu7RJkydiLvEN1U\nic38Af7KAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAb0lEQVQIHWNgYBD6r6Rk7MAABJ8ZGFi/AWm2\n7wwMLF+BDPYfDAyMQA4D8wQGhpW7gAx+BQa2TQuAjHz1cusDQJqhvoGBaxKIYQniHAASn0CMC0Bj\nPgIZ+g4QY9iAhjPwAY3xtGJgYHr/SUnZhoEBADmxGWDdfUO/AAAAAElFTkSuQmCC\n", + "text/latex": [ + "$$B$$" + ], + "text/plain": [ + "B" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Symbolic matrix\n", + "B = MatrixSymbol('B',3,3)\n", + "B" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Code generation\n", + "\n", + "There are several way to turn Sympy expressions into executable code. One reason is we want to evaluate expressions faster than substitution described above. Or we want the code in Python or C++ to interface with or plug into a larger code.\n", + "\n", + "See the Scipy 2017 Tutorial for more on Sympy code generation (http://www.sympy.org/scipy-2017-codegen-tutorial/ )" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Lambdify\n", + "Using 'lambdify' can turn an expression into an executable python function. It takes two arguments - the first is the input variable (or list of variables), and the second is the expression to convert." + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAAoAAAAOBAMAAADkjZCYAAAALVBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAOrOgAAAADnRSTlMAEJmJdiLvZqu7zURUMveL\naM0AAAAJcEhZcwAADsQAAA7EAZUrDhsAAABYSURBVAgdY2AQMlFlYGBMZwgLYOBIYOCYwMC3gIH5\nIYPcBAaW1wxsQPZzBuYHDFxPGBiWMBx+zsDA7nL5DQMQcDwEkVwNDOypDPcCGFgWMi4H8o00NzAA\nAPA4EsdooCJwAAAAAElFTkSuQmCC\n", + "text/latex": [ + "$$9$$" + ], + "text/plain": [ + "9" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "e = 2*a + 3\n", + "f1 = lambdify(a, e)\n", + "f1(3)" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAAoAAAAPBAMAAAAv0UM9AAAALVBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAOrOgAAAADnRSTlMAMpndu3bvImbNiRBUq9OB\nhjcAAAAJcEhZcwAADsQAAA7EAZUrDhsAAABESURBVAgdY2BgYBACYgYGExDBmgIiK6aAyAUgkqMA\nRG5lAJELQCSPAIjcxQAiz969++wqUIIBrIvhCYi55N0NEMXAAABbkhBrtxdTYQAAAABJRU5ErkJg\ngg==\n", + "text/latex": [ + "$$4$$" + ], + "text/plain": [ + "4" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "e = 2*a*b\n", + "f2 = lambdify([a,b],e)\n", + "f2(1,2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The 'lambdastr' function will return the python expression for the function. Can be useful for transferring the function to another script." + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'lambda a,b: (2*a*b)'" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from sympy.utilities.lambdify import lambdastr\n", + "lambdastr([a,b],e)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From f095f71bd716d4ebc47ce39ca364b88061667d1c Mon Sep 17 00:00:00 2001 From: Mark Dewing Date: Tue, 8 May 2018 09:05:15 -0500 Subject: [PATCH 2/2] Add comment and link about Intro to Sympy --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 7b1f261..b615875 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,5 @@ Directories: * StochasticReconfiguration - Stochastic reconfiguration for fixed population diffusion Monte Carlo. * Variational - Demonstration of variational principle for energy of hydrogen and helium atoms. * Wavefunctions - Various functional forms for wavefunctions. + +Many of these notebooks use Sympy for symbolic expressions. The notebook [Intro to Sympy](Intro%20to%20Sympy.ipynb) contains a a short guide to Sympy as used in these notebooks.