From 9cc8fcbd6b76bdd23a8e749e561465cad9d6cb51 Mon Sep 17 00:00:00 2001 From: Eric Berquist Date: Mon, 27 Jul 2015 10:06:32 -0400 Subject: [PATCH 1/2] Add Jupyter notebooks with examples. --- .../Untitled-checkpoint.ipynb | 192 +++++++++ .../Untitled1-checkpoint.ipynb | 389 ++++++++++++++++++ .../.ipynb_checkpoints/sympy-checkpoint.ipynb | 278 +++++++++++++ notebooks/Untitled.ipynb | 192 +++++++++ notebooks/Untitled1.ipynb | 389 ++++++++++++++++++ notebooks/sympy.ipynb | 278 +++++++++++++ 6 files changed, 1718 insertions(+) create mode 100644 notebooks/.ipynb_checkpoints/Untitled-checkpoint.ipynb create mode 100644 notebooks/.ipynb_checkpoints/Untitled1-checkpoint.ipynb create mode 100644 notebooks/.ipynb_checkpoints/sympy-checkpoint.ipynb create mode 100644 notebooks/Untitled.ipynb create mode 100644 notebooks/Untitled1.ipynb create mode 100644 notebooks/sympy.ipynb diff --git a/notebooks/.ipynb_checkpoints/Untitled-checkpoint.ipynb b/notebooks/.ipynb_checkpoints/Untitled-checkpoint.ipynb new file mode 100644 index 0000000..857c3e6 --- /dev/null +++ b/notebooks/.ipynb_checkpoints/Untitled-checkpoint.ipynb @@ -0,0 +1,192 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Molecular integral of diamagnetic contribution to nuclear spin-spin coupling constant\n", + "\n", + "## O. Matsuoka and T. Aoyama\n", + "\n", + "The Journal of Chemical Physics 73, 5718 (1980); doi: 10.1063/1.440051" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "from math import pi, exp\n", + "import numpy as np\n", + "import scipy.integrate as spi" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "alpha_A = 0.5\n", + "alpha_B = 1.0\n", + "A = [0.5, -0.6, 0.4]\n", + "B = [-0.5, 0.4, -0.3]\n", + "C = [-0.4, -0.3, 0.5]\n", + "D = [0.3, 0.5, -0.6]" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "spi.quad?" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def chi_1D(r, center, l, m, n, alpha):\n", + " return ((r[0] - center)**l) * ((r[1] - center)**m) * ((r[2] - center)**n) * exp(-alpha * (r[0] - center)**2)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "chi_C_1D_X = lambda r, center, alpha: chi_1D(r, center, 1, 0, 0, alpha)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "chi_C_1D_X_quad = lambda alpha, r: chi_C_1D_X(r, C, alpha)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "ename": "TypeError", + "evalue": "() missing 2 required positional arguments: 'r' and 'center'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mspi\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mquad\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mchi_C_1D_X_quad\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m10\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;32m/usr/local/lib/python3.4/site-packages/scipy/integrate/quadpack.py\u001b[0m in \u001b[0;36mquad\u001b[0;34m(func, a, b, args, full_output, epsabs, epsrel, limit, points, weight, wvar, wopts, maxp1, limlst)\u001b[0m\n\u001b[1;32m 309\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mweight\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 310\u001b[0m retval = _quad(func, a, b, args, full_output, epsabs, epsrel, limit,\n\u001b[0;32m--> 311\u001b[0;31m points)\n\u001b[0m\u001b[1;32m 312\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 313\u001b[0m retval = _quad_weight(func, a, b, args, full_output, epsabs, epsrel,\n", + "\u001b[0;32m/usr/local/lib/python3.4/site-packages/scipy/integrate/quadpack.py\u001b[0m in \u001b[0;36m_quad\u001b[0;34m(func, a, b, args, full_output, epsabs, epsrel, limit, points)\u001b[0m\n\u001b[1;32m 374\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mpoints\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 375\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0minfbounds\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 376\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0m_quadpack\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_qagse\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfunc\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mb\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mfull_output\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mepsabs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mepsrel\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mlimit\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 377\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 378\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0m_quadpack\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_qagie\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfunc\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mbound\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0minfbounds\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mfull_output\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mepsabs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mepsrel\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mlimit\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mTypeError\u001b[0m: () missing 2 required positional arguments: 'r' and 'center'" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "ERROR:tornado.general:Uncaught exception, closing connection.\n", + "Traceback (most recent call last):\n", + " File \"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py\", line 407, in _run_callback\n", + " callback(*args, **kwargs)\n", + " File \"/usr/local/lib/python3.4/site-packages/tornado/stack_context.py\", line 275, in null_wrapper\n", + " return fn(*args, **kwargs)\n", + " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/kernelbase.py\", line 252, in dispatcher\n", + " return self.dispatch_shell(stream, msg)\n", + " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/kernelbase.py\", line 173, in dispatch_shell\n", + " idents,msg = self.session.feed_identities(msg, copy=False)\n", + " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/session.py\", line 769, in feed_identities\n", + " raise ValueError(\"DELIM not in msg_list\")\n", + "ValueError: DELIM not in msg_list\n", + "ERROR:tornado.general:Uncaught exception, closing connection.\n", + "Traceback (most recent call last):\n", + " File \"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py\", line 433, in _handle_events\n", + " self._handle_recv()\n", + " File \"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py\", line 465, in _handle_recv\n", + " self._run_callback(callback, msg)\n", + " File \"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py\", line 407, in _run_callback\n", + " callback(*args, **kwargs)\n", + " File \"/usr/local/lib/python3.4/site-packages/tornado/stack_context.py\", line 275, in null_wrapper\n", + " return fn(*args, **kwargs)\n", + " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/kernelbase.py\", line 252, in dispatcher\n", + " return self.dispatch_shell(stream, msg)\n", + " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/kernelbase.py\", line 173, in dispatch_shell\n", + " idents,msg = self.session.feed_identities(msg, copy=False)\n", + " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/session.py\", line 769, in feed_identities\n", + " raise ValueError(\"DELIM not in msg_list\")\n", + "ValueError: DELIM not in msg_list\n", + "ERROR:tornado.application:Exception in callback None\n", + "Traceback (most recent call last):\n", + " File \"/usr/local/lib/python3.4/site-packages/tornado/ioloop.py\", line 840, in start\n", + " handler_func(fd_obj, events)\n", + " File \"/usr/local/lib/python3.4/site-packages/tornado/stack_context.py\", line 275, in null_wrapper\n", + " return fn(*args, **kwargs)\n", + " File \"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py\", line 433, in _handle_events\n", + " self._handle_recv()\n", + " File \"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py\", line 465, in _handle_recv\n", + " self._run_callback(callback, msg)\n", + " File \"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py\", line 407, in _run_callback\n", + " callback(*args, **kwargs)\n", + " File \"/usr/local/lib/python3.4/site-packages/tornado/stack_context.py\", line 275, in null_wrapper\n", + " return fn(*args, **kwargs)\n", + " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/kernelbase.py\", line 252, in dispatcher\n", + " return self.dispatch_shell(stream, msg)\n", + " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/kernelbase.py\", line 173, in dispatch_shell\n", + " idents,msg = self.session.feed_identities(msg, copy=False)\n", + " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/session.py\", line 769, in feed_identities\n", + " raise ValueError(\"DELIM not in msg_list\")\n", + "ValueError: DELIM not in msg_list\n" + ] + } + ], + "source": [ + "spi.quad(chi_C_1D_X_quad, 0, 10)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.4.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/notebooks/.ipynb_checkpoints/Untitled1-checkpoint.ipynb b/notebooks/.ipynb_checkpoints/Untitled1-checkpoint.ipynb new file mode 100644 index 0000000..a1179a3 --- /dev/null +++ b/notebooks/.ipynb_checkpoints/Untitled1-checkpoint.ipynb @@ -0,0 +1,389 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "%load_ext autoreload\n", + "%autoreload 2" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "from functools import reduce\n", + "from math import pi, exp, factorial, floor\n", + "import numpy as np" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "from pyints.one import overlap\n", + "from pyints.one import electric_field_from_V as electric_field" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def norm2(a):\n", + " return np.dot(a, a)\n", + "\n", + "def fact2(n):\n", + " return reduce(int.__mul__, range(n, 0, -2), 1)\n", + "\n", + "def binomial(n, k):\n", + " if n == k:\n", + " return 1\n", + " assert n > k\n", + " return factorial(n) // (factorial(k) * factorial(n - k))\n", + "\n", + "def binomial_prefactor(s, ia, ib, xpa, xpb):\n", + " total = 0\n", + " for t in range(s+1):\n", + " if s-ia <= t <= ib:\n", + " total += binomial(ia, s-t)*binomial(ib, t)*pow(xpa, ia-s+t)*pow(xpb,ib-t)\n", + " return total\n", + "\n", + "def gaussian_product_center(alpha1, A, alpha2, B):\n", + " return ((alpha1 * A) + (alpha2 * B)) / (alpha1 + alpha2)\n", + "\n", + "def overlap1d(l1, l2, PAx, PBx, gamma):\n", + " total = 0\n", + " for i in range(1+int(floor(0.5*(l1+l2)))):\n", + " total += binomial_prefactor(2*i, l1, l2, PAx, PBx) * fact2(2*i-1) / pow(2*gamma, i)\n", + " return total\n", + "\n", + "def overlap_pyquante(alpha1, lmn1, A, alpha2, lmn2, B):\n", + " l1, m1, n1 = lmn1\n", + " l2, m2, n2 = lmn2\n", + " rab2 = norm2(A - B)\n", + " gamma = alpha1 + alpha2\n", + " P = gaussian_product_center(alpha1, A, alpha2, B)\n", + " \n", + " pre = pow(pi/gamma, 1.5) * exp(-alpha1 * alpha2 * rab2 / gamma)\n", + " \n", + " wx = overlap1d(l1, l2, P[0] - A[0], P[0] - B[0], gamma)\n", + " wy = overlap1d(m1, m2, P[1] - A[1], P[1] - B[1], gamma)\n", + " wz = overlap1d(n1, n2, P[2] - A[2], P[2] - B[2], gamma)\n", + " \n", + " return pre * wx * wy * wz" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def binomial_prefactor_2(x, Ax, Bx, Px, l, m):\n", + " total = 0\n", + " for ix in range(l):\n", + " for jx in range(m):\n", + " total += \\\n", + " binomial(l, ix) * \\\n", + " binomial(m, jx) * \\\n", + " ((x - Px)**(ix + jx)) * \\\n", + " ((Px - Ax)**(l - ix)) * \\\n", + " ((Px - Bx)**(m - jx))\n", + " return total" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def overlap_three_center(alpha1, lmn1, A, alpha2, lmn2, B, alpha3, lmn3, C):\n", + " ax, ay, az = lmn1\n", + " bx, by, bz = lmn2\n", + "\n", + " gamma = alpha1 + alpha2\n", + " P = gaussian_product_center(alpha1, A, alpha2, B)\n", + " \n", + " total = 0\n", + " for ix in range(ax + 1):\n", + " for jx in range(bx + 1):\n", + " for iy in range(ay + 1):\n", + " for jy in range(by + 1):\n", + " for iz in range(az + 1):\n", + " for jz in range(bz + 1):\n", + " total += (\n", + " binomial(ax, ix) * \\\n", + " binomial(bx, jx) * \\\n", + " binomial(ay, iy) * \\\n", + " binomial(by, jy) * \\\n", + " binomial(az, iz) * \\\n", + " binomial(bz, jz) * \\\n", + " ((P[0] - A[0])**(ax - ix)) * \\\n", + " ((P[1] - A[1])**(ay - iy)) * \\\n", + " ((P[2] - A[2])**(az - iz)) * \\\n", + " ((P[0] - B[0])**(bx - jx)) * \\\n", + " ((P[1] - B[1])**(by - jy)) * \\\n", + " ((P[2] - B[2])**(bz - jz)) * \\\n", + " overlap(gamma, [ix + jx, iy + jy, iz + jz], P, alpha3, lmn3, C)\n", + " )\n", + " \n", + " return total" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "import itertools as i" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.0182571654982\n", + "-0.00620743626938\n", + "0.00576196143123\n", + "-0.00136563597926\n", + "0.00126763151487\n", + "0.00143127121952\n", + "0.0078784781131\n", + "-0.00731308144851\n", + "-0.00825713378096\n", + "0.00445198213986\n" + ] + } + ], + "source": [ + "for lmn3 in i.combinations_with_replacement(range(3), 3):\n", + " print(overlap_three_center(alpha_A, [1, 0, 0], A, alpha_B, [1, 0, 0], B, alpha_B, list(lmn3), C))" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "-0.105327247501\n", + "-0.105327247501\n", + "-0.0622031399323\n" + ] + } + ], + "source": [ + "print(overlap_three_center(alpha_A, [1, 0, 0], A, alpha_B, [1, 0, 0], B, alpha_B, [1, 0, 0], C))\n", + "print(overlap_three_center(alpha_B, [1, 0, 0], B, alpha_A, [1, 0, 0], A, alpha_B, [1, 0, 0], C))\n", + "print(overlap_three_center(alpha_A, [1, 0, 0], A, alpha_B, [1, 0, 0], C, alpha_B, [1, 0, 0], B))" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "alpha_A = 0.5\n", + "alpha_B = 1.0\n", + "A = np.array([0.5, -0.6, 0.4])\n", + "B = np.array([-0.5, 0.4, -0.3])\n", + "C = np.array([-0.4, -0.3, 0.5])\n", + "D = np.array([0.3, 0.5, -0.6])" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [], + "source": [ + "overlap_analytic = overlap(alpha_A, [1, 0, 0], A, alpha_B, [1, 0, 0], B)\n", + "overlap_analytic_pyquante = overlap_pyquante(alpha_A, [1, 0, 0], A, alpha_B, [1, 0, 0], B)\n", + "assert abs(overlap_analytic - overlap_analytic_pyquante) < 1.0e-16" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def overlap1d_numeric(l1, l2, PAx, PBx, gamma):\n", + " total = 0\n", + " for i in range(l1 + 1):\n", + " for j in range(l2 + 1):\n", + " total += (\n", + " binomial(l, ix) * \\\n", + " binomial(m, jx) * \\\n", + " ((x - Px)**(ix + jx)) * \\\n", + " ((Px - Ax)**(l - ix)) * \\\n", + " ((Px - Bx)**(m - jx))\n", + "\n", + " # for i in range(1+int(floor(0.5*(l1+l2)))):\n", + " # total += binomial_prefactor(2*i, l1, l2, PAx, PBx) * fact2(2*i-1) / pow(2*gamma, i)\n", + " return total" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def overlap_numeric(alpha1, lmn1, A, alpha2, lmn2, B):\n", + " l1, m1, n1 = lmn1\n", + " l2, m2, n2 = lmn2\n", + " rab2 = norm2(A - B)\n", + " gamma = alpha1 + alpha2\n", + " P = gaussian_product_center(alpha1, A, alpha2, B)\n", + " \n", + " pre = pow(pi/gamma, 1.5) * exp(-alpha1 * alpha2 * rab2 / gamma)\n", + " \n", + " wx = overlap1d_numeric(l1, l2, P[0] - A[0], P[0] - B[0], gamma)\n", + " wy = overlap1d_numeric(m1, m2, P[1] - A[1], P[1] - B[1], gamma)\n", + " wz = overlap1d_numeric(n1, n2, P[2] - A[2], P[2] - B[2], gamma)\n", + " \n", + " return pre * wx * wy * wz" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "import scipy.integrate as spi" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.4/site-packages/scipy/integrate/quadpack.py:352: IntegrationWarning: The integral is probably divergent, or slowly convergent.\n", + " warnings.warn(msg, IntegrationWarning)\n" + ] + }, + { + "data": { + "text/plain": [ + "(-0.048951572155845106, 1.3763160352661674e-05)" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "spi.quad(lambda alpha_C: (alpha_C ** 2) * overlap_analytic, 0, np.inf)" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.4/site-packages/scipy/integrate/quadpack.py:352: IntegrationWarning: The integral is probably divergent, or slowly convergent.\n", + " warnings.warn(msg, IntegrationWarning)\n" + ] + }, + { + "data": { + "text/plain": [ + "(-0.33156386027260937, 0.0014214591807548138)" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "spi.quad(lambda alpha_C: (alpha_C ** 2) * (exp(-alpha_C)) * overlap_analytic, 0, np.inf)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.4.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/notebooks/.ipynb_checkpoints/sympy-checkpoint.ipynb b/notebooks/.ipynb_checkpoints/sympy-checkpoint.ipynb new file mode 100644 index 0000000..c6ed2b6 --- /dev/null +++ b/notebooks/.ipynb_checkpoints/sympy-checkpoint.ipynb @@ -0,0 +1,278 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "%load_ext autoreload\n", + "%autoreload 2" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "import numpy as np" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import sympy as sy\n", + "sy.init_printing()" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "r = sy.symbols('r')\n", + "rx, ry, rz = sy.symbols('r_x, r_y, r_z')\n", + "A, B, C = sy.symbols('A, B, C')\n", + "Ax, Ay, Az = sy.symbols('A_x, A_y, A_z')\n", + "Bx, By, Bz = sy.symbols('B_x, B_y, B_z')\n", + "Cx, Cy, Cz = sy.symbols('C_x, C_y, C_z')\n", + "alpha, beta, gamma = sy.symbols('alpha, beta, gamma')" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "phi_A = sy.exp(-alpha * (r - A)**2)\n", + "phi_B = sy.exp(-beta * (r - B)**2)\n", + "phi_C = sy.exp(-gamma * (r - C)**2)" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "ename": "AttributeError", + "evalue": "'list' object has no attribute 'is_Number'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m/Users/flareon/opt/apps/python/sympy/sympy/core/cache.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 90\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 91\u001b[0;31m \u001b[0mretval\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 92\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/functools.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(*args, **kwds)\u001b[0m\n\u001b[1;32m 457\u001b[0m \u001b[0;32mnonlocal\u001b[0m \u001b[0mroot\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhits\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmisses\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfull\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 458\u001b[0;31m \u001b[0mkey\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmake_key\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkwds\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtyped\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 459\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mlock\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/functools.py\u001b[0m in \u001b[0;36m_make_key\u001b[0;34m(args, kwds, typed, kwd_mark, fasttypes, sorted, tuple, type, len)\u001b[0m\n\u001b[1;32m 381\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mkey\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 382\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0m_HashedSeq\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 383\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/functools.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, tup, hash)\u001b[0m\n\u001b[1;32m 350\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtup\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 351\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhashvalue\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mhash\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtup\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 352\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mTypeError\u001b[0m: unhashable type: 'numpy.ndarray'", + "\nDuring handling of the above exception, another exception occurred:\n", + "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m/Users/flareon/opt/apps/python/sympy/sympy/core/cache.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 90\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 91\u001b[0;31m \u001b[0mretval\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 92\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/functools.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(*args, **kwds)\u001b[0m\n\u001b[1;32m 457\u001b[0m \u001b[0;32mnonlocal\u001b[0m \u001b[0mroot\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhits\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmisses\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfull\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 458\u001b[0;31m \u001b[0mkey\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmake_key\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkwds\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtyped\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 459\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mlock\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/functools.py\u001b[0m in \u001b[0;36m_make_key\u001b[0;34m(args, kwds, typed, kwd_mark, fasttypes, sorted, tuple, type, len)\u001b[0m\n\u001b[1;32m 381\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mkey\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 382\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0m_HashedSeq\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 383\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/functools.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, tup, hash)\u001b[0m\n\u001b[1;32m 350\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtup\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 351\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhashvalue\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mhash\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtup\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 352\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mTypeError\u001b[0m: unhashable type: 'numpy.ndarray'", + "\nDuring handling of the above exception, another exception occurred:\n", + "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0msy\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexp\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m0.5\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0marray\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mrx\u001b[0m \u001b[0;34m-\u001b[0m \u001b[0;36m0.5\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mry\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;36m0.6\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrz\u001b[0m \u001b[0;34m-\u001b[0m \u001b[0;36m0.4\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;32m/Users/flareon/opt/apps/python/sympy/sympy/core/cache.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 91\u001b[0m \u001b[0mretval\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 92\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 93\u001b[0;31m \u001b[0mretval\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 94\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mretval\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 95\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/Users/flareon/opt/apps/python/sympy/sympy/core/function.py\u001b[0m in \u001b[0;36m__new__\u001b[0;34m(cls, *args, **options)\u001b[0m\n\u001b[1;32m 374\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 375\u001b[0m \u001b[0mevaluate\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0moptions\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'evaluate'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mglobal_evaluate\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 376\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msuper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mFunction\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__new__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcls\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0moptions\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 377\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mevaluate\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresult\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 378\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/Users/flareon/opt/apps/python/sympy/sympy/core/cache.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 91\u001b[0m \u001b[0mretval\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 92\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 93\u001b[0;31m \u001b[0mretval\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 94\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mretval\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 95\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/Users/flareon/opt/apps/python/sympy/sympy/core/function.py\u001b[0m in \u001b[0;36m__new__\u001b[0;34m(cls, *args, **options)\u001b[0m\n\u001b[1;32m 198\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 199\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mevaluate\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 200\u001b[0;31m \u001b[0mevaluated\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0meval\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 201\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mevaluated\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 202\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mevaluated\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/Users/flareon/opt/apps/python/sympy/sympy/functions/elementary/exponential.py\u001b[0m in \u001b[0;36meval\u001b[0;34m(cls, arg)\u001b[0m\n\u001b[1;32m 207\u001b[0m \u001b[0;34m@\u001b[0m\u001b[0mclassmethod\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 208\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0meval\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcls\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0marg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 209\u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0marg\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_Number\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 210\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0marg\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0mS\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mNaN\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 211\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mS\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mNaN\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mAttributeError\u001b[0m: 'list' object has no attribute 'is_Number'" + ] + } + ], + "source": [ + "sy.exp(-0.5 * (np.array([rx - 0.5, ry + 0.6, rz - 0.4])**2))" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPMAAAAXBAMAAAAsDWSYAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEIl2mSJE3e9UMqtm\nzbsXyEShAAAACXBIWXMAAA7EAAAOxAGVKw4bAAADG0lEQVRIDbWUS2jUUBSG/8xMkiaTZqIdcCFq\ntC6sCwlMXVm0lIqLVklBwZ0BhS4UbbG4KhTFTYuLgqggooOutRXrPuIDhSIjYlcupgtFKPSBWFHE\nem4e03snOo2LOTBzzvnvd//knmQGSBn6rk+pyPv73BRcWrfAysRgCkugqgyl4P7ldiKxVwNascMS\ndDl5OsJQkVZSYAm3cI9ksyyMV/dJucXkMEr9wGZAWZrp47kA08RTEwZjoaeNu9F6t9gVMNnpjNV1\ngaq9gPShpmQs1cI8ta+BPTU1xLCNuwhJhMkfIX2pwzg3buU0q4u/OAXYDmxldxTGS7RYikN1H3Bv\nXQ4w6XFMBZlhUx7wlldFN24lGOHOEU6hSZSlw2x0Ydi4DtOl+iJwNBZZNssoDtiCQtgVEh4IouAW\nrrTvhoUhqnVnMWZfzB5wkXXUte+xIt98X4VKnfQT2XeRavQ/f0oYxtbYfhbyUhUOYVn23m0KJHqQ\nIca5hQuql3dsvUJNHkciFq9WVQ/adNxS1lx04CEVytfSQqwbF7xLImZ29MoeYWo1ZignsXDxGIw5\nT2HkGxwKJchtrA/ESEEG6MR56jIVGMOROnCwHruBnMGwQneEsJTAtEWKeYxDuQqFDiiN9C5ZkZh3\naEcwCkRKFujBWVLNbkg/cJdttvCkhsUK9FmGqTYN349FDqMNtfgGfQV6Fci5mCpHcgsr2P3Uog2Y\nwCNqC5PQvsXyBBUCRv1lhuWq9LEaYbQ2h8yyJQ0Bd8jWj+BTLBt21LF0BjkbW6iYsnDSZgqFvExf\nAkZ9NcBGIdH/Qhh/xWjpeJffM4lhmL/p9RyNYPZQkfeijqX9pQ4ao4XMWG/f51gP3gYBC8ZMGDIz\n7bVDC5jU3unG+4PcJXRh08prDmuyPi9FtYDREMqNsUFXtgUXU+jChp7AegSXpmEmQ8DoCRPRAJPH\nUSwLJoovtKyRpjlJ94LmHCdFpYCRRr9CNMDy10rP6kxu1/U0XSshQSsntP/ECvyBEmZNFQp2U+0b\nmbfQpcP3phHVlLVsBUW3Kc4bm3Z2+RtDzSD+AAqsuf7bksXmAAAAAElFTkSuQmCC\n", + "text/latex": [ + "$$e^{- \\alpha \\left(A - r\\right)^{2} - \\beta \\left(B - r\\right)^{2} - \\gamma \\left(C - r\\right)^{2}}$$" + ], + "text/plain": [ + " 2 2 2\n", + " - α⋅(A - r) - β⋅(B - r) - γ⋅(C - r) \n", + "ℯ " + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sy.simplify(phi_A * phi_B * phi_C)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAEYAAAAwBAMAAABeexFrAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEM3dMomZdkQi71S7\nZqsQsTlgAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABtklEQVQ4Ec2Uv0vDUBDHv5GmSfpDgyCCCJbW\nP0DQoWPFyUGIQ1sQxCJIxcHGgi4uHTqJYEFwUAoidig4FPwHOoib0EEFhUL/AqmDk4i+pHmv8ZHX\ndOwtd/e9z10uIe8BItPaFVGJ6cfSA4sFQTSFU0GJyVXgniWCwAQ+BCUmm1DrLOEDOb9LJHU1n0jx\nJZprScxUrqBI6T0hEzIQyR1ABpQY7eN9QUcwZkAhj+vyNZrfAXJNRxmIXlON89IXYb4BAxjvcDWW\n/hCGPCQGXFaYyAX7wGt3GU8IJLlKP5U329gx1bVsWu+LnhF5dV8bhpn2nQLr84ywTS5aNj/chr9C\nG65/hKjqm+8ySmM25Qc9Q216MxL9lbUWwgveTNh0dHLMRMfDzZzQmXZb5qjktDOmfFFccjTbnZek\nutawQ8aYU5lbN1MDHhX9P2MARRcT/AS2nfPQnwOcuZhQE9hYJ4Icjydu4vEcCdUU8E48tTkyd6u3\nDugca6z7VpxoEcZpoMwYoLlvxWAH0UJAtynKRFpYKTl9tku3W8FsT6BM+eXQ2tDTKENWFJpKdrNs\nENMjIJlOMMBZn4fYH3EeZdf6ImJFAAAAAElFTkSuQmCC\n", + "text/latex": [ + "$$- \\frac{\\alpha \\beta}{\\alpha + \\beta}$$" + ], + "text/plain": [ + "-α⋅β \n", + "─────\n", + "α + β" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "(-alpha*beta/(alpha+beta))" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAADloAAAA8BAMAAABGXZtwAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAA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7Sk2KWhWUbNkGqORGIUMcfLP62x\ngxiht41dZ8OofrpYvzQAmshoFIeJ0JAoYqxfRgC6ncXHL5/WTkU5sSIeeoULwVkcVj5E6cVgyy0C\nFoFACFi/DASTJbIITAACP+utQ64GcFiTnaUj9mwRsAgMDQHrl0OD1lZsEYiIQK73VOyWMpz1AI6Y\nHC6IKMeyWQQsAsERsH4ZHCtLaRGwCFgELAIWAYuARcAiMHQE/h/qyqqB/HPIdwAAAABJRU5ErkJg\ngg==\n", + "text/latex": [ + "$$- \\frac{1.0 e^{- 0.5 A^{2} - 1.0 B^{2}}}{\\sqrt{\\pi} A \\left(1.0 + \\frac{2.0 B}{A}\\right)} \\left(- 0.408248290463863 \\pi A \\left(1.0 + \\frac{2.0 B}{A}\\right) e^{0.166666666666667 A^{2} \\left(1.0 + \\frac{2.0 B}{A}\\right)^{2}} \\operatorname{erf}{\\left (0.408248290463863 A \\left(1.0 + \\frac{2.0 B}{A}\\right) \\right )} - 0.408248290463863 \\pi A \\left(1.0 + \\frac{2.0 B}{A}\\right) e^{0.166666666666667 A^{2} \\left(1.0 + \\frac{2.0 B}{A}\\right)^{2}}\\right) + \\frac{1.0 e^{- 0.5 A^{2} - 1.0 B^{2}}}{\\sqrt{\\pi} A \\left(1.0 + \\frac{2.0 B}{A}\\right)} \\left(- 0.408248290463863 \\pi A \\left(1.0 + \\frac{2.0 B}{A}\\right) e^{0.166666666666667 A^{2} \\left(1.0 + \\frac{2.0 B}{A}\\right)^{2}} \\operatorname{erf}{\\left (0.408248290463863 A \\left(1.0 + \\frac{2.0 B}{A}\\right) \\right )} + 0.408248290463863 \\pi A \\left(1.0 + \\frac{2.0 B}{A}\\right) e^{0.166666666666667 A^{2} \\left(1.0 + \\frac{2.0 B}{A}\\right)^{2}}\\right)$$" + ], + "text/plain": [ + " ⎛ \n", + " ⎜ 2 ⎛ 2.0⋅\n", + " ⎜ 0.166666666666667⋅A ⋅⎜1.0 + ────\n", + " ⎜ ⎛ 2.0⋅B⎞ ⎝ A \n", + " 1.0⋅⎜- 0.408248290463863⋅π⋅A⋅⎜1.0 + ─────⎟⋅ℯ \n", + " ⎝ ⎝ A ⎠ \n", + "- ────────────────────────────────────────────────────────────────────────────\n", + " \n", + " \n", + " \n", + "\n", + " 2 \n", + "B⎞ \n", + "─⎟ \n", + " ⎠ ⎛ ⎛ 2.0⋅B⎞⎞ ⎛ 2.0⋅\n", + " ⋅erf⎜0.408248290463863⋅A⋅⎜1.0 + ─────⎟⎟ - 0.408248290463863⋅π⋅A⋅⎜1.0 + ────\n", + " ⎝ ⎝ A ⎠⎠ ⎝ A \n", + "──────────────────────────────────────────────────────────────────────────────\n", + " ⎛ 2.0⋅B⎞ \n", + " √π⋅A⋅⎜1.0 + ─────⎟ \n", + " ⎝ A ⎠ \n", + "\n", + " 2⎞ ⎛ \n", + " 2 ⎛ 2.0⋅B⎞ ⎟ ⎜ \n", + " 0.166666666666667⋅A ⋅⎜1.0 + ─────⎟ ⎟ 2 2 ⎜ \n", + "B⎞ ⎝ A ⎠ ⎟ - 0.5⋅A - 1.0⋅B ⎜ \n", + "─⎟⋅ℯ ⎟⋅ℯ 1.0⋅⎜- 0.4082482\n", + " ⎠ ⎠ ⎝ \n", + "─────────────────────────────────────────────────────────── + ────────────────\n", + " \n", + " \n", + " \n", + "\n", + " 2 \n", + " 2 ⎛ 2.0⋅B⎞ \n", + " 0.166666666666667⋅A ⋅⎜1.0 + ─────⎟ \n", + " ⎛ 2.0⋅B⎞ ⎝ A ⎠ ⎛ \n", + "90463863⋅π⋅A⋅⎜1.0 + ─────⎟⋅ℯ ⋅erf⎜0.40824829\n", + " ⎝ A ⎠ ⎝ \n", + "──────────────────────────────────────────────────────────────────────────────\n", + " \n", + " \n", + " \n", + "\n", + " \n", + " \n", + " 0.166666666666\n", + " ⎛ 2.0⋅B⎞⎞ ⎛ 2.0⋅B⎞ \n", + "0463863⋅A⋅⎜1.0 + ─────⎟⎟ + 0.408248290463863⋅π⋅A⋅⎜1.0 + ─────⎟⋅ℯ \n", + " ⎝ A ⎠⎠ ⎝ A ⎠ \n", + "──────────────────────────────────────────────────────────────────────────────\n", + " ⎛ 2.0⋅B⎞ \n", + " √π⋅A⋅⎜1.0 + ─────⎟ \n", + " ⎝ A ⎠ \n", + "\n", + " 2⎞ \n", + " 2 ⎛ 2.0⋅B⎞ ⎟ \n", + "667⋅A ⋅⎜1.0 + ─────⎟ ⎟ 2 2\n", + " ⎝ A ⎠ ⎟ - 0.5⋅A - 1.0⋅B \n", + " ⎟⋅ℯ \n", + " ⎠ \n", + "─────────────────────────────────────────\n", + " \n", + " \n", + " " + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sy.integrate(phi_A.replace(alpha, 0.5) * phi_B.replace(beta, 1.0), (r, -sy.oo, sy.oo))" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.4.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/notebooks/Untitled.ipynb b/notebooks/Untitled.ipynb new file mode 100644 index 0000000..857c3e6 --- /dev/null +++ b/notebooks/Untitled.ipynb @@ -0,0 +1,192 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Molecular integral of diamagnetic contribution to nuclear spin-spin coupling constant\n", + "\n", + "## O. Matsuoka and T. Aoyama\n", + "\n", + "The Journal of Chemical Physics 73, 5718 (1980); doi: 10.1063/1.440051" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "from math import pi, exp\n", + "import numpy as np\n", + "import scipy.integrate as spi" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "alpha_A = 0.5\n", + "alpha_B = 1.0\n", + "A = [0.5, -0.6, 0.4]\n", + "B = [-0.5, 0.4, -0.3]\n", + "C = [-0.4, -0.3, 0.5]\n", + "D = [0.3, 0.5, -0.6]" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "spi.quad?" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def chi_1D(r, center, l, m, n, alpha):\n", + " return ((r[0] - center)**l) * ((r[1] - center)**m) * ((r[2] - center)**n) * exp(-alpha * (r[0] - center)**2)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "chi_C_1D_X = lambda r, center, alpha: chi_1D(r, center, 1, 0, 0, alpha)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "chi_C_1D_X_quad = lambda alpha, r: chi_C_1D_X(r, C, alpha)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "ename": "TypeError", + "evalue": "() missing 2 required positional arguments: 'r' and 'center'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mspi\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mquad\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mchi_C_1D_X_quad\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m10\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;32m/usr/local/lib/python3.4/site-packages/scipy/integrate/quadpack.py\u001b[0m in \u001b[0;36mquad\u001b[0;34m(func, a, b, args, full_output, epsabs, epsrel, limit, points, weight, wvar, wopts, maxp1, limlst)\u001b[0m\n\u001b[1;32m 309\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mweight\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 310\u001b[0m retval = _quad(func, a, b, args, full_output, epsabs, epsrel, limit,\n\u001b[0;32m--> 311\u001b[0;31m points)\n\u001b[0m\u001b[1;32m 312\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 313\u001b[0m retval = _quad_weight(func, a, b, args, full_output, epsabs, epsrel,\n", + "\u001b[0;32m/usr/local/lib/python3.4/site-packages/scipy/integrate/quadpack.py\u001b[0m in \u001b[0;36m_quad\u001b[0;34m(func, a, b, args, full_output, epsabs, epsrel, limit, points)\u001b[0m\n\u001b[1;32m 374\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mpoints\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 375\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0minfbounds\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 376\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0m_quadpack\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_qagse\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfunc\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mb\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mfull_output\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mepsabs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mepsrel\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mlimit\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 377\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 378\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0m_quadpack\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_qagie\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfunc\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mbound\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0minfbounds\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mfull_output\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mepsabs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mepsrel\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mlimit\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mTypeError\u001b[0m: () missing 2 required positional arguments: 'r' and 'center'" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "ERROR:tornado.general:Uncaught exception, closing connection.\n", + "Traceback (most recent call last):\n", + " File \"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py\", line 407, in _run_callback\n", + " callback(*args, **kwargs)\n", + " File \"/usr/local/lib/python3.4/site-packages/tornado/stack_context.py\", line 275, in null_wrapper\n", + " return fn(*args, **kwargs)\n", + " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/kernelbase.py\", line 252, in dispatcher\n", + " return self.dispatch_shell(stream, msg)\n", + " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/kernelbase.py\", line 173, in dispatch_shell\n", + " idents,msg = self.session.feed_identities(msg, copy=False)\n", + " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/session.py\", line 769, in feed_identities\n", + " raise ValueError(\"DELIM not in msg_list\")\n", + "ValueError: DELIM not in msg_list\n", + "ERROR:tornado.general:Uncaught exception, closing connection.\n", + "Traceback (most recent call last):\n", + " File \"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py\", line 433, in _handle_events\n", + " self._handle_recv()\n", + " File \"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py\", line 465, in _handle_recv\n", + " self._run_callback(callback, msg)\n", + " File \"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py\", line 407, in _run_callback\n", + " callback(*args, **kwargs)\n", + " File \"/usr/local/lib/python3.4/site-packages/tornado/stack_context.py\", line 275, in null_wrapper\n", + " return fn(*args, **kwargs)\n", + " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/kernelbase.py\", line 252, in dispatcher\n", + " return self.dispatch_shell(stream, msg)\n", + " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/kernelbase.py\", line 173, in dispatch_shell\n", + " idents,msg = self.session.feed_identities(msg, copy=False)\n", + " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/session.py\", line 769, in feed_identities\n", + " raise ValueError(\"DELIM not in msg_list\")\n", + "ValueError: DELIM not in msg_list\n", + "ERROR:tornado.application:Exception in callback None\n", + "Traceback (most recent call last):\n", + " File \"/usr/local/lib/python3.4/site-packages/tornado/ioloop.py\", line 840, in start\n", + " handler_func(fd_obj, events)\n", + " File \"/usr/local/lib/python3.4/site-packages/tornado/stack_context.py\", line 275, in null_wrapper\n", + " return fn(*args, **kwargs)\n", + " File \"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py\", line 433, in _handle_events\n", + " self._handle_recv()\n", + " File \"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py\", line 465, in _handle_recv\n", + " self._run_callback(callback, msg)\n", + " File \"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py\", line 407, in _run_callback\n", + " callback(*args, **kwargs)\n", + " File \"/usr/local/lib/python3.4/site-packages/tornado/stack_context.py\", line 275, in null_wrapper\n", + " return fn(*args, **kwargs)\n", + " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/kernelbase.py\", line 252, in dispatcher\n", + " return self.dispatch_shell(stream, msg)\n", + " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/kernelbase.py\", line 173, in dispatch_shell\n", + " idents,msg = self.session.feed_identities(msg, copy=False)\n", + " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/session.py\", line 769, in feed_identities\n", + " raise ValueError(\"DELIM not in msg_list\")\n", + "ValueError: DELIM not in msg_list\n" + ] + } + ], + "source": [ + "spi.quad(chi_C_1D_X_quad, 0, 10)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.4.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/notebooks/Untitled1.ipynb b/notebooks/Untitled1.ipynb new file mode 100644 index 0000000..a1179a3 --- /dev/null +++ b/notebooks/Untitled1.ipynb @@ -0,0 +1,389 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "%load_ext autoreload\n", + "%autoreload 2" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "from functools import reduce\n", + "from math import pi, exp, factorial, floor\n", + "import numpy as np" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "from pyints.one import overlap\n", + "from pyints.one import electric_field_from_V as electric_field" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def norm2(a):\n", + " return np.dot(a, a)\n", + "\n", + "def fact2(n):\n", + " return reduce(int.__mul__, range(n, 0, -2), 1)\n", + "\n", + "def binomial(n, k):\n", + " if n == k:\n", + " return 1\n", + " assert n > k\n", + " return factorial(n) // (factorial(k) * factorial(n - k))\n", + "\n", + "def binomial_prefactor(s, ia, ib, xpa, xpb):\n", + " total = 0\n", + " for t in range(s+1):\n", + " if s-ia <= t <= ib:\n", + " total += binomial(ia, s-t)*binomial(ib, t)*pow(xpa, ia-s+t)*pow(xpb,ib-t)\n", + " return total\n", + "\n", + "def gaussian_product_center(alpha1, A, alpha2, B):\n", + " return ((alpha1 * A) + (alpha2 * B)) / (alpha1 + alpha2)\n", + "\n", + "def overlap1d(l1, l2, PAx, PBx, gamma):\n", + " total = 0\n", + " for i in range(1+int(floor(0.5*(l1+l2)))):\n", + " total += binomial_prefactor(2*i, l1, l2, PAx, PBx) * fact2(2*i-1) / pow(2*gamma, i)\n", + " return total\n", + "\n", + "def overlap_pyquante(alpha1, lmn1, A, alpha2, lmn2, B):\n", + " l1, m1, n1 = lmn1\n", + " l2, m2, n2 = lmn2\n", + " rab2 = norm2(A - B)\n", + " gamma = alpha1 + alpha2\n", + " P = gaussian_product_center(alpha1, A, alpha2, B)\n", + " \n", + " pre = pow(pi/gamma, 1.5) * exp(-alpha1 * alpha2 * rab2 / gamma)\n", + " \n", + " wx = overlap1d(l1, l2, P[0] - A[0], P[0] - B[0], gamma)\n", + " wy = overlap1d(m1, m2, P[1] - A[1], P[1] - B[1], gamma)\n", + " wz = overlap1d(n1, n2, P[2] - A[2], P[2] - B[2], gamma)\n", + " \n", + " return pre * wx * wy * wz" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def binomial_prefactor_2(x, Ax, Bx, Px, l, m):\n", + " total = 0\n", + " for ix in range(l):\n", + " for jx in range(m):\n", + " total += \\\n", + " binomial(l, ix) * \\\n", + " binomial(m, jx) * \\\n", + " ((x - Px)**(ix + jx)) * \\\n", + " ((Px - Ax)**(l - ix)) * \\\n", + " ((Px - Bx)**(m - jx))\n", + " return total" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def overlap_three_center(alpha1, lmn1, A, alpha2, lmn2, B, alpha3, lmn3, C):\n", + " ax, ay, az = lmn1\n", + " bx, by, bz = lmn2\n", + "\n", + " gamma = alpha1 + alpha2\n", + " P = gaussian_product_center(alpha1, A, alpha2, B)\n", + " \n", + " total = 0\n", + " for ix in range(ax + 1):\n", + " for jx in range(bx + 1):\n", + " for iy in range(ay + 1):\n", + " for jy in range(by + 1):\n", + " for iz in range(az + 1):\n", + " for jz in range(bz + 1):\n", + " total += (\n", + " binomial(ax, ix) * \\\n", + " binomial(bx, jx) * \\\n", + " binomial(ay, iy) * \\\n", + " binomial(by, jy) * \\\n", + " binomial(az, iz) * \\\n", + " binomial(bz, jz) * \\\n", + " ((P[0] - A[0])**(ax - ix)) * \\\n", + " ((P[1] - A[1])**(ay - iy)) * \\\n", + " ((P[2] - A[2])**(az - iz)) * \\\n", + " ((P[0] - B[0])**(bx - jx)) * \\\n", + " ((P[1] - B[1])**(by - jy)) * \\\n", + " ((P[2] - B[2])**(bz - jz)) * \\\n", + " overlap(gamma, [ix + jx, iy + jy, iz + jz], P, alpha3, lmn3, C)\n", + " )\n", + " \n", + " return total" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "import itertools as i" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.0182571654982\n", + "-0.00620743626938\n", + "0.00576196143123\n", + "-0.00136563597926\n", + "0.00126763151487\n", + "0.00143127121952\n", + "0.0078784781131\n", + "-0.00731308144851\n", + "-0.00825713378096\n", + "0.00445198213986\n" + ] + } + ], + "source": [ + "for lmn3 in i.combinations_with_replacement(range(3), 3):\n", + " print(overlap_three_center(alpha_A, [1, 0, 0], A, alpha_B, [1, 0, 0], B, alpha_B, list(lmn3), C))" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "-0.105327247501\n", + "-0.105327247501\n", + "-0.0622031399323\n" + ] + } + ], + "source": [ + "print(overlap_three_center(alpha_A, [1, 0, 0], A, alpha_B, [1, 0, 0], B, alpha_B, [1, 0, 0], C))\n", + "print(overlap_three_center(alpha_B, [1, 0, 0], B, alpha_A, [1, 0, 0], A, alpha_B, [1, 0, 0], C))\n", + "print(overlap_three_center(alpha_A, [1, 0, 0], A, alpha_B, [1, 0, 0], C, alpha_B, [1, 0, 0], B))" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "alpha_A = 0.5\n", + "alpha_B = 1.0\n", + "A = np.array([0.5, -0.6, 0.4])\n", + "B = np.array([-0.5, 0.4, -0.3])\n", + "C = np.array([-0.4, -0.3, 0.5])\n", + "D = np.array([0.3, 0.5, -0.6])" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [], + "source": [ + "overlap_analytic = overlap(alpha_A, [1, 0, 0], A, alpha_B, [1, 0, 0], B)\n", + "overlap_analytic_pyquante = overlap_pyquante(alpha_A, [1, 0, 0], A, alpha_B, [1, 0, 0], B)\n", + "assert abs(overlap_analytic - overlap_analytic_pyquante) < 1.0e-16" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def overlap1d_numeric(l1, l2, PAx, PBx, gamma):\n", + " total = 0\n", + " for i in range(l1 + 1):\n", + " for j in range(l2 + 1):\n", + " total += (\n", + " binomial(l, ix) * \\\n", + " binomial(m, jx) * \\\n", + " ((x - Px)**(ix + jx)) * \\\n", + " ((Px - Ax)**(l - ix)) * \\\n", + " ((Px - Bx)**(m - jx))\n", + "\n", + " # for i in range(1+int(floor(0.5*(l1+l2)))):\n", + " # total += binomial_prefactor(2*i, l1, l2, PAx, PBx) * fact2(2*i-1) / pow(2*gamma, i)\n", + " return total" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def overlap_numeric(alpha1, lmn1, A, alpha2, lmn2, B):\n", + " l1, m1, n1 = lmn1\n", + " l2, m2, n2 = lmn2\n", + " rab2 = norm2(A - B)\n", + " gamma = alpha1 + alpha2\n", + " P = gaussian_product_center(alpha1, A, alpha2, B)\n", + " \n", + " pre = pow(pi/gamma, 1.5) * exp(-alpha1 * alpha2 * rab2 / gamma)\n", + " \n", + " wx = overlap1d_numeric(l1, l2, P[0] - A[0], P[0] - B[0], gamma)\n", + " wy = overlap1d_numeric(m1, m2, P[1] - A[1], P[1] - B[1], gamma)\n", + " wz = overlap1d_numeric(n1, n2, P[2] - A[2], P[2] - B[2], gamma)\n", + " \n", + " return pre * wx * wy * wz" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "import scipy.integrate as spi" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.4/site-packages/scipy/integrate/quadpack.py:352: IntegrationWarning: The integral is probably divergent, or slowly convergent.\n", + " warnings.warn(msg, IntegrationWarning)\n" + ] + }, + { + "data": { + "text/plain": [ + "(-0.048951572155845106, 1.3763160352661674e-05)" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "spi.quad(lambda alpha_C: (alpha_C ** 2) * overlap_analytic, 0, np.inf)" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.4/site-packages/scipy/integrate/quadpack.py:352: IntegrationWarning: The integral is probably divergent, or slowly convergent.\n", + " warnings.warn(msg, IntegrationWarning)\n" + ] + }, + { + "data": { + "text/plain": [ + "(-0.33156386027260937, 0.0014214591807548138)" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "spi.quad(lambda alpha_C: (alpha_C ** 2) * (exp(-alpha_C)) * overlap_analytic, 0, np.inf)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.4.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/notebooks/sympy.ipynb b/notebooks/sympy.ipynb new file mode 100644 index 0000000..c6ed2b6 --- /dev/null +++ b/notebooks/sympy.ipynb @@ -0,0 +1,278 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "%load_ext autoreload\n", + "%autoreload 2" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "import numpy as np" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import sympy as sy\n", + "sy.init_printing()" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "r = sy.symbols('r')\n", + "rx, ry, rz = sy.symbols('r_x, r_y, r_z')\n", + "A, B, C = sy.symbols('A, B, C')\n", + "Ax, Ay, Az = sy.symbols('A_x, A_y, A_z')\n", + "Bx, By, Bz = sy.symbols('B_x, B_y, B_z')\n", + "Cx, Cy, Cz = sy.symbols('C_x, C_y, C_z')\n", + "alpha, beta, gamma = sy.symbols('alpha, beta, gamma')" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "phi_A = sy.exp(-alpha * (r - A)**2)\n", + "phi_B = sy.exp(-beta * (r - B)**2)\n", + "phi_C = sy.exp(-gamma * (r - C)**2)" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "ename": "AttributeError", + "evalue": "'list' object has no attribute 'is_Number'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m/Users/flareon/opt/apps/python/sympy/sympy/core/cache.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 90\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 91\u001b[0;31m \u001b[0mretval\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 92\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/functools.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(*args, **kwds)\u001b[0m\n\u001b[1;32m 457\u001b[0m \u001b[0;32mnonlocal\u001b[0m \u001b[0mroot\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhits\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmisses\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfull\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 458\u001b[0;31m \u001b[0mkey\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmake_key\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkwds\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtyped\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 459\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mlock\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/functools.py\u001b[0m in \u001b[0;36m_make_key\u001b[0;34m(args, kwds, typed, kwd_mark, fasttypes, sorted, tuple, type, len)\u001b[0m\n\u001b[1;32m 381\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mkey\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 382\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0m_HashedSeq\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 383\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/functools.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, tup, hash)\u001b[0m\n\u001b[1;32m 350\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtup\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 351\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhashvalue\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mhash\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtup\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 352\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mTypeError\u001b[0m: unhashable type: 'numpy.ndarray'", + "\nDuring handling of the above exception, another exception occurred:\n", + "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m/Users/flareon/opt/apps/python/sympy/sympy/core/cache.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 90\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 91\u001b[0;31m \u001b[0mretval\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 92\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/functools.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(*args, **kwds)\u001b[0m\n\u001b[1;32m 457\u001b[0m \u001b[0;32mnonlocal\u001b[0m \u001b[0mroot\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhits\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmisses\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfull\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 458\u001b[0;31m \u001b[0mkey\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmake_key\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkwds\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtyped\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 459\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mlock\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/functools.py\u001b[0m in \u001b[0;36m_make_key\u001b[0;34m(args, kwds, typed, kwd_mark, fasttypes, sorted, tuple, type, len)\u001b[0m\n\u001b[1;32m 381\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mkey\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 382\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0m_HashedSeq\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 383\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/functools.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, tup, hash)\u001b[0m\n\u001b[1;32m 350\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtup\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 351\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhashvalue\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mhash\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtup\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 352\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mTypeError\u001b[0m: unhashable type: 'numpy.ndarray'", + "\nDuring handling of the above exception, another exception occurred:\n", + "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0msy\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexp\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m0.5\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0marray\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mrx\u001b[0m \u001b[0;34m-\u001b[0m \u001b[0;36m0.5\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mry\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;36m0.6\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrz\u001b[0m \u001b[0;34m-\u001b[0m \u001b[0;36m0.4\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;32m/Users/flareon/opt/apps/python/sympy/sympy/core/cache.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 91\u001b[0m \u001b[0mretval\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 92\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 93\u001b[0;31m \u001b[0mretval\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 94\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mretval\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 95\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/Users/flareon/opt/apps/python/sympy/sympy/core/function.py\u001b[0m in \u001b[0;36m__new__\u001b[0;34m(cls, *args, **options)\u001b[0m\n\u001b[1;32m 374\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 375\u001b[0m \u001b[0mevaluate\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0moptions\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'evaluate'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mglobal_evaluate\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 376\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msuper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mFunction\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__new__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcls\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0moptions\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 377\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mevaluate\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresult\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 378\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/Users/flareon/opt/apps/python/sympy/sympy/core/cache.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 91\u001b[0m \u001b[0mretval\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 92\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 93\u001b[0;31m \u001b[0mretval\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 94\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mretval\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 95\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/Users/flareon/opt/apps/python/sympy/sympy/core/function.py\u001b[0m in \u001b[0;36m__new__\u001b[0;34m(cls, *args, **options)\u001b[0m\n\u001b[1;32m 198\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 199\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mevaluate\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 200\u001b[0;31m \u001b[0mevaluated\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0meval\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 201\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mevaluated\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 202\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mevaluated\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/Users/flareon/opt/apps/python/sympy/sympy/functions/elementary/exponential.py\u001b[0m in \u001b[0;36meval\u001b[0;34m(cls, arg)\u001b[0m\n\u001b[1;32m 207\u001b[0m \u001b[0;34m@\u001b[0m\u001b[0mclassmethod\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 208\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0meval\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcls\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0marg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 209\u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0marg\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_Number\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 210\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0marg\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0mS\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mNaN\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 211\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mS\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mNaN\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mAttributeError\u001b[0m: 'list' object has no attribute 'is_Number'" + ] + } + ], + "source": [ + "sy.exp(-0.5 * (np.array([rx - 0.5, ry + 0.6, rz - 0.4])**2))" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPMAAAAXBAMAAAAsDWSYAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEIl2mSJE3e9UMqtm\nzbsXyEShAAAACXBIWXMAAA7EAAAOxAGVKw4bAAADG0lEQVRIDbWUS2jUUBSG/8xMkiaTZqIdcCFq\ntC6sCwlMXVm0lIqLVklBwZ0BhS4UbbG4KhTFTYuLgqggooOutRXrPuIDhSIjYlcupgtFKPSBWFHE\nem4e03snOo2LOTBzzvnvd//knmQGSBn6rk+pyPv73BRcWrfAysRgCkugqgyl4P7ldiKxVwNascMS\ndDl5OsJQkVZSYAm3cI9ksyyMV/dJucXkMEr9wGZAWZrp47kA08RTEwZjoaeNu9F6t9gVMNnpjNV1\ngaq9gPShpmQs1cI8ta+BPTU1xLCNuwhJhMkfIX2pwzg3buU0q4u/OAXYDmxldxTGS7RYikN1H3Bv\nXQ4w6XFMBZlhUx7wlldFN24lGOHOEU6hSZSlw2x0Ydi4DtOl+iJwNBZZNssoDtiCQtgVEh4IouAW\nrrTvhoUhqnVnMWZfzB5wkXXUte+xIt98X4VKnfQT2XeRavQ/f0oYxtbYfhbyUhUOYVn23m0KJHqQ\nIca5hQuql3dsvUJNHkciFq9WVQ/adNxS1lx04CEVytfSQqwbF7xLImZ29MoeYWo1ZignsXDxGIw5\nT2HkGxwKJchtrA/ESEEG6MR56jIVGMOROnCwHruBnMGwQneEsJTAtEWKeYxDuQqFDiiN9C5ZkZh3\naEcwCkRKFujBWVLNbkg/cJdttvCkhsUK9FmGqTYN349FDqMNtfgGfQV6Fci5mCpHcgsr2P3Uog2Y\nwCNqC5PQvsXyBBUCRv1lhuWq9LEaYbQ2h8yyJQ0Bd8jWj+BTLBt21LF0BjkbW6iYsnDSZgqFvExf\nAkZ9NcBGIdH/Qhh/xWjpeJffM4lhmL/p9RyNYPZQkfeijqX9pQ4ao4XMWG/f51gP3gYBC8ZMGDIz\n7bVDC5jU3unG+4PcJXRh08prDmuyPi9FtYDREMqNsUFXtgUXU+jChp7AegSXpmEmQ8DoCRPRAJPH\nUSwLJoovtKyRpjlJ94LmHCdFpYCRRr9CNMDy10rP6kxu1/U0XSshQSsntP/ECvyBEmZNFQp2U+0b\nmbfQpcP3phHVlLVsBUW3Kc4bm3Z2+RtDzSD+AAqsuf7bksXmAAAAAElFTkSuQmCC\n", + "text/latex": [ + "$$e^{- \\alpha \\left(A - r\\right)^{2} - \\beta \\left(B - r\\right)^{2} - \\gamma \\left(C - r\\right)^{2}}$$" + ], + "text/plain": [ + " 2 2 2\n", + " - α⋅(A - r) - β⋅(B - r) - γ⋅(C - r) \n", + "ℯ " + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sy.simplify(phi_A * phi_B * phi_C)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAEYAAAAwBAMAAABeexFrAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEM3dMomZdkQi71S7\nZqsQsTlgAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABtklEQVQ4Ec2Uv0vDUBDHv5GmSfpDgyCCCJbW\nP0DQoWPFyUGIQ1sQxCJIxcHGgi4uHTqJYEFwUAoidig4FPwHOoib0EEFhUL/AqmDk4i+pHmv8ZHX\ndOwtd/e9z10uIe8BItPaFVGJ6cfSA4sFQTSFU0GJyVXgniWCwAQ+BCUmm1DrLOEDOb9LJHU1n0jx\nJZprScxUrqBI6T0hEzIQyR1ABpQY7eN9QUcwZkAhj+vyNZrfAXJNRxmIXlON89IXYb4BAxjvcDWW\n/hCGPCQGXFaYyAX7wGt3GU8IJLlKP5U329gx1bVsWu+LnhF5dV8bhpn2nQLr84ywTS5aNj/chr9C\nG65/hKjqm+8ySmM25Qc9Q216MxL9lbUWwgveTNh0dHLMRMfDzZzQmXZb5qjktDOmfFFccjTbnZek\nutawQ8aYU5lbN1MDHhX9P2MARRcT/AS2nfPQnwOcuZhQE9hYJ4Icjydu4vEcCdUU8E48tTkyd6u3\nDugca6z7VpxoEcZpoMwYoLlvxWAH0UJAtynKRFpYKTl9tku3W8FsT6BM+eXQ2tDTKENWFJpKdrNs\nENMjIJlOMMBZn4fYH3EeZdf6ImJFAAAAAElFTkSuQmCC\n", + "text/latex": [ + "$$- \\frac{\\alpha \\beta}{\\alpha + \\beta}$$" + ], + "text/plain": [ + "-α⋅β \n", + "─────\n", + "α + β" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "(-alpha*beta/(alpha+beta))" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAADloAAAA8BAMAAABGXZtwAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3R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ofrpYvzQAmshoFIeJ0JAoYqxfRgC6ncXHL5/WTkU5sSIeeoULwVkcVj5E6cVgyy0C\nFoFACFi/DASTJbIITAACP+utQ64GcFiTnaUj9mwRsAgMDQHrl0OD1lZsEYiIQK73VOyWMpz1AI6Y\nHC6IKMeyWQQsAsERsH4ZHCtLaRGwCFgELAIWAYuARcAiMHQE/h/qyqqB/HPIdwAAAABJRU5ErkJg\ngg==\n", + "text/latex": [ + "$$- \\frac{1.0 e^{- 0.5 A^{2} - 1.0 B^{2}}}{\\sqrt{\\pi} A \\left(1.0 + \\frac{2.0 B}{A}\\right)} \\left(- 0.408248290463863 \\pi A \\left(1.0 + \\frac{2.0 B}{A}\\right) e^{0.166666666666667 A^{2} \\left(1.0 + \\frac{2.0 B}{A}\\right)^{2}} \\operatorname{erf}{\\left (0.408248290463863 A \\left(1.0 + \\frac{2.0 B}{A}\\right) \\right )} - 0.408248290463863 \\pi A \\left(1.0 + \\frac{2.0 B}{A}\\right) e^{0.166666666666667 A^{2} \\left(1.0 + \\frac{2.0 B}{A}\\right)^{2}}\\right) + \\frac{1.0 e^{- 0.5 A^{2} - 1.0 B^{2}}}{\\sqrt{\\pi} A \\left(1.0 + \\frac{2.0 B}{A}\\right)} \\left(- 0.408248290463863 \\pi A \\left(1.0 + \\frac{2.0 B}{A}\\right) e^{0.166666666666667 A^{2} \\left(1.0 + \\frac{2.0 B}{A}\\right)^{2}} \\operatorname{erf}{\\left (0.408248290463863 A \\left(1.0 + \\frac{2.0 B}{A}\\right) \\right )} + 0.408248290463863 \\pi A \\left(1.0 + \\frac{2.0 B}{A}\\right) e^{0.166666666666667 A^{2} \\left(1.0 + \\frac{2.0 B}{A}\\right)^{2}}\\right)$$" + ], + "text/plain": [ + " ⎛ \n", + " ⎜ 2 ⎛ 2.0⋅\n", + " ⎜ 0.166666666666667⋅A ⋅⎜1.0 + ────\n", + " ⎜ ⎛ 2.0⋅B⎞ ⎝ A \n", + " 1.0⋅⎜- 0.408248290463863⋅π⋅A⋅⎜1.0 + ─────⎟⋅ℯ \n", + " ⎝ ⎝ A ⎠ \n", + "- ────────────────────────────────────────────────────────────────────────────\n", + " \n", + " \n", + " \n", + "\n", + " 2 \n", + "B⎞ \n", + "─⎟ \n", + " ⎠ ⎛ ⎛ 2.0⋅B⎞⎞ ⎛ 2.0⋅\n", + " ⋅erf⎜0.408248290463863⋅A⋅⎜1.0 + ─────⎟⎟ - 0.408248290463863⋅π⋅A⋅⎜1.0 + ────\n", + " ⎝ ⎝ A ⎠⎠ ⎝ A \n", + "──────────────────────────────────────────────────────────────────────────────\n", + " ⎛ 2.0⋅B⎞ \n", + " √π⋅A⋅⎜1.0 + ─────⎟ \n", + " ⎝ A ⎠ \n", + "\n", + " 2⎞ ⎛ \n", + " 2 ⎛ 2.0⋅B⎞ ⎟ ⎜ \n", + " 0.166666666666667⋅A ⋅⎜1.0 + ─────⎟ ⎟ 2 2 ⎜ \n", + "B⎞ ⎝ A ⎠ ⎟ - 0.5⋅A - 1.0⋅B ⎜ \n", + "─⎟⋅ℯ ⎟⋅ℯ 1.0⋅⎜- 0.4082482\n", + " ⎠ ⎠ ⎝ \n", + "─────────────────────────────────────────────────────────── + ────────────────\n", + " \n", + " \n", + " \n", + "\n", + " 2 \n", + " 2 ⎛ 2.0⋅B⎞ \n", + " 0.166666666666667⋅A ⋅⎜1.0 + ─────⎟ \n", + " ⎛ 2.0⋅B⎞ ⎝ A ⎠ ⎛ \n", + "90463863⋅π⋅A⋅⎜1.0 + ─────⎟⋅ℯ ⋅erf⎜0.40824829\n", + " ⎝ A ⎠ ⎝ \n", + "──────────────────────────────────────────────────────────────────────────────\n", + " \n", + " \n", + " \n", + "\n", + " \n", + " \n", + " 0.166666666666\n", + " ⎛ 2.0⋅B⎞⎞ ⎛ 2.0⋅B⎞ \n", + "0463863⋅A⋅⎜1.0 + ─────⎟⎟ + 0.408248290463863⋅π⋅A⋅⎜1.0 + ─────⎟⋅ℯ \n", + " ⎝ A ⎠⎠ ⎝ A ⎠ \n", + "──────────────────────────────────────────────────────────────────────────────\n", + " ⎛ 2.0⋅B⎞ \n", + " √π⋅A⋅⎜1.0 + ─────⎟ \n", + " ⎝ A ⎠ \n", + "\n", + " 2⎞ \n", + " 2 ⎛ 2.0⋅B⎞ ⎟ \n", + "667⋅A ⋅⎜1.0 + ─────⎟ ⎟ 2 2\n", + " ⎝ A ⎠ ⎟ - 0.5⋅A - 1.0⋅B \n", + " ⎟⋅ℯ \n", + " ⎠ \n", + "─────────────────────────────────────────\n", + " \n", + " \n", + " " + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sy.integrate(phi_A.replace(alpha, 0.5) * phi_B.replace(beta, 1.0), (r, -sy.oo, sy.oo))" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.4.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} From 3828ed5950280709f37d2805814e701e7ea9e60f Mon Sep 17 00:00:00 2001 From: Eric Berquist Date: Wed, 30 May 2018 15:50:47 -0400 Subject: [PATCH 2/2] don't commit Jupyter Notebook checkpoint files --- .gitignore | 2 + .../Untitled-checkpoint.ipynb | 192 --------- .../Untitled1-checkpoint.ipynb | 389 ------------------ .../.ipynb_checkpoints/sympy-checkpoint.ipynb | 278 ------------- 4 files changed, 2 insertions(+), 859 deletions(-) delete mode 100644 notebooks/.ipynb_checkpoints/Untitled-checkpoint.ipynb delete mode 100644 notebooks/.ipynb_checkpoints/Untitled1-checkpoint.ipynb delete mode 100644 notebooks/.ipynb_checkpoints/sympy-checkpoint.ipynb diff --git a/.gitignore b/.gitignore index 66b02c0..4f8254f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ *.html +.ipynb_checkpoints + # Python *.py[co] .cache diff --git a/notebooks/.ipynb_checkpoints/Untitled-checkpoint.ipynb b/notebooks/.ipynb_checkpoints/Untitled-checkpoint.ipynb deleted file mode 100644 index 857c3e6..0000000 --- a/notebooks/.ipynb_checkpoints/Untitled-checkpoint.ipynb +++ /dev/null @@ -1,192 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Molecular integral of diamagnetic contribution to nuclear spin-spin coupling constant\n", - "\n", - "## O. Matsuoka and T. Aoyama\n", - "\n", - "The Journal of Chemical Physics 73, 5718 (1980); doi: 10.1063/1.440051" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "from math import pi, exp\n", - "import numpy as np\n", - "import scipy.integrate as spi" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "alpha_A = 0.5\n", - "alpha_B = 1.0\n", - "A = [0.5, -0.6, 0.4]\n", - "B = [-0.5, 0.4, -0.3]\n", - "C = [-0.4, -0.3, 0.5]\n", - "D = [0.3, 0.5, -0.6]" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "spi.quad?" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "def chi_1D(r, center, l, m, n, alpha):\n", - " return ((r[0] - center)**l) * ((r[1] - center)**m) * ((r[2] - center)**n) * exp(-alpha * (r[0] - center)**2)" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "chi_C_1D_X = lambda r, center, alpha: chi_1D(r, center, 1, 0, 0, alpha)" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "chi_C_1D_X_quad = lambda alpha, r: chi_C_1D_X(r, C, alpha)" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "ename": "TypeError", - "evalue": "() missing 2 required positional arguments: 'r' and 'center'", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mspi\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mquad\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mchi_C_1D_X_quad\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m10\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[0;32m/usr/local/lib/python3.4/site-packages/scipy/integrate/quadpack.py\u001b[0m in \u001b[0;36mquad\u001b[0;34m(func, a, b, args, full_output, epsabs, epsrel, limit, points, weight, wvar, wopts, maxp1, limlst)\u001b[0m\n\u001b[1;32m 309\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mweight\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 310\u001b[0m retval = _quad(func, a, b, args, full_output, epsabs, epsrel, limit,\n\u001b[0;32m--> 311\u001b[0;31m points)\n\u001b[0m\u001b[1;32m 312\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 313\u001b[0m retval = _quad_weight(func, a, b, args, full_output, epsabs, epsrel,\n", - "\u001b[0;32m/usr/local/lib/python3.4/site-packages/scipy/integrate/quadpack.py\u001b[0m in \u001b[0;36m_quad\u001b[0;34m(func, a, b, args, full_output, epsabs, epsrel, limit, points)\u001b[0m\n\u001b[1;32m 374\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mpoints\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 375\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0minfbounds\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 376\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0m_quadpack\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_qagse\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfunc\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mb\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mfull_output\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mepsabs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mepsrel\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mlimit\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 377\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 378\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0m_quadpack\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_qagie\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfunc\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mbound\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0minfbounds\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mfull_output\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mepsabs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mepsrel\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mlimit\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mTypeError\u001b[0m: () missing 2 required positional arguments: 'r' and 'center'" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "ERROR:tornado.general:Uncaught exception, closing connection.\n", - "Traceback (most recent call last):\n", - " File \"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py\", line 407, in _run_callback\n", - " callback(*args, **kwargs)\n", - " File \"/usr/local/lib/python3.4/site-packages/tornado/stack_context.py\", line 275, in null_wrapper\n", - " return fn(*args, **kwargs)\n", - " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/kernelbase.py\", line 252, in dispatcher\n", - " return self.dispatch_shell(stream, msg)\n", - " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/kernelbase.py\", line 173, in dispatch_shell\n", - " idents,msg = self.session.feed_identities(msg, copy=False)\n", - " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/session.py\", line 769, in feed_identities\n", - " raise ValueError(\"DELIM not in msg_list\")\n", - "ValueError: DELIM not in msg_list\n", - "ERROR:tornado.general:Uncaught exception, closing connection.\n", - "Traceback (most recent call last):\n", - " File \"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py\", line 433, in _handle_events\n", - " self._handle_recv()\n", - " File \"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py\", line 465, in _handle_recv\n", - " self._run_callback(callback, msg)\n", - " File \"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py\", line 407, in _run_callback\n", - " callback(*args, **kwargs)\n", - " File \"/usr/local/lib/python3.4/site-packages/tornado/stack_context.py\", line 275, in null_wrapper\n", - " return fn(*args, **kwargs)\n", - " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/kernelbase.py\", line 252, in dispatcher\n", - " return self.dispatch_shell(stream, msg)\n", - " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/kernelbase.py\", line 173, in dispatch_shell\n", - " idents,msg = self.session.feed_identities(msg, copy=False)\n", - " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/session.py\", line 769, in feed_identities\n", - " raise ValueError(\"DELIM not in msg_list\")\n", - "ValueError: DELIM not in msg_list\n", - "ERROR:tornado.application:Exception in callback None\n", - "Traceback (most recent call last):\n", - " File \"/usr/local/lib/python3.4/site-packages/tornado/ioloop.py\", line 840, in start\n", - " handler_func(fd_obj, events)\n", - " File \"/usr/local/lib/python3.4/site-packages/tornado/stack_context.py\", line 275, in null_wrapper\n", - " return fn(*args, **kwargs)\n", - " File \"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py\", line 433, in _handle_events\n", - " self._handle_recv()\n", - " File \"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py\", line 465, in _handle_recv\n", - " self._run_callback(callback, msg)\n", - " File \"/usr/local/lib/python3.4/site-packages/zmq/eventloop/zmqstream.py\", line 407, in _run_callback\n", - " callback(*args, **kwargs)\n", - " File \"/usr/local/lib/python3.4/site-packages/tornado/stack_context.py\", line 275, in null_wrapper\n", - " return fn(*args, **kwargs)\n", - " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/kernelbase.py\", line 252, in dispatcher\n", - " return self.dispatch_shell(stream, msg)\n", - " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/kernelbase.py\", line 173, in dispatch_shell\n", - " idents,msg = self.session.feed_identities(msg, copy=False)\n", - " File \"/usr/local/lib/python3.4/site-packages/IPython/kernel/zmq/session.py\", line 769, in feed_identities\n", - " raise ValueError(\"DELIM not in msg_list\")\n", - "ValueError: DELIM not in msg_list\n" - ] - } - ], - "source": [ - "spi.quad(chi_C_1D_X_quad, 0, 10)" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.4.3" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/notebooks/.ipynb_checkpoints/Untitled1-checkpoint.ipynb b/notebooks/.ipynb_checkpoints/Untitled1-checkpoint.ipynb deleted file mode 100644 index a1179a3..0000000 --- a/notebooks/.ipynb_checkpoints/Untitled1-checkpoint.ipynb +++ /dev/null @@ -1,389 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "%load_ext autoreload\n", - "%autoreload 2" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "from functools import reduce\n", - "from math import pi, exp, factorial, floor\n", - "import numpy as np" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "from pyints.one import overlap\n", - "from pyints.one import electric_field_from_V as electric_field" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "def norm2(a):\n", - " return np.dot(a, a)\n", - "\n", - "def fact2(n):\n", - " return reduce(int.__mul__, range(n, 0, -2), 1)\n", - "\n", - "def binomial(n, k):\n", - " if n == k:\n", - " return 1\n", - " assert n > k\n", - " return factorial(n) // (factorial(k) * factorial(n - k))\n", - "\n", - "def binomial_prefactor(s, ia, ib, xpa, xpb):\n", - " total = 0\n", - " for t in range(s+1):\n", - " if s-ia <= t <= ib:\n", - " total += binomial(ia, s-t)*binomial(ib, t)*pow(xpa, ia-s+t)*pow(xpb,ib-t)\n", - " return total\n", - "\n", - "def gaussian_product_center(alpha1, A, alpha2, B):\n", - " return ((alpha1 * A) + (alpha2 * B)) / (alpha1 + alpha2)\n", - "\n", - "def overlap1d(l1, l2, PAx, PBx, gamma):\n", - " total = 0\n", - " for i in range(1+int(floor(0.5*(l1+l2)))):\n", - " total += binomial_prefactor(2*i, l1, l2, PAx, PBx) * fact2(2*i-1) / pow(2*gamma, i)\n", - " return total\n", - "\n", - "def overlap_pyquante(alpha1, lmn1, A, alpha2, lmn2, B):\n", - " l1, m1, n1 = lmn1\n", - " l2, m2, n2 = lmn2\n", - " rab2 = norm2(A - B)\n", - " gamma = alpha1 + alpha2\n", - " P = gaussian_product_center(alpha1, A, alpha2, B)\n", - " \n", - " pre = pow(pi/gamma, 1.5) * exp(-alpha1 * alpha2 * rab2 / gamma)\n", - " \n", - " wx = overlap1d(l1, l2, P[0] - A[0], P[0] - B[0], gamma)\n", - " wy = overlap1d(m1, m2, P[1] - A[1], P[1] - B[1], gamma)\n", - " wz = overlap1d(n1, n2, P[2] - A[2], P[2] - B[2], gamma)\n", - " \n", - " return pre * wx * wy * wz" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "def binomial_prefactor_2(x, Ax, Bx, Px, l, m):\n", - " total = 0\n", - " for ix in range(l):\n", - " for jx in range(m):\n", - " total += \\\n", - " binomial(l, ix) * \\\n", - " binomial(m, jx) * \\\n", - " ((x - Px)**(ix + jx)) * \\\n", - " ((Px - Ax)**(l - ix)) * \\\n", - " ((Px - Bx)**(m - jx))\n", - " return total" - ] - }, - { - "cell_type": "code", - "execution_count": 30, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "def overlap_three_center(alpha1, lmn1, A, alpha2, lmn2, B, alpha3, lmn3, C):\n", - " ax, ay, az = lmn1\n", - " bx, by, bz = lmn2\n", - "\n", - " gamma = alpha1 + alpha2\n", - " P = gaussian_product_center(alpha1, A, alpha2, B)\n", - " \n", - " total = 0\n", - " for ix in range(ax + 1):\n", - " for jx in range(bx + 1):\n", - " for iy in range(ay + 1):\n", - " for jy in range(by + 1):\n", - " for iz in range(az + 1):\n", - " for jz in range(bz + 1):\n", - " total += (\n", - " binomial(ax, ix) * \\\n", - " binomial(bx, jx) * \\\n", - " binomial(ay, iy) * \\\n", - " binomial(by, jy) * \\\n", - " binomial(az, iz) * \\\n", - " binomial(bz, jz) * \\\n", - " ((P[0] - A[0])**(ax - ix)) * \\\n", - " ((P[1] - A[1])**(ay - iy)) * \\\n", - " ((P[2] - A[2])**(az - iz)) * \\\n", - " ((P[0] - B[0])**(bx - jx)) * \\\n", - " ((P[1] - B[1])**(by - jy)) * \\\n", - " ((P[2] - B[2])**(bz - jz)) * \\\n", - " overlap(gamma, [ix + jx, iy + jy, iz + jz], P, alpha3, lmn3, C)\n", - " )\n", - " \n", - " return total" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "import itertools as i" - ] - }, - { - "cell_type": "code", - "execution_count": 31, - "metadata": { - "collapsed": false, - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0.0182571654982\n", - "-0.00620743626938\n", - "0.00576196143123\n", - "-0.00136563597926\n", - "0.00126763151487\n", - "0.00143127121952\n", - "0.0078784781131\n", - "-0.00731308144851\n", - "-0.00825713378096\n", - "0.00445198213986\n" - ] - } - ], - "source": [ - "for lmn3 in i.combinations_with_replacement(range(3), 3):\n", - " print(overlap_three_center(alpha_A, [1, 0, 0], A, alpha_B, [1, 0, 0], B, alpha_B, list(lmn3), C))" - ] - }, - { - "cell_type": "code", - "execution_count": 33, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "-0.105327247501\n", - "-0.105327247501\n", - "-0.0622031399323\n" - ] - } - ], - "source": [ - "print(overlap_three_center(alpha_A, [1, 0, 0], A, alpha_B, [1, 0, 0], B, alpha_B, [1, 0, 0], C))\n", - "print(overlap_three_center(alpha_B, [1, 0, 0], B, alpha_A, [1, 0, 0], A, alpha_B, [1, 0, 0], C))\n", - "print(overlap_three_center(alpha_A, [1, 0, 0], A, alpha_B, [1, 0, 0], C, alpha_B, [1, 0, 0], B))" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "alpha_A = 0.5\n", - "alpha_B = 1.0\n", - "A = np.array([0.5, -0.6, 0.4])\n", - "B = np.array([-0.5, 0.4, -0.3])\n", - "C = np.array([-0.4, -0.3, 0.5])\n", - "D = np.array([0.3, 0.5, -0.6])" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": { - "collapsed": false, - "scrolled": true - }, - "outputs": [], - "source": [ - "overlap_analytic = overlap(alpha_A, [1, 0, 0], A, alpha_B, [1, 0, 0], B)\n", - "overlap_analytic_pyquante = overlap_pyquante(alpha_A, [1, 0, 0], A, alpha_B, [1, 0, 0], B)\n", - "assert abs(overlap_analytic - overlap_analytic_pyquante) < 1.0e-16" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "def overlap1d_numeric(l1, l2, PAx, PBx, gamma):\n", - " total = 0\n", - " for i in range(l1 + 1):\n", - " for j in range(l2 + 1):\n", - " total += (\n", - " binomial(l, ix) * \\\n", - " binomial(m, jx) * \\\n", - " ((x - Px)**(ix + jx)) * \\\n", - " ((Px - Ax)**(l - ix)) * \\\n", - " ((Px - Bx)**(m - jx))\n", - "\n", - " # for i in range(1+int(floor(0.5*(l1+l2)))):\n", - " # total += binomial_prefactor(2*i, l1, l2, PAx, PBx) * fact2(2*i-1) / pow(2*gamma, i)\n", - " return total" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "def overlap_numeric(alpha1, lmn1, A, alpha2, lmn2, B):\n", - " l1, m1, n1 = lmn1\n", - " l2, m2, n2 = lmn2\n", - " rab2 = norm2(A - B)\n", - " gamma = alpha1 + alpha2\n", - " P = gaussian_product_center(alpha1, A, alpha2, B)\n", - " \n", - " pre = pow(pi/gamma, 1.5) * exp(-alpha1 * alpha2 * rab2 / gamma)\n", - " \n", - " wx = overlap1d_numeric(l1, l2, P[0] - A[0], P[0] - B[0], gamma)\n", - " wy = overlap1d_numeric(m1, m2, P[1] - A[1], P[1] - B[1], gamma)\n", - " wz = overlap1d_numeric(n1, n2, P[2] - A[2], P[2] - B[2], gamma)\n", - " \n", - " return pre * wx * wy * wz" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "import scipy.integrate as spi" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/usr/local/lib/python3.4/site-packages/scipy/integrate/quadpack.py:352: IntegrationWarning: The integral is probably divergent, or slowly convergent.\n", - " warnings.warn(msg, IntegrationWarning)\n" - ] - }, - { - "data": { - "text/plain": [ - "(-0.048951572155845106, 1.3763160352661674e-05)" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "spi.quad(lambda alpha_C: (alpha_C ** 2) * overlap_analytic, 0, np.inf)" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/usr/local/lib/python3.4/site-packages/scipy/integrate/quadpack.py:352: IntegrationWarning: The integral is probably divergent, or slowly convergent.\n", - " warnings.warn(msg, IntegrationWarning)\n" - ] - }, - { - "data": { - "text/plain": [ - "(-0.33156386027260937, 0.0014214591807548138)" - ] - }, - "execution_count": 21, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "spi.quad(lambda alpha_C: (alpha_C ** 2) * (exp(-alpha_C)) * overlap_analytic, 0, np.inf)" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.4.3" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/notebooks/.ipynb_checkpoints/sympy-checkpoint.ipynb b/notebooks/.ipynb_checkpoints/sympy-checkpoint.ipynb deleted file mode 100644 index c6ed2b6..0000000 --- a/notebooks/.ipynb_checkpoints/sympy-checkpoint.ipynb +++ /dev/null @@ -1,278 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "%load_ext autoreload\n", - "%autoreload 2" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "import numpy as np" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "import sympy as sy\n", - "sy.init_printing()" - ] - }, - { - "cell_type": "code", - "execution_count": 25, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "r = sy.symbols('r')\n", - "rx, ry, rz = sy.symbols('r_x, r_y, r_z')\n", - "A, B, C = sy.symbols('A, B, C')\n", - "Ax, Ay, Az = sy.symbols('A_x, A_y, A_z')\n", - "Bx, By, Bz = sy.symbols('B_x, B_y, B_z')\n", - "Cx, Cy, Cz = sy.symbols('C_x, C_y, C_z')\n", - "alpha, beta, gamma = sy.symbols('alpha, beta, gamma')" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "phi_A = sy.exp(-alpha * (r - A)**2)\n", - "phi_B = sy.exp(-beta * (r - B)**2)\n", - "phi_C = sy.exp(-gamma * (r - C)**2)" - ] - }, - { - "cell_type": "code", - "execution_count": 28, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "ename": "AttributeError", - "evalue": "'list' object has no attribute 'is_Number'", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m/Users/flareon/opt/apps/python/sympy/sympy/core/cache.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 90\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 91\u001b[0;31m \u001b[0mretval\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 92\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/functools.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(*args, **kwds)\u001b[0m\n\u001b[1;32m 457\u001b[0m \u001b[0;32mnonlocal\u001b[0m \u001b[0mroot\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhits\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmisses\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfull\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 458\u001b[0;31m \u001b[0mkey\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmake_key\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkwds\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtyped\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 459\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mlock\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/functools.py\u001b[0m in \u001b[0;36m_make_key\u001b[0;34m(args, kwds, typed, kwd_mark, fasttypes, sorted, tuple, type, len)\u001b[0m\n\u001b[1;32m 381\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mkey\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 382\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0m_HashedSeq\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 383\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/functools.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, tup, hash)\u001b[0m\n\u001b[1;32m 350\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtup\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 351\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhashvalue\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mhash\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtup\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 352\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mTypeError\u001b[0m: unhashable type: 'numpy.ndarray'", - "\nDuring handling of the above exception, another exception occurred:\n", - "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m/Users/flareon/opt/apps/python/sympy/sympy/core/cache.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 90\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 91\u001b[0;31m \u001b[0mretval\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 92\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/functools.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(*args, **kwds)\u001b[0m\n\u001b[1;32m 457\u001b[0m \u001b[0;32mnonlocal\u001b[0m \u001b[0mroot\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhits\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmisses\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfull\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 458\u001b[0;31m \u001b[0mkey\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmake_key\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkwds\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtyped\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 459\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mlock\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/functools.py\u001b[0m in \u001b[0;36m_make_key\u001b[0;34m(args, kwds, typed, kwd_mark, fasttypes, sorted, tuple, type, len)\u001b[0m\n\u001b[1;32m 381\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mkey\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 382\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0m_HashedSeq\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 383\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/functools.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, tup, hash)\u001b[0m\n\u001b[1;32m 350\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtup\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 351\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhashvalue\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mhash\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtup\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 352\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mTypeError\u001b[0m: unhashable type: 'numpy.ndarray'", - "\nDuring handling of the above exception, another exception occurred:\n", - "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0msy\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexp\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m0.5\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0marray\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mrx\u001b[0m \u001b[0;34m-\u001b[0m \u001b[0;36m0.5\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mry\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;36m0.6\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrz\u001b[0m \u001b[0;34m-\u001b[0m \u001b[0;36m0.4\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[0;32m/Users/flareon/opt/apps/python/sympy/sympy/core/cache.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 91\u001b[0m \u001b[0mretval\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 92\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 93\u001b[0;31m \u001b[0mretval\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 94\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mretval\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 95\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/Users/flareon/opt/apps/python/sympy/sympy/core/function.py\u001b[0m in \u001b[0;36m__new__\u001b[0;34m(cls, *args, **options)\u001b[0m\n\u001b[1;32m 374\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 375\u001b[0m \u001b[0mevaluate\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0moptions\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'evaluate'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mglobal_evaluate\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 376\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msuper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mFunction\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__new__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcls\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0moptions\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 377\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mevaluate\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresult\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 378\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/Users/flareon/opt/apps/python/sympy/sympy/core/cache.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 91\u001b[0m \u001b[0mretval\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 92\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 93\u001b[0;31m \u001b[0mretval\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 94\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mretval\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 95\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/Users/flareon/opt/apps/python/sympy/sympy/core/function.py\u001b[0m in \u001b[0;36m__new__\u001b[0;34m(cls, *args, **options)\u001b[0m\n\u001b[1;32m 198\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 199\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mevaluate\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 200\u001b[0;31m \u001b[0mevaluated\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0meval\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 201\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mevaluated\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 202\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mevaluated\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/Users/flareon/opt/apps/python/sympy/sympy/functions/elementary/exponential.py\u001b[0m in \u001b[0;36meval\u001b[0;34m(cls, arg)\u001b[0m\n\u001b[1;32m 207\u001b[0m \u001b[0;34m@\u001b[0m\u001b[0mclassmethod\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 208\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0meval\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcls\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0marg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 209\u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0marg\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_Number\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 210\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0marg\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0mS\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mNaN\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 211\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mS\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mNaN\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mAttributeError\u001b[0m: 'list' object has no attribute 'is_Number'" - ] - } - ], - "source": [ - "sy.exp(-0.5 * (np.array([rx - 0.5, ry + 0.6, rz - 0.4])**2))" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPMAAAAXBAMAAAAsDWSYAAAAMFBMVEX///8AA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MqNsUFXtgUXU+jChp7AegSXpmEmQ8DoCRPRAJPH\nUSwLJoovtKyRpjlJ94LmHCdFpYCRRr9CNMDy10rP6kxu1/U0XSshQSsntP/ECvyBEmZNFQp2U+0b\nmbfQpcP3phHVlLVsBUW3Kc4bm3Z2+RtDzSD+AAqsuf7bksXmAAAAAElFTkSuQmCC\n", - "text/latex": [ - "$$e^{- \\alpha \\left(A - r\\right)^{2} - \\beta \\left(B - r\\right)^{2} - \\gamma \\left(C - r\\right)^{2}}$$" - ], - "text/plain": [ - " 2 2 2\n", - " - α⋅(A - r) - β⋅(B - r) - γ⋅(C - r) \n", - "ℯ " - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "sy.simplify(phi_A * phi_B * phi_C)" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAEYAAAAwBAMAAABeexFrAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEM3dMomZdkQi71S7\nZqsQsTlgAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABtklEQVQ4Ec2Uv0vDUBDHv5GmSfpDgyCCCJbW\nP0DQoWPFyUGIQ1sQxCJIxcHGgi4uHTqJYEFwUAoidig4FPwHOoib0EEFhUL/AqmDk4i+pHmv8ZHX\ndOwtd/e9z10uIe8BItPaFVGJ6cfSA4sFQTSFU0GJyVXgniWCwAQ+BCUmm1DrLOEDOb9LJHU1n0jx\nJZprScxUrqBI6T0hEzIQyR1ABpQY7eN9QUcwZkAhj+vyNZrfAXJNRxmIXlON89IXYb4BAxjvcDWW\n/hCGPCQGXFaYyAX7wGt3GU8IJLlKP5U329gx1bVsWu+LnhF5dV8bhpn2nQLr84ywTS5aNj/chr9C\nG65/hKjqm+8ySmM25Qc9Q216MxL9lbUWwgveTNh0dHLMRMfDzZzQmXZb5qjktDOmfFFccjTbnZek\nutawQ8aYU5lbN1MDHhX9P2MARRcT/AS2nfPQnwOcuZhQE9hYJ4Icjydu4vEcCdUU8E48tTkyd6u3\nDugca6z7VpxoEcZpoMwYoLlvxWAH0UJAtynKRFpYKTl9tku3W8FsT6BM+eXQ2tDTKENWFJpKdrNs\nENMjIJlOMMBZn4fYH3EeZdf6ImJFAAAAAElFTkSuQmCC\n", - "text/latex": [ - "$$- \\frac{\\alpha \\beta}{\\alpha + \\beta}$$" - ], - "text/plain": [ - "-α⋅β \n", - "─────\n", - "α + β" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "(-alpha*beta/(alpha+beta))" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAADloAAAA8BAMAAABGXZtwAAAAMFBMVEX///8AAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAEM3dMiK7mat272aJ\nVER1AWP9AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAgAElEQVR4Ae1dC5AkRZn+e7p7enr6MS2EghuG\n06yKD9QdH4hvRoxTRIxpNcQI1NgmPMC7U3c4ZXdPOWhODxfxbvs8EReJmAEEFYVr9TxFvNj2xbiy\nSisXKp5328IFXujp7oIs4Apz/yOzKqu7uruq+rkbmRFdlY//z//P78+/siurKhMgSjjz9lJHtsTe\nczuW2QKLgEVgeAhYvxwetrZmi0A0BMr5hY6M03BvxzJbYBGwCAwPAeuXw8PW1mwRiIZAMXawI+MU\nzBc6FtoCi4BFYGgIWL8cGrS2YotAVARyne8tAe6KWqvlswhYBPpBwPplP+hZXovAABC45hqq5PQ/\nu41O0/jM8hj8qfAaPhNFfstHtuMzy9jTdJE9WwQsAkNEwPrlEMG1VVsEoiCQq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4L9o4QYzY28aqcwpNHH8AAAJFSURBVIt92nSxftkGSQtkY05GdZiQakcVY/0yJND+\n5C2dMPkQbumMYZo2jDT+f/ONYu9NA7PHukOUs5YPLhm76C98qLlJ/QVLOCkbmuHoR0wdsVVhtYwo\nJnaLCBoriBF721h1brFPmy7WL9sgaYFszMmIDhNW64hirF+GBdqfvrUT7izonba89Ooy6M1se275\nOvkuk6mmqg5xbsGJjjByVyRZ3nvtSFUMlSlaq0KrFE3MBEzE4o1ttN42SYZv18X6ZeguPFqGaA4T\nWsdoYqxfhgbal6HVL5d+6N4dmgwXmQkn/lsnJpFKyr1SzRfcwu1udHSxVCWCrEw5AtMoWSK1KryC\n0cT8mwgaM4iRetuYdfZYyEcX65cehCYvEc1hQrcjmhjrl6GB9mNo88up64xBzuA4w4h3jGYa6QNO\n4dedGMBM1UiMLHp5BEn3ROAZLUuUVkXQMIqYfFEEjRnESL1tzDp7LOSji/VLD0ITmIjiMBGaEUWM\n9csIQPuwtPll7iEfKsyaafjne3KP3bbVfSHxhWbRxWZiVPFUM7Sk2KWhWUbNkGqORGIUMcfLP62x\ngxiht41dZ8OofrpYvzQAmshoFIeJ0JAoYqxfRgC6ncXHL5/WTkU5sSIeeoULwVkcVj5E6cVgyy0C\nFoFACFi/DASTJbIITAACP+utQ64GcFiTnaUj9mwRsAgMDQHrl0OD1lZsEYiIQK73VOyWMpz1AI6Y\nHC6IKMeyWQQsAsERsH4ZHCtLaRGwCFgELAIWAYuARcAiMHQE/h/qyqqB/HPIdwAAAABJRU5ErkJg\ngg==\n", - "text/latex": [ - "$$- \\frac{1.0 e^{- 0.5 A^{2} - 1.0 B^{2}}}{\\sqrt{\\pi} A \\left(1.0 + \\frac{2.0 B}{A}\\right)} \\left(- 0.408248290463863 \\pi A \\left(1.0 + \\frac{2.0 B}{A}\\right) e^{0.166666666666667 A^{2} \\left(1.0 + \\frac{2.0 B}{A}\\right)^{2}} \\operatorname{erf}{\\left (0.408248290463863 A \\left(1.0 + \\frac{2.0 B}{A}\\right) \\right )} - 0.408248290463863 \\pi A \\left(1.0 + \\frac{2.0 B}{A}\\right) e^{0.166666666666667 A^{2} \\left(1.0 + \\frac{2.0 B}{A}\\right)^{2}}\\right) + \\frac{1.0 e^{- 0.5 A^{2} - 1.0 B^{2}}}{\\sqrt{\\pi} A \\left(1.0 + \\frac{2.0 B}{A}\\right)} \\left(- 0.408248290463863 \\pi A \\left(1.0 + \\frac{2.0 B}{A}\\right) e^{0.166666666666667 A^{2} \\left(1.0 + \\frac{2.0 B}{A}\\right)^{2}} \\operatorname{erf}{\\left (0.408248290463863 A \\left(1.0 + \\frac{2.0 B}{A}\\right) \\right )} + 0.408248290463863 \\pi A \\left(1.0 + \\frac{2.0 B}{A}\\right) e^{0.166666666666667 A^{2} \\left(1.0 + \\frac{2.0 B}{A}\\right)^{2}}\\right)$$" - ], - "text/plain": [ - " ⎛ \n", - " ⎜ 2 ⎛ 2.0⋅\n", - " ⎜ 0.166666666666667⋅A ⋅⎜1.0 + ────\n", - " ⎜ ⎛ 2.0⋅B⎞ ⎝ A \n", - " 1.0⋅⎜- 0.408248290463863⋅π⋅A⋅⎜1.0 + ─────⎟⋅ℯ \n", - " ⎝ ⎝ A ⎠ \n", - "- ────────────────────────────────────────────────────────────────────────────\n", - " \n", - " \n", - " \n", - "\n", - " 2 \n", - "B⎞ \n", - "─⎟ \n", - " ⎠ ⎛ ⎛ 2.0⋅B⎞⎞ ⎛ 2.0⋅\n", - " ⋅erf⎜0.408248290463863⋅A⋅⎜1.0 + ─────⎟⎟ - 0.408248290463863⋅π⋅A⋅⎜1.0 + ────\n", - " ⎝ ⎝ A ⎠⎠ ⎝ A \n", - "──────────────────────────────────────────────────────────────────────────────\n", - " ⎛ 2.0⋅B⎞ \n", - " √π⋅A⋅⎜1.0 + ─────⎟ \n", - " ⎝ A ⎠ \n", - "\n", - " 2⎞ ⎛ \n", - " 2 ⎛ 2.0⋅B⎞ ⎟ ⎜ \n", - " 0.166666666666667⋅A ⋅⎜1.0 + ─────⎟ ⎟ 2 2 ⎜ \n", - "B⎞ ⎝ A ⎠ ⎟ - 0.5⋅A - 1.0⋅B ⎜ \n", - "─⎟⋅ℯ ⎟⋅ℯ 1.0⋅⎜- 0.4082482\n", - " ⎠ ⎠ ⎝ \n", - "─────────────────────────────────────────────────────────── + ────────────────\n", - " \n", - " \n", - " \n", - "\n", - " 2 \n", - " 2 ⎛ 2.0⋅B⎞ \n", - " 0.166666666666667⋅A ⋅⎜1.0 + ─────⎟ \n", - " ⎛ 2.0⋅B⎞ ⎝ A ⎠ ⎛ \n", - "90463863⋅π⋅A⋅⎜1.0 + ─────⎟⋅ℯ ⋅erf⎜0.40824829\n", - " ⎝ A ⎠ ⎝ \n", - "──────────────────────────────────────────────────────────────────────────────\n", - " \n", - " \n", - " \n", - "\n", - " \n", - " \n", - " 0.166666666666\n", - " ⎛ 2.0⋅B⎞⎞ ⎛ 2.0⋅B⎞ \n", - "0463863⋅A⋅⎜1.0 + ─────⎟⎟ + 0.408248290463863⋅π⋅A⋅⎜1.0 + ─────⎟⋅ℯ \n", - " ⎝ A ⎠⎠ ⎝ A ⎠ \n", - "──────────────────────────────────────────────────────────────────────────────\n", - " ⎛ 2.0⋅B⎞ \n", - " √π⋅A⋅⎜1.0 + ─────⎟ \n", - " ⎝ A ⎠ \n", - "\n", - " 2⎞ \n", - " 2 ⎛ 2.0⋅B⎞ ⎟ \n", - "667⋅A ⋅⎜1.0 + ─────⎟ ⎟ 2 2\n", - " ⎝ A ⎠ ⎟ - 0.5⋅A - 1.0⋅B \n", - " ⎟⋅ℯ \n", - " ⎠ \n", - "─────────────────────────────────────────\n", - " \n", - " \n", - " " - ] - }, - "execution_count": 16, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "sy.integrate(phi_A.replace(alpha, 0.5) * phi_B.replace(beta, 1.0), (r, -sy.oo, sy.oo))" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.4.3" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -}