{ "cells": [ { "cell_type": "markdown", "id": "3b186648-ff51-4f49-bd7d-1033ae8e09df", "metadata": {}, "source": [ "# Common Problems and Pitfalls\n", "\n", "This is a collection of common problems encountered and how to fix them. \n", "\n", "If you happen to encounter any other problems not listed here, and you think they should be publicly known please open an issue in git and it will be added to this list." ] }, { "cell_type": "markdown", "id": "8a6cda7f-767a-44b2-8096-fd7e796dbbc9", "metadata": {}, "source": [ "## Factorization\n", "\n", "### No Factorization or the wrong factorization was found\n", "If this happens it is most likely due to sympy using the wrong domain for the norm polynomial. \n", "to circumvent this, please specify an appropriate domain in the function `irreducible_factors` or `factorize_bq_poly`." ] }, { "cell_type": "code", "execution_count": 9, "id": "8d2fab69-0525-4d9b-aea1-69d19d4f7536", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(1, [Poly(t**6 - 7*t**5/8 + 3*t**4/256 - 19*t**3/512 + 211*t**2/4096 + 75*t/2048 + 75/8192,[t])])\n", "(1, [Poly(1.0*t**2 + 0.492825811803928*t + 0.0822107209716016,[t]), Poly(1.0*t**2 + 0.111704408445438*t + 0.193572984168327,[t]), Poly(1.0*t**2 - 1.47953022024937*t + 0.575304958998812,[t])])\n" ] } ], "source": [ "import sympy as sy\n", "import biquaternion_py as bq\n", "\n", "t=sy.symbols('t')\n", "\n", "print(bq.irreducible_factors(bq.Poly(t**6 - 7*t**5/8 + 3*t**4/256 - 19*t**3/512 + 211*t**2/4096 + 75*t/2048 + 75*t**0/8192,[t])))\n", "print(bq.irreducible_factors(bq.Poly(t**6 - 7*t**5/8 + 3*t**4/256 - 19*t**3/512 + 211*t**2/4096 + 75*t/2048 + 75*t**0/8192,[t]),domain='RR'))" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.11.6" } }, "nbformat": 4, "nbformat_minor": 5 }