diff --git a/examples/speed_tests_numba_and_cython.ipynb b/examples/speed_tests_numba_and_cython.ipynb index 665ad7f..d7e0c28 100644 --- a/examples/speed_tests_numba_and_cython.ipynb +++ b/examples/speed_tests_numba_and_cython.ipynb @@ -36,13 +36,72 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": { "cellView": "form", "collapsed": true, - "id": "oDEK94GOaK4Q" + "id": "oDEK94GOaK4Q", + "outputId": "60a49850-f2f7-4e7a-b827-1686d291a681", + "colab": { + "base_uri": "https://localhost:8080/" + } }, - "outputs": [], + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Collecting fast_wave\n", + " Downloading fast_wave-1.5.1-py3-none-any.whl.metadata (14 kB)\n", + "Collecting llvmlite==0.42.0 (from fast_wave)\n", + " Downloading llvmlite-0.42.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.8 kB)\n", + "Requirement already satisfied: mpmath==1.3.0 in /usr/local/lib/python3.10/dist-packages (from fast_wave) (1.3.0)\n", + "Collecting numba==0.59.1 (from fast_wave)\n", + " Downloading numba-0.59.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (2.7 kB)\n", + "Requirement already satisfied: numpy==1.26.4 in /usr/local/lib/python3.10/dist-packages (from fast_wave) (1.26.4)\n", + "Collecting sympy==1.12 (from fast_wave)\n", + " Downloading sympy-1.12-py3-none-any.whl.metadata (12 kB)\n", + "Collecting cython==3.0.10 (from fast_wave)\n", + " Downloading Cython-3.0.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.2 kB)\n", + "Downloading fast_wave-1.5.1-py3-none-any.whl (320 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m320.7/320.7 kB\u001b[0m \u001b[31m5.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading Cython-3.0.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.6/3.6 MB\u001b[0m \u001b[31m33.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading llvmlite-0.42.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (43.8 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m43.8/43.8 MB\u001b[0m \u001b[31m15.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading numba-0.59.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.7 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.7/3.7 MB\u001b[0m \u001b[31m41.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading sympy-1.12-py3-none-any.whl (5.7 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.7/5.7 MB\u001b[0m \u001b[31m50.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hInstalling collected packages: sympy, llvmlite, cython, numba, fast_wave\n", + " Attempting uninstall: sympy\n", + " Found existing installation: sympy 1.13.1\n", + " Uninstalling sympy-1.13.1:\n", + " Successfully uninstalled sympy-1.13.1\n", + " Attempting uninstall: llvmlite\n", + " Found existing installation: llvmlite 0.43.0\n", + " Uninstalling llvmlite-0.43.0:\n", + " Successfully uninstalled llvmlite-0.43.0\n", + " Attempting uninstall: cython\n", + " Found existing installation: Cython 3.0.11\n", + " Uninstalling Cython-3.0.11:\n", + " Successfully uninstalled Cython-3.0.11\n", + " Attempting uninstall: numba\n", + " Found existing installation: numba 0.60.0\n", + " Uninstalling numba-0.60.0:\n", + " Successfully uninstalled numba-0.60.0\n", + "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", + "torch 2.5.1+cu121 requires sympy==1.13.1; python_version >= \"3.9\", but you have sympy 1.12 which is incompatible.\u001b[0m\u001b[31m\n", + "\u001b[0mSuccessfully installed cython-3.0.10 fast_wave-1.5.1 llvmlite-0.42.0 numba-0.59.1 sympy-1.12\n", + "Collecting mrmustard\n", + " Downloading mrmustard-0.7.3-py3-none-any.whl.metadata (15 kB)\n", + "Downloading mrmustard-0.7.3-py3-none-any.whl (217 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m217.6/217.6 kB\u001b[0m \u001b[31m4.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hInstalling collected packages: mrmustard\n", + "Successfully installed mrmustard-0.7.3\n" + ] + } + ], "source": [ "#@title Installation\n", "!pip install fast_wave\n", @@ -51,12 +110,24 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 3, "metadata": { "cellView": "form", - "id": "xKirGWMNdvAs" + "id": "xKirGWMNdvAs", + "outputId": "4bb2598f-c155-4698-dbc7-dcf1dd82a693", + "colab": { + "base_uri": "https://localhost:8080/" + } }, - "outputs": [], + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Functionality Test Passed: True\n" + ] + } + ], "source": [ "#@title Imports and Definitions\n", "import time\n", @@ -292,7 +363,7 @@ "n = 5 #@param\n", "x_max = 5.0 #@param\n", "x_min = -5.0 #@param\n", - "number_of_points = 5000 #@param\n", + "number_of_points = 50 #@param\n", "\n", "x_values = np.linspace(x_min, x_max, number_of_points)\n", "\n", @@ -321,7 +392,7 @@ ")])\n", "\n", "fig.update_layout(\n", - " title=\"Runtime Comparison\",\n", + " title=\"Performance Comparison\",\n", " xaxis_title=\"Approach\",\n", " yaxis_title=\"Runtime (s)\",\n", " bargap=0.6,\n", @@ -339,13 +410,13 @@ "metadata": { "id": "WaYYDVs6PLWq", "cellView": "form", - "outputId": "d37e2558-0e0c-41a5-d849-e5fee91c8e1b", + "outputId": "6f05682e-5053-4c1b-d546-907dad5ab645", "colab": { "base_uri": "https://localhost:8080/", "height": 437 } }, - "execution_count": 60, + "execution_count": 11, "outputs": [ { "output_type": "display_data", @@ -355,9 +426,9 @@ "
\n", "\n", "