Skip to content

Instantly share code, notes, and snippets.

@righ1113
Last active December 12, 2019 17:35
Show Gist options
  • Save righ1113/79cca4249169904c7720f49d5f3767fc to your computer and use it in GitHub Desktop.
Save righ1113/79cca4249169904c7720f49d5f3767fc to your computer and use it in GitHub Desktop.
Jupyter NotebookでEgison
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"$$\\frac{2}{3}$$"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"(/ 4 6)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"$$\\{2, 3, 5, 7, 11, 13, 17, 19, 23, 29\\}$$"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"(take 10 primes)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"$$y + x^2$$"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"(+ y (* x x))"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"$$tensor(\\{2, 2, 2, 2\\}, \\{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1\\})$$"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"(generate-tensor kronecker-delta { 2 2 2 2 })"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": []
}
],
"source": [
"(define $X [| (* r (sin sita) (cos fai))\n",
" (* r (sin sita) (sin fai))\n",
" (* r (cos sita))\n",
" |])"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"$$\\begin{pmatrix} r sin(sita) cos(fai) \\\\ r sin(sita) sin(fai) \\\\ r cos(sita)\\\\ \\end{pmatrix}$$"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"X"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": []
}
],
"source": [
"(define $t [| 1 2 3 4 5 |])"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"$$\\begin{pmatrix} 1 \\\\ 2 \\\\ 3 \\\\ 4 \\\\ 5\\\\ \\end{pmatrix}$$"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"t"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Egison2",
"language": "egison",
"name": "egison2"
},
"language_info": {
"codemirror_mode": "egison",
"file_extension": ".egi",
"mimetype": "text/plain",
"name": "egison"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment