{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "6ced514d", "metadata": { "execution": { "iopub.execute_input": "2024-03-20T20:01:10.428393Z", "iopub.status.busy": "2024-03-20T20:01:10.425069Z", "iopub.status.idle": "2024-03-20T20:01:12.030897Z", "shell.execute_reply": "2024-03-20T20:01:12.029203Z" } }, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle z^{12}\\)" ], "text/latex": [ "$\\displaystyle z^{12}$" ], "text/plain": [ "z^12" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%display latex\n", "var('z')\n", "z^12" ] }, { "cell_type": "code", "execution_count": 2, "id": "c7892a6b", "metadata": { "execution": { "iopub.execute_input": "2024-03-20T20:01:12.038747Z", "iopub.status.busy": "2024-03-20T20:01:12.036329Z", "iopub.status.idle": "2024-03-20T20:01:12.053716Z", "shell.execute_reply": "2024-03-20T20:01:12.052816Z" } }, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\sqrt{z^{2} + \\frac{1}{2}}\\)" ], "text/latex": [ "$\\displaystyle \\sqrt{z^{2} + \\frac{1}{2}}$" ], "text/plain": [ "sqrt(z^2 + 1/2)" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sqrt(z^2 + 1/2)" ] }, { "cell_type": "code", "execution_count": 3, "id": "e21e6cb2", "metadata": { "execution": { "iopub.execute_input": "2024-03-20T20:01:12.060384Z", "iopub.status.busy": "2024-03-20T20:01:12.057715Z", "iopub.status.idle": "2024-03-20T20:01:12.076845Z", "shell.execute_reply": "2024-03-20T20:01:12.075711Z" } }, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\verb|a|\\verb| |\\verb|string|\\)" ], "text/latex": [ "$\\displaystyle \\verb|a|\\verb| |\\verb|string|$" ], "text/plain": [ "'a string'" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "'a string'" ] }, { "cell_type": "code", "execution_count": 4, "id": "dd456149", "metadata": { "execution": { "iopub.execute_input": "2024-03-20T20:01:12.081755Z", "iopub.status.busy": "2024-03-20T20:01:12.080920Z", "iopub.status.idle": "2024-03-20T20:01:12.101138Z", "shell.execute_reply": "2024-03-20T20:01:12.100199Z" } }, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\newcommand{\\Bold}[1]{\\mathbf{#1}}\\Bold{Q}\\)" ], "text/latex": [ "$\\displaystyle \\newcommand{\\Bold}[1]{\\mathbf{#1}}\\Bold{Q}$" ], "text/plain": [ "Rational Field" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "QQ" ] }, { "cell_type": "code", "execution_count": 5, "id": "eb9eec5c", "metadata": { "execution": { "iopub.execute_input": "2024-03-20T20:01:12.106037Z", "iopub.status.busy": "2024-03-20T20:01:12.105286Z", "iopub.status.idle": "2024-03-20T20:01:12.134657Z", "shell.execute_reply": "2024-03-20T20:01:12.133565Z" } }, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\newcommand{\\Bold}[1]{\\mathbf{#1}}\\Bold{Z}[x]\\)" ], "text/latex": [ "$\\displaystyle \\newcommand{\\Bold}[1]{\\mathbf{#1}}\\Bold{Z}[x]$" ], "text/plain": [ "Univariate Polynomial Ring in x over Integer Ring" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ZZ['x']" ] }, { "cell_type": "code", "execution_count": 6, "id": "c84840c9", "metadata": { "execution": { "iopub.execute_input": "2024-03-20T20:01:12.140415Z", "iopub.status.busy": "2024-03-20T20:01:12.139292Z", "iopub.status.idle": "2024-03-20T20:01:12.161481Z", "shell.execute_reply": "2024-03-20T20:01:12.160359Z" } }, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(\\begin{array}{rrr}\n", "2 & 4 & 6 \\\\\n", "-1 & -1 & -1\n", "\\end{array}\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(\\begin{array}{rrr}\n", "2 & 4 & 6 \\\\\n", "-1 & -1 & -1\n", "\\end{array}\\right)$" ], "text/plain": [ "[ 2 4 6]\n", "[-1 -1 -1]" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "matrix(QQ, 2, 3, [[2,4,6],[-1,-1,-1]])" ] }, { "cell_type": "code", "execution_count": 7, "id": "30d8ba0a", "metadata": { "execution": { "iopub.execute_input": "2024-03-20T20:01:12.165111Z", "iopub.status.busy": "2024-03-20T20:01:12.164167Z", "iopub.status.idle": "2024-03-20T20:01:12.176903Z", "shell.execute_reply": "2024-03-20T20:01:12.176182Z" } }, "outputs": [], "source": [ "%display plain" ] }, { "cell_type": "code", "execution_count": 8, "id": "546ec9e8", "metadata": { "execution": { "iopub.execute_input": "2024-03-20T20:01:12.180359Z", "iopub.status.busy": "2024-03-20T20:01:12.179476Z", "iopub.status.idle": "2024-03-20T20:01:12.325334Z", "shell.execute_reply": "2024-03-20T20:01:12.324288Z" } }, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\newcommand{\\Bold}[1]{\\mathbf{#1}}\\Bold{Q}\\)" ], "text/latex": [ "$\\displaystyle \\newcommand{\\Bold}[1]{\\mathbf{#1}}\\Bold{Q}$" ], "text/plain": [ "Rational Field" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%display latex\n", "QQ" ] }, { "cell_type": "code", "execution_count": 9, "id": "d9320a70", "metadata": { "execution": { "iopub.execute_input": "2024-03-20T20:01:12.344474Z", "iopub.status.busy": "2024-03-20T20:01:12.333184Z", "iopub.status.idle": "2024-03-20T20:01:12.417621Z", "shell.execute_reply": "2024-03-20T20:01:12.416748Z" } }, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\newcommand{\\Bold}[1]{\\mathbb{#1}}\\Bold{Q}\\)" ], "text/latex": [ "$\\displaystyle \\newcommand{\\Bold}[1]{\\mathbb{#1}}\\Bold{Q}$" ], "text/plain": [ "Rational Field" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "latex.blackboard_bold(True)\n", "QQ" ] }, { "cell_type": "code", "execution_count": 10, "id": "58086941", "metadata": { "execution": { "iopub.execute_input": "2024-03-20T20:01:12.422072Z", "iopub.status.busy": "2024-03-20T20:01:12.421355Z", "iopub.status.idle": "2024-03-20T20:01:12.503768Z", "shell.execute_reply": "2024-03-20T20:01:12.502581Z" } }, "outputs": [], "source": [ "latex.blackboard_bold(False)\n", "%display plain" ] }, { "cell_type": "code", "execution_count": 11, "id": "5d88be4e", "metadata": { "execution": { "iopub.execute_input": "2024-03-20T20:01:12.509433Z", "iopub.status.busy": "2024-03-20T20:01:12.508377Z", "iopub.status.idle": "2024-03-20T20:01:12.562075Z", "shell.execute_reply": "2024-03-20T20:01:12.561204Z" } }, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\sqrt{x + y}\\)" ], "text/latex": [ "$\\displaystyle \\sqrt{x + y}$" ], "text/plain": [ "sqrt(x + y)" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%display latex\n", "var('x y')\n", "sqrt(x + y)" ] }, { "cell_type": "code", "execution_count": 12, "id": "3f9c55ec", "metadata": { "execution": { "iopub.execute_input": "2024-03-20T20:01:12.565841Z", "iopub.status.busy": "2024-03-20T20:01:12.564841Z", "iopub.status.idle": "2024-03-20T20:01:12.633298Z", "shell.execute_reply": "2024-03-20T20:01:12.629379Z" } }, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\newcommand{\\sqrt}[1]{(#1)^\\frac{1}{2}}\\sqrt{x + y}\\)" ], "text/latex": [ "$\\displaystyle \\newcommand{\\sqrt}[1]{(#1)^\\frac{1}{2}}\\sqrt{x + y}$" ], "text/plain": [ "sqrt(x + y)" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "latex.add_macro(r\"\\newcommand{\\sqrt}[1]{(#1)^\\frac{1}{2}}\")\n", "sqrt(x + y)" ] }, { "cell_type": "code", "execution_count": 13, "id": "736d3a66", "metadata": { "execution": { "iopub.execute_input": "2024-03-20T20:01:12.660822Z", "iopub.status.busy": "2024-03-20T20:01:12.643730Z", "iopub.status.idle": "2024-03-20T20:01:12.691537Z", "shell.execute_reply": "2024-03-20T20:01:12.690333Z" } }, "outputs": [], "source": [ "latex.extra_macros('')\n", "%display plain" ] } ], "metadata": { "kernelspec": { "display_name": "SageMath 10.3", "language": "sage", "name": "sagemath" }, "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.10.12" } }, "nbformat": 4, "nbformat_minor": 5 }