From 2ac02543fe1d35284091b2b3d0dd8dfce7f8f6c2 Mon Sep 17 00:00:00 2001 From: Kasper Peeters Date: Tue, 28 Nov 2023 21:02:23 +0000 Subject: [PATCH] Update zoom docs. --- core/algorithms/zoom.cnb | 321 ++++++++++++++++++++++++++------------- 1 file changed, 217 insertions(+), 104 deletions(-) diff --git a/core/algorithms/zoom.cnb b/core/algorithms/zoom.cnb index f7e875b39a..8007c1facf 100644 --- a/core/algorithms/zoom.cnb +++ b/core/algorithms/zoom.cnb @@ -1,166 +1,279 @@ { - "cells" : - [ + "cell_id": 12388625031739274582, + "cells": [ { - "cell_origin" : "client", - "cell_type" : "latex", - "cells" : - [ + "cell_id": 9790434250152926668, + "cell_origin": "client", + "cell_type": "latex", + "cells": [ { - "cell_origin" : "client", - "cell_type" : "latex_view", - "source" : "\\algorithm{zoom}{Only show selected terms in a sum, and restrict subsequent algorithms to these terms.}\n\nOften you want manipulations to only apply to a selected subset of terms in a large sum. The \\algo{zoom} \nalgorithm makes only certain terms visible, representing the remaining terms with dots.\n\nHere is an expression with a 5 terms," + "cell_id": 15712383533467766647, + "cell_origin": "client", + "cell_type": "latex_view", + "source": "\\algorithm{zoom}{Only show selected terms in a sum, and restrict subsequent algorithms to these terms.}\n\nOften you want manipulations to only apply to a selected subset of terms in a large sum. The \\algo{zoom} \nalgorithm makes only certain terms visible, representing the remaining terms with dots. Any subsequent \nalgorithms will only act on these visible terms.\n\nHere is an expression with 5 terms," } ], - "hidden" : true, - "source" : "\\algorithm{zoom}{Only show selected terms in a sum, and restrict subsequent algorithms to these terms.}\n\nOften you want manipulations to only apply to a selected subset of terms in a large sum. The \\algo{zoom} \nalgorithm makes only certain terms visible, representing the remaining terms with dots.\n\nHere is an expression with a 5 terms," + "hidden": true, + "source": "\\algorithm{zoom}{Only show selected terms in a sum, and restrict subsequent algorithms to these terms.}\n\nOften you want manipulations to only apply to a selected subset of terms in a large sum. The \\algo{zoom} \nalgorithm makes only certain terms visible, representing the remaining terms with dots. Any subsequent \nalgorithms will only act on these visible terms.\n\nHere is an expression with 5 terms," }, { - "cell_origin" : "client", - "cell_type" : "input", - "cells" : - [ + "cell_id": 18249221998629101273, + "cell_origin": "client", + "cell_type": "input", + "cells": [ { - "cell_origin" : "server", - "cell_type" : "latex_view", - "cells" : - [ + "cell_id": 832102351445041075, + "cell_origin": "server", + "cell_type": "latex_view", + "cells": [ { - "cell_origin" : "server", - "cell_type" : "input_form", - "source" : "\\int{A_{m n} + B_{m n} C + D_{m} F_{n} C + T_{m n} + B_{m n} R}{x}" + "cell_id": 9949232075425525555, + "cell_origin": "server", + "cell_type": "input_form", + "source": "\\int{A_{m n} + B_{m n} C + D_{m} F_{n} C + T_{m n} + B_{m n} R}{x}" } ], - "source" : "\\begin{dmath*}{}\\int \\left(A_{m n}+B_{m n} C+D_{m} F_{n} C+T_{m n}+B_{m n} R\\right)\\,\\,{\\rm d}x\\end{dmath*}" + "source": "\\begin{dmath*}{}\\int \\left(A_{m n}+B_{m n} C+D_{m} F_{n} C+T_{m n}+B_{m n} R\\right)\\,\\,{\\rm d}x\\end{dmath*}" } ], - "source" : "ex:=\\int{ A_{m n} + B_{m n} C + D_{m} F_{n} C + T_{m n} + B_{m n} R}{x};" + "source": "ex:=\\int{ A_{m n} + B_{m n} C + D_{m} F_{n} C + T_{m n} + B_{m n} R}{x};" }, { - "cell_origin" : "client", - "cell_type" : "latex", - "cells" : - [ + "cell_id": 13659065226182250481, + "cell_origin": "client", + "cell_type": "latex", + "cells": [ { - "cell_origin" : "client", - "cell_type" : "latex_view", - "source" : "In order to restrict attention only to the terms containing a $B_{m n}$ factor, we use" + "cell_id": 7824220655507828023, + "cell_origin": "client", + "cell_type": "latex_view", + "source": "In order to restrict attention only to the terms containing a $B_{m n}$ factor, we use" } ], - "hidden" : true, - "source" : "In order to restrict attention only to the terms containing a $B_{m n}$ factor, we use" + "hidden": true, + "source": "In order to restrict attention only to the terms containing a $B_{m n}$ factor, we use" }, { - "cell_origin" : "client", - "cell_type" : "input", - "cells" : - [ + "cell_id": 1689356463027717950, + "cell_origin": "client", + "cell_type": "input", + "cells": [ { - "cell_origin" : "server", - "cell_type" : "latex_view", - "cells" : - [ + "cell_id": 12771084065845159432, + "cell_origin": "server", + "cell_type": "latex_view", + "cells": [ { - "cell_origin" : "server", - "cell_type" : "input_form", - "source" : "\\int{ ... + B_{m n} C + ... + B_{m n} R}{x}" + "cell_id": 9274589530037907797, + "cell_origin": "server", + "cell_type": "input_form", + "source": "\\int{ ... + B_{m n} C + ... + B_{m n} R}{x}" } ], - "source" : "\\begin{dmath*}{}\\int \\left( \\ldots +B_{m n} C+ \\ldots +B_{m n} R\\right)\\,\\,{\\rm d}x\\end{dmath*}" + "source": "\\begin{dmath*}{}\\int \\left( \\ldots +B_{m n} C+ \\ldots +B_{m n} R\\right)\\,\\,{\\rm d}x\\end{dmath*}" } ], - "source" : "zoom(_, $B_{m n} Q??$);" + "source": "zoom(_, $B_{m n} Q??$);" }, { - "cell_origin" : "client", - "cell_type" : "latex", - "cells" : - [ + "cell_id": 15624721342745846134, + "cell_origin": "client", + "cell_type": "latex", + "cells": [ { - "cell_origin" : "client", - "cell_type" : "latex_view", - "source" : "Subsequent algorithms only work on the visible terms above, not on the terms hidden inside the dots," + "cell_id": 17410332808818929102, + "cell_origin": "client", + "cell_type": "latex_view", + "source": "Subsequent algorithms only work on the visible terms above, not on the terms hidden inside the dots," } ], - "hidden" : true, - "source" : "Subsequent algorithms only work on the visible terms above, not on the terms hidden inside the dots," + "hidden": true, + "source": "Subsequent algorithms only work on the visible terms above, not on the terms hidden inside the dots," }, { - "cell_origin" : "client", - "cell_type" : "input", - "cells" : - [ + "cell_id": 10129922943028457003, + "cell_origin": "client", + "cell_type": "input", + "cells": [ { - "cell_origin" : "server", - "cell_type" : "latex_view", - "cells" : - [ + "cell_id": 18342956436361625444, + "cell_origin": "server", + "cell_type": "latex_view", + "cells": [ { - "cell_origin" : "server", - "cell_type" : "input_form", - "source" : "\\int{ ... + B_{m n} Q + ... + B_{m n} R}{x}" + "cell_id": 16005847141097910160, + "cell_origin": "server", + "cell_type": "input_form", + "source": "\\int{ ... + B_{m n} Q + ... + B_{m n} R}{x}" } ], - "source" : "\\begin{dmath*}{}\\int \\left( \\ldots +B_{m n} Q+ \\ldots +B_{m n} R\\right)\\,\\,{\\rm d}x\\end{dmath*}" + "source": "\\begin{dmath*}{}\\int \\left( \\ldots +B_{m n} Q+ \\ldots +B_{m n} R\\right)\\,\\,{\\rm d}x\\end{dmath*}" } ], - "source" : "substitute(_, $C->Q$);" + "source": "substitute(_, $C->Q$);" }, { - "cell_origin" : "client", - "cell_type" : "latex", - "cells" : - [ + "cell_id": 3698624047896256704, + "cell_origin": "client", + "cell_type": "latex", + "cells": [ { - "cell_origin" : "client", - "cell_type" : "latex_view", - "source" : "To make the hidden terms visible again, use \\algo{unzoom}, and note that the third term below has remained unaffected\nby the substitution above," + "cell_id": 1364384404771354882, + "cell_origin": "client", + "cell_type": "latex_view", + "source": "To make the hidden terms visible again, use \\algo{unzoom}, and note that the third term below has remained unaffected\nby the substitution above," } ], - "hidden" : true, - "source" : "To make the hidden terms visible again, use \\algo{unzoom}, and note that the third term below has remained unaffected\nby the substitution above," + "hidden": true, + "source": "To make the hidden terms visible again, use \\algo{unzoom}, and note that the third term below has remained unaffected\nby the substitution above," }, { - "cell_origin" : "client", - "cell_type" : "input", - "cells" : - [ + "cell_id": 12305737181127973918, + "cell_origin": "client", + "cell_type": "input", + "cells": [ { - "cell_origin" : "server", - "cell_type" : "latex_view", - "cells" : - [ + "cell_id": 14182150800835876859, + "cell_origin": "server", + "cell_type": "latex_view", + "cells": [ { - "cell_origin" : "server", - "cell_type" : "input_form", - "source" : "\\int{A_{m n} + B_{m n} Q + D_{m} F_{n} C + T_{m n} + B_{m n} R}{x}" + "cell_id": 15817951198748811538, + "cell_origin": "server", + "cell_type": "input_form", + "source": "\\int{A_{m n} + B_{m n} Q + D_{m} F_{n} C + T_{m n} + B_{m n} R}{x}" } ], - "source" : "\\begin{dmath*}{}\\int \\left(A_{m n}+B_{m n} Q+D_{m} F_{n} C+T_{m n}+B_{m n} R\\right)\\,\\,{\\rm d}x\\end{dmath*}" + "source": "\\begin{dmath*}{}\\int \\left(A_{m n}+B_{m n} Q+D_{m} F_{n} C+T_{m n}+B_{m n} R\\right)\\,\\,{\\rm d}x\\end{dmath*}" } ], - "source" : "unzoom(_);" + "source": "unzoom(_);" }, { - "cell_origin" : "client", - "cell_type" : "latex", - "cells" : - [ + "cell_id": 16646151267176514516, + "cell_origin": "client", + "cell_type": "latex", + "cells": [ { - "cell_origin" : "client", - "cell_type" : "latex_view", - "source" : "The \\algo{zoom}/\\algo{unzoom} combination is somewhat similar to the old deprecated \\algo{take_match}/\\algo{replace_match}\nalgorithms, but makes it more clear that terms have been suppressed." + "cell_id": 15699559416768481923, + "cell_origin": "client", + "cell_type": "latex_view", + "source": "The \\algo{zoom}/\\algo{unzoom} combination is somewhat similar to the old deprecated \\algo{take_match}/\\algo{replace_match}\nalgorithms, but makes it more clear that terms have been suppressed." } ], - "hidden" : true, - "source" : "The \\algo{zoom}/\\algo{unzoom} combination is somewhat similar to the old deprecated \\algo{take_match}/\\algo{replace_match}\nalgorithms, but makes it more clear that terms have been suppressed." + "hidden": true, + "source": "The \\algo{zoom}/\\algo{unzoom} combination is somewhat similar to the old deprecated \\algo{take_match}/\\algo{replace_match}\nalgorithms, but makes it more clear that terms have been suppressed." }, { - "cell_origin" : "client", - "cell_type" : "input", - "source" : "" + "cell_id": 7109914892061753876, + "cell_origin": "client", + "cell_type": "latex", + "cells": [ + { + "cell_id": 13381205589170017357, + "cell_origin": "client", + "cell_type": "latex_view", + "source": "It is possible to give \\algo{zoom} a list of patterns, in which case each term that is kept \nmust match at least one of these patterns. See the examples below." + } + ], + "hidden": true, + "source": "It is possible to give \\algo{zoom} a list of patterns, in which case each term that is kept \nmust match at least one of these patterns. See the examples below." + }, + { + "cell_id": 8311727161713613771, + "cell_origin": "client", + "cell_type": "input", + "cells": [ + { + "cell_id": 12630693352689133903, + "cell_origin": "server", + "cell_type": "latex_view", + "cells": [ + { + "cell_id": 4332350231412736633, + "cell_origin": "server", + "cell_type": "input_form", + "source": "x A1 + (x)**2 A2 + y A3 + (y)**2 A4" + } + ], + "source": "\\begin{dmath*}{}x {A_{1}}+{x}^{2} {A_{2}}+y {A_{3}}+{y}^{2} {A_{4}}\\end{dmath*}" + } + ], + "source": "ex:= x A1 + x**2 A2 + y A3 + y**2 A4;" + }, + { + "cell_id": 3583791065499312572, + "cell_origin": "client", + "cell_type": "input", + "cells": [ + { + "cell_id": 13249471701688341117, + "cell_origin": "server", + "cell_type": "latex_view", + "cells": [ + { + "cell_id": 3109806130242165243, + "cell_origin": "server", + "cell_type": "input_form", + "source": "x A1 + ... + y A3 + ... " + } + ], + "source": "\\begin{dmath*}{}x {A_{1}}+ \\ldots +y {A_{3}}+ \\ldots \\end{dmath*}" + } + ], + "source": "zoom(ex, ${x A??, y A??}$);" + }, + { + "cell_id": 13696329711587056329, + "cell_origin": "client", + "cell_type": "input", + "cells": [ + { + "cell_id": 17285963096983226809, + "cell_origin": "server", + "cell_type": "latex_view", + "cells": [ + { + "cell_id": 4422541137627824015, + "cell_origin": "server", + "cell_type": "input_form", + "source": "x A1 + (x)**2 A2 + y A3 + (y)**2 A4" + } + ], + "source": "\\begin{dmath*}{}x {A_{1}}+{x}^{2} {A_{2}}+y {A_{3}}+{y}^{2} {A_{4}}\\end{dmath*}" + } + ], + "source": "unzoom(ex);" + }, + { + "cell_id": 4724132867443574503, + "cell_origin": "client", + "cell_type": "input", + "cells": [ + { + "cell_id": 7359062134225205211, + "cell_origin": "server", + "cell_type": "latex_view", + "cells": [ + { + "cell_id": 7673380454616900479, + "cell_origin": "server", + "cell_type": "input_form", + "source": "x A1 + (x)**2 A2 + ... " + } + ], + "source": "\\begin{dmath*}{}x {A_{1}}+{x}^{2} {A_{2}}+ \\ldots \\end{dmath*}" + } + ], + "source": "zoom(ex, ${x A??, x**2 A??}$);" + }, + { + "cell_id": 6103038216337334699, + "cell_origin": "client", + "cell_type": "input", + "source": "" } ], - "description" : "Cadabra JSON notebook format", - "version" : 1 + "description": "Cadabra JSON notebook format", + "version": 1.0 }